I want to encrypt database because confidential data is being stored. I use mongodb with mongoid. It possible for this kind of database? And what alternatives can you recomend, if it is not?
P.S. Main purpose is: if anybody hack the server and steal DB, it would be unencryptable.
UPDATE: thanks for nickh, I found very many soultions for ActiveRecord, but nothing for Mongoid and other Mongo clinets. It would be great to find some soultion for Mongo and Mongoid!
I have gotten attr_encrypted working with Mongo and Mongoid. It takes only a few tweaks.
Make sure that all of the encrypted_ fields that are automatically created by attr_encrypted are explicitly created in the model. For instance, if you have:
you need to have:
Also notice you need to tell it to encode the encrypted string otherwise Mongo will complain loudly.
Lastly, if you’re encrypting a hash, do this: