crypto
A collection of cryptographic utilities.
Modules
library
crypto.chacha20
ChaCha20 stream cipher library, the IETF variant with a 96-bit nonce and a 32-bit block counter.
library
crypto.hkdf
HMAC-based Extract-and-Expand Key Derivation Function library.
library
crypto.hmac
Hash-based Message Authentication Code library.
library
crypto.random
Cryptographically secure random generator, use it for secrets: session tokens, keys, nonces, salts.
library
crypto.xchacha20
XChaCha20 stream cipher library, ChaCha20 with a 192-bit nonce.
Classes & types
class
crypto.Hash
The static fields shared by all hash classes, e.g. crypto.SHA256.
class
crypto.MD5
MD5 object.
class
crypto.SHA1
SHA1 object.
class
crypto.SHA256
SHA256 object.
class
crypto.SHA384
SHA384 object.
class
crypto.SHA512
SHA512 object.
Functions
#crypto.pbkdf2
function crypto.pbkdf2(options: pbkdf2.Options): string
Derives a password using the pbkdf2 algorithm.
See PBKDF2 for the algorithm.
Parameters
| Name | Type | Description |
|---|---|---|
options | pbkdf2.Options |
Returns
| Type | Name | Description |
|---|---|---|
string | pbkdf2_str | The derived key as a binary string of length bytes. |