Quantcast
Channel: Covert a DES 96 bit key to 64 bit - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Maarten Bodewes for Covert a DES 96 bit key to 64 bit

$
0
0

The key you have displayed is 48 bits in size, not 96 bits in size - if it is considered to be specified hexadecimals. A DES key without parity would be 56 bits in size. This means that you have to create the parity bits that are missing. The parity of DES is described as such:

One bit in each 8-bit byte of the KEY may be utilized for error detection in key generation, distribution, and storage. Bits 8, 16,..., 64 are for use in ensuring that each byte is of odd parity.

Note that the bits are numbered starting at the left with value 1, meaning that the least significant bit of each byte is used for parity. So you have to distribute the bits you have been given over the bytes, and then adjust the parity of each byte by possibly flipping the least significant bit (using XOR with 1).

Usually libraries have support for this kind of operation. In Java you can do this by generating the DES key using SecretKeyFactory for instance.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>