In the Microsoft C sample code for RC4-encrypting a file using the CryptoAPI, the functions CryptGenKey and CryptDeriveKey are passed an undocumented flag
#define KEYLENGTH 0x00800000
...
if (CryptGenKey(
hCryptProv,
ENCRYPT_ALGORITHM,
KEYLENGTH | CRYPT_EXPORTABLE,
&hKey))
...
There is no flag with this value defined in the CryptoAPI header file wincrypt.h
. Leaving it out doesn't seem to do any harm. In fact, when I change the algorithm from RC4 to AES, using this flag results in an ERROR_INVALID_PARAMETER
.
What is it there for?