4 ms·
The standard answer is “use bcrypt and don’t try to roll your own” Example when you say concatenation, do you mean hash(email + secret) or hash(secret + email)
by gcr 3y ago
The standard answer is “use bcrypt and don’t try to roll your own”
Example when you say concatenation, do you mean hash(email + secret) or hash(secret + email)? The choice matters: off the top of my head, I know the former lets an attacker reuse state between hashing attempts if the emails are known because hashing occurs one block at a time, so knowing. I wouldn’t be surprised if the later had weaknesses too.
Keep in mind most emails appear in public databases, so it’s not clear what you’re trying to protect.
- iraqmtpizza 3y agotrue. SHA-256 is vulnerable to length extension attacks because it uses Merkle–Damgård. one reason to consider SHA-3 which is a sponge. except not for password hashing because that requires a resource-intensive function like Argon2