Name

des_decipher

Synopsis

void des_decipher(const unsigned char *ciphertext, unsigned char *plaintext, 
   unsigned char *key);

Return Value

None.

Description

Uses DES to decipher one 64-bit block of ciphertext specified by ciphertext. It is assumed that ciphertext contains data previously enciphered with des_encipher. Specify the 64-bit key in key. (Recall that every eighth bit of this key is ignored, resulting in a 56-bit key.) The 64-bit block of plaintext is returned in plaintext. It is the responsibility of the caller to manage the storage required in plaintext. To decipher a large buffer of data, call des_decipher in accordance with the block cipher mode used to encipher the data. For efficiency, des_decipher can reuse the subkeys computed during a previous call. To enable this, set key to NULL in subsequent calls.

Complexity

O (1)

Get Mastering Algorithms with C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.