EVP_PBE_scrypt

Derive a key with scrypt from a password and salt.

Synopsis

Declared in <openssl/evp.h>

int
EVP_PBE_scrypt(
    char const* pass,
    size_t passlen,
    unsigned char const* salt,
    size_t saltlen,
    uint64_t N,
    uint64_t r,
    uint64_t p,
    uint64_t maxmem,
    unsigned char* key,
    size_t keylen);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
passPassword bytes (may be NULL when passlen is 0).
passlenLength of pass in bytes.
saltSalt octets.
saltlenLength of salt in bytes.
NCPU/memory cost parameter (power of two).
rBlock size parameter.
pParallelization parameter.
maxmemMemory limit in bytes (0 selects the library default).
keyOutput buffer for the derived key.
keylenDesired derived-key length in bytes.