Reputation: 1
I'm trying to encrypt a string variable to understand DES Algorithm with Python Crypto.Chiper package. But I don't really understand why key length must be 8 bytes long. I searched everywhere and I saw DES algorithm key length is 56 bits. Why are they different?
Upvotes: 0
Views: 461
Reputation:
As described e.g. on wikipedia, the key consists of 56bit + 8 parity bits. Since these usually aren't used in the encryption-process itself, they usually don't get mentioned (see e.g. here for details). In fact the DES implementation in Crypto.Cipher
explicitly states that parity-bits are discarded. So basically it's a relic of the olden days of crypto and a design-decision of the creators of the library.
Upvotes: 1