The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Passwords - Provides an easy to use API for the creation and management of passwords in a secure manner

VERSION

Version 0.01

SYNOPSIS

    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';
    }

EXPORT

    PASSWORD_DEFAULT
    PASSWORD_BCRYPT
    
    password_get_info
    password_hash
    password_needs_rehash
    password_verify

SUBROUTINES

password_get_info( $hash )

Returns information about the given hash

    {
        'algoName' => 'bcrypt',
        'algo' => 1,
        'options' => {
            'cost' => 14
        }
    };

password_hash ( $password, $algo, %options )

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_needs_rehash ( $hash, $algo, %options )

Checks if the given hash matches the given options

password_verify ( $password, $hash )

Verifies that a password matches a hash

AUTHOR

Günter Grodotzki <guenter@perlhipster.com>

BUGS

Please report any bugs or feature requests via Github

ACKNOWLEDGEMENTS

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:

LICENSE AND COPYRIGHT

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.