rsc | cfa37a7 | 2004-04-10 18:53:55 +0000 | [diff] [blame] | 1 | .TH RC4 3 |
| 2 | .SH NAME |
| 3 | setupRC4state, rc4, rc4skip, rc4back - alleged rc4 encryption |
| 4 | .SH SYNOPSIS |
| 5 | .B #include <u.h> |
| 6 | .br |
| 7 | .B #include <libc.h> |
| 8 | .br |
| 9 | .B #include <mp.h> |
| 10 | .br |
| 11 | .B #include <libsec.h> |
| 12 | .PP |
| 13 | .B |
| 14 | void setupRC4state(RC4state *s, uchar *seed, int slen) |
| 15 | .PP |
| 16 | .B |
| 17 | void rc4(RC4state *s, uchar *data, int dlen) |
| 18 | .PP |
| 19 | .B |
| 20 | void rc4skip(RC4state *s, int nbytes) |
| 21 | .PP |
| 22 | .B |
| 23 | void rc4back(RC4state *s, int nbytes) |
| 24 | .SH DESCRIPTION |
| 25 | .PP |
| 26 | This is an algorithm alleged to be Rivest's RC4 encryption function. It is |
| 27 | a pseudo-random number generator with a 256 byte state and a long |
| 28 | cycle. The input buffer is XOR'd with the output of the |
| 29 | generator both to encrypt and to decrypt. The seed, entered |
| 30 | using |
| 31 | .IR setupRC4state , |
| 32 | can be any length. The generator can be run forward using |
| 33 | .IR rc4 , |
| 34 | skip over bytes using |
| 35 | .I rc4skip |
| 36 | to account lost transmissions, |
| 37 | or run backwards using |
| 38 | .I rc4back |
| 39 | to cover retransmitted data. |
| 40 | The |
| 41 | .I RC4state |
| 42 | structure keeps track of the algorithm. |
| 43 | .SH SOURCE |
rsc | b5fdffe | 2004-04-19 19:22:56 +0000 | [diff] [blame] | 44 | .B /usr/local/plan9/src/libsec |
rsc | cfa37a7 | 2004-04-10 18:53:55 +0000 | [diff] [blame] | 45 | .SH SEE ALSO |
rsc | bf8a59f | 2004-04-11 03:42:27 +0000 | [diff] [blame] | 46 | .IR mp (3), |
| 47 | .IR aes (3), |
| 48 | .IR blowfish (3), |
| 49 | .IR des (3), |
| 50 | .IR dsa (3), |
| 51 | .IR elgamal (3), |
| 52 | .IR rsa (3), |
| 53 | .IR sechash (3), |
| 54 | .IR prime (3), |
| 55 | .IR rand (3) |