CRYPTO_RC4

C Specification


#include <nitroCrypto/crypto/rc4.h>

void CRYPTO_RC4(
const void* key,
u32 key_len,
void* data,
u32 data_len,
);

void CRYPTO_RC4Fast(
const void* key,
u32 key_len,
void* data,
u32 data_len,
);
		

Arguments

key Pointer to the byte sequence for the encryption/decryption key used with the RC4 algorithm.
key_len Length of the key specified by key_ptr. The length of the key must be 16 bytes or less; longer lengths are truncated to 16 bytes.
data Pointer to the target data to encrypt/decrypt with the RC4 algorithm.
data_len Length of the data specified by data.

Return Values

None.

Description

Performs encryption/decryption using the RC4 shared key encryption algorithm. The same function is used for both encryption and decryption in the RC4 algorithm. Data stored within the data argument is directly processed and overwritten with the converted results.
This function is defined as an inline function which calls the CRYPTO_RC4*Init and CRYPTO_RC4*Crypt functions sequentially.

The CRYPTO_RC4 and CRYPTO_RC4Fast functions are the same, except that the CRYPTO_RC4Fast function is faster and requires more stack memory. The CRYPTO_RC4 fuction gets the CRYPTORC4Context structure which requires a minimum of 260 bytes from the stack. The CRYPTO_RC4Fast function gets the CRYPTORC4FastContext structure, which requires a minimum of 1032 bytes from the stack. With regard to speed, CRYPTO_RC4FastCrypto handles data of a sufficiently large size at approximately 1.5 times the normal processing speed.

For detailed information on using the RC4 algorithm, see Overview of Encryption Using RC4 Algorithm.

See Also

CRYPTO_RC4Encrypt, CRYPTO_RC4Init

Revision History

03/07/2006 Added an overview
02/24/2006 Switched from Crypt to Crypto
01/30/2006 Added a description
12/28/2005 Corrected typos
12/27/2005 Initial version

CONFIDENTIAL