c#解密帮忙
求大虾们帮忙看一下下面这个加密的程序的解密方式谢谢private string ToHexString(byte[] bytes)
{
char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7','8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
char[] chars = new char[bytes.Length * 2];
for (int i = 0; i < bytes.Length; i++)
{
int b = bytes[i];
chars[i * 2] = hexDigits[b >> 4];
chars[i * 2 + 1] = hexDigits[b & 0xF];
}
System.Console.Write("ret:" + new string(chars));
return new string(chars);
} --------------------编程问答-------------------- 这那里是加密啊 就是转换16进数字为字符
public byte[] ToByte(string p_HexString)
{
byte[] _ReturnBytes = new byte[p_HexString.Length / 2];
string _HexText = p_HexString;
for (int i = 0; i != _ReturnBytes.Length; i++)
{
_ReturnBytes[i] = Convert.ToByte(_HexText.Substring(0, 2));
_HexText = _HexText.Remove(0, 2);
}
return _ReturnBytes;
}
你想获取HEXSTRING没这么麻烦
public string ToHexText(byte[] p_Bytes)
{
return BitConverter.ToString(p_Bytes).ToUpper().Replace("-", "");
} --------------------编程问答-------------------- 朋友上面那段代码测试结果为参数格式有问题
_ReturnBytes[i] = Convert.ToByte(_HexText.Substring(0, 2));
这里指向报异常
补充:.NET技术 , C#