Module encryption

Module encryption 

Source
Expand description

Module that provides a simple API for symmetric encryption in the output formats used by Concordium.

Structs§

CipherText
A wrapper around a byte array to represent a ciphertext. JSON encodings are in base64.
EncryptedData
Ciphertext together with metadata describing the encryption method.
EncryptionMetadata
Metadata that enables decryption of some encrypted data provided an a password is provided.
Password
A wrapper to make it less likely to abuse passwords.

Enums§

DecryptionError
Errors that can occur during AES decryption.
EncryptionMethod
Supported encryption methods.
KeyDerivationMethod
Supported key derivation methods.

Constants§

AES_BLOCK_SIZE
AES block size in bytes
NUM_ROUNDS
The number of rounds of the key derivation function to use for hashing the password.

Functions§

decrypt
Dual to the encrypt method.
encrypt
Encrypt the given plaintext using the provided password. This uses the AES256 cipher using PBKDF2SHA256 key derivation function using a randomly sampled salt. The number of rounds of the key derivation function is defined by the NUM_ROUNDS constant.