CRYPTO_RC4Encrypt

C Specification


#include <nitroCrypto/crypto/rc4.h>

void CRYPTO_RC4Encrypt(
CRYPTORC4Context* context,
const void* in,
u32 length,
void* out,
);

void CRYPTO_RC4FastEncrypt(
CRYPTORC4FastContext* context,
const void* in,
u32 length,
void* out,
);
		

Arguments

context This function specifies the CRYPTORC4Context structure set with a key configured by the CRYPTO_RC4Init function. The CRYPTO_RC4FastCrypt function specifies the CRYPTORC4FastContext structure with a key configured by the CRYPTO_RC4FastInit function.
in Pointer to the target data to encrypt/decrypt with the RC4 algorithm.
length Length of the data specified by in.
out Pointer to where the results of the encryption/decryption are stored.

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 in is processed, while the converted results are written to out. You can specify the same pointer for in and out, thereby overwriting them.

The CRYPTO_RC4* and CRYPTO_RC4Fast* functions are the same, except that the CRYPTO_RC4Fast* functions are faster and require more stack memory. The CRYPTORC4Context structure used by the CRYPTO_RC4* functions is 260 bytes in size and the CRYPTORC4FastContext structure used by the CRYPTO_RC4Fast* functions is 1032 bytes in size. With regard to speed, CRYPTO_RC4FastEncrypt handles data of a sufficiently large size at approximately 1.5 times the normal processing speed. However, the difference in speed is caused by assigning the same pointer for in and out. If different pointers are assigned, there is almost no speed difference between the CRYPTO_RC4Encrypt and the CRYPTO_RC4FastEncrypt functions.

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

See Also

CRYPTO_RC4, 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 and added information regarding the speed of RC4Fast
12/27/2005 Initial version

CONFIDENTIAL