8 ms·
Write a password library that uses bcrypt. Compare hashes with strcmp. Put it on the internet. See what happens. :)
by tedunangst 12y ago
Write a password library that uses bcrypt. Compare hashes with strcmp. Put it on the internet. See what happens. :)
- dmpk2k 12y agoThat doesn't tell me anything. :/ As far as I can tell, you're implying an attacker can determine a password using timing of hash comparisons. How is this any different (just more complicated) than a regular brute force attack?
- Gurkenmaster 12y agostrcmp will stop at the end of the string. (the first zero or \0) Comparing the hashes ABC\0DEF and ABC\0XYZ will result true. There are a lot of hashcollisions which make finding a password a lot easier but the password won't work with sites that don't use strcmp.
- thirsteh 12y agoThat (using ==) is what py-bcrypt does, written by Damien Miller, a fairly well-known OpenSSH and OpenBSD hacker. It has definitely attracted some "smart" comments from "experts," as does anything that uses == in a security setting, no matter the actual context. Sure, it's usually poignant critique, but anyone who actually knows anything about this subject agrees that doing a non-constant-time-compare on what is essentially a random oracle leaks nothing of value to an attacker, and people are just parroting a catch phrase without understanding it. It's the evolution of the fan favorite "That's security through obscurity!" applied outside cryptography.
- tedunangst 12y agoWho do you think told me what happens? :)
- thirsteh 12y agoPerfect. Small world.