Created
October 2, 2016 17:04
-
-
Save stefan2904/c8a81bd40c9245f99455a244f8a64541 to your computer and use it in GitHub Desktop.
PHP's bcrypt ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $options = ['salt' => "m7z6odpn/jenmx0ablkhge"]; | |
| // PHP's bcrypt implementation ignores input after binary-zero. So ... | |
| echo password_hash("a\0", PASSWORD_DEFAULT, $options) . "\n"; | |
| echo password_hash("a\0bcd", PASSWORD_DEFAULT, $options) . "\n"; | |
| echo password_hash("a\0bcdasdasdads", PASSWORD_DEFAULT, $options) . "\n"; | |
| echo password_hash("a\0aaa", PASSWORD_DEFAULT, $options) . "\n"; | |
| // ... return the same hash! | |
| // see http://blog.ircmaxell.com/2015/03/security-issue-combining-bcrypt-with.html | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $2y$10$m7z6odpn/jenmx0ablkhge07wnzTKOYEH4K5r.ZrRyWNtQw31XUp6 | |
| $2y$10$m7z6odpn/jenmx0ablkhge07wnzTKOYEH4K5r.ZrRyWNtQw31XUp6 | |
| $2y$10$m7z6odpn/jenmx0ablkhge07wnzTKOYEH4K5r.ZrRyWNtQw31XUp6 | |
| $2y$10$m7z6odpn/jenmx0ablkhge07wnzTKOYEH4K5r.ZrRyWNtQw31XUp6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment