OpenCores
URL https://opencores.org/ocsvn/rc4-prbs/rc4-prbs/trunk

Subversion Repositories rc4-prbs

[/] [rc4-prbs/] [trunk/] [README.txt] - Blame information for rev 20

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 ortegaalfr
Hi,
2
 
3
I was looking for a quick implementation of RC4 and I couldn't find one, so I wrote one based on the wikipedia example.
4
 
5
It's quite easy to use:
6
 
7
1) First, issue rst
8
2) Load the password byte-by-byte into the password_input port. The lenght of the password is KEY_SIZE
9
3) Issue 768 clocks to perform key expansion
10 19 ortegaalfr
4) Wait 1536 clocks while the module discards the first weak bytes of the stream as per RFC 4345.
11 15 ortegaalfr
5) Now you should start receiving the pseudo-random stream via the output bus, one byte every clock. The output_ready signal signals when a valid byte is present at the output K.
12 12 ortegaalfr
To encrypt or decrypt using RC4 you simply xor your data with the output stream.
13 3 ortegaalfr
 
14 20 ortegaalfr
WARNING: The 256-byte register that this implementation uses is very costly in FPGA resources and will result in >2000 slices used in some synthetizers.
15
 
16 4 ortegaalfr
The testbench and makefile work using icarus verilog and you can peer into rc4_tb.v to see an example implementation.
17 3 ortegaalfr
 
18 4 ortegaalfr
After installing icarus verilog in your path, just issue:
19
 
20
make
21
 
22
and then
23
 
24
./rc4.vvp
25
 
26
And you should see the output of the simulation.
27
 
28 6 ortegaalfr
Any question or suggestion send an email to aortega@alu.itba.edu.ar, cc: alfred@groundworkstech.com
29 3 ortegaalfr
 
30
Cheers,
31
 
32
Alfredo
33 13 ortegaalfr
 
34
 
35
PS: This is licensed LGPL, not public domain or BSD, so you should, put a copy of the license in your software and stuff. Yes, I'm talking to you jhunjhun, you too have to do it.
36
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.