KeyForge is a production-grade, universal, configurable software licensing and cryptographic key management platform. Designed from first principles as a reusable enterprise framework, KeyForge enables any software application (Desktop, Web API, CLI tool, Windows automation, plugins, mobile, embedded) to implement state-of-the-art software licensing through declarative configuration.
- Asymmetric Digital Signatures: Pure Ed25519 asymmetric cryptography (RFC 8032) ensuring private signing keys remain strictly in the secure backend vault while clients verify signatures offline or online using public verification keys.
- Deterministic Canonical Serialization: Strict RFC 8785 (JSON Canonicalization Scheme - JCS) ensures cross-language, bit-exact cryptographic signature alignment across Python, Node.js, C#, Go, PowerShell, and C++.
- Flexible Human-Readable Key Formats: Configurable key formatting (Crockford Base32, alphanumeric, custom alphabets, grouping, prefixes) with error-detecting Luhn Mod-32 and CRC-8 check digits to eliminate user typos.
- Comprehensive License Types:
- Trial Licenses: Configurable duration (e.g. 14-day).
- Lifetime Licenses: Perpetual authorization.
- Subscription Licenses: Periodic renewals with cryptographic re-signing.
- Feature-Based Licenses: Granular entitlement flags (
has_feature('export_pdf')). - Device & Seat-Bound Licenses: Hardware/installation limits with online seat tracking and deactivation.
- Organization / User-Bound Licenses: Tenant and account binding.
- Hybrid Licenses: Any arbitrary combination defined by configuration profiles.
- Online & Offline Validation:
- Online: REST API activation, seat limits, periodic heartbeats, remote suspension, and instant revocation.
- Offline: Zero-network signature verification, tamper detection, and anti-clock-rollback tracking (
ClockGuard).
- Multi-Version Key Vault & Rotation: Automated key rotation supporting multiple active verification keys during migration without breaking legacy issued licenses.
- High-Performance REST API & Admin Console: Built with FastAPI, OpenAPI 3.1, SQLite/PostgreSQL persistence, Argon2id password hashing, sliding-window rate limiting, and structured audit trails.
- Multi-Language Client SDKs: Official reference libraries for Python, Node.js/TypeScript, Windows PowerShell, C#/.NET, and Go.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ADMIN / OPERATOR β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ¬ββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββ ββββββββββββββββββββββ
β Web Admin Console β β Administrative CLI β
ββββββββββββ¬βββββββββββ ββββββββββββ¬ββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β KEYFORGE SERVER & REST API β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β API Endpoints: /licenses, /activate, /validate, /products, /keys β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β
β β Security: Argon2id Auth, API Key Tokens, Rate Limiter, Audit Log β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β
β β Engines: Policy Evaluator, Key Generator, Ed25519 Signer/Verifier β β
β βββββββββββββββββββββ¬βββββββββββββββββββββββββββββ¬βββββββββββββββββββ β
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββΌββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββ βββββββββββββββββββββ
β Database / Store β β Crypto Key Vault β
β (SQLite / Postgres)β β (Ed25519 Keypairs)β
βββββββββββββββββββββ βββββββββββββββββββββ
β β
βββββββββββββββ¬βββββββββββββββ
β
ββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββ
β ONLINE CLIENT SDK β β OFFLINE CLIENT SDK β
β (Python, Node, PS, C#, Go) β β (Public Key Verification) β
βββββββββββββββββββββββββββββββββ€ βββββββββββββββββββββββββββββββββ€
β β’ API Activation & Heartbeat β β β’ Detached / Embedded Sig β
β β’ Device Fingerprint Binding β β β’ Tamper Detection β
β β’ Revocation & Renewal Sync β β β’ Clock-Rollback Defense β
β β’ Secure Local License Cache β β β’ Offline Grace Period Check β
βββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββ
python -m pip install -r requirements.txtpython -m keyforge.cli serve --port 8000- Interactive Admin Dashboard: http://127.0.0.1:8000/dashboard
- Interactive OpenAPI Swagger: http://127.0.0.1:8000/docs
- Admin Credentials: Configured via your private environment variables (
KEYFORGE_ADMIN_USERandKEYFORGE_ADMIN_PASS).
KeyForge includes a full-featured CLI:
# Start server
python -m keyforge.cli serve --host 127.0.0.1 --port 8000
# List registered products
python -m keyforge.cli products list
# List cryptographic signing keys
python -m keyforge.cli keys list
# Issue a license
python -m keyforge.cli issue --product desktop-app --customer alice@company.com --edition pro --devices 3
# Inspect a license token
python -m keyforge.cli inspect "kf1.eyJjdXN0b21lci...3da3a8c6"from keyforge_client import KeyForgeClient, FileLicenseStorage
client = KeyForgeClient(
product_id="photostudio",
public_key="-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----",
storage=FileLicenseStorage(),
)
if client.is_valid():
print(f"Active Edition: {client.get_edition()}")
if client.has_feature("raw_export"):
enable_raw_export()
else:
client.activate("PHOTO-7K4M-9Q2X-8T6P")const { KeyForgeNodeClient } = require('@keyforge/client');
const client = new KeyForgeNodeClient({
productId: 'cloud-analytics-api',
publicKey: '3da3a8c6a28099c9e212dfed6e79eada58575c2534a466ec485ed0bbeca722c0',
});
const result = await client.validate(token);
if (result.is_valid && client.hasFeature('advanced_export')) {
// Allow API access
}Import-Module .\sdk\powershell\KeyForge.psm1
# Activate and validate
Invoke-KeyForgeActivation -ServerUrl "http://127.0.0.1:8000" -ProductId "desktop-app" -LicenseKey "DSK-XXXX-XXXX-XXXX"
$status = Test-KeyForgeLicense -ServerUrl "http://127.0.0.1:8000" -ProductId "desktop-app" -LicenseKey "DSK-XXXX-XXXX-XXXX"Run the full automated test suite covering unit tests, cryptographic verification, canonicalization, API integration, seat limits, rate limiting, and negative tamper testing:
python -m pytest tests/ -v- Architecture Specification
- Cryptography & Key Management Guide
- Security Threat Model
- REST API Reference
- Configuration & Profiles Guide
- Client Integration Guide
- Offline Licensing Specification
- Vercel 100% Free-Tier Deployment Guide
- Deployment & Disaster Recovery Guide
- Security Audit Checklist
Deploy KeyForge directly to Vercel with a free serverless cloud PostgreSQL database (Neon or Supabase):
See the complete step-by-step guide in docs/VERCEL_DEPLOYMENT.md.
This project is open source software licensed under the MIT License. Copyright (c) 2026 tnb1j (KeyForge Architecture Team).