Encrypt and decrypt strings
Features
- Advanced Encryption Standard based encryption
- Built with Generics allowing multiple configurations and instances concurrently.
var encryptedString = aesEncryptionService.Encrypt("Sample123!");
var decryptedString = aesEncryptionService.Decrypt(encryptedString);
var encryptedByteArray = aesEncryptionService.EncryptToByteArray("Sample123!");
var decryptedStringFromByteArray = aesEncryptionService.Decrypt(encryptedByteArray);
Console.WriteLine(
$@"Encrypted String
{ encryptedString }
Decrypted string
{ decryptedString }
Encrypted To ByteArray
{ Encoding.UTF8.GetString(encryptedByteArray) }
Decrypted String
{ decryptedStringFromByteArray }
");
Encrypted String
7BFFAPx56rGtAtB/LVBvdw==
Decrypted string
Sample123!
Encrypted To ByteArray
?�E ?y?�?�-Pow
Decrypted String
Sample123!