AES

Advanced Encryption Standard (AES) symmetric encryption algorithm as defined in FIPS 197.

AES supports multiple modes of operation:

  • GCM and CCM — authenticated encryption with associated data (AEAD).

  • CTR, CBC, OFB, CFB, CFB8 — unauthenticated block/stream cipher modes.

  • ECB — electronic codebook, unsuitable for most use cases.

  • CMAC — message authentication code.

Key sizes of 128, 192, or 256 bits are available via Key.Size. For authenticated encryption, prefer GCM. For legacy compatibility, CBC is widely supported.

Inheritors

Types

Link copied to clipboard

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

Link copied to clipboard

AES in Counter with CBC-MAC (CCM) mode, an authenticated encryption scheme as defined in NIST SP 800-38C.

Link copied to clipboard

AES in Cipher Feedback (CFB) mode with full-block feedback, a stream cipher as defined in NIST SP 800-38A.

Link copied to clipboard

AES in Cipher Feedback (CFB8) mode with 8-bit feedback as defined in NIST SP 800-38A.

Link copied to clipboard

AES Cipher-based Message Authentication Code (CMAC) as defined in NIST SP 800-38B.

Link copied to clipboard

AES in Counter (CTR) mode, a stream cipher as defined in NIST SP 800-38A.

Link copied to clipboard

AES in Electronic Codebook (ECB) mode as defined in NIST SP 800-38A.

Link copied to clipboard

AES in Galois/Counter Mode (GCM), an authenticated encryption scheme as defined in NIST SP 800-38D.

Link copied to clipboard
Link copied to clipboard

AES in Output Feedback (OFB) mode, a stream cipher as defined in NIST SP 800-38A.

Properties

Link copied to clipboard
abstract val id: CryptographyAlgorithmId<*>

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<K>

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