Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I need help with the syntax for salting a password using CGI::Application::Plugin::Authentication and Digest::MD5.
1. the password is entered by the user
2. the salt found in TableB is added
3. the salt and the password are MD5 encrypted
4. the results are then to be compared to the salted password already in TableA
(The salt is in TableB and the md5 salted password is in TableA -- joined on column2.)
I believe that I need to use a custom filter. I've read and re-read the CPAN examples but I still can't "get it". Any help or links to other examples would be appreciated.
TABLES => ['column1 TableA, 'column1 TableB'], JOIN_ON => 'TableA.column2 = TableB.column2', CONSTRAINTS => { 'TableA.username' => '__CREDENTIAL_1__', 'md5_base64:salt:password' => '__CREDENTIAL_2__', 'TableB.column3' => __CREDENTIAL_3__', } FILTERS => { salt => \&salt_filter }, ], sub salt_filter { my $param = shift; my $value = shift; $value = $dbh->prepare ("SELECT salt FROM TableB JOIN TableA ON TableB.column2 = TableA.column2 "); return $value; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to use salt with CGI::Application::Plugin::Authentication
by scorpio17 (Canon) on May 10, 2011 at 15:13 UTC | |
by Anonymous Monk on May 11, 2011 at 23:36 UTC | |
|
Re: How to use salt with CGI::Application::Plugin::Authentication
by locked_user sundialsvc4 (Abbot) on May 10, 2011 at 12:28 UTC | |
|
Re: How to use salt with CGI::Application::Plugin::Authentication
by locked_user sundialsvc4 (Abbot) on May 10, 2011 at 15:40 UTC | |
by Argel (Prior) on May 11, 2011 at 19:17 UTC | |
by Anonymous Monk on May 11, 2011 at 23:49 UTC | |
by Anonymous Monk on May 11, 2011 at 23:33 UTC |