Cipher

interface Cipher

Authenticated encryption with associated data (AEAD) contract for KryptoStore payloads.

Implementations must bind associatedData (when non-null) to the ciphertext so tampering with either the ciphertext or store metadata fails authentication.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun decrypt(message: ByteArray, associatedData: ByteArray? = null): ByteArray

Decrypts and authenticates ciphertext message with optional AEAD associatedData.

Link copied to clipboard
abstract suspend fun encrypt(message: ByteArray, associatedData: ByteArray? = null): ByteArray

Encrypts plaintext message with optional AEAD associatedData.