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

            Assert.AreEqual("DEFENDTHEEASTWALLOFTHECASTLE", plainText);
        }
Esempio n. 2
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);
            }
        }