Rails: storing encrypted data in database

后端 未结 5 917
后悔当初
后悔当初 2020-12-30 06:03

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 recome

5条回答
  •  粉色の甜心
    2020-12-30 07:00

    I've had a lot of success with the attr_encrypted gem. However, I've only used it with ActiveRecord. I don't know if it works with MongoMapper or Mongoid.

    Regardless of how you implement this, I strongly recommend only encrypting certain fields. Don't encrypt every field in every table. Doing that will make it difficult to use associations, search using LIKE, etc.

提交回复
热议问题