Passwords - Provides an easy to use API for the creation and management of passwords in a secure manner
Version 0.01
use Passwords; # create password-hash (simple way with bcrypt, random-salt, cost of 14) my $hash = password_hash('perlhipster'); say $hash; # custom options # my $hash = password_hash('perlhipster', PASSWORD_BCRYPT, ( 'cost' => 20, 'salt' => 'This-Is-ASillySalt2014')); # verify password if (password_verify('perlhipster', $hash)) { say 'ok'; } else { say 'nok'; }
PASSWORD_DEFAULT PASSWORD_BCRYPT password_get_info password_hash password_needs_rehash password_verify
Returns information about the given hash
{ 'algoName' => 'bcrypt', 'algo' => 1, 'options' => { 'cost' => 14 } };
Creates a password hash
Use the constant PASSWORD_DEFAULT for the current default algorithm which is PASSWORD_BCRYPT. Per default a cost of 14 will be used and a secure salt will be generated.
PASSWORD_DEFAULT
PASSWORD_BCRYPT
Checks if the given hash matches the given options
Verifies that a password matches a hash
Günter Grodotzki <guenter@perlhipster.com>
Please report any bugs or feature requests via Github
This package is not a new invention, everything needed was already out there. To avoid confusion, especially to newer developers this offers a dead simple wrapper on a easy to remember namespace. Additionally this package is compatible with PHP (and most likely other languages) which makes it a great addition on multi-lang plattforms.
Therefore props go to:
crypt_blowfish
http://www.openwall.com/crypt/
Andrew Main (ZEFRAM)
Crypt::Eksblowfish::Bcrypt Authen::Passphrase::BlowfishCrypt
Anthony Ferrara (ircmaxell)
https://github.com/ircmaxell
Copyright (C) 2014 Günter Grodotzki.
This [library|program|code|module] is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the file LICENSE.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
To install Passwords, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Passwords
CPAN shell
perl -MCPAN -e shell install Passwords
For more information on module installation, please visit the detailed CPAN module installation guide.