Search for a tool
RC4 Cipher

Tool for encoding / decoding with the RC4 (Rivest Cipher 4) algorithm used in particular in the TLS (Transport Layer Security) protocol.

Results

RC4 Cipher -

Tag(s) : Modern Cryptography

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'RC4 Cipher' tool for free! Thank you!

RC4 Cipher

RC4 Decoder


Loading...
(if this message do not disappear, try to refresh this page)








See also: RSA CipherXOR Cipher

RC4 Encoder

The RC4 was created to be symmetric, the encryption phase is identical to decryption, use the form above.

Answers to Questions (FAQ)

What is RC4? (Definition)

RC4 for Rivest Cipher 4 is a symmetric and fast cipher algorithm, well suited to binary data, created by Ronald Rivest and used in some protocols like TLS or WEP.

How to encrypt using RC4 cipher?

The RC4 digit uses a key that can initialize an array of 256 boxes.

The algorithm that allows to initialize the array with the key key is:

// Pseudocode
for i = 0 -> 255 {
t[i] = i
}
j = 0
k = length(cle)
for i = 0 -> 255 {
j = (j + t[i] + key[i % k]) % 256
swap t[i] <-> t[j]
}

The array t can then be used to generate a stream by moving values and XOR operation.

The RC4 algorithm is then: // Pseudocode
a = b = 0
j = length(string)
codes = []
for i = 0 -> j {
a = (a + 1) % 256
b = (b + t[a]) % 256
swap t[a] <-> t[b]
codes []= ( t[ (t[a] + t[b]) % 256] ) XOR string[i]
}
print codes

The codes are values between 0 and 255.

Example: dCode (64,43,6F,64,65 in hexadecimal) encrypted with the key RC4 (52,43,34 in hexadecimal) is coded 2B,7F,DA,B6,1D (hexadecimal)
Identically 2B,7F,DA,B6,1D (in hexadecimal) decrypted with the same key RC4 (52,43,34 in hex) becomes 64,43,6F,64,65 (dCode in ASCII)

How to decrypt RC4 cipher?

Decryption is exactly the same as encryption.

How to recognize a RC4 ciphertext?

The codes generated by RC4 are between 0 and 255, usually represented in hexadecimal.

RC4 is pseudo-random, there is no easily detectable bias.

The code is also called RCfour, ARCFour, ARC4, Alleged RC4 or Ron's Code 4.

Any reference to WEP or TLS protocols is a clue.

When was RC4 invented?

RC4 was invented by Ronald Rivest (one of the inventors of RSA encryption) in 1987.

Source code

dCode retains ownership of the "RC4 Cipher" source code. Any algorithm for the "RC4 Cipher" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "RC4 Cipher" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "RC4 Cipher" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.

Cite dCode

The content of the page "RC4 Cipher" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source. Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link: https://www.dcode.fr/rc4-cipher
In a scientific article or book, the recommended bibliographic citation is: RC4 Cipher on dCode.fr [online website], retrieved on 2025-04-15, https://www.dcode.fr/rc4-cipher

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'RC4 Cipher' tool for free! Thank you!


https://www.dcode.fr/rc4-cipher
© 2025 dCode — The ultimate collection of tools for games, math, and puzzles.
 
Feedback