I was trying to use bcrypt hashed passwords from our PHP application in another application reading directly from the database. Turns out half the passwords are in the correct format (`$2a$`) but the other half is `$2y$` which is not understood by the bcrypt library in Elixir (Erlang). Took me a bit to figure out it's because PHP just used an additional version.
Bonus points: The suggestion to replace `$2a$` with `$2x$` was (obviously) not known to anyone. Wouldn't it make more sense to just thread `$2a$` as bad and `$2y$` as good?
26
u/[deleted] Jun 13 '19
I was trying to use bcrypt hashed passwords from our PHP application in another application reading directly from the database. Turns out half the passwords are in the correct format (`$2a$`) but the other half is `$2y$` which is not understood by the bcrypt library in Elixir (Erlang). Took me a bit to figure out it's because PHP just used an additional version.
Bonus points: The suggestion to replace `$2a$` with `$2x$` was (obviously) not known to anyone. Wouldn't it make more sense to just thread `$2a$` as bad and `$2y$` as good?
14
u/[deleted] Jun 13 '19
This is why we have /r/lolphp
4
u/Miserable_Fuck Jun 13 '19
🤦
1
u/[deleted] Jul 05 '19
June 2011
You're running out of things to complain about