Security Architecture
QuantumLockβ’ security design and implementation details.
Overviewβ
QuantumLockβ’ is designed with a defense-in-depth approach, using multiple layers of cryptographic protection to ensure license integrity and prevent tampering.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SECURITY LAYERS β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Layer 1: Post-Quantum Cryptography β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β ML-DSA-65 (FIPS 204) - Quantum-resistant signatures ββ
β β Hybrid RSA-PSS + ML-DSA for transition security ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Layer 2: Revocation & Anti-Rollback β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Epoch-based revocation with cryptographic proofs ββ
β β OS-level secure storage for epoch state ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Layer 3: Device Binding β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Hardware fingerprinting with SHA-256 binding ββ
β β Salt-based fingerprint protection ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Layer 4: Binary Protection (SDK/CLI) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββββββ
β β Nuitka compilation to native code ββ
β β Anti-debugging and obfuscation ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Post-Quantum Cryptographyβ
Why Post-Quantum?β
Quantum computers threaten current cryptographic algorithms:
| Algorithm | Status | Quantum Threat |
|---|---|---|
| RSA-2048 | β οΈ Transition | Broken by Shor's algorithm |
| ECDSA | β οΈ Transition | Broken by Shor's algorithm |
| AES-256 | β Safe | Grover reduces to 128-bit (still secure) |
| SHA-256 | β Safe | Grover reduces to 128-bit (still secure) |
| ML-DSA | β PQC | Designed for quantum resistance |
ML-DSA (FIPS 204)β
QuantumLockβ’ uses ML-DSA-65 (Module-Lattice Digital Signature Algorithm):
- Based on lattice problems (hard for quantum computers)
- NIST standardized (FIPS 204)
- Security level: 192-bit classical, 128-bit quantum
# ML-DSA signature in license artifact
{
"header": {
"alg": "RSA-PSS-SHA256", # Classical signature
"alg_pqc": "ML-DSA-65" # Post-quantum signature
},
"signatures": {
"classic": "RSA-PSS signature...",
"pqc": "ML-DSA signature..."
}
}
Hybrid Signingβ
We use hybrid signatures for transition security:
- RSA-PSS-SHA256: Current standard, widely trusted
- ML-DSA-65: Future-proof against quantum attacks
Both signatures must verify for the license to be valid.
Verification:
β RSA-PSS signature valid
β ML-DSA signature valid
β License accepted
If either fails:
β Signature verification failed
β License rejected
Revocation Systemβ
Epoch-Based Revocationβ
Traditional CRL (Certificate Revocation Lists) have issues:
- Large lists to download
- Stale data problems
- Easy to bypass offline
QuantumLockβ’ uses epoch-based revocation:
Epoch 0: Initial state (no revocations)
β
Epoch 1: License A revoked
β
Epoch 2: License B revoked
β
Epoch 3: License A restored
...
How It Worksβ
- Each license stores the minimum valid epoch
- Client stores the current epoch securely
- On validation, client checks:
current_epoch >= license.min_epoch - If client epoch < server epoch, sync is required
Anti-Rollback Protectionβ
Prevents attackers from using old revocation sets:
# Secure epoch storage per platform
macOS: Keychain Services
Windows: DPAPI (Data Protection API)
Linux: Secret Service (libsecret)
Attack attempt:
1. Attacker captures epoch 40 revocation set
2. License X is revoked at epoch 42
3. Attacker tries to use old epoch 40 set
Defense:
1. Client stored epoch 42 securely
2. Epoch 40 < stored epoch 42
3. Rollback detected β validation fails
Device Bindingβ
Hardware Fingerprintingβ
Licenses can be bound to specific devices:
binding = {
"type": "hardware",
"value": "sha256:9f86d081884c7d659a2feaa0c55ad015...",
"algorithm": "SHA-256",
"salt": "random-salt-value",
"properties": ["cpu_id", "motherboard_serial", "disk_serial"]
}
Fingerprint Generationβ
# Client-side fingerprint generation
fingerprint = {
"cpu_id": get_cpu_id(),
"motherboard_serial": get_motherboard_serial(),
"disk_serial": get_disk_serial(),
"mac_address": get_primary_mac()
}
# Hash with salt
fingerprint_json = json.dumps(fingerprint, sort_keys=True)
salted = salt + fingerprint_json
binding_value = "sha256:" + sha256(salted).hexdigest()
Binding Verificationβ
During validation:
# Server-side verification
client_fingerprint = request.device_fingerprint
expected_hash = license.binding.value
computed_hash = compute_fingerprint_hash(
fingerprint=client_fingerprint,
salt=license.binding.salt,
algorithm=license.binding.algorithm
)
if computed_hash != expected_hash:
return ValidationResult(
is_valid=False,
error="BINDING_MISMATCH"
)
License Artifact Structureβ
JWT-like Formatβ
header.payload.signature_classic.signature_pqc
Headerβ
{
"typ": "QL-LICENSE",
"ver": "1.0",
"alg": "RSA-PSS-SHA256",
"alg_pqc": "ML-DSA-65",
"kid": "ql-api-v2-default"
}
Payloadβ
{
"jti": "unique-license-id",
"sub": "customer:acme-corp",
"iss": "quantumlock.softquantus.com",
"iat": 1735570068,
"nbf": 1735570068,
"exp": 1767106068,
"grace_until": 1768315668,
"revocation_epoch": 0,
"entitlements": [...],
"binding": {...},
"metadata": {...}
}
Canonical Serializationβ
For signature verification, payload is canonicalized:
- Keys sorted alphabetically
- No whitespace
- UTC timestamps as Unix epoch
- UTF-8 encoding
Key Managementβ
Key Hierarchyβ
Root Key (HSM-stored, offline)
β
βββ Issuing Key (ql-api-v2-default)
β βββ RSA-4096 private key
β βββ ML-DSA-65 private key
β
βββ Backup Key (ql-api-v2-backup)
βββ RSA-4096 private key
βββ ML-DSA-65 private key
Key Rotationβ
- New key pair generated
- New key marked
active - Old key marked
rotated(still valid for verification) - Grace period for clients to update
- Old key marked
expired
Key Storageβ
| Environment | Storage |
|---|---|
| Production | Azure Key Vault HSM |
| Staging | Azure Key Vault |
| Development | File-based (encrypted) |
Binary Protectionβ
SDK/CLI Compilationβ
The SDK and CLI are compiled with Nuitka for protection:
Python Source β Nuitka β Native Binary (.so/.pyd/.exe)
Protection Layersβ
- Code Compilation: Python bytecode β machine code
- String Encryption: Sensitive strings encrypted
- Anti-Debug: Detection of debuggers/reversing tools
- Integrity Checks: Binary self-verification
Limitationsβ
Binary protection is not a security boundaryβit's a deterrent:
- Determined attackers can still reverse engineer
- Server-side validation is always authoritative
- Offline validation has inherent trust limitations
Threat Modelβ
What We Protect Againstβ
| Threat | Mitigation |
|---|---|
| License key guessing | Cryptographic signatures |
| License forgery | Dual RSA + ML-DSA signatures |
| License modification | Signature verification |
| Revocation bypass | Epoch-based anti-rollback |
| Device cloning | Hardware fingerprint binding |
| Replay attacks | Timestamps + nonces |
| Quantum attacks | ML-DSA-65 signatures |
What We Don't Protect Againstβ
| Threat | Reason |
|---|---|
| Full system compromise | Attacker has root access |
| Memory dumping | Runtime decryption visible |
| Hardware keyloggers | Out of scope |
| Social engineering | Human factor |
Complianceβ
Standardsβ
- NIST FIPS 204: ML-DSA signature algorithm
- NIST FIPS 203: ML-KEM (future key exchange)
- RFC 7518: JSON Web Algorithms
- RFC 7519: JWT structure (adapted)
Certificationsβ
- SOC 2 Type II (in progress)
- ISO 27001 (planned)
Security Recommendationsβ
For Implementersβ
- Always verify both signatures (RSA + ML-DSA)
- Sync revocation epoch regularly
- Use device binding for high-value licenses
- Store proofs securely for offline validation
- Monitor for anomalies in validation patterns
For Usersβ
- Protect API keys like passwords
- Use environment variables not hardcoded keys
- Implement rate limiting in your application
- Log validation failures for security monitoring
- Report suspicious activity to support
Reporting Security Issuesβ
Found a vulnerability? Please report responsibly:
We offer a bug bounty program for qualifying issues.