today I'm working on replacing the Crypt::DES with Crypt::CBC to allow for arbitrary-length password strings, but I can't get validation/ verification of the passwords from the cookie.
in the set_cookie routine:
and the new $epassword is tossed into the cookie.my $cipher = Crypt::CBC->new( {'key' => 'stringie', 'cipher' => 'DES', 'iv' => 'vectory!', 'regenerate_key' => 0, # default true 'padding' => 'space', 'prepend_iv' => 1 } ); my $epassword = $cipher->encrypt_hex($password);
and later ( on subsequent hits to the app, essentially) we check the cookie pass against the DB pass like so:
where $dbpw is just fetched from the DB based on the username ....my $cipher = Crypt::CBC->new( {'key' => 'stringie', 'cipher' => 'DES', 'iv' => 'vectory!', 'regenerate_key' => 0, # default true 'padding' => 'space', 'prepend_iv' => 1 } ); my $dbpwmd5 = $cipher->encrypt_hex($dbpw);
and the values don't match. the newly encrypted $dbpw and the value from the cookie, that is.
after reading a couple other nodes ( Crypt::CBC question, Safe symmetric encryption - Crypt::CBC + Crypt::Blowfish? ) a block cipher (like DES) should allow for comparision.
In reply to Crypt::CBC and verifying passwords by geektron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |