3 ms·
Try 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 bcr
by pjscott 15y ago
Try
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.
- kingkilr 15y agoDo not do this, repeated SHA'ing is not cryptographically secure: https://github.com/antirez/lamernews/pull/8#issuecomment-2475480 https://github.com/antirez/lamernews/pull/8#issuecomment-247...
- pjscott 15y agoOh really? If you use SHA1 then the scheme I just described is a pretty well-established method called PBKDF1, specified in RFC2898: http://tools.ietf.org/html/rfc2898#section-5.1 http://tools.ietf.org/html/rfc2898#section-5.1
- lindvall 15y ago"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
- pjscott 15y agoThe keys it produces are big enough for this application. PBKDF2 can produce output keys of arbitrary size, which is why PBKDF1 got deprecated, but it's not always necessary.