Exemplo n.º 1
0
        public void DecryptBasicTest()
        {
            Beaufort bf        = new Beaufort("FORTIFICATION");
            var      plainText = bf.Decrypt("CKMPVCPVWPIWUJOGIUAPVWRIWUUK");

            Assert.AreEqual("DEFENDTHEEASTWALLOFTHECASTLE", plainText);
        }
Exemplo n.º 2
0
        public void EncryptBasicTest()
        {
            Beaufort bf        = new Beaufort("FORTIFICATION");
            var      encrypted = bf.Encrypt("DEFENDTHEEASTWALLOFTHECASTLE");

            Assert.AreEqual("CKMPVCPVWPIWUJOGIUAPVWRIWUUK", encrypted);
        }
Exemplo n.º 3
0
        public void Unigraph_BeaufortTest()
        {
            Beaufort beaufort = new Beaufort(Utility.KeyedEnglishAlphabet("KRYPTOS"));

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

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

                Assert.AreEqual(generated, clear);
            }
        }