Last active
August 29, 2015 14:19
-
-
Save natmchugh/fbd418c2657c3257dfee to your computer and use it in GitHub Desktop.
A test in ruby for this problem http://blog.ircmaxell.com/2015/03/security-issue-combining-bcrypt-with.html confirmed
This file contains 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
require 'bcrypt' | |
my_password = "\0hello is it me you're looking for"; | |
verify = BCrypt::Password.create(my_password) | |
puts my_password.inspect | |
# This password verifies according to bcrypt | |
puts verify == my_password ? ' password verified ' : 'password incorrect'; | |
# but also ... | |
puts verify == '' ? ' But also verifies to a blank string' : 'Hey thats just a blank string'; | |
# or indeed any password that starts with a null byte | |
puts verify == "\0I can see it you eyes" ? ' Yep password is good' : 'Hey thats different'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment