Exemple #1
0
        public static bool TestEncrypt()
        {
            string messageToEncrypt = "the quick brown fox jumps over the lazy dog";
            string result           = algorithm.Crypt(messageToEncrypt);
            string correctResult    = "wkh txlfn eurzq ira mxpsv ryhu wkh odcb grj";

            Console.WriteLine($"\nMensagem de input: {messageToEncrypt}");
            Console.WriteLine($"Resultado obtido: {result}");
            Console.WriteLine($"Resultado esperado: {correctResult}");
            return(result == correctResult);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            string fraseNormal = null;
            var    bla         = new CesarCypher();
            var    respostta   = bla.Crypt(fraseNormal);

            Console.WriteLine(respostta);
        }
Exemple #3
0
        static void Main(string[] args)
        {
            CesarCypher cypher = new CesarCypher();

            string msgTeste = "the quick brown fox jumps over the lazy dog";

            msgTeste = cypher.Crypt(msgTeste);
            Console.WriteLine("Encriptografada: " + msgTeste);

            msgTeste = cypher.Decrypt(msgTeste);
            Console.WriteLine("Decriptografada: " + msgTeste);
        }