Expand description
This module contains all cryptographic primitives used by dexios-core
Enums§
- Algorithm
- This is an
enum
containing all AEADs supported bydexios-core
- Mode
- This defines the possible modes used for encrypting/decrypting
Constants§
- ALGORITHMS_
LEN - BLOCK_
SIZE - This is the streaming block size
- ENCRYPTED_
MASTER_ KEY_ LEN - MASTER_
KEY_ LEN - SALT_
LEN - This is the length of the salt used for password hashing
Statics§
- ALGORITHMS
- This is an array containing all AEADs supported by
dexios-core
.
Functions§
- gen_
master_ key - Generates a new protected master key of the specified
MASTER_KEY_LEN
. - gen_
nonce - This can be used to generate a nonce for encryption
It requires both the algorithm and the mode, so it can correctly determine the nonce length
This nonce can be passed directly to
EncryptionStreams::initialize()
- gen_
salt - Generates a salt, of the specified
SALT_LEN
- get_
nonce_ len - This function calculates the length of the nonce, depending on the data provided