TripleDES: Specified key is a known weak key for 'TripleDES' and cannot be used

后端 未结 8 1121
时光说笑
时光说笑 2020-12-29 10:45

I\'m using the .NET 3.0 class System.Security.Cryptography.MACTripleDES class to generate a MAC value. Unfortunately, I am working with a hardware device that

相关标签:
8条回答
  • 2020-12-29 11:22

    There is a great suggestion using reflection in the MSDN forums

    0 讨论(0)
  • 2020-12-29 11:24

    Quite simple (After looking at the code from GitHub)

    static bool TripleDES.IsWeakKey(Byte[] rgbKey)

    Since it is static - it is easy to test your key against it

    1. Size must be either 16 or 24 bytes (???) Why can't they put it in the documentation
    2. The code check for few simple repetitions Just create random enuogh values

    See code at: https://github.com/mono/mono/blob/master/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs

    Dekel

    0 讨论(0)
提交回复
热议问题