Structs§
- Encrypted
Encoded Content - Ciphertext and the parameters needed to decrypt it.
- Encrypted
Payload - Encrypted payload containing the ciphertext and encryption parameters.
- Encryption
Keys - Parameters for the existing remote-attachment encryption scheme.
Constants§
- AES_
GCM_ NONCE_ SIZE - Size of the AES-GCM nonce in bytes (96-bit)
- AES_
GCM_ TAG_ SIZE - Size of the AES-GCM authentication tag in bytes (128-bit)
- HKDF_
SALT_ SIZE - Size of the HKDF salt in bytes (256-bit)
- SECRET_
SIZE - Size of the encryption secret in bytes (256-bit)
Functions§
- decrypt
- Decrypts ciphertext that was encrypted with
encrypt. - decrypt_
bytes - Checks the length and digest before decrypting arbitrary bytes.
- decrypt_
encoded_ content - Decrypts a protobuf envelope encrypted with
encrypt_encoded_content. - derive_
key - Derives an AES-256 key from a secret and salt using HKDF-SHA256.
- encrypt
- Encrypts plaintext using AES-256-GCM with HKDF-SHA256 key derivation.
- encrypt_
bytes - Encrypts arbitrary bytes with the remote-attachment scheme.
- encrypt_
encoded_ content - Encrypts the protobuf envelope, not only its
contentfield. - sha256
- Computes the SHA-256 hash of the given bytes.