forsyth20121205-174063a80cc13 years agoHistory
49 lines · 1.2 KB · Text
RawDownload
.TH CRYPT-RC4 2.SH NAMEcrypt: rc4setup, rc4, rc4skip, rc4back \- RC4 encryption.SH SYNOPSIS.EXinclude "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 DESCRIPTIONThese functions implement the stream encryption algorithm that is claimed tobe equivalent to RSA Security's RC4.It is a pseudo-random number generator with a 256byte state and a long cycle..PP.B Rc4setupsets the initial.IR seed ,which can be any non-zero length, andreturns a representation of the initial state of the algorithm,which is used in subsequent calls..PP.B Rc4runs the generator starting with the given.IR state ,and XORs the output of the generator withthe first.I nbytes of.IR buf ,updating the.IR state ..B Rc4is symmetric and is used both to encrypt and decrypt..B Rc4skipskips over bytes (eg, to account for lost transmissions);.B rc4backruns the generator backwards (eg, to account for retransmissions)..SH SEE ALSO.IR crypt-intro (2),.IR crypt-crypt (2)