UPDATED:
I edited Bcrypt.pm as below, and I can confirm this allows me to verify $2a$ or $2y$ bcrypt passwords.
=================
# diff -Naur /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-mult
+i/Crypt/Eksblowfish/Bcrypt.pm.orig /usr/lib64/perl5/site_perl/5.8.8/x
+86_64-linux-thread-multi/Crypt/Eksblowfish/Bcrypt.pm
--- /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Crypt/E
+ksblowfish/Bcrypt.pm.orig 2014-12-16 05:50:54.000000000 +0000
+++ /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Crypt/E
+ksblowfish/Bcrypt.pm 2014-12-16 05:23:46.000000000 +0000
@@ -153,7 +153,7 @@
sub bcrypt($$) {
my($password, $settings) = @_;
croak "bad bcrypt settings"
- unless $settings =~ m#\A\$2(a?)\$([0-9]{2})\$
+ unless $settings =~ m#\A\$2([ay]?)\$([0-9]{2})\$
([./A-Za-z0-9]{22})#x;
my($key_nul, $cost, $salt_base64) = ($1, $2, $3);
my $hash = bcrypt_hash({
=============
So assuming I pull a $2y$10$ hashed password from the database, I can just s/^\$2y\$/\$2a\$/ and verify it using Crypt::Eksblowfish::Bcrypt, is that I'm hearing?
If that is the case, I support I can hack up the module itself and allow $2a or $2y without throwing an error.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.