A licensing software and key validation server for small scale developers in a simple hassle-free way.
The goal of developing this project is to prevent software piracy and improve protection and security measures for software. The software piracy protection system works by injecting the system into the newly downloaded software product. Users must first register for using a software product and then purchase the software via online payment. Once the payment is complete, users can download the software and the serial key for the same. The software reads the ID of your machine (PC/laptop) and generates a unique user ID by using an algorithm. The user can now log in via the user ID by providing the serial key.
There will be three sectors to discuss features.
- A database for managing serial keys.
- UI for Create, Read, Update and Delete (CRUD) operations.
- Recording each serial key with it's creation date, activation date, license type, duration length, condition, status etc.
- Add arbitrary trial day limitation to the software.
- Option to select either onine key validation or offline.
- Saving registration information in an encrypted file in system directory securely (changeable).
- Generating a unique hardware ID for the user's machine with options to select signatures from following devices.
- Processor
- Base Board
- Disk Drive
- Video Controller
- Physical Media
- BIOS
- Operating System
- Using TripleDES encryption to generate serial keys.
- Different license level and type to lock functions for different usecase.
- Generate serial keys for offline validation.
- Take users' hardware ID and software identifier into account.
- Generate valid keys for different amount of days.
First clone the repository with git clone git@github.com:TissuePowder/Simple-Licensor.git
Then proceed to the following sectors to set up each of them.
- Go to the
License Server
directory, open a shell/terminal and run the commandnpm install
- Install postgresql in your machine and set up a database named
simple-licensor
- Create a user with username
admin
and password12345
or edit theconfig/database.js
accordingly. - Start the server with
npm start
for production mode ornpm run dev
for development mode.
- Install .net framework 4.0 or higher to be able to use this dll.
- Project is developed in SharpDevelop v4.4. Any compatible IDE including Visual Studio that supports C# version >= 5.0 is necessary to work on this project.
- Add a reference to the dll in your project.
- Add namespace
using SimpleLicensor;
(C#) at the beginning of your main.cs
file. - Add the following piece of code in your
main()
function. Set values for the variables as you wish.
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//SoftwareName: Your software's name, this will be used to make ComputerID
string SoftwareName = "TestApp1";
//RegFilePath: The file path that, if the user entered the registration code, will save it and check on every run.
string RegfilePath = Application.StartupPath + "\\keyfile.reg";
//HiddenFilePath: This file will be used to save system information, days to finish trial mode, and current date.
string HiddenFilePath = Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\SimpleLicensor.bfr";
//DefaultDays: How many days the user can run in trial mode.
int DefaultDays = 30;
//Identifier: Three character string for making serial key.
string Identifier = "538";
//CheckOnline: Whether the key would be checked in an online server or offline.
bool CheckOnline = true;
//Server: Server address to check the serial key.
string Server = "https://yourserver.com/api/keycheck";
AppLocker t = new AppLocker(SoftwareName, RegfilePath, HiddenFilePath, DefaultDays, Identifier, Server);
//Change the bits in the following array as you wish, or it will use default encryption.
byte[] MyOwnKey = { 97, 250, 1, 5, 84, 21, 7, 63,
4, 54, 87, 56, 123, 10, 3, 62,
7, 9, 20, 36, 37, 21, 101, 57};
t.TripleDESKey = MyOwnKey;
AppLocker.RunTypes RT = t.ShowDialog(CheckOnline);
bool is_trial;
if (RT != AppLocker.RunTypes.Expired) {
if (RT == AppLocker.RunTypes.Full) {
is_trial = false;
}
else {
is_trial = true;
}
//Pass the is_trial boolean in your MainForm's constructor and use the value to lock functions.
Application.Run(new MainForm(is_trial));
}
- Use the identifier and client's hardware ID to generate a serial key.
- Use to serial in your app's trial registration dialog to register.