projects
/
authen-passphrase-scrypt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b68c60f
)
Better POD
author
Marius Gavrilescu
<marius@ieval.ro>
Sat, 14 Apr 2018 15:30:55 +0000
(18:30 +0300)
committer
Marius Gavrilescu
<marius@ieval.ro>
Sat, 14 Apr 2018 15:30:55 +0000
(18:30 +0300)
lib/Authen/Passphrase/Scrypt.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Authen/Passphrase/Scrypt.pm
b/lib/Authen/Passphrase/Scrypt.pm
index fabc7aeadb41418fa90872b1b8cbe83bc4979e5c..3a43e25b3632d83f0a1a9cdb3e406b86b65db56f 100644
(file)
--- a/
lib/Authen/Passphrase/Scrypt.pm
+++ b/
lib/Authen/Passphrase/Scrypt.pm
@@
-98,9
+98,9
@@
Authen::Passphrase::Scrypt - passphrases using Tarsnap's scrypt algorithm
use Authen::Passphrase::Scrypt;
# Hash a password
use Authen::Passphrase::Scrypt;
# Hash a password
- my $sc = Authen::Passphrase::Scrypt->new(
{
+ my $sc = Authen::Passphrase::Scrypt->new(
passphrase => 'correcthorsebatterystaple'
passphrase => 'correcthorsebatterystaple'
-
}
);
+ );
my $hash = $sc->as_rfc2307;
say "The given password hashes to $hash";
my $hash = $sc->as_rfc2307;
say "The given password hashes to $hash";
@@
-111,13
+111,13
@@
Authen::Passphrase::Scrypt - passphrases using Tarsnap's scrypt algorithm
say 'The password was "xkcd"' if $sc->match('xkcd');
# Advanced hashing
say 'The password was "xkcd"' if $sc->match('xkcd');
# Advanced hashing
- my $sc = Authen::Passphrase::Scrypt->new(
{
+ my $sc = Authen::Passphrase::Scrypt->new(
passphrase => 'xkcd',
logN => 14, # General work factor
r => 16, # Memory work factor
p => 1, # CPU (parallellism) work factor
salt => 'SodiumChloride && sODIUMcHLORIDE', # Must be 32 bytes
passphrase => 'xkcd',
logN => 14, # General work factor
r => 16, # Memory work factor
p => 1, # CPU (parallellism) work factor
salt => 'SodiumChloride && sODIUMcHLORIDE', # Must be 32 bytes
-
}
);
+ );
say 'The given password now hashes to ', $sc->as_rfc2307;
=head1 DESCRIPTION
say 'The given password now hashes to ', $sc->as_rfc2307;
=head1 DESCRIPTION
@@
-136,10
+136,11
@@
from within L<Authen::Passphrase>. The methods are:
=over
=over
-=item Authen::Passphrase::Scrypt->B<new>(I<
\
%args>)
+=item Authen::Passphrase::Scrypt->B<new>(I<%args>)
Creates a new L<Authen::Passphrase::Scrypt> from a given passphrase
Creates a new L<Authen::Passphrase::Scrypt> from a given passphrase
-and parameters. Use this to hash a passphrase. The arguments are:
+and parameters. Use this to hash a passphrase. This function takes
+either a key value list or a hashref. The arguments are:
=over
=over
@@
-176,6
+177,8
@@
fine-tuning: if scrypt uses too much memory but not enough CPU,
decrease logN and increase p; if scrypt uses too much CPU but not
enough memory, decrease logN and increase r.
decrease logN and increase p; if scrypt uses too much CPU but not
enough memory, decrease logN and increase r.
+Note that C<< 2^logN >> must fit in 64 bits and C<< r * p < 2^30 >>.
+
=item $sc->B<as_rfc2307>
Returns the hash of the passphrase, in RFC2307 format. This is
=item $sc->B<as_rfc2307>
Returns the hash of the passphrase, in RFC2307 format. This is
@@
-192,6
+195,7
@@
Returns true if the given passphrase matches the hash, false
otherwise.
=item Authen::Passphrase::Scrypt->from_crypt
otherwise.
=item Authen::Passphrase::Scrypt->from_crypt
+
=item $sc->as_crypt
These functions both croak. They are provided for compatibility with
=item $sc->as_crypt
These functions both croak. They are provided for compatibility with
This page took
0.010911 seconds
and
4
git commands to generate.