🖌️
FC.Extension
  • FC.Extension
  • How to Use?
  • Release Note
  • FC.Extension.List
    • ToDataTable
  • FC.Extension.Date
    • Age
  • FC.Extension.String
    • Encrypt
    • Decrypt
    • Truncate a String
  • SQL
    • SQL Extension
    • PostgreSQL Extension
Powered by GitBook
On this page

Was this helpful?

  1. FC.Extension.String

Encrypt

Encrypt a string as a extension method. It uses RSA Standard algorithm to do this.

Method: Encrypt

[Command("Enc")]
public class EncryptExtension_Command : ICommand
{        
    [CommandOption("enc", 'e', Description = "Value that has to be encrypt")]
    public string Value { get; set; }

    [CommandOption("key", 'k', Description = "Key used to encrypt or Decrypt.")]
    public string Key { get; set; }

    public ValueTask ExecuteAsync(IConsole console)
    {
        string encryptedValue = Value.Encrypt(Key);
        console.Output.WriteLine($"Plan Text : {Value} Encrypted Value : {encryptedValue} Key : {Key}");
        return default;
    }
}
PreviousFC.Extension.StringNextDecrypt

Last updated 3 years ago

Was this helpful?