EVP_RC4(3ossl)

πŸ’– EVP_RC4(3ossl) β€” the OpenSSL page, but make it make sense πŸ’–

okay bestie, sit down, grab a boba, because we're talking about EVP_rc4, EVP_rc4_40 and EVP_rc4_hmac_md5 β€” the EVP RC4 stream cipher family. this is from the OpenSSL manual, section 3ossl, and yes we're doing the whole thing, no skips, no cliffhangers. 🫢


✨ NAME ✨

EVP_rc4, EVP_rc4_40, EVP_rc4_hmac_md5 β€” the EVP RC4 stream cipher. that's the whole vibe. 🌸


✨ SYNOPSIS ✨

like, here's the summoning ritual:

#include <openssl/evp.h>

const EVP_CIPHER *EVP_rc4(void);
const EVP_CIPHER *EVP_rc4_40(void);
const EVP_CIPHER *EVP_rc4_hmac_md5(void);

three functions, three little const EVP_CIPHER * returns, zero arguments. clean. ✨


✨ DESCRIPTION ✨

so basically: the RC4 stream cipher for EVP. that's the whole premise. now let's meet the girls one by one. πŸ‘‘

🌈 EVP_rc4()

RC4 stream cipher. it's a variable key length cipher with a default key length of 128 bits. iconic, flexible, does the thing. πŸ’…

🌈 EVP_rc4_40()

RC4 stream cipher, but with a 40 bit key length.

⚠️ WARNING: this function is obsolete. bestie, its usage should be replaced with the EVP_rc4() and the EVP_CIPHER_CTX_set_key_length() functions. like, genuinely, move on. πŸ’€

🌈 EVP_rc4_hmac_md5()

Authenticated encryption with the RC4 stream cipher, using MD5 as HMAC. yes, together. a duo. πŸŽ€

⚠️ WARNING: this is not intended for usage outside of TLS and requires calling some undocumented ctrl functions. also β€” and this is the important bit β€” these ciphers do not conform to the EVP AEAD interface. so like, do not just casually use this, okay? πŸ™ˆ

✨ NOTES ✨

real talk for the developers in the chat: be aware of the negative performance implications of calling these functions multiple times. like, it's giving expensive. 😭

instead, consider using EVP_CIPHER_fetch(3) with EVP_CIPHER-RC4(7). see "Performance" in crypto(7) for further information. that's the move. πŸ¦‹


✨ RETURN VALUES ✨

these functions return an EVP_CIPHER structure that contains the implementation of the symmetric cipher. if you wanna know the details of that EVP_CIPHER structure, go look at EVP_CIPHER_meth_new(3). it's all there, i promise. πŸ’œ


✨ SEE ALSO ✨

the little friends of this page, go read them too:


Copyright 2017-2023 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>.


okay that's the whole page, you ate that. and for the sign-off moment: this was the OpenSSL 3.5.9 version of the page, dated 2026-09-29, filed under EVP_RC4(3ossl). periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from