Skip to main content

QuantumLock™ API

Quantum-enhanced licensing system powered by QCOS for secure license generation and validation.

Overview

QuantumLock™ uses quantum circuit optimization to generate cryptographically-secure licenses with:

  • Quantum Random Number Generation (QRNG) - True randomness from quantum superposition
  • Quantum Fingerprinting - Unique quantum signatures per license
  • Post-Quantum Cryptography - Future-proof security against quantum attacks
  • QCOS Autopilot - Deterministic quantum license generation (99.86% fidelity)

Authentication

All QuantumLock endpoints require JWT authentication. First, login to obtain your token:

# Login to get JWT token
curl -X POST https://api.softquantus.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "your-email@company.com",
"password": "your-password"
}'

Response:

{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "bearer"
}

Use the access_token in all subsequent requests:

curl -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

API Endpoints

Generate License

Creates a quantum-enhanced license for your end customer.

Endpoint: POST /api/quantumlock/v1/licenses/generate

Request:

{
"end_customer_id": "customer-unique-id",
"features": ["feature-1", "feature-2"],
"expires_in_days": 365,
"metadata": {
"company": "Acme Corp",
"plan": "enterprise",
"max_users": 100
}
}

Response:

{
"license_key": "QCOS-XXXX-XXXX-XXXX-XXXX",
"customer_id": "your-email@company.com:customer-unique-id",
"features": ["feature-1", "feature-2"],
"issued_at": "2024-01-15T10:30:00Z",
"expires_at": "2025-01-15T10:30:00Z",
"quantum_signature": "q1:0.9876|q2:0.9823|q3:0.9901|...",
"metadata": {
"company": "Acme Corp",
"plan": "enterprise",
"max_users": 100
}
}

cURL Example:

curl -X POST https://api.softquantus.com/api/quantumlock/v1/licenses/generate \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"end_customer_id": "customer-123",
"features": ["ai-optimizer", "real-quantum", "priority-support"],
"expires_in_days": 365,
"metadata": {
"company": "Acme Corp",
"plan": "enterprise"
}
}'

Validate License

Verifies a license key's authenticity and checks expiration.

Endpoint: POST /api/quantumlock/v1/licenses/validate

Request:

{
"license_key": "QCOS-XXXX-XXXX-XXXX-XXXX"
}

Response:

{
"valid": true,
"customer_id": "your-email@company.com:customer-123",
"features": ["ai-optimizer", "real-quantum", "priority-support"],
"issued_at": "2024-01-15T10:30:00Z",
"expires_at": "2025-01-15T10:30:00Z",
"days_remaining": 235,
"quantum_verified": true,
"metadata": {
"company": "Acme Corp",
"plan": "enterprise"
}
}

cURL Example:

curl -X POST https://api.softquantus.com/api/quantumlock/v1/licenses/validate \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"license_key": "QCOS-XXXX-XXXX-XXXX-XXXX"
}'

Get Usage Statistics

Retrieve your license generation statistics.

Endpoint: GET /api/quantumlock/v1/stats

Response:

{
"total_licenses": 1250,
"active_licenses": 980,
"expired_licenses": 270,
"this_month": 45,
"quantum_fidelity_avg": 0.9986,
"generation_time_avg_ms": 28
}

cURL Example:

curl https://api.softquantus.com/api/quantumlock/v1/stats \
-H "Authorization: Bearer YOUR_JWT_TOKEN"

Get SDK Information

Retrieve SDK installation and usage instructions for different languages.

Endpoint: GET /api/quantumlock/v1/sdk/{language}

Supported Languages: python, nodejs, java, csharp

cURL Example:

curl https://api.softquantus.com/api/quantumlock/v1/sdk/python \
-H "Authorization: Bearer YOUR_JWT_TOKEN"

SDK Integration

Python SDK

Installation:

pip install quantumlock-sdk

Usage:

from quantumlock_sdk import LicenseValidator, LicenseError, FeatureNotLicensed

# Initialize validator
validator = LicenseValidator()

# Validate license
try:
license_data = validator.validate("QCOS-XXXX-XXXX-XXXX-XXXX")
print(f"License valid for: {license_data['customer_id']}")
print(f"Features: {license_data['features']}")
print(f"Expires: {license_data['expires_at']}")
except LicenseError as e:
print(f"License validation failed: {e}")

# Check specific feature
try:
validator.check_feature("QCOS-XXXX-XXXX-XXXX-XXXX", "ai-optimizer")
print("Feature 'ai-optimizer' is licensed!")
except FeatureNotLicensed as e:
print(f"Feature not available: {e}")

FastAPI Integration

from fastapi import FastAPI, Depends, HTTPException
from quantumlock_sdk import LicenseValidator, LicenseError

app = FastAPI()
validator = LicenseValidator()

def verify_license(license_key: str):
"""Dependency to verify license on each request"""
try:
return validator.validate(license_key)
except LicenseError as e:
raise HTTPException(status_code=401, detail=str(e))

@app.get("/protected-endpoint")
async def protected_endpoint(
license_key: str,
license_data: dict = Depends(verify_license)
):
return {
"message": "Access granted",
"customer": license_data["customer_id"],
"features": license_data["features"]
}

Flask Integration

from flask import Flask, request, jsonify
from quantumlock_sdk import LicenseValidator, LicenseError
from functools import wraps

app = Flask(__name__)
validator = LicenseValidator()

def require_license(f):
"""Decorator to protect routes with license validation"""
@wraps(f)
def decorated_function(*args, **kwargs):
license_key = request.headers.get('X-License-Key')
if not license_key:
return jsonify({"error": "License key required"}), 401

