LicenseValidationDialog is a class designed to validate license keys on the user's side.

QT-LicenseValidationDialog

Basic

LicenseValidationDialog is a class designed to validate license keys on the user's side. The class is designed to verify the correctness of the license key of the software you create. To use the program you created, the user will have to provide:

  • License key
  • License hash
  • User name
  • Expiration date

    general_look

Errors

If the provided data is incorrect or the fields are empty, an appropriate message will appear.
data_error

The class for verifying the remaining license validity time connects to an external NTP time server. If the connection fails, an appropriate message will be displayed.
time_error

If the license expires, an appropriate message will be displayed.
timeleft_error

If all data is correct and the license is valid, the class will return the value true in the public variable - valid.

How to use?

To use the class, you need to add the LicenseValidationDialog class files to your project. Just copy the files to your project directory and make changes to your application's .pro file by adding the files one by one after the '\' character. The next step is to add the IMG directory to your project folder. There are basic icons inside. Change them as you see fit, but be sure not to rename the files.
file_adding

Okay, we are half the battle. Now, you need to make some changes to the main.cpp file. First, we create an object named m, it can be named whatever you want, but let's follow this nomenclature. Then we check it, if we have already entered the license and if it is a valid CheckBasicValid() function. The function gets information from the save file (more info will be provided later). If the function returns false, then either we do not have the save file or something is wrong with the license. Therefore, we run the validation window - m.exec(). Now, we have three options: the license was checked automatically, the user closed the validation window or entered the correct data. It doesn't matter, the result of these operations is saving the license information in the valid variable. Now, we have to check if the valid variable is equal to be true. If so, we start the main application window, if not - close the application. Below is an example of use:
main cpp

Oh, and don't forget to include class!
include

Settings

You will find them in the header file.
settings
The given api key values are examples, be sure to change them!

  • API_KEY - Your unique API key. It should be at least 20 characters long. It is used to create and verify user licenses. It should be located only here and should not be scattered around. It's connected with the security of your application! After compiling the application to an .exe file, it will be in a binary form - impossible to read. But remember, it's still in the source code, be careful what you share!
  • NTP_SERVER - Time server, choose your own server. I live in Poland, that's why I used a Polish time server - tempus1.gum.gov.pl
  • save_license - The variable that stores information whether, after correct validation, the application is to save the license data in the license file. true - save, false - do not save. If the data is not saved, the user will have to enter them each time the application is started. Despite the information being saved, the application will check the license validity anyway by connecting to the time server.
  • set_custom_language - Whether the class should use a language other than the default - English. If so, the application will look for the language file in the default location (application exe folder / language.txt) unless a different path is specified in the custom_language_file_path variable.

Language file

Each name should be put on a new line. Structure of the language file:

  • Title of the validation window
  • License key label
  • License hash label
  • User Name label
  • Expiration date label
  • Cancel button text
  • OKAY button text
  • Error window title
  • Expiration error
  • NTP connection error
  • Invalid data error

Sample file:
language_file
The file should contain strictly 11 lines!

How does the class work?

In the beginning, the developer generates any license key. You can use free online license key generators. So you already have a generated license, you also come up with a username and expiry date of the license. What about the hash? And here is all the magic. The hash is generated from the license key, username, license expiration date and your API key. After generating the hash, we share the data with the user. The class does exactly the same, generates a hash based on the given data (license key, username and license expiration date) and compares it with the hash provided by the user. If the hashes are correct, the data is correct. But what if the user changes the data himself, for example extends the license validity by changing the license expiry date? This is what an API key only you know is for. The user does not know the API key and therefore cannot generate the hash corresponding to the new license data. You are safe until someone knows your API key. Protect it at all costs!

How can I generate license keys and the corresponding hashes?

The formula is simple:
In the beginning, we create one string of individual elements in the order: license_key + user_name + expiration_date (format: dd.MM.yyyy) + API_KEY. Then we generate a hash from this string using the Sha256 method. You can easily do it with sha256 generators online. The result of this is our hash that we provide to the user along with the username, license key and license expiry date. That's all!

