Joined: 18 Apr 2002 Posts: 16777215 Location: Kuala Lumpur, Malaysia
Posted: Sun Jan 12, 2003 11:47 pm Post subject:
RC4 is a stream cipher symmetric key algorithm.
RC4 uses a variable length key from 1 to 256 bytes to initialize a 256-byte state table. The state table is used for subsequent generation of pseudo-random bytes and then to generate a pseudo-random stream which is XORed with the plaintext to give the ciphertext. Each element in the state table is swapped at least once. The RC4 key is often limited to 40 bits, because of export restrictions but it is sometimes used as a 128 bit key. It has the capability of using keys between 1 and 2048 bits.
Public key operations take O(k2) steps, private key operations take O(k3) steps, and key generation takes O(k4) steps, where k is the number of bits in the modulus(n=pq).
The algorithm is based on the use of a random permutation.
Developed in 1987 by Ronald Rivest. RSA Data Security kept it as a trade secret.
On September 9, 1994, the RC4 algorithm was anonymously posted on the Internet on the Cyperpunks’ “anonymous remailers” list.
RC4 is used for file encryption in products such as RSA SecurPC. RC4 is used in many commercial software packages such as Lotus Notes and Oracle Secure SQL. It is also part of the Cellular Specification. RC4 is used for file encryption in products such as RSA SecurPC. It is also used for secure communications, as in the encryption of traffic to and from secure web sites using the SSL (Secure Sockets Layer) protocol.
C code for generator for RC4
* SIZE is (1<<ALPHA) = (1 times 2 to the 8th) = 256.
* ind(x) is the low order 8 bits of x, or x mod 256.
static void rc4(m,r,aa)
int *m; /* Memory: array of SIZE ALPHA-bit terms */
int *r; /* Results: the sequence, same size as m */
int *aa; /* Accumulator: a single value */
register int a,x,y,i;
for (i=0; i<SIZE; ++i)
r[i] = m[ind(x+y)];
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum