/*-----------------------------------------------------------------------------
This function performs a DES encryption or decryption on a single 64-bit block
of data, using the specified 56-bit key. The data and key are packed one bit
per byte. Every element of data[] must be either 0 or 1. The results
will be highly anomalous if this is not the case.
The encrypted or decrypted data is returned to the data[] buffer.
-----------------------------------------------------------------------------*/
void des::encrypt_decrypt(unsigned char data[DES_DATA_SIZE],
int /* boolean */ encrypt)
还有这个引自wikipedia:
Before the main rounds, the block is divided into two 32-bit halves and processed alternately; this criss-crossing is known as the Feistel scheme. The Feistel structure ensures that decryption and encryption are very similar processes — the only difference is that the subkeys are applied in the reverse order when decrypting. The rest of the algorithm is identical.