Skip to content
UniKit

RC4 cipher

Encrypt and decrypt with the RC4 stream cipher: 1–256 byte keys (text or hex) and independent input/output encodings (UTF-8 text, hex, Base64 or decimal bytes). Encryption and decryption are the same operation — paste the hex ciphertext back and pick decrypt. RC4 has systematic key-scheduling biases and RFC 7465 told TLS to stop using it, so this tool is for legacy interoperability and study only.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Plaintext / ciphertext

Result

Encryption and decryption are the same operation; RC4 is unsafe and kept only for legacy compatibility and study.

Enter content to see the result

Input bytes: 0 · Key bytes: 0 · Result bytes: 0

What this tool does

  • Interoperate with legacy devices or protocols that still speak RC4 (WEP-era tools, some private serial protocols).
  • Check a hand-written RC4 against published vectors.
  • Demonstrate stream ciphers: xoring the same keystream twice restores the plaintext.

Example

Input

Plaintext

Output

bbf316e8d940af0ad3

Published vectors: key=Key / Plaintext → bbf316e8d940af0ad3, key=Wiki / pedia → 1021bf0420, key=Secret / Attack at dawn → 45a01f645fc35b383552544b9bf5.

Frequently asked questions

Is RC4 still safe to use?

Not for anything new. RC4's KSA/PRGA have systematic biases (early keystream bytes are predictable), which broke WEP, WPA-TKIP and early SSL; RFC 7465 explicitly told TLS to stop using it. This tool exists for legacy interoperability and teaching — use AES-GCM or ChaCha20-Poly1305 for real work.

Why are encryption and decryption the same operation?

A stream cipher just xors the keystream with the data: ciphertext = plaintext XOR keystream, plaintext = ciphertext XOR keystream. With the same key, running it again restores the input; the encrypt/decrypt switch is only a label.

How can I verify the result?

Use published vectors: key=Key with plaintext Plaintext gives bbf316e8d940af0ad3, key=Wiki with pedia gives 1021bf0420, and key=Secret with Attack at dawn gives 45a01f645fc35b383552544b9bf5. All three together confirm the KSA/PRGA.

Are there key length limits?

1 to 256 bytes. All-zero or very short keys show the strongest biases, so use at least 16 random bytes in practice. An empty key is rejected outright rather than silently treated as zeros.

Why does text output sometimes fail?

Ciphertext is usually not a valid UTF-8 byte sequence. The tool then reports that it is not valid text instead of showing mojibake; use hex or Base64 to see the raw bytes.

Keywords:RC4stream cipherARC4

Related tools