Ejemplo n.º 1
0
        public void DecryptBasicTest()
        {
            Porta p         = new Porta("FORTIFICATION");
            var   plainText = p.Decrypt("SYNNJSCVRNRLAHUTUKUCVRYRLANY");

            Assert.AreEqual("DEFENDTHEEASTWALLOFTHECASTLE", plainText);
        }
Ejemplo n.º 2
0
        public void Unigraph_PortaTest()
        {
            Porta porta = new Porta(Utility.KeyedEnglishAlphabet("KRYPTOS"));

            porta.Key = "KRYPTOS";

            cipher    = "";
            clear     = "";
            generated = "";
            for (int i = 0; i < 25; i++)
            {
                generated = porta.GenerateRandomString();

                cipher = porta.Encrypt(generated);
                clear  = porta.Decrypt(cipher);

                Assert.AreEqual(generated, clear);
            }
        }