[C#] 纯文本查看 复制代码
using System;
using System.Text;
using System.Timers;
namespace CreackMe
{
internal class Program
{
private static void Main(string[] args)
{
Program.GetSeriarNumber(null, null);
Timer timer = new Timer(20000.0);
timer.Elapsed += Program.GetSeriarNumber;
timer.Start();
byte[] bytes = new byte[]
{
115,
101,
114,
105,
97,
108,
32,
110,
117,
109,
98,
101,
114,
239,
188,
154
};
byte[] bytes2 = new byte[]
{
233,
148,
153,
232,
175,
175,
231,
154,
132,
229,
186,
143,
229,
136,
151,
229,
143,
183
};
Console.WriteLine(Encoding.UTF8.GetString(bytes));
string s = Console.ReadLine();
try
{
Console.WriteLine("\r\n" + EncryptHelper.SymmetricDecrypt(Convert.FromBase64String(s), EncryptHelper.SymmetricFormat.AES, Program.key, Program.iv));
timer.Stop();
}
catch (Exception)
{
Console.WriteLine(Encoding.UTF8.GetString(bytes2));
}
Console.ReadKey();
}
private static void GetSeriarNumber(object sender, ElapsedEventArgs e)
{
byte[] desString = new byte[]
{
230,
173,
163,
231,
161,
174,
231,
154,
132,
229,
186,
143,
229,
136,
151,
229,
143,
183
};
Program.key = EncryptHelper.Hash(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")).ToTimestamp().ToString(), EncryptHelper.HashFormat.MD532);
Program.iv = EncryptHelper.Hash(DateTime.Parse(DateTime.Now.ToString("F")).ToTimestamp().ToString(), EncryptHelper.HashFormat.MD516);
Program.value = EncryptHelper.SymmetricEncrypt(desString, EncryptHelper.SymmetricFormat.AES, Program.key, Program.iv);
}
public static void CalcSeriarNumber(int length, string seriarNumber)
{
Program.current++;
if (Program.current >= length)
{
Program.CalcSeriarNumberResult = EncryptHelper.Hash(seriarNumber, EncryptHelper.HashFormat.MD516);
return;
}
seriarNumber = EncryptHelper.Hash(seriarNumber, EncryptHelper.HashFormat.MD532);
Program.CalcSeriarNumber(length, seriarNumber);
}
private static int current = 0;
private static string CalcSeriarNumberResult = "";
private static byte[] value = null;
private static string key = null;
private static string iv = null;
}
}