private static void NewAES256EncryptedFromStream(byte[] bytes, bool value, string password) { var tag = new AES256Encrypted <ILTagBool>(new MemoryStream(bytes)); var clear = tag.Decrypt(password); Assert.AreEqual(value, AsBool(clear)); }
public void DecryptParameterValidation() { var tag = new AES256Encrypted <ILTagBool>(new MemoryStream(new byte[] { 42, 68, 0, 0, 16, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 97, 115, 115, 119, 111, 114, 100, 112, 97, 115, 115, 119, 111, 114, 100, 112, 97, 115, 115, 119, 111, 114, 100, 112, 97, 115, 115, 119, 111, 114, 100, 72, 104, 36, 141, 30, 66, 29, 203, 15, 6, 42, 29, 52, 96, 232, 3 })); AssertPasswordMissing(() => tag.Decrypt(null)); }