Functions | |
void | DES_set_odd_parity (DES_cblock *key) |
int HC_DEPRECATED | DES_check_key_parity (DES_cblock *key) |
int | DES_is_weak_key (DES_cblock *key) |
int HC_DEPRECATED | DES_set_key (DES_cblock *key, DES_key_schedule *ks) |
int | DES_set_key_unchecked (DES_cblock *key, DES_key_schedule *ks) |
int | DES_set_key_checked (DES_cblock *key, DES_key_schedule *ks) |
int | DES_key_sched (DES_cblock *key, DES_key_schedule *ks) |
void | DES_encrypt (uint32_t u[2], DES_key_schedule *ks, int encp) |
void | DES_ecb_encrypt (DES_cblock *input, DES_cblock *output, DES_key_schedule *ks, int encp) |
void | DES_cbc_encrypt (const void *in, void *out, long length, DES_key_schedule *ks, DES_cblock *iv, int encp) |
void | DES_pcbc_encrypt (const void *in, void *out, long length, DES_key_schedule *ks, DES_cblock *iv, int encp) |
void | DES_ecb3_encrypt (DES_cblock *input, DES_cblock *output, DES_key_schedule *ks1, DES_key_schedule *ks2, DES_key_schedule *ks3, int encp) |
void | DES_ede3_cbc_encrypt (const void *in, void *out, long length, DES_key_schedule *ks1, DES_key_schedule *ks2, DES_key_schedule *ks3, DES_cblock *iv, int encp) |
void | DES_cfb64_encrypt (const void *in, void *out, long length, DES_key_schedule *ks, DES_cblock *iv, int *num, int encp) |
uint32_t | DES_cbc_cksum (const void *in, DES_cblock *output, long length, DES_key_schedule *ks, DES_cblock *iv) |
void | DES_string_to_key (const char *str, DES_cblock *key) |
int HC_DEPRECATED | DES_new_random_key (DES_cblock *key) |
void HC_DEPRECATED | DES_init_random_number_generator (DES_cblock *seed) |
void HC_DEPRECATED | DES_random_key (DES_cblock *key) |
uint32_t DES_cbc_cksum | ( | const void * | in, | |
DES_cblock * | output, | |||
long | length, | |||
DES_key_schedule * | ks, | |||
DES_cblock * | iv | |||
) |
Crete a checksum using DES in CBC encryption mode. This mode is only used for Kerberos 4, and it should stay that way.
The IV must always be diffrent for diffrent input data blocks.
in | data to checksum | |
output | the checksum | |
length | length of data | |
ks | key schedule to use | |
iv | initial vector to use |
void DES_cbc_encrypt | ( | const void * | in, | |
void * | out, | |||
long | length, | |||
DES_key_schedule * | ks, | |||
DES_cblock * | iv, | |||
int | encp | |||
) |
Encrypt/decrypt a block using DES in Chain Block Cipher mode (cbc).
The IV must always be diffrent for diffrent input data blocks.
in | data to encrypt | |
out | data to encrypt | |
length | length of data | |
ks | key schedule to use | |
iv | initial vector to use | |
encp | if non zero, encrypt. if zero, decrypt. |
void DES_cfb64_encrypt | ( | const void * | in, | |
void * | out, | |||
long | length, | |||
DES_key_schedule * | ks, | |||
DES_cblock * | iv, | |||
int * | num, | |||
int | encp | |||
) |
Encrypt/decrypt using DES in cipher feedback mode with 64 bit feedback.
The IV must always be diffrent for diffrent input data blocks.
in | data to encrypt | |
out | data to encrypt | |
length | length of data | |
ks | key schedule to use | |
iv | initial vector to use | |
num | offset into in cipher block encryption/decryption stop last time. | |
encp | if non zero, encrypt. if zero, decrypt. |
int HC_DEPRECATED DES_check_key_parity | ( | DES_cblock * | key | ) |
Check if the key have correct parity.
key | key to check the parity. |
void DES_ecb3_encrypt | ( | DES_cblock * | input, | |
DES_cblock * | output, | |||
DES_key_schedule * | ks1, | |||
DES_key_schedule * | ks2, | |||
DES_key_schedule * | ks3, | |||
int | encp | |||
) |
Encrypt/decrypt a block using triple DES using EDE mode, encrypt/decrypt/encrypt.
input | data to encrypt | |
output | data to encrypt | |
ks1 | key schedule to use | |
ks2 | key schedule to use | |
ks3 | key schedule to use | |
encp | if non zero, encrypt. if zero, decrypt. |
void DES_ecb_encrypt | ( | DES_cblock * | input, | |
DES_cblock * | output, | |||
DES_key_schedule * | ks, | |||
int | encp | |||
) |
Encrypt/decrypt a block using DES.
input | data to encrypt | |
output | data to encrypt | |
ks | key schedule to use | |
encp | if non zero, encrypt. if zero, decrypt. |
void DES_ede3_cbc_encrypt | ( | const void * | in, | |
void * | out, | |||
long | length, | |||
DES_key_schedule * | ks1, | |||
DES_key_schedule * | ks2, | |||
DES_key_schedule * | ks3, | |||
DES_cblock * | iv, | |||
int | encp | |||
) |
Encrypt/decrypt using Triple DES in Chain Block Cipher mode (cbc).
The IV must always be diffrent for diffrent input data blocks.
in | data to encrypt | |
out | data to encrypt | |
length | length of data | |
ks1 | key schedule to use | |
ks2 | key schedule to use | |
ks3 | key schedule to use | |
iv | initial vector to use | |
encp | if non zero, encrypt. if zero, decrypt. |
void DES_encrypt | ( | uint32_t | u[2], | |
DES_key_schedule * | ks, | |||
int | encp | |||
) |
Encrypt/decrypt a block using DES. Also called ECB mode
u | data to encrypt | |
ks | key schedule to use | |
encp | if non zero, encrypt. if zero, decrypt. |
void HC_DEPRECATED DES_init_random_number_generator | ( | DES_cblock * | seed | ) |
Seed the random number generator. Deprecated, use RAND - random number
seed | a seed to seed that random number generate with. |
int DES_is_weak_key | ( | DES_cblock * | key | ) |
Checks if the key is any of the weaks keys that makes DES attacks trival.
key | key to check. |
int DES_key_sched | ( | DES_cblock * | key, | |
DES_key_schedule * | ks | |||
) |
Compatibility function for eay libdes, works just like DES_set_key_checked().
key | a key to initialize the key schedule with. | |
ks | a key schedule to initialize. |
int HC_DEPRECATED DES_new_random_key | ( | DES_cblock * | key | ) |
Generate a random des key using a random block, fixup parity and skip weak keys.
key | is set to a random key. |
void DES_pcbc_encrypt | ( | const void * | in, | |
void * | out, | |||
long | length, | |||
DES_key_schedule * | ks, | |||
DES_cblock * | iv, | |||
int | encp | |||
) |
Encrypt/decrypt a block using DES in Propagating Cipher Block Chaining mode. This mode is only used for Kerberos 4, and it should stay that way.
The IV must always be diffrent for diffrent input data blocks.
in | data to encrypt | |
out | data to encrypt | |
length | length of data | |
ks | key schedule to use | |
iv | initial vector to use | |
encp | if non zero, encrypt. if zero, decrypt. |
void HC_DEPRECATED DES_random_key | ( | DES_cblock * | key | ) |
Generate a random key, deprecated since it doesn't return an error code, use DES_new_random_key().
key | is set to a random key. |
int HC_DEPRECATED DES_set_key | ( | DES_cblock * | key, | |
DES_key_schedule * | ks | |||
) |
Setup a des key schedule from a key. Deprecated function, use DES_set_key_unchecked() or DES_set_key_checked() instead.
key | a key to initialize the key schedule with. | |
ks | a key schedule to initialize. |
int DES_set_key_checked | ( | DES_cblock * | key, | |
DES_key_schedule * | ks | |||
) |
Just like DES_set_key_unchecked() except checking that the key is not weak for or have correct parity.
key | a key to initialize the key schedule with. | |
ks | a key schedule to initialize. |
int DES_set_key_unchecked | ( | DES_cblock * | key, | |
DES_key_schedule * | ks | |||
) |
Setup a des key schedule from a key. The key is no longer needed after this transaction and can cleared.
Does NOT check that the key is weak for or have wrong parity.
key | a key to initialize the key schedule with. | |
ks | a key schedule to initialize. |
void DES_set_odd_parity | ( | DES_cblock * | key | ) |
Set the parity of the key block, used to generate a des key from a random key. See DES key generation.
key | key to fixup the parity for. |
void DES_string_to_key | ( | const char * | str, | |
DES_cblock * | key | |||
) |
Convert a string to a DES key. Use something like PKCS5_PBKDF2_HMAC_SHA1() to create key from passwords.
str | The string to convert to a key | |
key | the resulting key |