Wanzyee Studio
CryptoExtension

Extension methods to encrypt and decrypt a string or byte array. More...

Static Public Member Functions

static string ToHash (this string text, string key="")
 Convert the specified string to a base64 formatted hash code. More...
 
static byte[] ToHash (this byte[] bytes, string key="")
 Convert the specified byte array to hash bytes. More...
 
static string ToEncrypted (this string text, string key="")
 Convert the specified string to a base64 formatted encrypted code. More...
 
static byte[] ToEncrypted (this byte[] bytes, string key="")
 Convert the specified byte array to encrypted bytes. More...
 
static string ToDecrypted (this string text, string key="")
 Convert the specified base64 formatted encrypted code to a string. More...
 
static byte[] ToDecrypted (this byte[] bytes, string key="")
 Convert the specified encrypted bytes to a byte array. More...
 

Detailed Description

Extension methods to encrypt and decrypt a string or byte array.

Member Function Documentation

static string ToHash ( this string  text,
string  key = "" 
)
static

Convert the specified string to a base64 formatted hash code.

Parameters
textText.
keyKey.
Returns
Hash code.
static byte [] ToHash ( this byte[]  bytes,
string  key = "" 
)
static

Convert the specified byte array to hash bytes.

Parameters
bytesBytes.
keyKey.
Returns
Hash bytes.
static string ToEncrypted ( this string  text,
string  key = "" 
)
static

Convert the specified string to a base64 formatted encrypted code.

Parameters
textText.
keyKey.
Returns
Encrypted code.
static byte [] ToEncrypted ( this byte[]  bytes,
string  key = "" 
)
static

Convert the specified byte array to encrypted bytes.

Parameters
bytesBytes.
keyKey.
Returns
Encrypted bytes.
static string ToDecrypted ( this string  text,
string  key = "" 
)
static

Convert the specified base64 formatted encrypted code to a string.

Parameters
textText.
keyKey.
Returns
Decrypted string.
static byte [] ToDecrypted ( this byte[]  bytes,
string  key = "" 
)
static

Convert the specified encrypted bytes to a byte array.

Parameters
bytesBytes.
keyKey.
Returns
Decrypted byte array.