PS Easier license generation will be possible later with my generator. Search for the repository later - LicenseValidationGenerator. If it is not there yet, I am still working on it.

Something else?

  • If you use my class, please leave a message about it somewhere in your application. I will be extremely happy and motivated to continue working!
  • It was created in the QT program on the basis of an open source license.
    QT website: https://www.qt.io/
  • All icons were downloaded from Google Fonts under an open source license. You can use your own icons to replace files in the IMG directory.
Similar Resources

An implementation of [Jimenez et al., 2016] Ground Truth Ambient Occlusion, MIT license

An implementation of [Jimenez et al., 2016] Ground Truth Ambient Occlusion, MIT license

XeGTAO Introduction XeGTAO is an open source, MIT licensed, DirectX/HLSL implementation of the Practical Realtime Strategies for Accurate Indirect Occ

Jan 5, 2023

A read-only, license friendly, FUSE based btrfs implementation

btrfs-fuse About This is a read-only btrfs implementation using FUSE (Filesystem in Userspace). Although btrfs is already in mainline Linux kernel, th

Oct 13, 2022

Automatic License Plate Recognition library

openalpr OpenALPR is an open source Automatic License Plate Recognition library written in C++ with bindings in C#, Java, Node.js, Go, and Python. The

Jan 3, 2023

libmdbx is an extremely fast, compact, powerful, embedded, transactional key-value database, with permissive license

libmdbx is an extremely fast, compact, powerful, embedded, transactional key-value database, with permissive license

One of the fastest embeddable key-value ACID database without WAL. libmdbx surpasses the legendary LMDB in terms of reliability, features and performance.

Dec 19, 2022

Log.c2 is based on rxi/log.c with MIT LICENSE which is inactive now. Log.c has a very flexible and scalable architecture

log.c2 A simple logging library. Log.c2 is based on rxi/log.c with MIT LICENSE which is inactive now. Log.c has a very flexible and scalable architect

Feb 13, 2022

rax/RAX is a C++ extension library designed to provide new, fast, and reliable cross-platform class types.

rax rax/RAX is a C++ extension library designed to provide cross-platform new, fast, and reliable class types for different fields such as work with I

May 2, 2022

Opt - Class template designed to express optionality without having to sacrifice memory to store additional bool flag

mp::optT, Policy mp::optT, Policy is a class template designed to express optionality. It has interface similar to std::optionalT (see here) but

Jun 5, 2022

Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.

Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.

Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.

Jan 4, 2023

WAFer is a C language-based software platform for scalable server-side and networking applications. Think node.js for C programmers.

WAFer WAFer is a C language-based ultra-light scalable server-side web applications framework. Think node.js for C programmers. Because it's written i

Dec 6, 2022

WAFer is a C language-based software platform for scalable server-side and networking applications. Think node.js for C programmers.

WAFer WAFer is a C language-based ultra-light scalable server-side web applications framework. Think node.js for C programmers. Because it's written i

Dec 6, 2022

Source code of the paper "Lord of the Ring(s): Side Channel Attacks on the CPU On-Chip Ring Interconnect Are Practical"

Overview This repository contains the source code to reproduce the experiments of the paper: Lord of the Ring(s): Side Channel Attacks on the CPU On-C

Oct 16, 2022

Side-channel file transfer between independent VM executed on the same physical host

Side-channel file transfer between independent VM executed on the same physical host

Inter-process or cross-VM data exchange via CPU load modulation What is this I made this PoC as a visual aid for an online discussion about M1RACLES -

Dec 28, 2022

