/// <summary> /// checks if a key is weak (and perhaps shouldn't be used) /// </summary> /// <param name="key"> /// the key material to test against /// </param> /// <returns> /// true: key is "weak" / false: key passed the test /// </returns> public static bool IsWeakKey (byte[] key) { BlowfishAlgorithm bfAlg = new BlowfishAlgorithm(key, null, false, true); return(bfAlg.m_bf.IsWeakKey); }
public override ICryptoTransform CreateDecryptor ( byte[] key, byte[] iv ) { BlowfishAlgorithm result = new BlowfishAlgorithm( key, iv, (CipherMode.CBC == ModeValue), false); result.Padding = Padding; return(result); }