I was learning DES when it occurred to me that there could be a possible case where a (key, plainText)
pair could result in an encryptedText
such that, plainText == encryptedText
.
Quickly I found out that there exists weak keys (especially for DES!) that make it quite vulnerable. So, the worst that can happen with these weak keys is that double encryption would return the original plainText
.
I want to look at one example where the output of the DES would be same as input.
What I've already tried:
- A brute force: wrote a generator for random
[key, pText]
pairs and DES over them to see if theeText
is same aspText
. Got a C Language implementation from here. Specs:len(pText) = 64b
,len(key) = 56b
,Generated random cases: 10M
. I do understand that the number of cases barely scratches the surface, but I was hoping (naively I guess) I'd find at lease one such case. - Gave a little thought and realised that, if the crypto function in the Feistel Structure returns
0
in every round, at the end of 16 rounds, we'd have the same output. This depends upon the inputs to that function (which are in-turn derived from the talked about pair) - Yet another thought is that: if the input is small enough (yes assuming we have padding enabled) the output would also be of the same size, which means that there's a very high probability that the
pText
is same aseText
. Just to make my thoughts more clear, if input is of size 1 bit, say1
, the output could be0
or1
, implying, the chances of my case occurring is 50%!
May be I should see the mathematical model of the DES and infer if it's possible, but I feel like I've already spent too much time on this!
Please suggest me how do I go about cracking this case!
Thanks! :)