本帖最后由 vipcrack 于 2020-2-6 14:29 编辑
Keygen Source:
[C#] 纯文本查看 复制代码 using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Windows.Forms;
namespace Keygen1._1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static string k(string A_0)
{
string s = "dafei250";
string s2 = "DAFEI500";
byte[] bytes = Encoding.ASCII.GetBytes(s);
byte[] bytes2 = Encoding.ASCII.GetBytes(s2);
DESCryptoServiceProvider descryptoServiceProvider = new DESCryptoServiceProvider();
int keySize = descryptoServiceProvider.KeySize;
MemoryStream memoryStream = new MemoryStream();
CryptoStream cryptoStream = new CryptoStream(memoryStream, descryptoServiceProvider.CreateEncryptor(bytes, bytes2), CryptoStreamMode.Write);
StreamWriter streamWriter = new StreamWriter(cryptoStream);
streamWriter.Write(A_0);
streamWriter.Flush();
cryptoStream.FlushFinalBlock();
streamWriter.Flush();
return Convert.ToBase64String(memoryStream.GetBuffer(), 0, (int)memoryStream.Length);
}
private void button1_Click(object sender, EventArgs e)
{
string a = textBox1.Text;
string a_ = a.Substring(2, a.Length-2);
string text = k(a_);
textBox2.Text = text.Substring(0, 40);
}
}
} |