예제 #1
0
 public static void DesTest()
 {
     DESEncryptor des = new DESEncryptor(Resource.Key);
             String encryString = des.Encrypt(Resource.SourceString);
             String result = des.Decrypt( encryString);
             Assert.AreEqual (Resource.SourceString, result);
 }
예제 #2
0
        public static void Des_ErrorKey_Test()
        {
            Assert.Catch(() => {
                    DESEncryptor des = new DESEncryptor(Resource.ErrorKey);
                    String encryString = des.Encrypt( Resource.SourceString);
                    String result = des.Decrypt(encryString);
                    Assert.AreNotEqual(Resource.SourceString, result);

                    },"");
        }