IsWeakKey() public static method

public static IsWeakKey ( byte key ) : bool
key byte
return bool
Example #1
0
 private static byte[] FixKey(byte[] key, int keyOff, int keyLen)
 {
     byte[] array = new byte[24];
     if (keyLen != 16)
     {
         if (keyLen != 24)
         {
             throw new ArgumentException("Bad length for DESede key: " + keyLen, "keyLen");
         }
         Array.Copy(key, keyOff, array, 0, 24);
     }
     else
     {
         Array.Copy(key, keyOff, array, 0, 16);
         Array.Copy(key, keyOff, array, 16, 8);
     }
     if (DesEdeParameters.IsWeakKey(array))
     {
         throw new ArgumentException("attempt to create weak DESede key");
     }
     return(array);
 }
Example #2
0
 public new static bool IsWeakKey(byte[] key)
 {
     return(DesEdeParameters.IsWeakKey(key, 0, key.Length));
 }
Example #3
0
 public new static bool IsWeakKey(byte[] key, int offset)
 {
     return(DesEdeParameters.IsWeakKey(key, offset, key.Length - offset));
 }