File Coverage

blib/lib/Password/OWASP/Bcrypt.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 10 11 90.9


line stmt bran cond sub pod time code
1             our $VERSION = '0.005';
2             use Moose;
3 1     1   48853  
  1         325217  
  1         5  
4             # ABSTRACT: A BlowfishCrypt implemenation of Password::OWASP
5              
6             with 'Password::OWASP::AbstractBase';
7              
8             use Authen::Passphrase::BlowfishCrypt;
9 1     1   5679  
  1         17376  
  1         45  
10              
11 17     17 0 108 __PACKAGE__->meta->make_immutable;
12              
13              
14             =pod
15              
16             =encoding UTF-8
17              
18             =head1 NAME
19              
20             Password::OWASP::Bcrypt - A BlowfishCrypt implemenation of Password::OWASP
21              
22             =head1 VERSION
23              
24             version 0.005
25              
26             =head1 SYNOPSIS
27              
28             package MyApp::Authentication;
29              
30             use Password::OWASP::Bcrypt;
31              
32             my $user = get_from_db();
33             my $from_web = "Some very secret password";
34              
35             my $owasp = Password::OWASP::Bcrypt->new(
36             # optional
37             hashing => 'sha512',
38             update_method => sub {
39             my $password = shift;
40             $user->update_password($password);
41             return;
42             },
43             );
44              
45             if (!$owasp->check_password($from_web)) {
46             die "You cannot login";
47             }
48              
49             =head1 DESCRIPTION
50              
51             Implements BlowfishCrypt password checking.
52              
53             =head1 METHODS
54              
55             =head2 crypt_password
56              
57             Encrypt the password and return it as an RFC2307 formatted string.
58              
59             =head1 SEE ALSO
60              
61             =over
62              
63             =item * L<Password::OWASP::AbstractBase>
64              
65             =item * L<Authen::Passphrase::BlowfishCrypt>
66              
67             =back
68              
69             =head1 AUTHOR
70              
71             Wesley Schwengle <waterkip@cpan.org>
72              
73             =head1 COPYRIGHT AND LICENSE
74              
75             This software is Copyright (c) 2019 by Wesley Schwengle.
76              
77             This is free software, licensed under:
78              
79             The (three-clause) BSD License
80              
81             =cut