IsWeakKey() public static method

public static IsWeakKey ( byte key ) : bool
key byte
return bool
Example #1
0
 public DesParameters(byte[] key, int keyOff, int keyLen) : base(key, keyOff, keyLen)
 {
     if (DesParameters.IsWeakKey(key, keyOff))
     {
         throw new ArgumentException("attempt to create weak DES key");
     }
 }
Example #2
0
 public static bool IsWeakKey(byte[] key, int offset, int length)
 {
     for (int i = offset; i < length; i += 8)
     {
         if (DesParameters.IsWeakKey(key, i))
         {
             return(true);
         }
     }
     return(false);
 }
Example #3
0
 public static bool IsWeakKey(byte[] key)
 {
     return(DesParameters.IsWeakKey(key, 0));
 }