110,534
社区成员
发帖
与我相关
我的任务
分享
static byte[] strToToHexByte(string hexString)
{
hexString = hexString.Replace(" ", "");
if ((hexString.Length % 2) != 0)
hexString += " ";
byte[] returnBytes = new byte[hexString.Length / 2];
for (int i = 0; i < returnBytes.Length; i++)
returnBytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
return returnBytes;
}
var key = strToToHexByte("D02DAC6052868AA54537842CDD3B9BEA");
var data = strToToHexByte("08123456780000000000000000000000");
//用的CipherMode.ECB, PaddingMode.PKCS7