Class Cryptography
Provides methods for cryptographic operations, including hashing and encryption.
Inherited Members
Namespace: Innovt.Core.Utilities
Assembly: Innovt.Core.dll
Syntax
public static class Cryptography
Methods
| Edit this page View SourceAesDecrypt(string, string)
Decrypts an encrypted string using the AES algorithm with a specified key.
Declaration
public static string AesDecrypt(string encryptedText, string keyString)
Parameters
Type | Name | Description |
---|---|---|
string | encryptedText | The encrypted string to be decrypted. |
string | keyString | The key for AES decryption. |
Returns
Type | Description |
---|---|
string | The decrypted plaintext string. |
AesEncrypt(string, string)
Encrypts a plaintext string using the AES algorithm with a specified key.
Declaration
public static string AesEncrypt(string plainText, string keyString)
Parameters
Type | Name | Description |
---|---|---|
string | plainText | The plaintext string to be encrypted. |
string | keyString | The key for AES encryption. |
Returns
Type | Description |
---|---|
string | The encrypted string. |
Md5Hash(string)
Computes the MD5 hash of a given plaintext password.
Declaration
public static string Md5Hash(this string plainPassword)
Parameters
Type | Name | Description |
---|---|---|
string | plainPassword | The plaintext password to be hashed. |
Returns
Type | Description |
---|---|
string | The MD5 hash of the plaintext password. |
RijndaelDecrypt(string, string)
Decrypts an encrypted string using the Rijndael algorithm with a specified key.
Declaration
[Obsolete("Obsolete")]
public static string RijndaelDecrypt(string encryptedText, string keyString)
Parameters
Type | Name | Description |
---|---|---|
string | encryptedText | The encrypted string to be decrypted. |
string | keyString | The key for Rijndael decryption. |
Returns
Type | Description |
---|---|
string | The decrypted plaintext string. |
RijndaelEncrypt(string, string)
Encrypts a plaintext string using the Rijndael algorithm with a specified key.
Declaration
public static string RijndaelEncrypt(string plainText, string keyString)
Parameters
Type | Name | Description |
---|---|---|
string | plainText | The plaintext string to be encrypted. |
string | keyString | The key for Rijndael encryption. |
Returns
Type | Description |
---|---|
string | The encrypted string. |
ShaHash(string, string)
Computes the SHA-256 hash of a given plaintext password with an optional salt.
Declaration
public static string ShaHash(this string plainPassword, string salt = "")
Parameters
Type | Name | Description |
---|---|---|
string | plainPassword | The plaintext password to be hashed. |
string | salt | An optional salt value to add to the plaintext before hashing. |
Returns
Type | Description |
---|---|
string | The SHA-256 hash of the plaintext password. |