private
void
calc()
{
int
i,j;
uint
t1,t2,t3;
Byte[] temp =
new
Byte[4];
DateTime dateTime = DateTime.Now;
string
nowstr = dateTime.ToString(
"yyyyMMddHHmm0000"
);
Byte[] nowbyte = Encoding.ASCII.GetBytes(nowstr);
Byte[] data =
new
Byte[144];
for
(i = 0; i < 16; i++)
{
data[i] = nowbyte[i];
}
for
(i = 0; i < 128; i+=4)
{
for
(j = 0; j < 4; j++)
{
temp[3 - j] = (
byte
)(data1[i + j] ^ data[i + j + 4] ^ data[i + j + 8] ^ data[i + j + 12]);
temp[3 - j] = data2[temp[3 - j]];
}
t1 = BitConverter.ToUInt32(temp, 0);
for
(j=0; j < 4; j++)
{
temp[3 - j] = (
byte
)(data[i + j]);
}
t2 = BitConverter.ToUInt32(temp, 0);
t3 = (t1 >> 14 | t1 << 18)^ (t1 >> 22 | t1 << 10)^ (t1 >> 8 | t1 << 24)^ (t1 >> 30 | t1 << 2)^t2^t1;
data[16 + i] = (
byte
)(t3 >> 24);
data[17 + i] = (
byte
)(t3 >> 16);
data[18 + i] = (
byte
)(t3 >> 8);
data[19 + i] = (
byte
)(t3);
}
string
str = (data[140] % 10).ToString();
str += (data[141] % 10).ToString();
str += (data[142] % 10).ToString();
str += (data[143] % 10).ToString();
str += (data[136] % 10).ToString();
str += (data[137] % 10).ToString();
textBox1.Text = str;
textBox1.SelectAll();
textBox1.Copy();
}