Skip to content

Instantly share code, notes, and snippets.

View gcrawshaw's full-sized avatar

Geoff Crawshaw gcrawshaw

View GitHub Profile
@gcrawshaw
gcrawshaw / gist:1071698
Created July 8, 2011 12:12
Using bcrypt to secure passwords in a Perl application
#!/usr/bin/perl
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);