Method

Encrypt

Encrypt data with the key and iv.

DESCrypt.Encrypt("luohongwei", key,iv)

output:

kG80Y/WtZkuopjhh9u2ZDQ==

Encrypt

Encrypt data with the key and iv.This method return byte array,and the params is all byte array.

byte[] enBytes=DESCrypt.Encrypt(System.Text.Encoding.UTF8.GetBytes("luohongwei"),
key.FromHex(),iv.FromHex());
Convert.ToBase64String(enBytes)

output:

kG80Y/WtZkuopjhh9u2ZDQ==

Decrypt

Decrypt data with the key and iv.

DESCrypt.Decrypt("kG80Y/WtZkuopjhh9u2ZDQ==",key,iv)

output:

luohongwei

Decrypt

Decrypt data with the key and iv.This method return byte array,and the params is all byte array.

byte[] deBytes=DESCrypt.Decrypt(enBytes,
key.FromHex(),iv.FromHex());
System.Text.Encoding.UTF8.GetString(deBytes)

output:

luohongwei