Re:An HN style social news site written in Ruby/Sinatra/Redi...
by kingkilr on Thursday October 20, 2011 @10:16PM
(#3138057)
Do not do this, repeated SHA'ing is not cryptographically secure: https://github.com/antirez/lamernews/pull/8#issuecomment-247...
Re:An HN style social news site written in Ruby/Sinatra/Redi...
by pjscott on Friday October 21, 2011 @01:19AM
(#3138547)
Oh really? If you use SHA1 then the scheme I just described is a pretty well-established method called PBKDF1, specified in RFC2898:
Re:An HN style social news site written in Ruby/Sinatra/Redi...
by lindvall on Friday October 21, 2011 @02:39PM
(#3141069)
"PBKDF1 is recommended only for compatibility with existing applications since the keys it produces may not be large enough for some applications." — RFC 2898, September 2000
SHA256(SHA256(... SHA256(password + salt)))
With perhaps five thousand iterations of SHA256, if you really don't want to depend on bcrypt. Or just use bcrypt; it's a good library, and removes the temptation to get creative with password hashing.