使用devise加密附加表​​列 [英] Encrypting additional Table columns using devise

查看:79
本文介绍了使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