Hello Monks
I wonder would anyone be able to help me get my head around Authen::Passphrase::SaltedDigest. I am having trouble with the concept more than anything else.
I need to store hashed passphrases in a MySQL database to increase the security. I have chosen Authen::Passphrase::SaltedDigest but not too sure if I am implementing it correctly. Specifically, I am confused about the salt. If I generated a hash as follows:
....
$ppr = Authen::Passphrase::SaltedDigest->new(
algorithm => "SHA-1", salt_random => 20,
passphrase => "passphrase");
....
I then get a hashed string in $ppr as follows:
$hash = $ppr->hash;
So, I take it I store this value in the database, is that correct?
If so, how to I check the users inputted passphrase for a hash match if the salt was random on generation!?
I thought I might have to run the inputted passphrase AND the same salt value through the algorithm to come up with the same hash??
Sorry for the dumb question but can anyone help?
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.