Exemplo n.º 1
0
        public void ValidTest()
        {
            RailFenceEnc ite = new RailFenceEnc(3);

            Assert.IsTrue(ite.Encrypt("REDDITCOMRDAILYPROGRAMMER") == "RIMIRAREDTORALPORMEDCDYGM");
            RailFenceDecrypt iteTwo = new RailFenceDecrypt(4);

            Assert.IsTrue(iteTwo.Decrypt("TCNMRZHIKWFUPETAYEUBOOJSVHLDGQRXOEO") == "THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG");
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            RailFenceEnc test   = new RailFenceEnc(3);
            string       output = test.Encrypt("REddITCOMRDAILYPROGRAMMER");

            Console.WriteLine(output);
            RailFenceDecrypt test1   = new RailFenceDecrypt(3);
            string           output1 = test1.Decrypt("RImiRAREDTORALPORMEDCDYGM");

            Console.WriteLine(output1);
            RailFenceEnc newRail = new RailFenceEnc(4);
            string       text    = newRail.Encrypt("THEQUIcKBrOWNFOXJUMPSOVERTHELAZYDOG");

            Console.WriteLine(text);
            RailFenceDecrypt newRailDec = new RailFenceDecrypt(4);
            string           text2      = newRailDec.Decrypt("TCNMRzHIkWFUPETAYEUBOOJSVHLDGQRXOEO");

            Console.WriteLine(text2);


            Console.ReadKey();
        }
Exemplo n.º 3
0
        public void InvalidTest()
        {
            RailFenceEnc ite = new RailFenceEnc(3);

            Assert.IsFalse(ite.Encrypt("REDDITCOMRDAILYPROGRAMMER") == "REDDITCOMRDAILYPROGRAMMER");
        }