EVP_RC4(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’… EVP_RC4 β€” the RC4 stream cipher, but make it evp(3) ✨

okay so bestie, this is a page from the libcrypto manual β€” specifically the EVP_RC4(3) entry, and it's all about the RC4 stream cipher sitting pretty inside the evp(3) framework. it's giving classic crypto, fr fr.


🌸 SYNOPSIS 🌸

like, first you gotta pull in the library:

library β€œlibcrypto” #include <openssl/evp.h>

and then these three icons are yours:

const EVP_CIPHER *
EVP_rc4(void);

const EVP_CIPHER *
EVP_rc4_40(void);

const EVP_CIPHER *
EVP_rc4_hmac_md5(void);

πŸŽ€ DESCRIPTION πŸŽ€

so these functions hand you the RC4 stream cipher, all wrapped up in the evp(3) framework. it's a variable key length cipher, iykyk β€” the key length is not fixed, it can change. πŸ’«

  • EVP_rc4() β€” this one uses a default key length of 128 bits. the main character, honestly. πŸ‘‘
  • EVP_rc4_40() β€” same vibe but with a key length of 40 bits instead. and listen… this function is deprecated. 😭 do not use it. use EVP_rc4() together with EVP_CIPHER_CTX_set_key_length(3) instead, periodt.
  • EVP_rc4_hmac_md5() β€” this one serves authenticated encryption, using the RC4 stream cipher with MD5 as HMAC. but bestie, be so for real: this function is not intended for usage outside of TLS, and it requires calling some undocumented control functions. πŸ™ˆ it also does not conform to the EVP AEAD interface. so yeah, it's giving "do not touch unless you're literally in TLS". πŸ’€

πŸ¦‹ RETURN VALUES πŸ¦‹

these functions return an EVP_CIPHER structure that provides the implementation of the symmetric cipher. that's the whole tea. ✨


πŸ’– SEE ALSO πŸ’–

go read those too, bestie, they're lowkey important. 🫢


🌈 HISTORY 🌈

  • EVP_rc4() first appeared in SSLeay 0.5.1, and EVP_rc4_40() in OpenSSL 0.9.1. these functions have been available since OpenBSD 2.4. vintage, honestly. πŸ•°οΈ
  • EVP_rc4_hmac_md5() first appeared in OpenSSL 1.0.1 and has been available since OpenBSD 5.3. ✨

ngl, the 40-bit one and the hmac_md5 one are not the vibe β€” deprecated and TLS-only respectively. read the caveats and slay responsibly. πŸ’…

okay that's the whole page, bestie β€” this one came from the Debian edition, dated June 8, 2025, and it's page EVP_RC4(3). mwah, go forth and cipher. πŸŽ€πŸ’œπŸ¦‹

πŸ“¦ where this page comes from