Exemplo n.º 1
0
 /// <summary>
 /// DES解密
 /// </summary>
 /// <param name="encryptText">密文</param>
 /// <returns></returns>
 public static string DecryptStringReverse(string encryptText)
 {
     if (IsEncrypt() != Boolean.TrueString)
     {
         return(encryptText);
     }
     return(EncryptionDES.DecryptStringReverse(encryptText));
 }
Exemplo n.º 2
0
        public void EncipherTest()
        {
            uint[] key = new uint[] { 1, 2, 3, 4, 5, 6 };

            byte[] expected = new byte[] { 96, 97, 98, 99 };

            var encrypter = new  EncryptionDES();

            byte[] ciphertext = encrypter.Encrypt(expected, key);
            byte[] actual     = encrypter.Decrypt(ciphertext, key);

            CollectionAssert.AreEqual(expected, actual);
        }