Here's an example of how to use the Caesar Cipher encryption algorithm using the EscNet micro framework
First configure your dependency in your Startup.cs
services.AddCaesarCipherCryptography(KEY_UP);
Now receive your dependency via constructor.
private readonly ICaesarCipherCryptography _caesarCipherCryptography; public MyClass(ICaesarCipherCryptography caesarCipherCryptography){ _caesarCipherCryptography = caesarCipherCryptography; }
Now to encrypt the phrase use
string encryptedPhrase = _caesarCipherCryptography.Encrypt("phrase to be encrypted");
And to decrypt the phrase use
string decryptedPhrase = _caesarCipherCryptography.Decrypt("phrase to be decrypted");
2021 ©
There was an error while loading. Please reload this page.