Subversion Repositories planix.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
.TH RC4 2
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
44
.B /sys/src/libsec
45
.SH SEE ALSO
46
.IR mp (2),
47
.IR aes (2),
48
.IR blowfish (2),
49
.IR des (2),
50
.IR dsa (2),
51
.IR elgamal (2),
52
.IR rsa (2),
53
.IR sechash (2),
54
.IR prime (2),
55
.IR rand (2)