nacl.hashlib

The nacl.hashlib module exposes directly usable implementations of raw constructs which libsodium exposes with simplified APIs, like the ones in nacl.hash and in nacl.pwhash.

The blake2b and scrypt() implementations are as API compatible as possible with the corresponding ones added to cpython standard library’s hashlib module in cpython’s version 3.6.

class blake2b(data=b'', digest_size=32, key=b'', salt=b'', person=b'')[source]

hashlib API compatible blake2b algorithm implementation

scrypt(password, salt='', n=1048576, r=8, p=1, maxmem=33554432, dklen=64)[source]

Derive a cryptographic key using the scrypt KDF.

Implements the same signature as the hashlib.scrypt implemented in cpython version 3.6