Karel Miko > Crypt-ScryptKDF-0.010 > Crypt::ScryptKDF

Download:
Crypt-ScryptKDF-0.010.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.010   Source  

NAME ^

Crypt::ScryptKDF - Scrypt password based key derivation function

SYNOPSIS ^

Creating / verifying scrypt-based password hash:

 use Crypt::ScryptKDF qw(scrypt_hash scrypt_hash_verify);

 my $hash1 = scrypt_hash("secret password");
 # .. later
 die "Invalid password" unless scrypt_hash_verify("secret password", $hash1);

 #or by specifying Scrypt parameters
 my $hash2 = scrypt_hash("secret password", \32, 16384, 8, 1, 32);
 # .. later
 die "Invalid password" unless scrypt_hash_verify("secret password", $hash2);

Creating raw scrypt-based derived key:

 use Crypt::ScryptKDF qw(scrypt_raw scrypt_hex scrypt_b64);

 my $binary_buffer = scrypt_raw($password, $salt, $N, $r, $p, $len);
 my $hexadecimal_string = scrypt_hex($password, $salt, $N, $r, $p, $len);
 my $base64_string = scrypt_b64($password, $salt, $N, $r, $p, $len);

DESCRIPTION ^

Scrypt is a password-based key derivation function (like for example PBKDF2). Scrypt was designed to be "memory-hard" algorithm in order to make it expensive to perform large scale custom hardware attacks.

It can be used for:

More details about Scrypt: http://www.tarsnap.com/scrypt/scrypt.pdf and https://tools.ietf.org/html/draft-josefsson-scrypt-kdf

IMPORTANT: This module needs a cryptographically strong random number generator. It tries to use one of the following:

FUNCTIONS ^

LICENSE ^

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

COPYRIGHT ^

Copyright (c) 2013-2015 DCIT, a.s. http://www.dcit.cz / Karel Miko

syntax highlighting: