Does anyone know why if I encrypt a file with the DES algorithm (ECB) with the key 'abc123' and then decrypt it with the key 'aac022', I am able to decrypt it 100% even though it is a different key? (The keys are written in hexadecimal)
Asked
Active
Viewed 129 times
0
-
If you meant 0000000000abc123 and 0000000000aac022 as hex representations of 64 bit input blocks to PC1 they only vary by LSBs in the 6th, 7th and 8th bytes. These LSBs are key parity bits in the DES standard and there's no requirement an implementation validate them nor do they contribute to selected keys. Disregarding the parity bits, the two keys are identical. – user16145658 Mar 24 '23 at 23:41
-
[Difference comparing the two keys](https://i.stack.imgur.com/KBOcN.jpg), where scheduled keys (KS) produced by applying the Key Schedule and Permuted Choice 2 (PC2). – user16145658 Mar 24 '23 at 23:48
-
As long as the differences are only in the LSBs of the 8 input bytes the round keys will be identical since the key parity is not part of the 56 bit key. – user16145658 Mar 25 '23 at 11:48
-
IBM defined DES with big-endian bit ordering on 8 bit interfaces. This can be shown in it's two patents on DES and got reflected in FIPS-46. We commonly use 7 downto 0, MSB downto LSB in describing bits in bytes keeping the order in mind There 1 to 8 would be 7 downto 0. [This image](https://i.stack.imgur.com/wKK2N.jpg) shows where to find the key parity bits. – user16145658 Mar 25 '23 at 22:49