EVP_CHACHA20(3ossl)
π NAME π
EVP_chacha20, EVP_chacha20_poly1305 β it's giving EVP ChaCha20 stream cipher. That's the whole thing, bestie. Page lives in section 3ossl of the OpenSSL manuals, and yes, we're reading it together π
β¨ SYNOPSIS β¨
#include <openssl/evp.h>
const EVP_CIPHER *EVP_chacha20(void);
const EVP_CIPHER *EVP_chacha20_poly1305(void);
Look at those two little function calls, so small, so powerful, main character energy fr fr π«Ά
π¦ DESCRIPTION π¦
Okay so. The ChaCha20 stream cipher, but make it EVP. Let's break it down:
π
EVP_chacha20() π
This is the ChaCha20 stream cipher itself, no cap.
- The key length is 256 bits π
- The IV is 128 bits long
- The first 64 bits of that IV is a counter in little-endian order, followed by a 64 bit nonce
So like, for example, a nonce of:
0000000000000002
with an initial counter of 42 (2a in hex) would be expressed as:
2a000000000000000000000000000002
Not me obsessing over how the counter just slides in at the front because little-endian said "I'll go first" πβ¨
π EVP_chacha20_poly1305() π
This one is authenticated encryption with ChaCha20-Poly1305 β the whole package, the it-girl of ciphers π
- Like
EVP_chacha20(), the key is 256 bits - The IV is 96 bits
- It supports additional authenticated data (AAD)
- It produces a 128-bit authentication tag
Want the deets on how that AEAD thing works? Go read the "AEAD INTERFACE" in EVP_EncryptInit(3) section. It's all there, iykyk πβ¨
β οΈ NOTES β οΈ
Heads up bestie, this part is the "listen to me" part π
Developers should be aware of the negative performance implications of calling these functions multiple times π like, calling them over and over is not the move. Consider using EVP_CIPHER_fetch(3) with EVP_CIPHER-CHACHA(7) instead. For the full tea, see "Performance" in crypto(7) π
Also, a lil lore drop: RFC 7539 (https://www.rfc-editor.org/rfc/rfc7539.html#section-2.4) uses a 32 bit counter and a 96 bit nonce for the IV. So like, different layout, same cipher energy π¦
π₯ RETURN VALUES π₯
These functions return an EVP_CIPHER structure that contains the implementation of the symmetric cipher. That's the gift π
Want to know what's actually inside that structure? See EVP_CIPHER_meth_new(3) for the details π
π SEE ALSO π
Go read them, bestie, they're all connected, it's a whole universe π
π COPYRIGHT π
Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html. Legal said I have to say it and I said it π
Okay that's the whole page, we did it π This was EVP_CHACHA20 from the OpenSSL manual, version 3.5.9, dated 2026-09-29 β that's the source, the version and the date all wrapped up in a lil sign-off for you π«Άπ Stay encrypted, stay iconic, periodt β¨π§
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms