Beispiel #1
0
        public void CryptEqualLenKeyMsgIsSuccessful()
        {
            const string KEY1 = "ABCDABCDABCDABCDABCDABCDABCD";
            const string MSG1 = "CRYPTOISSHORTFORCRYPTOGRAPHY";

            string cipherText = Vigenere.EncryptASCII(MSG1, KEY1);

            Assert.AreEqual("CSASTPKVSIQUTGQUCSASTPIUAQJB", cipherText, $"Encrypt of {MSG1} failed");
            string plainText = Vigenere.DecryptASCII(cipherText, KEY1);

            Assert.AreEqual(MSG1, plainText, $"Decrypted message doesn't equal {MSG1}");
        }
Beispiel #2
0
        public void CryptShortIsSuccessful()
        {
            const string KEY1 = "LEMON";
            const string MSG1 = "ATTACKATDAWN";

            string cipherText = Vigenere.EncryptASCII(MSG1, KEY1);

            Assert.AreEqual("LXFOPVEFRNHR", cipherText, $"Encrypt of {MSG1} failed");
            string plainText = Vigenere.DecryptASCII(cipherText, KEY1);

            Assert.AreEqual(MSG1, plainText, $"Decrypted message doesn't equal {MSG1}");
        }