• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Search | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

Help with RC4!

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Cryptographic Theory and Cryptanalysis - Internal and Transmission Security

View previous topic :: View next topic  
Author Message
black_death
Just Arrived
Just Arrived


Joined: 28 Dec 2002
Posts: 0


Offline

PostPosted: Sun Jan 12, 2003 10:20 pm    Post subject: Help with RC4! Reply with quote

i was asked to code a program that dose enryption using rc4 but i can not find a good tutorial on rc4 can somebody help me!
or just give me a simple example of how it works.....

thanx in advance


Last edited by black_death on Sun Jan 12, 2003 10:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
igir3dsk1
Just Arrived
Just Arrived


Joined: 28 Sep 2002
Posts: 4
Location: 7h3 !n73rn37 :)

Offline

PostPosted: Sun Jan 12, 2003 10:31 pm    Post subject: Reply with quote

Take a look here!
http://www.ncat.edu/~grogans/algorithm_history_and_descriptio.htm

Cool you dont have to use 'url' tags. Very Happy
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ShaolinTiger
Forum Fanatic
Forum Fanatic


Joined: 18 Apr 2002
Posts: 16777215
Location: Kuala Lumpur, Malaysia

Offline

PostPosted: Sun Jan 12, 2003 11:47 pm    Post subject: Reply with quote

Description

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.

History

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.

Usage

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.

Code:
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.
 */

#define ALPHA      (8)
#define SIZE       (1<<ALPHA)
#define ind(x)     (x&(SIZE-1))
 
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;
  a=*aa;
  for (i=0; i<SIZE; ++i)
  {
    x=m[i];
    a=ind(a+x);
    y=m[a];
    m[i]=y; m[a]=x;
    r[i] = m[ind(x+y)];
  }
  *aa=a;
}


http://burtleburtle.net/bob/rand/isaac.html#RC4code
Back to top
View user's profile Send private message Visit poster's website
black_death
Just Arrived
Just Arrived


Joined: 28 Dec 2002
Posts: 0


Offline

PostPosted: Wed Jan 15, 2003 10:52 am    Post subject: Reply with quote

tanx guys great help
Back to top
View user's profile Send private message
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Cryptographic Theory and Cryptanalysis - Internal and Transmission Security All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
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

Community Area

Log in | Register