Search for a tool
RC4 Cipher

Tool to code / decode RC4 messages. Rivest Cipher 4 is a fast symmetric encryption algorithm created by Ronald Rivest used in some protocols like TLS or WEP.

Results

RC4 Cipher -

Tag(s) : Modern Cryptography

Share dCode and you

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!

Team dCode likes feedback and relevant comments; to get an answer give an email (not published). It is thanks to you that dCode has the best RC4 Cipher tool. Thank you.

# RC4 Cipher

## RC4 Decoder

 Results format ASCII characters (printable only) Hexadecimal 00-7F-FF Decimal 0-127-255 Octal 000-177-377 Binary 00000000-11111111 File to download

## RC4 Encoder

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

Tool to code / decode RC4 messages. Rivest Cipher 4 is a fast symmetric encryption algorithm created by Ronald Rivest 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:

// Pseudocodefor i = 0 ... 255 { t[i] = i}j = 0k = 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, ARC4, Alleged RC4 or Ron's Code 4.

### When RC4 have been invented ?

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

## Source code

dCode retains ownership of the source code of the script RC4 Cipher online. Except explicit open source licence (indicated Creative Commons / free), any algorithm, applet, snippet, software (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any function (convert, solve, decrypt, encrypt, decipher, cipher, decode, code, translate) written in any informatic langauge (PHP, Java, C#, Python, Javascript, Matlab, etc.) which dCode owns rights will not be released for free. To download the online RC4 Cipher script for offline use on PC, iPhone or Android, ask for price quote on contact page !