From 12165ac9a6bf87101bf5ad03826d13f2f670ead2 Mon Sep 17 00:00:00 2001 From: David Sparer Date: Mon, 11 Jul 2016 18:06:28 -0600 Subject: [PATCH] Added required property to the ICryptographyProvider interface to get the underlying crypto algorithm --- mRemoteV1/Security/AeadCryptographyProvider.cs | 2 ++ mRemoteV1/Security/AesCryptographyProvider.cs | 2 ++ mRemoteV1/Security/Encryptor.cs | 2 ++ mRemoteV1/Security/ICryptographyProvider.cs | 2 ++ 4 files changed, 8 insertions(+) diff --git a/mRemoteV1/Security/AeadCryptographyProvider.cs b/mRemoteV1/Security/AeadCryptographyProvider.cs index 544320b8..2c148346 100644 --- a/mRemoteV1/Security/AeadCryptographyProvider.cs +++ b/mRemoteV1/Security/AeadCryptographyProvider.cs @@ -37,6 +37,8 @@ namespace mRemoteNG.Security public int BlockSizeInBytes => _aeadBlockCipher.GetBlockSize(); + public string CipherEngine => _aeadBlockCipher.AlgorithmName; + public AeadCryptographyProvider() { _aeadBlockCipher = new GcmBlockCipher(new AesFastEngine()); diff --git a/mRemoteV1/Security/AesCryptographyProvider.cs b/mRemoteV1/Security/AesCryptographyProvider.cs index 9d3b23b3..6acb8b8f 100644 --- a/mRemoteV1/Security/AesCryptographyProvider.cs +++ b/mRemoteV1/Security/AesCryptographyProvider.cs @@ -12,6 +12,8 @@ namespace mRemoteNG.Security public int BlockSizeInBytes => _aesEngine.GetBlockSize(); + public string CipherEngine => _aesEngine.AlgorithmName; + public AesCryptographyProvider() { _aesEngine = new AesEngine(); diff --git a/mRemoteV1/Security/Encryptor.cs b/mRemoteV1/Security/Encryptor.cs index 03281730..045700af 100644 --- a/mRemoteV1/Security/Encryptor.cs +++ b/mRemoteV1/Security/Encryptor.cs @@ -24,6 +24,8 @@ namespace mRemoteNG.Security public int BlockSizeInBytes => _blockCipher.GetBlockSize(); + public string CipherEngine => _blockCipher.AlgorithmName; + public Encryptor() { _encoding = Encoding.UTF8; diff --git a/mRemoteV1/Security/ICryptographyProvider.cs b/mRemoteV1/Security/ICryptographyProvider.cs index 428a19d2..54eb8d19 100644 --- a/mRemoteV1/Security/ICryptographyProvider.cs +++ b/mRemoteV1/Security/ICryptographyProvider.cs @@ -6,6 +6,8 @@ namespace mRemoteNG.Security { int BlockSizeInBytes { get; } + string CipherEngine { get; } + string Encrypt(string plainText, SecureString encryptionKey); string Decrypt(string cipherText, SecureString decryptionKey);