资源简介
使用mac地址对电脑授权,输入mac地址,选择时间,使用des加密,生成文件 密钥见源文件中

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.IO;
namespace FMSLicenseMachine
{
///
public class DES
{
///
///
///
///
public static string Encode(string str string key)
{
try
{
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
provider.Key = Encoding.ASCII.GetBytes(key.Substring(0 8));
provider.IV = Encoding.ASCII.GetBytes(key.Substring(0 8));
byte[] bytes = Encoding.GetEncoding(“utf-8“).GetBytes(str);
MemoryStream stream = new MemoryStream();
CryptoStream stream2 = new CryptoStream(stream provider.CreateEncryptor() CryptoStreamMode.Write);
stream2.Write(bytes 0 bytes.Length);
stream2.FlushFinalBlock();
StringBuilder builder = new StringBuilder();
foreach (byte num in stream.ToArray())
{
builder.AppendFormat(“{0:X2}“ num);
}
stream.Close();
return builder.ToString();
}
catch (Exception) { return “xxxx“; }
}
///
///
///
///
public static string Decode(string str string key)
{
try
{
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
provider.Key = Encoding.ASCII.GetBytes(key.Substring(0 8));
provider.IV = Encoding.ASCII.GetBytes(key.Substring(0 8));
byte[] buffer = new byte[str.Length / 2];
for (int i = 0; i < (str.Length / 2); i++)
{
int num2 = Convert.ToInt32(str.Substring(i * 2 2) 0x10);
buffer[i] = (byte)num2;
}
MemoryStream stream = new MemoryStream();
CryptoStream stream2 = new CryptoStream(stream provider.CreateDecryptor() CryptoStreamMode.Write);
stream2.Write(buffer 0 buffer.Length);
stream2.FlushFinalBlock();
stream.Close();
return Encoding.GetEncoding(“UTF-8“).GetString(stream.ToArray());
}
catch (Exception) { return ““; }
}
public static void main(string[] asd)
{
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
I.A.... 941 2018-03-01 13:25 FMSLicenseMachine.sln
I.A.... 18944 2018-03-01 13:25 FMSLicenseMachine.suo
I.A.... 15872 2018-03-01 13:25 FMSLicenseMachine\bin\Debug\FMSLicenseMachine.exe
I.A.... 34304 2018-03-01 13:25 FMSLicenseMachine\bin\Debug\FMSLicenseMachine.pdb
I.A.... 14328 2018-03-01 13:25 FMSLicenseMachine\bin\Debug\FMSLicenseMachine.vshost.exe
I.A.... 83456 2018-03-01 13:25 FMSLicenseMachine\bin\Release\FMSLicenseMachine.exe
I.A.... 32256 2018-03-01 13:25 FMSLicenseMachine\bin\Release\FMSLicenseMachine.pdb
I.A.... 14328 2018-03-01 13:25 FMSLicenseMachine\bin\Release\FMSLicenseMachine.vshost.exe
I.A.... 490 2018-03-01 13:25 FMSLicenseMachine\bin\Release\FMSLicenseMachine.vshost.exe.manifest
I.A.... 2864 2018-03-01 13:25 FMSLicenseMachine\DES.cs
I.A.... 67646 2018-03-01 13:25 FMSLicenseMachine\fms.ico
I.A.... 3967 2018-03-01 13:25 FMSLicenseMachine\FMSLicenseMachine.csproj
I.A.... 6301 2018-03-01 13:25 FMSLicenseMachine\Form1.cs
I.A.... 9977 2018-03-01 13:25 FMSLicenseMachine\Form1.Designer.cs
I.A.... 5814 2018-03-01 13:25 FMSLicenseMachine\Form1.resx
I.A.... 746 2018-03-01 13:25 FMSLicenseMachine\obj\Debug\FMSLicenseMachine.csproj.FileListAbsolute.txt
I.A.... 847 2018-03-01 13:25 FMSLicenseMachine\obj\Debug\FMSLicenseMachine.csproj.GenerateResource.Cache
I.A.... 15872 2018-03-01 13:25 FMSLicenseMachine\obj\Debug\FMSLicenseMachine.exe
I.A.... 180 2018-03-01 13:25 FMSLicenseMachine\obj\Debug\FMSLicenseMachine.Form1.resources
I.A.... 34304 2018-03-01 13:25 FMSLicenseMachine\obj\Debug\FMSLicenseMachine.pdb
I.A.... 180 2018-03-01 13:25 FMSLicenseMachine\obj\Debug\FMSLicenseMachine.Properties.Resources.resources
I.A.... 762 2018-03-01 13:25 FMSLicenseMachine\obj\Release\FMSLicenseMachine.csproj.FileListAbsolute.txt
I.A.... 847 2018-03-01 13:25 FMSLicenseMachine\obj\Release\FMSLicenseMachine.csproj.GenerateResource.Cache
I.A.... 180 2018-03-01 13:25 FMSLicenseMachine\obj\Release\FMSLicenseMachine.Form1.resources
I.A.... 32256 2018-03-01 13:25 FMSLicenseMachine\obj\Release\FMSLicenseMachine.pdb
I.A.... 180 2018-03-01 13:25 FMSLicenseMachine\obj\Release\FMSLicenseMachine.Properties.Resources.resources
I.A.... 83456 2018-03-01 13:25 FMSLicenseMachine\obj\Release\LicenseMachine.exe
I.A.... 498 2018-03-01 13:25 FMSLicenseMachine\Program.cs
I.A.... 1384 2018-03-01 13:25 FMSLicenseMachine\Properties\AssemblyInfo.cs
I.A.... 2884 2018-03-01 13:25 FMSLicenseMachine\Properties\Resources.Designer.cs
............此处省略18个文件信息
相关资源
- Remote Desktop Organizer v1.4.7 支持win10
- 3des加解密_C 实现
- RSA AES DES ECC加密算法源码
- 密码学课程设计:DES加密解密算法的
- 提供几个加密算法的源码
- DES IP置换IP逆置换
- DES的C 源码
- Design of Analog CMOS Integrated Circuits 拉扎
- codesys编程手册中文版
- System Design Interview - An Insider’s Guide
- RTL8111 8168等网卡刷mac地址工具软件
- Grokking the System Design Interview
- 翻译的美国大学经典参考书,Roland
- Hillstone ARP防护——StoneOS如何保
- 认识界面以及PCB设计整体要求
- The Research on Smart Drill-in Fluid Design
- 埃塞俄比亚东北部Dessie转诊医院的糖
- Altium designer超全元件库+封装库部分
- dive into design patterns(Alexander Shvets)
- Antenna Theory Analysis and Design.3rd Edition
- FMEDesktop2019特别版forMacv2019.0.0.0.19181苹
- LANDesk 管理解决方案和采用英特尔:r
- Mentor Graphics Expedition Enterprise v7.9.5.r
- PowerDesigner16.6 破解补丁
- Altium Designer实战攻略与高速PCB设计P
- 复旦dc综合工具教程
- lotus domino notes(包括client administrato
- Type-c 接口封装,24引脚,Altium Design
- Behavior Designer 1.6.3(u2018.3.0).unitypa
- Codesys变成入门手册
评论
共有 条评论