使用devise加密附加表列 [英] Encrypting additional Table columns using devise
问题描述
我正在使用设计,使用密码列的bcrypt加密器进行rails验证。
I'm usingn devise for rails authentication with the bcrypt encryptor for the password column.
我有一个用户表存储我要加密的敏感信息
I have a User table that stores sensitive information which I would like to encrypt
是否可以使用设计加密和解密其他用户列(除了密码)?
Is it possible to use devise to encrypt and decrypt other User columns (other than just password)?
推荐答案
尝试 devise_aes_encryptable ,它是Devise的扩展,并且具有加密和解密方法。
其余的是你自己定制的它根据你的需要。
Try devise_aes_encryptable, its an extension to Devise and has both Encrypt and Decrypt methods.
The rest is upto you how to customize it as per your needs.
在Devise中找不到一个模块:Devise :: Decryptors ,但是有一个模块:Devise :: Encryptors 。所以,我建议使用上面的扩展。
I couldn't find a Module: Devise::Decryptors in Devise, but there was a Module: Devise::Encryptors. So, I propose to use the extension above.
希望它有帮助。
这篇关于使用devise加密附加表列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!