CBC

AES in Cipher Block Chaining (CBC) mode as defined in NIST SP 800-38A.

Each plaintext block is XORed with the previous ciphertext block before encryption. Uses a 128-bit (16-byte) IV by default. Does not provide authentication — use GCM when integrity is required.

val key = provider.get(AES.CBC).keyGenerator().generateKey()
val ciphertext = key.cipher().encrypt(plaintext)

Types

Link copied to clipboard
Link copied to clipboard

An AES-CBC key that provides encryption and decryption via cipher.

Properties

Link copied to clipboard
open override val id: CryptographyAlgorithmId<AES.CBC>

The typed identifier that uniquely distinguishes this algorithm and is used to look it up from a CryptographyProvider.

Functions

Link copied to clipboard

Returns a Decoder that decodes AES keys from the specified Key.Format.

Link copied to clipboard
abstract fun keyGenerator(keySize: BinarySize = Key.Size.B256): KeyGenerator<AES.CBC.Key>

Returns a KeyGenerator that generates AES keys of the given keySize.