CHACHA20POLY1305
ChaCha20-Poly1305 is an authenticated encryption with associated data (AEAD) scheme that combines the ChaCha20 stream cipher with the Poly1305 message authentication code. It provides both confidentiality for the plaintext and integrity and authenticity for the ciphertext and any associated data. The construction uses a 256-bit key and a 12-byte (96-bit) nonce. A Poly1305 key is first derived from ChaCha20 by encrypting a 32-byte block with counter set to 0; the actual encryption uses ChaCha20 with the same key and nonce and a counter starting at 1. The Poly1305 tag authenticates the associated data, the ciphertext, and their respective lengths, producing a 16-byte authentication tag appended to the ciphertext.
ChaCha20-Poly1305 was designed by Daniel J. Bernstein and colleagues and was standardized for IETF protocols in
Security and usage notes: each message must use a unique nonce with the same key; nonce reuse