#include <rc4.h>
Inheritance diagram for RC4:


The ISC implementation of RC4 is compatible with RSADSI RC4, and with the cipher that the US State Dept. calls RC4; it is also known as "alleged RC4" and ARCFOUR.
Usage flow: RC4() // instantiate a new RC4 object init() // specify the key crypt() // perform the encrypt or decrypt operation Recommendations for strict FIPS 140-1 compliance: RC4 is not a FIPS approved algorithm, so the RC4 class should *NOT* be used.
Sample code illustrating the use of this class appears in the Cookbook section Using the Symmetric Ciphers.
Public Member Functions | |
| RC4 () | |
| Constructor. Calls init(). | |
| ~RC4 () | |
| Destructor. Calls init(). | |
| int | init () |
| Initialize the RC4 object. | |
| int | init (int len, const char *key) |
| Initialize the RC4 object and load a new key. | |
| int | add (int len, const char *b) |
| Update the permutation controlling the internal pseudorandom number generator. | |
| int | crypt (int len, const char *src, char *dest) |
| Encrypt or decrypt a specified buffer. | |
| int | gen () |
| Generate one pseudorandom byte. | |
| int add | ( | int | len, | |
| const char * | b | |||
| ) |
Update the permutation controlling the internal pseudorandom number generator.
| len | the length in bytes of the input buffer | |
| b | a pointer to the input buffer |
| int crypt | ( | int | len, | |
| const char * | src, | |||
| char * | dest | |||
| ) |
Encrypt or decrypt a specified buffer.
| len | the length of the input and output buffers in bytes | |
| src | a pointer to the input buffer | |
| dest | a pointer to the output buffer |
| int gen | ( | ) |
Generate one pseudorandom byte.
| int init | ( | int | len, | |
| const char * | key | |||
| ) |
Initialize the RC4 object and load a new key.
| len | the length of key in bytes | |
| key | a pointer to the new key |
| int init | ( | ) |
Initialize the RC4 object.
| ISC Cryptographic Development Kit - User's Guide | |
| Questions? E-mail ISC technical support | |
| Copyright© 2002-2006 Information Security Corp. All rights reserved. |