开发者

Rails storing host password for FTP model

开发者 https://www.devze.com 2022-12-12 20:36 出处:网络
I\'m building a rails app that communicates with other servers via ftp.The user needs to input their host, username and password for their particular ftp server.I wouldn\'t want to store thei开发者_运

I'm building a rails app that communicates with other servers via ftp. The user needs to input their host, username and password for their particular ftp server. I wouldn't want to store thei开发者_运维知识库r password as cleartext, but I need the actual password to connect to the server when it comes time. Would it make sense to use a two-way hash?

I found a few implementations that might do the job:

http://crypt.rubyforge.org/blowfish.html

http://crypt.rubyforge.org/rijndael.html

http://ezcrypto.rubyforge.org/

Thanks,

Trevor


Since password is eventually passed to the FTP server as cleartext, any db encryption is a bonus.


I ended up using attr_encrypted which worked great.

0

精彩评论

暂无评论...
验证码 换一张
取 消