Skip to content

Instantly share code, notes, and snippets.


Geoff Crawshaw gcrawshaw

View GitHub Profile
gcrawshaw / gist:1071698
Created July 8, 2011 12:12
Using bcrypt to secure passwords in a Perl application
View gist:1071698
use Crypt::Eksblowfish::Bcrypt;
use Crypt::Random;
$password = 'bigtest';
$encrypted = encrypt_password($password);
print "$password is encrypted as $encrypted\n";
print "Yes the password is $password\n" if check_password($password, $encrypted);
print "No the password is not smalltest\n" if !check_password('smalltest', $encrypted);