Exemplo n.º 1
0
        public void StringCrypt_Basic_TripleDES()
        {
            string input = "test 123 %$#";

            byte[] output      = StringCrypt.EncryptTripleDES(input);
            string outputFinal = StringCrypt.DecryptTripleDES(output);

            Assert.AreEqual(input, outputFinal, "String output should be as exected after decrypt.");
        }
Exemplo n.º 2
0
        public void StringCrypt_Specific_TripleDES_NewAlg()
        {
            string    input = "foobar and some special characters $%^&*()";
            TripleDES alg   = TripleDES.Create("TripleDES");

            byte[] output      = StringCrypt.EncryptTripleDES(input, alg);
            string outputFinal = StringCrypt.DecryptTripleDES(output, alg);

            Assert.AreEqual(input, outputFinal, "String output should be as exected after decrypt.");
        }
Exemplo n.º 3
0
        public void StringCrypt_Specific_TripleDES_WrongAlg()
        {
            string    input = "foobar and some special characters $%^&*()";
            TripleDES alg1  = TripleDES.Create("TripleDES");
            TripleDES alg2  = TripleDES.Create("TripleDES");

            byte[] output      = StringCrypt.EncryptTripleDES(input, alg1);
            string outputFinal = StringCrypt.DecryptTripleDES(output, alg2);

            Assert.AreNotEqual(input, outputFinal, "String output should not be decryptable.");
        }