Module primitives

Source
Expand description

This module contains all cryptographic primitives used by dexios-core

Enums§

Algorithm
This is an enum containing all AEADs supported by dexios-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