MySerialKey.GiqhDev
1.0.2
dotnet add package MySerialKey.GiqhDev --version 1.0.2
NuGet\Install-Package MySerialKey.GiqhDev -Version 1.0.2
<PackageReference Include="MySerialKey.GiqhDev" Version="1.0.2" />
<PackageVersion Include="MySerialKey.GiqhDev" Version="1.0.2" />
<PackageReference Include="MySerialKey.GiqhDev" />
paket add MySerialKey.GiqhDev --version 1.0.2
#r "nuget: MySerialKey.GiqhDev, 1.0.2"
#:package MySerialKey.GiqhDev@1.0.2
#addin nuget:?package=MySerialKey.GiqhDev&version=1.0.2
#tool nuget:?package=MySerialKey.GiqhDev&version=1.0.2
MySerialKey.GiqhDev
MySerialKey.GiqhDev generates, normalizes, and validates short serial keys for .NET applications.
Default serial format:
XXXXX-XXXXXX-XXXXX-XXXXXX
The package uses cryptographically secure randomness and has no third-party runtime dependencies.
Status
Version 1.0.0 is prepared as a local NuGet package candidate.
Installation
dotnet add package MySerialKey.GiqhDev
Quick Start
using MySerialKey.GiqhDev;
string serial = SerialKeyGenerator.Generate();
SerialValidationResult result = SerialKeyValidator.Validate(serial);
Console.WriteLine(serial);
Console.WriteLine(result.IsValid);
Generation
string serial = SerialKeyGenerator.Generate();
The default alphabet excludes visually ambiguous characters:
ABCDEFGHJKMNPQRSTUVWXYZ23456789
Validation
SerialValidationResult result = SerialKeyValidator.ValidateFormat(serial);
if (!result.IsValid)
{
Console.WriteLine(result.Error);
Console.WriteLine(result.Message);
}
Validate is an alias for structural format validation. It does not prove authenticity.
Normalization
string normalized = SerialKeyNormalizer.Normalize("a7k9p x2m8q4 b6n3r z9t5w8");
Output:
A7K9P-X2M8Q4-B6N3R-Z9T5W8
Custom Configuration
var options = new SerialKeyGenerationOptions
{
Segments = new[] { 4, 4, 4, 4 },
Separator = '-',
Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
UseUppercase = true
};
string serial = SerialKeyGenerator.Generate(options);
Authenticated Serials
Authenticated serials reserve part of the 22 alphanumeric characters for a compact authentication tag:
byte[] secretKey = Convert.FromBase64String(configuration.Secret);
string serial = SerialKeyGenerator.GenerateAuthenticated(secretKey);
SerialValidationResult result = SerialKeyValidator.ValidateAuthenticated(serial, secretKey);
This protects against basic tampering and random strings that merely match the visual format.
Security Notes
Authenticated serials use HMAC-SHA256 with a compact truncated tag. This is a lightweight offline authenticity check, not DRM.
Do not embed high-value secrets in client applications when an attacker can inspect the machine or executable. For stronger scenarios, prefer server-side activation or asymmetric license signatures where clients only receive a public key.
This package does not protect completely against reverse engineering, executable patching, secret extraction, validation bypasses, or attackers with full control of the client machine.
Compatibility
The package targets:
- .NET Framework 4.8
- .NET 6
- .NET 7
- .NET 8
- .NET 9
- .NET 10
Publishing
Publishing to NuGet.org is handled by GitHub Actions trusted publishing.
Create a trusted publishing policy on NuGet.org with these values:
Package Owner: GiqhDev
Repository Owner: GiqhDev
Repository: MySerialKey.GiqhDev
Workflow File: publish-nuget.yml
Environment: leave empty
The workflow runs on pushes to master and can also be started manually from the GitHub Actions tab.
Roadmap
- v1.1: additional pattern presets and optional checksum.
- v1.2: product metadata and product-specific serial namespaces.
- v2.0: evaluate asymmetric signed licenses.
License
MIT.
Author
Gustavo Quintana Hidalgo.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- No dependencies.
-
net10.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.