RC4_SET_KEY(3SSL)
π RC4_set_key, RC4 β RC4 encryption π
okay bestie, so this is a page from the OpenSSL manuals, section 3SSL, filed under RC4_SET_KEY. sit down, grab a boba, because we're talking about the Alleged RC4 cipher and it's giving vintage π«Ά
β¨ NAME β¨
RC4_set_key, RC4 β RC4 encryption π
πΈ SYNOPSIS πΈ
#include <openssl/rc4.h>
okay so heads up: the following functions have been deprecated since OpenSSL 3.0, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value β peep openssl_user_macros(7) for the deets π
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, every single function described on this page is deprecated. no cap. apps should be using EVP_EncryptInit_ex(3), EVP_EncryptUpdate(3) and EVP_EncryptFinal_ex(3) instead β or the equivalently named decrypt functions, whatever fits your vibe β¨
this library implements the Alleged RC4 cipher, which gets described, like, for example in Applied Cryptography. it's believed to be compatible with RC4[TM], a proprietary cipher of RSA Security Inc. π
RC4 is a stream cipher with variable key length. typically, 128 bit (16 byte) keys are used for strong encryption, but shorter insecure key sizes have been widely used because of export restrictions. the way that history nerfed our crypto π
RC4 is made of two phases: a key setup phase and the actual encryption or decryption phase.
RC4_set_key()β sets up theRC4_KEYkey using thelenbytes long key atdataπRC4()β encrypts or decrypts thelenbytes of data atindatausingkey, then places the result atoutdata. repeatedRC4()calls with the same key yield a continuous key stream β
and because RC4 is a stream cipher (the input is XORed with a pseudo-random key stream to produce the output), decryption uses the same function calls as encryption. one function, both directions, main character energy fr fr π
π RETURN VALUES π
RC4_set_key() and RC4() do not return values. nothing. silence. zero. the void π
π NOTE π
apps should use the higher level functions like EVP_EncryptInit(3) etc. instead of calling these functions directly, bestie. i'm serious.
β οΈ It is difficult to securely use stream ciphers. for example, do not perform multiple encryptions using the same key stream. that's a real warning, not a vibe check π
π SEE ALSO π
πΈ HISTORY πΈ
all of these functions were deprecated in OpenSSL 3.0. iconic of them to age out, honestly π§
π COPYRIGHT π
Copyright 2000-2020 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>. π«Ά
and that's the whole page, bestie!! this was OpenSSL 4.0.3, dated 2026-09-29, filed in section 3SSL under RC4_SET_KEY. deprecated but still iconic, lowkey nostalgic, highkey don't use it in prod π
β¨πΈ
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms