示例#1
0
 public void decodeTest()
 {
     string Key = "something";
     VernamKey target = new VernamKey(Key);
     string text = "\a\aTNS\a\r\aN";
     string expected = "this is a hidden text";
     string actual;
     actual = target.decode(text);
     Assert.AreEqual(expected, actual);
 }
示例#2
0
        public void encryptTest()
        {
            string Key = "something";
            VernamKey target = new VernamKey(Key);
            string text = "this is a hidden text";
            string expected = "\a\aTNS\a\r\aN";
            string actual;
            actual = target.encrypt(text);
            Assert.AreEqual(expected, actual);

            // test that there is a difference between keys
            Key = "a different key";
            target = new VernamKey(Key);
            text = "this is a hidden text";
            expected = "\a\aTNS\a\r\aN";
            actual = target.encrypt(text);
            Assert.AreNotEqual(expected, actual);
        }