public static string Decrypt(PublicSecret secret, string key) { Secret internalSecret = new Secret() { IV = Convert.FromBase64String(secret.IV), Data = Convert.FromBase64String(secret.Data) }; AESEncryption encryptor = new AESEncryption(key); return encryptor.Decrypt(internalSecret); }
public void TestMethod1() { const string sourceText = "This is a test, indeed."; const string encryptionKey = "12345abcde...."; AESEncryption enc = new AESEncryption(encryptionKey); Secret result = enc.Encrypt(sourceText); string decResult = enc.Decrypt(result); Assert.AreEqual(sourceText, decResult); }