RC4(3)

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

πŸ’… RC4(3) β€” RC4 encryption πŸ’…

okay bestie, welcome to the Library Functions Manual page for RC4(3) β€” manual name folded in right up top, no boring header-line copy-paste energy. The stars are RC4_set_key and RC4, and honestly this whole page is giving β€œhistoric crypto with a giant warning sticker.” 🫢

🌸 NAME 🌸

RC4_set_key, RC4 β€” RC4 encryption.

✨ SYNOPSIS ✨

the synopsis says library β€œlibcrypto” and tells you to include:

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

then the function signatures, exactly:

void
RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);

void
RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata,
    unsigned char *outdata);

πŸ’– DESCRIPTION πŸ’–

so this library implements the alleged RC4 cipher β€” the one described, for example, in "Applied Cryptography". It's believed to be compatible with RC4[TM], which is a proprietary cipher of RSA Security Inc. πŸ‘‘

RC4 is a stream cipher with a variable key length. Typically, 128-bit (16-byte) keys are used for strong encryption, but shorter insecure key sizes have been widely used due to export restrictions. πŸ’€

RC4 has two phases: a key setup phase, and then the actual encryption or decryption phase. main character structure, honestly. πŸŽ€

RC4_set_key() handles the setup: it sets up the RC4_KEY named key using the len bytes long key at data. πŸ—οΈ

RC4() encrypts or decrypts the len bytes of data at indata using key, and places the result at outdata. Repeated RC4() calls with the same key yield a continuous key stream β€” no cap. πŸ”₯

Since RC4 is a stream cipher (the input is XOR'ed with a pseudo-random key stream to produce the output), decryption uses the same function calls as encryption. one function, both directions, iconic. πŸ¦‹

πŸ‘€ SEE ALSO πŸ‘€

go read these when you're done, bestie:

πŸ•°οΈ HISTORY πŸ•°οΈ

RC4_set_key() and RC4() appeared in SSLeay 0.4 or earlier, and they've been available since OpenBSD 2.4. old-school but not old enough to escape the warning. 🫠

πŸ’€ BUGS πŸ’€

🚨 This cipher is broken and should no longer be used. Periodt. Not a quirky legacy flex β€” broken. please don't use it. 😭

xoxo bestie β€” source/version: Debian; date: June 8, 2025. mwah πŸ’‹

πŸ“¦ where this page comes from