summaryrefslogtreecommitdiff
path: root/man/2/crypt-rc4
diff options
context:
space:
mode:
authorforsyth <forsyth@vitanuova.com>2010-08-10 23:06:28 +0100
committerforsyth <forsyth@vitanuova.com>2010-08-10 23:06:28 +0100
commit7de2b42d50e3c05cc143e7b51284009b5e185581 (patch)
tree42fffe0c9804551c120ef89c3f505059bbd31cfb /man/2/crypt-rc4
parent99c84fef96ccd10bb6cabb823384c033090293e9 (diff)
20100810-2306
Diffstat (limited to 'man/2/crypt-rc4')
-rw-r--r--man/2/crypt-rc449
1 files changed, 49 insertions, 0 deletions
diff --git a/man/2/crypt-rc4 b/man/2/crypt-rc4
new file mode 100644
index 00000000..8f04705e
--- /dev/null
+++ b/man/2/crypt-rc4
@@ -0,0 +1,49 @@
+.TH CRYPT-RC4 2
+.SH NAME
+crypt: rc4setup, rc4, rc4skip, rc4back \- RC4 encryption
+.SH SYNOPSIS
+.EX
+include "ipints.m";
+ipints := load IPints IPints->PATH;
+IPint: import ipints;
+
+include "crypt.m";
+crypt := load Crypt Crypt->PATH;
+
+rc4setup: fn(seed: array of byte): ref RC4state;
+rc4: fn(state: ref RC4state, buf: array of byte, n: int);
+rc4skip: fn(state: ref RC4state, n: int);
+rc4back: fn(state: ref RC4state, n: int);
+.EE
+.SH DESCRIPTION
+These functions implement the stream encryption algorithm that is claimed to
+be equivalent to RSA Security's RC4.
+It is a pseudo-random number generator with a 256
+byte state and a long cycle.
+.PP
+.B Rc4setup
+sets the initial
+.IR seed ,
+which can be any non-zero length, and
+returns a representation of the initial state of the algorithm,
+which is used in subsequent calls.
+.PP
+.B Rc4
+runs the generator starting with the given
+.IR state ,
+and XORs the output of the generator with
+the first
+.I n
+bytes of
+.IR buf ,
+updating the
+.IR state .
+.B Rc4
+is symmetric and is used both to encrypt and decrypt.
+.B Rc4skip
+skips over bytes (eg, to account for lost transmissions);
+.B rc4back
+runs the generator backwards (eg, to account for retransmissions).
+.SH SEE ALSO
+.IR crypt-intro (2),
+.IR crypt-crypt (2)