Crypt::Passphrase::Scrypt - A scrypt encoder for Crypt::Passphrase


version 0.001



This creates a new scrypt encoder, it takes named parameters that are all optional. Note that some defaults are likely to change at some point in the future, as computers get progressively more powerful and cryptoanalysis gets more advanced.

  • cost

    This is the cost factor that is used to hash passwords, it scales exponentially. It currently defaults to 16, but this may change in any future version.

  • block_size

    This defaults to 8, you probably have no need for changing this.

  • parallelism

    The number of threads used for the hash. This defaults to 1, but this number may change in any future version.

  • output_size

    The size of a hashed value. This defaults to 16 bytes, increasing it only makes sense if your passwords actually contain more than 128 bits of entropy.

  • salt_size

    The size of the salt. This defaults to 16 bytes, which should be more than enough for any use-case.


This hashes the passwords with scrypt according to the specified settings and a random salt (and will thus return a different result each time).


This returns true if the hash uses a different cipher, or if any of the cost is lower that desired by the encoder.


This class supports the following crypt type: scrypt

verify_password($password, $hash)

This will check if a password matches a scrypt hash.


Leon Timmermans <>


This software is copyright (c) 2021 by Leon Timmermans.

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