Proof-of-concept implementation for the paper "Osiris: Automated Discovery of Microarchitectural Side Channels" (USENIX Security'21)

Osiris This repository contains the implementation of the Osiris framework discussed in the research paper "Osiris: Automated Discovery of Microarchit

Nov 11, 2022

A simple library that helps Android developers to execute JavaScript code from Android native side easily without using Webview.

AndroidJSModule A simple library that helps Android developers to execute JavaScript code from Android native side easily without using Webview. Insta

May 24, 2022

High performance server-side application framework

Seastar Introduction SeaStar is an event-driven framework allowing you to write non-blocking, asynchronous code in a relatively straightforward manner

Jan 7, 2023

Patches/unpatches an MCC CEA map to use client side hit detection for all weapons

MCC CEA Client-Side Hit Detection Map Patcher This program allows you to patch an MCC map so that all maps use client-side hit detection instead of ju

Aug 30, 2022

Rudimentary opinionated client-side lua libwayland bindings and scanner

wau This should work with Lua 5.3+. By default it builds with 5.3 instead of 5.4 because the examples depend on lgi. These aren't 1-to-1 bindings to l

Nov 19, 2022

Server side minimalistic HTTP protocol implementation for the Arduino platform.

ArduinoHttpServer Server side minimalistic Object Oriented HTTP protocol implementation for the Arduino platform. ArduinoHttpServer is a simple HTTP r

Oct 17, 2022
Show keys you typed on screen.

Show Me The Key Show keys you typed on screen. Project Website A SUSE Hack Week 20 Project: Show Me The Key: A screenkey alternative that works under

Jan 3, 2023
✔️The smallest header-only GUI library(4 KLOC) for all platforms
✔️The smallest header-only GUI library(4 KLOC) for all platforms

Welcome to GUI-lite The smallest header-only GUI library (4 KLOC) for all platforms. 中文 Lightweight ✂️ Small: 4,000+ lines of C++ code, zero dependenc

Jan 8, 2023
🎮 Plants vs. Zombies multiplayer battle, developed via reverse engineering, inline hook and dynamic-link library injection. Two online players defend and attack as the plant side and zombie side respectively.
🎮 Plants vs. Zombies multiplayer battle, developed via reverse engineering, inline hook and dynamic-link library injection. Two online players defend and attack as the plant side and zombie side respectively.

Plants vs. Zombies Online Battle This project has two original repositories: https://github.com/czs108/Plants-vs.-Zombies-Online-Battle https://github

Oct 14, 2021
A package to use Material side sheet into your Flutter project. Learn more about side sheet at Material.io
A package to use Material side sheet into your Flutter project. Learn more about side sheet at Material.io

Side Sheet A package to use Material side sheet into your Flutter project. Learn more about side sheet at Material.io Platform Support Android iOS Mac

Aug 25, 2022
Side panels for the Voron Zero printer that has 16 WS2812 RGB LED's per side.
Side panels for the Voron Zero printer that has 16 WS2812 RGB LED's per side.

Voron Zero RGB Side Panels Side panels for the Voron Zero printer with 16 WS2812 RGB LED's per side. The build below has some 3mm TAP Plastic black LE

Jul 22, 2022
Edit a PF-DTA content in hex on a side-by-side display of EBCDIC character representation.
Edit a PF-DTA content in hex on a side-by-side display of EBCDIC character representation.

AS400 Hex Editor Edit a PF-DTA content in hex on a side-by-side display of EBCDIC character representation. Introduction This tool was written to edit

May 3, 2022
Brute Force Bitcoin Private keys, Public keys

Rotor-Cuda This is a modified version of KeyHunt v1.7 by kanhavishva. A lot of gratitude to all the developers whose codes has been used here. Feature

Sep 24, 2022
This project is pretty straightforward, you have to recode printf. You will learn what is and how to implement variadic functions. Once you validate it, you will reuse this function in your future projects.
This project is pretty straightforward, you have to recode printf. You will learn what is and how to implement variadic functions. Once you validate it, you will reuse this function in your future projects.

100/100 Introduction to ft_printf This is the third project in the 1337 Curriculum #42network . This project is pretty straight forward, recode the pr

May 27, 2022
This tool will check a list of IP addresses of RouterOS-based routers to validate if they were infected with Meris.

Meris RouterOS Checker This tool will check a list of ip addresses of RouterOS-based routers to validate if they were infected with Meris. The tool wi

Nov 23, 2022
License plate parsing using Darknet and YOLO
License plate parsing using Darknet and YOLO

DarkPlate Note that DarkPlate by itself is not a complete software project. The intended purpose was to create a simple project showing how to use Dar

Dec 9, 2022