-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
26 lines (21 loc) · 887 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
namespace EncryptionDecryptionUsingSymmetricKey
{
class Program
{
static void Main(string[] args)
{
//Guid key generated with base64encoded and uppercase combination
var key = "A+W2nzdpbEe3UHrCBZU5Qw==";
//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 = AesAlgorithm.Encrypt(key, str);
Console.WriteLine($"encrypted string = {encryptedString}");
var decryptedString = AesAlgorithm.Decrypt(key, encryptedString);
Console.WriteLine($"decrypted string = {decryptedString}");
Console.ReadKey();
}
}
}