Example #1
0
        static void Main(string[] args)
        {
            var key = "b14ca5898a4e4133bbce2ea2315a1916";

            //Console.WriteLine("Please enter a secret key for the symmetric algorithm.");
            //var key = Console.ReadLine();

            Console.WriteLine("Please enter a string for encryption");
            var str             = Console.ReadLine();
            var encryptedString = AesOperation.EncryptString(key, str);

            Console.WriteLine($"encrypted string = {encryptedString}");

            var decryptedString = AesOperation.DecryptString(key, encryptedString);

            Console.WriteLine($"decrypted string = {decryptedString}");

            Console.ReadKey();
        }
Example #2
0
        static void Main(string[] args)
        {
            var celesi = "b14ca5898a4e4133bbce2ea2315a1916";

            //Console.WriteLine("Ju lutem shenoni nje celes sekret per algoritmin simetrik.");
            //var celesi = Console.ReadLine();

            Console.WriteLine("Ju lutem shenoni nje tekst per enkriptim:");
            var str        = Console.ReadLine();
            var enkriptimi = AesOperation.EncryptString(celesi, str);

            Console.WriteLine($"Teksti i enkriptuar = {enkriptimi}");

            var dekriptimi = AesOperation.DecryptString(celesi, enkriptimi);

            Console.WriteLine($"Teksti i dekriptuar = {dekriptimi}");

            Console.ReadKey();
        }