Generating 30 000 unique keys in a matter of seconds.

License Key Generator

A human-friendly generator for license keys and serial numbers.

Features

  • Full multithreading, thanks to .NET Core’s TPL (Task Parallel Library);
  • Custom “resulting-sum” algorithm to generate a bunch of unique license keys quickly;
  • Responsive UI, built in WinForms (glamorous, indeed);
  • On-the-fly license key validator;
  • Decoupling, e.g. strict separation between UI and logic;
  • Generated license keys that are easy for people to spell out loud;
  • Native support for async/await.

NuGet packages, demo, source

Get the generator NuGet package from https://www.nuget.org/packages/BarbezDotEu.License.Generation/ or use

Install-Package BarbezDotEu.License.Generation -Version 1.0.0

Get the verifier NuGet package from https://www.nuget.org/packages/BarbezDotEu.License.Verification/ or use

Install-Package BarbezDotEu.License.Verification -Version 1.0.0

Source code on GitHub: hannesbarbez/BarbezDotEu.License: License key generation and verification (github.com)

Demo application for inspiration: hannesbarbez/BarbezDotEu.License.Generator.WinForms: Barbez.Eu Serial Number Generator (github.com)

Custom “resulting-sum” algorithm

Lacking academic knowledge on serial number or license key generation algos, the generator algorithm is my own idea, so I’ve decided to dub it “resulting-sum”. More info on the exact workings to follow, for now the source code should suffice to explain its inner workings.

Performance

After running a couple of tests on an AMD Ryzen 1600 (6 cores, 12 threads) based machine, I compiled a short table with the results.

On this hardware, a ResultingSum of 68 takes Y time to render/generate X number of unique keys. The sweet-spots are marked in bold in the below table.

Results will differ for other ResultingSum values. For a value of 68, 30 000 unique keys are generated in under 9 seconds.

The going gets tougher when generating 150 000 unique keys in exactly 4 minutes. Oh lawd.

Table

Keys (X)Time (ms, Y)ms/key (=Y/X)
11212.00
10131.30
100320.32
10001460.15
25003580.14
50007190.14
1000015000.15
2000048000.24
3000086000.29
50000213000.43
62500315000.50
75000438000.58
87500660000.75
100000840000.84
1500002400001.60
A ResultingSum of 68 takes Y time to render/generate X number of unique keys on a Ryzen 1600 based machine.

Graphs

Y time needed (ms) to generate X number of keys.
Y time needed (ms) to generate X number of keys.
Y time needed (ms) per key when generating X number of keys.
Y time needed (ms) per key when generating X number of keys.

Screenshots of app demoing the NuGet packages

Maybe not so much. After all, it’s WinForms in 2020.

The Barbez.eu License Key Generator as it appears when launched.
The Barbez.eu License Key Generator as it appears when launched.
The Barbez.eu License Key Generator is thinking hard.
The Barbez.eu License Key Generator is thinking hard.
The full-screened Barbez.eu License Key Generator, having generated 30 000 unique keys in a matter of seconds.
Generating 30 000 unique keys in a matter of seconds.
On-the-fly testing of one of the generated license keys.
On-the-fly testing of one of the generated license keys.
Better luck next time.
Better luck next time.

In conclusion

The Barbez.eu license key generator is ideal if you’re in need of a decent number of license keys or serial numbers that are easy and quick to spell out to one another, and quick enough to generate.