mongodb - Rails: storing encrypted data in database -
i want encrypt database because confidential data being stored. use mongodb mongoid. possible kind of database? , alternatives can recomend, if not?
p.s. main purpose is: if hack server , steal db, unencryptable.
update: nickh, found many soultions activerecord, nothing mongoid , other mongo clinets. great find soultion mongo , mongoid!
i have gotten attr_encrypted working mongo , mongoid. takes few tweaks.
make sure of encrypted_ fields automatically created attr_encrypted explicitly created in model. instance, if have:
attr_encrypted :email, :key => 'blah blah blah', :encode => true you need have:
field :email, :type => string field :encrypted_email, :type => string also notice need tell encode encrypted string otherwise mongo complain loudly.
lastly, if you're encrypting hash, this:
field :raw_auth_hash, :type => hash field :encrypted_raw_auth_hash, :type => string attr_encrypted :raw_auth_hash, :key => 'blah', :marshal => true, :encode => true
Comments
Post a Comment