代码拉取完成,页面将自动刷新
using System;
using System.Collections.Generic;
using System.Diagnostics;
//using System.Linq;
using System.Security.Cryptography;
using System.Text;
//using System.Threading.Tasks;
namespace crpt
{
class Program
{
private static char[] codeTab = new char[256];
private static void InitCodeTab()
{
for (int i = 97; i <= 122; i++)
{
char upper = (char)(i - 97 + 65);
codeTab[i] = upper;
codeTab[upper] = upper;
}
for (int i = 48; i <= 57; i++)
{
codeTab[i] = (char)i;
}
codeTab[32] = ' ';
codeTab[44] = ',';
codeTab[46] = '.';
}
private static String toStrTab(String s)
{
char lastCh = '\0';
StringBuilder sb = new StringBuilder(s.Length);
int length = s.Length;
for (int i = 0; i < length; i++)
{
char ch = s[i];
if (ch < 'Ā')
{
ch = codeTab[ch];
if ((ch == 0) || ((lastCh == ' ') && (ch == ' ')))
continue;
lastCh = ch;
sb.Append(ch);
}
}
return sb.ToString().Trim();
}
static void Main(string[] args)
{
string str = args[0];
InitCodeTab();
//string str = "200001|pdsb|20121017105425|2012101700000078|pdsb0001|pdsb_pds|01|3042060759||20121017|";
str = toStrTab(str);
byte[] hash;
using (MD5 md5 = MD5.Create())
{
hash = md5.ComputeHash(Encoding.Default.GetBytes(str));
}
byte[] dest = new byte[8];
for (int i = 0; i < 8; i++)
{
dest[i] = (byte)(hash[i] ^ hash[8 + i]);
}
byte[] key = new byte[8];
//7B 2F EF C3 04 C2 BC 9D
key[0] = 0x7b;
key[1] = 0x2f;
key[2] = 0xef;
key[3] = 0xc3;
key[4] = 0x04;
key[5] = 0xc2;
key[6] = 0xbc;
key[7] = 0x9d;
var des = DES.Create();
des.Mode = CipherMode.ECB;
des.Padding = PaddingMode.None;
des.Key = key;
var encryptor1 = des.CreateEncryptor();
byte[] outBlock = encryptor1.TransformFinalBlock(dest, 0, dest.Length);
Console.Write(BitConverter.ToString(outBlock).Replace("-", string.Empty));
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。