scrypt

Module for Scrypt algorithm.

class Scrypt

Bases: object

Scrypt class. It derives key using Scrypt algorithm.

static DeriveKey(password: Union[bytes, str], salt: Union[bytes, str], key_len: int, n: int, r: int, p: int) bytes

Derive a key.

Parameters:
  • password (str or bytes) – Password

  • salt (str or bytes) – Salt

  • key_len (int) – Length of the derived key

  • n (int) – CPU/Memory cost parameter

  • r (int) – Block size parameter

  • p (int) – Parallelization parameter

Returns:

Computed result

Return type:

bytes