示例#1
0
 public static void TripleDesTest()
 {
     TripleDESEncryptor des = new TripleDESEncryptor (Resource.Key);
                 String encryString = des.Encrypt (Resource.SourceString);
                 String result = des.Decrypt (encryString);
                 Assert.AreEqual (Resource.SourceString, result);
 }
示例#2
0
        public static void TripleDes_ErrorKey_Test()
        {
            Assert.Catch(() => {
                    TripleDESEncryptor des = new TripleDESEncryptor(Resource.Key);
                    String encryString = des.Encrypt(Resource.SourceString);
                    String result = des.Decrypt(encryString);

                    Assert.AreNotEqual(Resource.SourceString, result);
                    },"");
        }