2

I'm using the DUKPT algorithm to generate keys for the DES encryption algorithm. The C# implementation of DES throws an exception when you attempt to use a weak key.

Is it possible for the DUKPT algorithm to generate weak keys, or does it avoid them? What can I do if it does generate a weak key?

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
MjeOsX
  • 375
  • 4
  • 12

1 Answers1

4

Possible, but very unlikely. The DUKPT algorithm gives a unique key for every transaction, and all bits at any time can be set or not, therefore it is possible for it to generate a "weak" key of all 0s. Depending on the size of your key it becomes much less likely to happen of course, and you want to be careful about arbitrarily throwing out "weak" keys, as that weakens the other keys as well.

An all zero key happens 1 time out of 2^(N) where N is the number of bits in your key, so for your 64 bit key: 1/(2^64)...needless to say, not very often. Since the DUKPT generates a unique key per transaction, you should be fine using it without checking for that case in DES since you'll presumably be doing all 16 rounds anyways.

NominSim
  • 8,447
  • 3
  • 28
  • 38