示例#1
0
        public string Decrypt(string cipherText, string key1, string key2)
        {
            var cipherText1    = desMotor.Decrypt(cipherText, key2);
            var finalPlainText = desMotor.Decrypt(cipherText1, key1);

            return(finalPlainText);
        }
        public string Encrypt(string plainText, string key1, string key2)
        {
            var cipherText1     = desMotor.Encrypt(plainText, key1);
            var cipherText2     = desMotor.Decrypt(cipherText1, key2);
            var finalCipherText = desMotor.Encrypt(cipherText2, key1);

            return(finalCipherText);
        }
 public void DecryptTest(string plainText, string key, string cipherText)
 {
     Assert.Equal(plainText, desMotor.Decrypt(cipherText, key));
 }