Add key for cutter
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
<Properties StartupConfiguration="{D4C80689-6490-4754-9453-D0EF6081FCDB}|Default">
|
||||||
|
<MonoDevelop.Ide.Workbench ActiveDocument="keygen/Program.cs">
|
||||||
|
<Files>
|
||||||
|
<File FileName="keygen/Program.cs" Line="60" Column="1" />
|
||||||
|
</Files>
|
||||||
|
</MonoDevelop.Ide.Workbench>
|
||||||
|
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||||
|
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
|
<BreakpointStore />
|
||||||
|
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
|
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
||||||
|
<MonoDevelop.Ide.ItemProperties.keygen PreferredExecutionTarget="MonoDevelop.Default" />
|
||||||
|
</Properties>
|
||||||
+82
-2
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Management;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@@ -6,7 +8,61 @@ namespace keygen
|
|||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
private static string GetCodedKey(string userHwk)
|
private static readonly string PasswordHash = "P@sS_x_w0rd";
|
||||||
|
private static readonly string SaltKey = "S@LT_&_KEY";
|
||||||
|
private static readonly string VIKey = "@1B2c3D4_e5F6g7H8@";
|
||||||
|
|
||||||
|
public static string Encrypt(string plainText)
|
||||||
|
{
|
||||||
|
byte[] bytes1 = Encoding.UTF8.GetBytes(plainText);
|
||||||
|
byte[] bytes2 = new Rfc2898DeriveBytes(PasswordHash, Encoding.ASCII.GetBytes(SaltKey)).GetBytes(32);
|
||||||
|
RijndaelManaged rijndaelManaged = new RijndaelManaged();
|
||||||
|
rijndaelManaged.Mode = CipherMode.CBC;
|
||||||
|
rijndaelManaged.Padding = PaddingMode.Zeros;
|
||||||
|
ICryptoTransform encryptor = rijndaelManaged.CreateEncryptor(bytes2, Encoding.ASCII.GetBytes(VIKey));
|
||||||
|
byte[] array;
|
||||||
|
using (MemoryStream memoryStream = new MemoryStream())
|
||||||
|
{
|
||||||
|
using (CryptoStream cryptoStream = new CryptoStream((Stream)memoryStream, encryptor, CryptoStreamMode.Write))
|
||||||
|
{
|
||||||
|
cryptoStream.Write(bytes1, 0, bytes1.Length);
|
||||||
|
cryptoStream.FlushFinalBlock();
|
||||||
|
array = memoryStream.ToArray();
|
||||||
|
cryptoStream.Close();
|
||||||
|
}
|
||||||
|
memoryStream.Close();
|
||||||
|
}
|
||||||
|
return Convert.ToBase64String(array);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Decrypt(string encryptedText)
|
||||||
|
{
|
||||||
|
byte[] buffer = Convert.FromBase64String(encryptedText);
|
||||||
|
byte[] bytes = new Rfc2898DeriveBytes(PasswordHash, Encoding.ASCII.GetBytes(SaltKey)).GetBytes(32);
|
||||||
|
RijndaelManaged rijndaelManaged = new RijndaelManaged();
|
||||||
|
rijndaelManaged.Mode = CipherMode.CBC;
|
||||||
|
rijndaelManaged.Padding = PaddingMode.None;
|
||||||
|
ICryptoTransform decryptor = rijndaelManaged.CreateDecryptor(bytes, Encoding.ASCII.GetBytes(VIKey));
|
||||||
|
MemoryStream memoryStream = new MemoryStream(buffer);
|
||||||
|
CryptoStream cryptoStream = new CryptoStream((Stream)memoryStream, decryptor, CryptoStreamMode.Read);
|
||||||
|
byte[] numArray = new byte[buffer.Length];
|
||||||
|
int count = cryptoStream.Read(numArray, 0, numArray.Length);
|
||||||
|
memoryStream.Close();
|
||||||
|
cryptoStream.Close();
|
||||||
|
return Encoding.UTF8.GetString(numArray, 0, count).TrimEnd("\0".ToCharArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetHDDSerialNumber(string drive)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(drive) || drive == null)
|
||||||
|
drive = "C";
|
||||||
|
ManagementObject managementObject = new ManagementObject("Win32_LogicalDisk.DeviceID=\"" + drive + ":\"");
|
||||||
|
managementObject.Get();
|
||||||
|
return managementObject["VolumeSerialNumber"].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static string GetCodedKey(string userHwk)
|
||||||
{
|
{
|
||||||
string input = userHwk.Substring(12, 4) + "T" + userHwk.Substring(24, 4) + "H" + userHwk.Substring(8, 4) + "O" + userHwk.Substring(16, 4) + "M" + userHwk.Substring(28, 4) + "S" + userHwk.Substring(4, 4) + "O" + userHwk.Substring(20, 4) + "N" + userHwk.Substring(0, 4);
|
string input = userHwk.Substring(12, 4) + "T" + userHwk.Substring(24, 4) + "H" + userHwk.Substring(8, 4) + "O" + userHwk.Substring(16, 4) + "M" + userHwk.Substring(28, 4) + "S" + userHwk.Substring(4, 4) + "O" + userHwk.Substring(20, 4) + "N" + userHwk.Substring(0, 4);
|
||||||
using (MD5 md5Hash = MD5.Create())
|
using (MD5 md5Hash = MD5.Create())
|
||||||
@@ -28,9 +84,33 @@ namespace keygen
|
|||||||
return stringBuilder.ToString();
|
return stringBuilder.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static string GetLicenceForCutter()
|
||||||
|
{
|
||||||
|
var serial = GetHDDSerialNumber("C");
|
||||||
|
|
||||||
|
var array_LicenseLineItemsEncrypted = new string[16];
|
||||||
|
array_LicenseLineItemsEncrypted[0] = Encrypt("Paid");
|
||||||
|
array_LicenseLineItemsEncrypted[1] = Encrypt(serial);
|
||||||
|
array_LicenseLineItemsEncrypted[2] = Encrypt("1");
|
||||||
|
array_LicenseLineItemsEncrypted[3] = Encrypt("00.00.0000");
|
||||||
|
|
||||||
|
var sb = new StringBuilder();
|
||||||
|
sb.Append(array_LicenseLineItemsEncrypted[0] + "\r\n");
|
||||||
|
sb.Append(array_LicenseLineItemsEncrypted[1] + "\r\n");
|
||||||
|
sb.Append(array_LicenseLineItemsEncrypted[2] + "\r\n");
|
||||||
|
sb.Append(array_LicenseLineItemsEncrypted[3]);
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Console.Write("Please enter hardware ID: ");
|
Console.WriteLine("You cutter license key is: ");
|
||||||
|
Console.Write(GetLicenceForCutter());
|
||||||
|
Console.WriteLine("----------------------------- COPY UNTIL THIS LINE ------------------------- ");
|
||||||
|
|
||||||
|
Console.Write("Please enter hardware ID: ");
|
||||||
var key = Console.ReadLine();
|
var key = Console.ReadLine();
|
||||||
if (key == null)
|
if (key == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Regular → Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -41,6 +41,7 @@
|
|||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="System.Management" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 2012
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "keygen", "keygen.csproj", "{D4C80689-6490-4754-9453-D0EF6081FCDB}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{D4C80689-6490-4754-9453-D0EF6081FCDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D4C80689-6490-4754-9453-D0EF6081FCDB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D4C80689-6490-4754-9453-D0EF6081FCDB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{D4C80689-6490-4754-9453-D0EF6081FCDB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<Properties StartupConfiguration="{D4C80689-6490-4754-9453-D0EF6081FCDB}|Default" />
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
// <autogenerated />
|
||||||
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5.2", FrameworkDisplayName = "")]
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/Volumes/MacData/Projects/laser-crypto/keygen/obj/Debug/.NETFramework,Version=v4.5.2.AssemblyAttribute.cs
|
||||||
|
/Volumes/MacData/Projects/laser-crypto/keygen/bin/Debug/keygen.exe.config
|
||||||
|
/Volumes/MacData/Projects/laser-crypto/keygen/bin/Debug/keygen.exe.mdb
|
||||||
|
/Volumes/MacData/Projects/laser-crypto/keygen/bin/Debug/keygen.exe
|
||||||
|
/Volumes/MacData/Projects/laser-crypto/keygen/obj/Debug/keygen.exe
|
||||||
|
/Volumes/MacData/Projects/laser-crypto/keygen/obj/Debug/keygen.exe.mdb
|
||||||
Regular → Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user