Skip to content

Cryptology

Taiizor edited this page Mar 1, 2023 · 2 revisions

CryptologyExtension Class

The CryptologyExtension class contains extension methods for cryptographic operations such as converting text to Base64, encrypting text with AES, and generating MD5 hash values.

Namespace

The CryptologyExtension class is defined in the Skylark.Standard.Extension.Cryptology namespace.

Methods

TextToBase

Converts a text string to a Base64-encoded string.

Syntax

public static string TextToBase(string Text = MCCM.Text, EET Encode = MCCM.Encode)

Parameters

  • Text (string): The text string to be converted to Base64. The default value is MCCM.Text.
  • Encode (EET): The encoding type of the text string. The default value is MCCM.Encode.

Return Value

A string that represents the Base64-encoded version of the input text.

Exceptions

  • E: Throws an E exception if an error occurs.

TextToBaseAsync

Asynchronously converts a text string to a Base64-encoded string.

Syntax

public static Task<string> TextToBaseAsync(string Text = MCCM.Text, EET Encode = MCCM.Encode)

Parameters

  • Text (string): The text string to be converted to Base64. The default value is MCCM.Text.
  • Encode (EET): The encoding type of the text string. The default value is MCCM.Encode.

Return Value

A task that represents the asynchronous operation. The task result is a string that represents the Base64-encoded version of the input text.

TextToAes

Encrypts a text string with the Advanced Encryption Standard (AES) algorithm.

Syntax

public static string TextToAes(string Text = MCCM.Text, string IV = MCCM.IV, string Key = MCCM.Key, CipherMode Mode = MCCM.Cipher, EET Encode = MCCM.Encode)

Parameters

  • Text (string): The text string to be encrypted. The default value is MCCM.Text.
  • IV (string): The initialization vector (IV) to use for the AES algorithm. The default value is MCCM.IV.
  • Key (string): The key to use for the AES algorithm. The default value is MCCM.Key.
  • Mode (CipherMode): The cipher mode to use for the AES algorithm. The default value is MCCM.Cipher.
Clone this wiki locally