Table of Contents

Class Crypto

Namespace
ZapLib.Security
Assembly
ZapLib.dll

訊息加解密輔助工具

public class Crypto
Inheritance
Crypto
Inherited Members

Constructors

Crypto(Encoding)

建構子

public Crypto(Encoding encoding = null)

Parameters

encoding Encoding

編碼方式,預設為 ASCII,可自行修改為 UTF8

Properties

CryptoEncoding

加密類別使用的編碼方式,可自行指定為 UTF8 (預設為 ASCII)

public Encoding CryptoEncoding { get; set; }

Property Value

Encoding

IV

DES 加密初始化向量

public string IV { get; set; }

Property Value

string

Methods

DESDecryption(string, string)

DES 解密

public string DESDecryption(string content, string iv)

Parameters

content string

加密後的內容

iv string

初始化向量

Returns

string

解密後的內容

DESEncryption(string, string)

DES 加密

public string DESEncryption(string content, string iv = null)

Parameters

content string

原始內容

iv string

初始化向量

Returns

string

加密後的內容

Md5(string)

MD5 雜湊資料

public string Md5(string content = "")

Parameters

content string

資料

Returns

string

雜湊後的資料

RandomString(int)

產生指定長度的亂數字串 [A-Za-z0-9]

public string RandomString(int len)

Parameters

len int

指定長度

Returns

string

亂數字串