🌊 RC4 Encrypt & Decrypt
Client-side RC4 stream cipher (aka ARC4 / Arcfour) encrypt and decrypt with zero dependencies. Flexible 1-256 byte keys. Independent encoding switchers for Key / Input / Output (Hex / UTF-8 / Base64) with real-time UTF-8 byte counters (not character counts). Built-in RFC 6229 official test vectors (40/64/128/256-bit) plus Wikipedia demo, RC4-drop[N] hardening presets (0/768/1536/3072), Swap I/O, and Roundtrip self-test. Persistent RFC 7465 (2015) deprecation banner (TLS prohibited / FMS 2001 broke WEP / NOMORE 2015). For education and legacy interop only — keys and plaintext are not uploaded by the tool.
Direction
Note: RC4 is symmetric — encryption and decryption use the exact same algorithm. Direction switch only affects UI labels and default encoding presets.
Recommended: 5-16 bytes (40-128 bits). Min 1, max 256. Short keys are cryptographically very weak — education only.
RC4-drop[N] (discard initial keystream bytes)
Discarding the first N keystream bytes mitigates FMS / Mantin early-bias attacks. Both sides must use the same drop value to interoperate.
Output Format
FAQ
Is RC4 still safe for production?
No. IETF published RFC 7465 "Prohibiting RC4 Cipher Suites" in 2015, explicitly forbidding RC4 in TLS. Multiple practical attacks exist: FMS (Fluhrer-Mantin-Shamir 2001) broke WEP; Klein 2005; AlFardan et al. 2013 (TLS plaintext recovery); Bar Mitzvah 2015; NOMORE 2015. Major browsers (Chrome 48, Firefox 44, Edge) disabled RC4 by default from 2016. Use AES-GCM or ChaCha20-Poly1305 for new systems — this tool is for legacy decryption and education only.
What is RC4-drop[N] and how do I choose N?
The first few bytes of RC4 keystream have statistical biases (FMS 2001, Mantin 2005). Discarding the first N bytes meaningfully reduces the attack surface. Common choices:
• 0: standard RC4 (RFC 6229 test vectors use this); • 768: SCAN registry default; • 1536: RFC 4345 conservative (SSH arcfour128/arcfour256); • 3072: Mantin 2005 recommended ceiling; • 12288: most conservative (not preset, use custom).
Note: both sides must use the same N, otherwise keystream misalignment prevents decryption.
Why does the tool count bytes instead of characters?
RC4 processes byte sequences, not characters. In UTF-8 an ASCII character is 1 byte, a Chinese character is 3 bytes, and an emoji (🎉) is 4 bytes. Many competitor tools show only "character count," which is deeply misleading: "中文" looks like 2 characters but is 6 bytes. This tool counts bytes everywhere, avoiding the common "I thought my key was long enough" pitfall.
How do I choose between Hex / UTF-8 / Base64?
Key: prefer Hex (two chars per byte, unambiguous — matches OpenSSL `enc -rc4 -K` format). Input: UTF-8 for plaintext, Hex or Base64 for binary ciphertext. Output: Hex is default (compact, reliable); Base64 is shorter but uses `+/=` symbols; UTF-8 output only works if the result is actually textual, otherwise you get "not valid UTF-8". This tool lets Key / Input / Output each switch independently to match different language ecosystems (OpenSSL, CryptoJS, Java `Cipher.getInstance("RC4")`, Python pycryptodome).
Is my data safe?
All encryption, decryption, and key handling run locally in your browser (pure JavaScript — no external API calls), and keys and plaintext are not uploaded by the tool. Correctness is verified against RFC 6229 official test vectors and the Wikipedia demo. Still, prefer using this tool on local files or public test data rather than entering highly sensitive production keys in any browser.
Free online RC4 stream cipher encrypt and decrypt tool (a.k.a. ARC4 / Arcfour) — client-side with pure JavaScript (zero dependencies). Flexible 1-256 byte keys. Independent Hex / UTF-8 / Base64 encoding switchers on Key / Input / Output with real-time UTF-8 byte counters (not characters — avoids the common "one Chinese char = 3 bytes" confusion found on other tools). Built-in RFC 6229 official test vectors (40/64/128/256-bit), the Wikipedia `RC4("Key","Plaintext")` demo, and RC4-drop[N] hardening presets (0 / 768 SCAN / 1536 RFC 4345 / 3072 conservative) to skip FMS/Mantin early keystream bias. Persistent RFC 7465 (2015) deprecation banner — TLS prohibited, FMS 2001 broke WEP, NOMORE 2015 attack. For education and legacy-data interop only — use AES-GCM or ChaCha20-Poly1305 for new systems. One-click Swap I/O direction flip and Roundtrip self-test. Keys and plaintext are not uploaded by the tool.