diff --git a/mRemoteNGTests/Security/AeadCryptographyProviderTests.cs b/mRemoteNGTests/Security/AeadCryptographyProviderTests.cs index 8d3511626..68f0ee856 100644 --- a/mRemoteNGTests/Security/AeadCryptographyProviderTests.cs +++ b/mRemoteNGTests/Security/AeadCryptographyProviderTests.cs @@ -4,6 +4,8 @@ using System.Security; using mRemoteNG.Security; using mRemoteNG.Security.SymmetricEncryption; using NUnit.Framework; +using NUnit.Framework.Constraints; +using Org.BouncyCastle.Security; namespace mRemoteNGTests.Security @@ -72,5 +74,13 @@ namespace mRemoteNGTests.Security } return combinationList; } + + [Test] + public void DecryptionFailureThrowsException() + { + var cipherText = _cryptographyProvider.Encrypt(_plainText, _encryptionKey); + ActualValueDelegate decryptMethod = () => _cryptographyProvider.Decrypt(cipherText, "wrongKey".ConvertToSecureString()); + Assert.That(decryptMethod, Throws.TypeOf()); + } } } \ No newline at end of file