blob: ba848d9059b6a75a55e5e30cae83b3d56875eeda [file] [log] [blame]
rsccfa37a72004-04-10 18:53:55 +00001.TH RC4 3
2.SH NAME
3setupRC4state, 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
14void setupRC4state(RC4state *s, uchar *seed, int slen)
15.PP
16.B
17void rc4(RC4state *s, uchar *data, int dlen)
18.PP
19.B
20void rc4skip(RC4state *s, int nbytes)
21.PP
22.B
23void rc4back(RC4state *s, int nbytes)
24.SH DESCRIPTION
25.PP
26This is an algorithm alleged to be Rivest's RC4 encryption function. It is
27a pseudo-random number generator with a 256 byte state and a long
28cycle. The input buffer is XOR'd with the output of the
29generator both to encrypt and to decrypt. The seed, entered
30using
31.IR setupRC4state ,
32can be any length. The generator can be run forward using
33.IR rc4 ,
34skip over bytes using
35.I rc4skip
36to account lost transmissions,
37or run backwards using
38.I rc4back
39to cover retransmitted data.
40The
41.I RC4state
42structure keeps track of the algorithm.
43.SH SOURCE
rscb5fdffe2004-04-19 19:22:56 +000044.B /usr/local/plan9/src/libsec
rsccfa37a72004-04-10 18:53:55 +000045.SH SEE ALSO
rscbf8a59f2004-04-11 03:42:27 +000046.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)