piapia123
en

RC4 Encryption and Decryption

Encoding

Everything runs locally in your browser — nothing is uploaded

Input
Drop a file here to load its contents
Output

Encrypt and decrypt text with RC4 (also called ARCFOUR). It is a dozen lines long and extremely fast, which is why it was stuffed into a great many old protocols: WEP, WPA's TKIP, early SSL cipher suites, Microsoft RDP, and a range of embedded devices — you are almost certainly here to read old data or reproduce a legacy ciphertext. ⚠️ RC4 is completely broken today: its opening bytes deviate noticeably from random (byte two is zero with probability about 1/128 rather than 1/256), and enough of those early bytes let an attacker recover part of the key without knowing the plaintext — that is precisely how WEP fell. Use AES-GCM or ChaCha20-Poly1305 for anything new. If you must interoperate with a legacy system, discard at least the first 256 bytes of output; this tool does not do that for you, because it would change the result you are trying to match.

Features

  • Both directions share one PRGA — RC4 encryption and decryption are the same operation
  • Keys of any length (1–256 bytes), written as text or hex (tolerating colons, spaces and a 0x prefix)
  • Ciphertext as Base64 or hex; both are accepted on input
  • Non-ASCII text handled as UTF-8 bytes
  • Deterministic: the same input and key always give the same output, with no randomness involved
  • A wrong key is explained rather than left looking like a broken tool

How to use

  1. Enter the key (it must match exactly between encrypting and decrypting)
  2. Choose the direction: encrypt or decrypt
  3. Paste your content into the input box
  4. Click Copy to take the result

FAQ

Is RC4 still usable?
Not for anything new. It has three problems: statistical biases in its opening bytes, a key/IV correlation that can be exploited (the FMS attack, which killed WEP), and no integrity checking at all — an attacker can flip a bit in the ciphertext and the corresponding plaintext bit flips with the receiver none the wiser. Its position today is the same as MD5's: for reading old data and reproducing legacy results. For a stream cipher use ChaCha20-Poly1305; for a block cipher use AES-GCM.
Why are encryption and decryption the same operation?
Because RC4 is a stream cipher: it derives a keystream as long as the plaintext and XORs it in byte by byte. XOR has the property that doing it twice with the same value cancels out, so XORing the ciphertext with the same keystream restores the plaintext — encryption and decryption are mathematically one function. That is why this tool needs only one implementation: the direction merely decides whether the input is read as text or as ciphertext, and how the output is written.
Is there a key length requirement?
Anywhere from 1 to 256 bytes (beyond 256 nothing is added, since the key schedule only ever reads `key[i % length]`). In practice use 16 bytes (128 bits) or more. Note that RC4 keys have no fixed length, unlike AES and DES where a wrong length is an immediate error.
Decryption produced garbage — is the tool broken?
Almost certainly a wrong key. RC4 has no check value, so a wrong key does not fail; it silently yields random bytes, and this tool then fails while decoding them as UTF-8. Check that the key matches exactly what was used to encrypt (case and spaces included) and that it is written in the same form (text or hex). It is also possible the ciphertext is binary rather than text.

Related tools