Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement