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"); } }
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); }
public static bool IsWeakKey(byte[] key) { return(DesParameters.IsWeakKey(key, 0)); }