Skip to content

String.Encription

Tomáš Bouda edited this page Nov 22, 2017 · 1 revision

🔴 Type Extensions.String.Encription.Hasher

Provides methods for string hashing


🔴 Type Extensions.String.Encription.Hasher.eHashType

Supported hash algorithms


🔺 Field Extensions.String.Encription.Hasher.eHashType.SHA1

https://www.howtogeek.com/238705/what-is-sha-1-and-why-will-retiring-it-kick-thousands-off-the-internet/


🔹 Method Extensions.String.Encription.Hasher.ComputeHash(System.String,Extensions.String.Encription.Hasher.eHashType)

Computes the hash of the string using a specified hash algorithm

Param Description
input The string to hash
hashType The hash algorithm to use

Returns: The resulting hash or an empty string on error


🔴 Type Extensions.String.Encription.StringEncrypt

Provides methods for string encryption/decryption


🔹 Method Extensions.String.Encription.StringEncrypt.Encrypt(System.String,System.String)

Encrypts a string using the supplied key. Encoding is done using RSA encryption.

Param Description
stringToEncrypt String that must be encrypted.
key EncryptionKey.

Returns: A string representing a byte array separated by a minus sign.

Exception Description
System.ArgumentException Occurs when stringToEncrypt or key is null or empty.

🔹 Method Extensions.String.Encription.StringEncrypt.Decrypt(System.String,System.String)

Decrypts a string using the supplied key. Decoding is done using RSA encryption.

Param Description
key DecryptionKey.

Returns: The decrypted string or null if decryption failed.

Param Description
stringToDecrypt
Exception Description
System.ArgumentException Occurs when stringToDecrypt or key is null or empty.