gray > Crypt-Scrypt > Crypt::Scrypt

Download:
Crypt-Scrypt-0.05.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.05   Source  

NAME ^

Crypt::Scrypt - Perl interface to the scrypt key derivation function

SYNOPSIS ^

    use Crypt::Scrypt;

    my $scrypt = Crypt::Scrypt->new(
        key          => $key,
        max_mem      => $bytes,
        max_mem_frac => $fraction,
        max_time     => $seconds
    );
    my $ciphertext = $scrypt->encrypt($plaintext);
    my $plaintext  = $scrypt->decrypt($ciphertext);

    # or using class methods:
    my $ciphertext = Crypt::Scrypt->encrypt($plaintext,  key => $key, %args);
    my $plaintext  = Crypt::Scrypt->decrypt($ciphertext, key => $key, %args);

DESCRIPTION ^

The Crypt::Scrypt module provides an interface to the scrypt key derivation function. It is designed to be far more secure against hardware brute-force attacks than alternative functions such as PBKDF2 or bcrypt.

CONSTRUCTOR ^

new

    $scrypt = Crypt::Scrypt->new(
        key          => $key,
        max_mem      => $bytes,
        max_mem_frac => $fraction,
        max_time     => $seconds
    );

When encrypting, the key strength is maximized subject to the specified limits; when decrypting, an error is returned if decrypting the data is not possible within the specified limits.

METHODS ^

encrypt

    $ciphertext = $scrypt->encrypt($plaintext, %args)

Encrypts the plaintext and returns the ciphertext. The plaintext can be either a scalar or scalar reference. Additional named arguments can override any value provided to the constructor. Croaks on failure.

decrypt

    $plaintext  = $scrypt->decrypt($ciphertext, %args)

Decrypts the ciphertext and and returns the plaintext. The ciphertext can be either a scalar or scalar reference. Additional named arguments can override any value provided to the constructor. Croaks on failure.

SEE ALSO ^

http://www.tarsnap.com/scrypt.html

http://git.chromium.org/gitweb/?p=chromiumos/third_party/libscrypt.git;a=tree

REQUESTS AND BUGS ^

Please report any bugs or feature requests to http://rt.cpan.org/Public/Bug/Report.html?Queue=Crypt-Scrypt. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Crypt::Scrypt

You can also look for information at:

COPYRIGHT AND LICENSE ^

Copyright (C) 2011 gray <gray at cpan.org>, all rights reserved.

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

AUTHOR ^

gray, <gray at cpan.org>

syntax highlighting: