Hi Guys,
I am asking what the purpose of the "DES_full.charset" file is. I am assuming that it is meant to be a list of valid key bytes for DES so that the correct parity is used.
If this is the case then I suspect there might be an error here - the file contains the following bytes:-
01
03
05
07
09
0b
0d
0f
11
13
15
17
19
1b
1d
1f....
Each one of these is an odd number in terms of its decimal value, for example:-
01
03
05
07
09
11
13
15
17
19
21
23
25
27
29
31...
The problem is that DES parity isn't calculated based on the decimal value of each byte. It is the number of one bits set in each byte that determines the parity. This means the following bytes have odd parity in terms of DES:-
01
02
04
07
08
0B
0D
0E
10
13
15
16
19
1A
1C
1F...
From Wikipedia:-
"The key is nominally stored or transmitted as 8 bytes, each with odd parity. According to ANSI X3.92-1981 (Now, known as ANSI INCITS 92-1981), section 3.5:
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.
"
A "cheat sheet" from a DES device that I have is here:-
http://mattames.com/DESparity.png
I believe this is to be true and correct, can you please update the DES_full.charset file? I can create a pull request in GitHub if needed.
Cheers,
Matt
I am asking what the purpose of the "DES_full.charset" file is. I am assuming that it is meant to be a list of valid key bytes for DES so that the correct parity is used.
If this is the case then I suspect there might be an error here - the file contains the following bytes:-
01
03
05
07
09
0b
0d
0f
11
13
15
17
19
1b
1d
1f....
Each one of these is an odd number in terms of its decimal value, for example:-
01
03
05
07
09
11
13
15
17
19
21
23
25
27
29
31...
The problem is that DES parity isn't calculated based on the decimal value of each byte. It is the number of one bits set in each byte that determines the parity. This means the following bytes have odd parity in terms of DES:-
01
02
04
07
08
0B
0D
0E
10
13
15
16
19
1A
1C
1F...
From Wikipedia:-
"The key is nominally stored or transmitted as 8 bytes, each with odd parity. According to ANSI X3.92-1981 (Now, known as ANSI INCITS 92-1981), section 3.5:
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.
"
A "cheat sheet" from a DES device that I have is here:-
http://mattames.com/DESparity.png
I believe this is to be true and correct, can you please update the DES_full.charset file? I can create a pull request in GitHub if needed.
Cheers,
Matt