Name

des_encipher

Synopsis

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

Return Value

None.

Description

Uses DES to encipher one 64-bit block of plaintext specified by plaintext. 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 ciphertext is returned in ciphertext. It is the responsibility of the caller to manage the storage required in ciphertext. To encipher a large buffer of data, call des_encipher in accordance with a block cipher mode (see the example later in this chapter). For efficiency, des_encipher 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.