ChaCha20Poly1305

ChaCha20-Poly1305 authenticated encryption with associated data (AEAD) as defined in RFC 8439.

ChaCha20-Poly1305 combines the ChaCha20 stream cipher with the Poly1305 message authentication code to provide both confidentiality and integrity. Uses 256-bit keys, 96-bit (12-byte) nonce, and a 128-bit (16-byte) authentication tag.

A good alternative to AES.GCM on platforms without hardware AES acceleration (AES-NI), as ChaCha20 performs well in pure software implementations.

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

Types

Link copied to clipboard
Link copied to clipboard

A ChaCha20-Poly1305 key that provides authenticated encryption and decryption via cipher.

Properties

Link copied to clipboard

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 ChaCha20-Poly1305 keys from the specified Key.Format.

Link copied to clipboard

Returns a KeyGenerator that generates ChaCha20-Poly1305 keys.