try:
license_data = validator.validate(license_key)
request.license_data = license_data
return f(*args, **kwargs)
except LicenseError as e:
return jsonify({"error": str(e)}), 401

return decorated_function

@app.route('/protected')
@require_license
def protected_route():
return jsonify({
"message": "Access granted",
"customer": request.license_data["customer_id"]
})

Django Integration

# middleware.py
from django.http import JsonResponse
from quantumlock_sdk import LicenseValidator, LicenseError

class QuantumLockMiddleware:
def __init__(self, get_response):
self.get_response = get_response
self.validator = LicenseValidator()

def __call__(self, request):
# Skip validation for public endpoints
if request.path.startswith('/public/'):
return self.get_response(request)

license_key = request.headers.get('X-License-Key')
if not license_key:
return JsonResponse(
{"error": "License key required"},
status=401
)

try:
request.license_data = self.validator.validate(license_key)
except LicenseError as e:
return JsonResponse({"error": str(e)}, status=401)

return self.get_response(request)

# settings.py
MIDDLEWARE = [
# ... other middleware
'your_app.middleware.QuantumLockMiddleware',
]

Code Examples

Generate License for End Customer

import requests

# Your JWT token from login
jwt_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

response = requests.post(
"https://api.softquantus.com/api/quantumlock/v1/licenses/generate",
headers={
"Authorization": f"Bearer {jwt_token}",
"Content-Type": "application/json"
},
json={
"end_customer_id": "customer-123",
"features": ["ai-optimizer", "real-quantum"],
"expires_in_days": 365,
"metadata": {
"company": "Acme Corp",
"plan": "enterprise",
"max_users": 100
}
}
)

license_data = response.json()
print(f"License generated: {license_data['license_key']}")

# Send license_key to your end customer
# They will use it with the SDK for validation

Validate License in Your Application

from quantumlock_sdk import LicenseValidator, LicenseError

validator = LicenseValidator()

# Get license key from user (config file, environment variable, etc.)
license_key = "QCOS-XXXX-XXXX-XXXX-XXXX"

try:
license_data = validator.validate(license_key)

# Check if license is valid and has required features
if "ai-optimizer" in license_data["features"]:
print("AI Optimizer feature enabled!")
# Enable feature in your application

if "real-quantum" in license_data["features"]:
print("Real quantum hardware access enabled!")
# Connect to quantum backends

except LicenseError as e:
print(f"License validation failed: {e}")
# Disable premium features, show upgrade prompt

Feature-Gated Functionality

from quantumlock_sdk import LicenseValidator, FeatureNotLicensed

validator = LicenseValidator()

def quantum_optimize_circuit(circuit, license_key):
"""Feature that requires 'ai-optimizer' license"""

# Check if user has the feature
try:
validator.check_feature(license_key, "ai-optimizer")
except FeatureNotLicensed:
raise Exception(
"AI Optimizer feature not licensed. "
"Please upgrade your plan to access this feature."
)

# User has the feature - proceed with optimization
optimized_circuit = run_qcos_optimizer(circuit)
return optimized_circuit

def connect_quantum_hardware(backend_name, license_key):
"""Feature that requires 'real-quantum' license"""

try:
validator.check_feature(license_key, "real-quantum")
except FeatureNotLicensed:
raise Exception(
"Real quantum hardware access not licensed. "
"Please upgrade to Enterprise plan."
)

# User has access - connect to hardware
backend = connect_to_backend(backend_name)
return backend

Technical Specifications

Quantum Security

  • QRNG: 16-64 qubits generating true random numbers via quantum superposition
  • Quantum Fingerprinting: Unique amplitude patterns per license (2^16-2^64 states)
  • Post-Quantum Signatures: CRYSTALS-Dilithium3 (NIST-approved PQC algorithm)
  • Fidelity: Average 99.86% quantum circuit fidelity
  • Performance: 36 licenses/second, 0.028s average generation time

License Format

License Key: QCOS-XXXX-XXXX-XXXX-XXXX
└─┬─┘ └────────┬────────┘
│ │
│ └─ Base32-encoded quantum fingerprint (16 chars)
└─ Service prefix

Quantum Signature Format

q1:0.9876|q2:0.9823|q3:0.9901|...|q16:0.9912
└─┬──────┘

└─ Qubit amplitude (quantum state probability)

Each qubit amplitude represents the probability amplitude of the quantum state, creating a unique fingerprint that cannot be forged without quantum computational resources.

Performance Benchmarks

MetricValue
License Generation36 licenses/second
Average Generation Time28ms
Quantum Fidelity99.86%
Validation Time (SDK)<1ms (offline)
Qubits per License16 (standard), 32-64 (enterprise)

Security Considerations

Best Practices

  1. Store licenses securely - Use environment variables or secure key management
  2. Validate on startup - Check license validity when application starts
  3. Cache validation results - Validate once, cache for performance
  4. Monitor expiration - Alert users 30 days before expiration
  5. Use HTTPS - Always transmit licenses over encrypted connections

Threat Model

QuantumLock protects against:

  • ✅ License key guessing (2^256 keyspace)
  • ✅ Quantum fingerprint forgery (requires quantum computer)
  • ✅ Future quantum attacks (post-quantum cryptography)
  • ✅ License tampering (cryptographic signatures)
  • ✅ Feature manipulation (server-side validation)

Pricing

Contact sales@softquantus.com for QuantumLock pricing or visit the pricing page.

Support