Skip to main content

Secure license key generation, software activation, and hardware binding.

Project description

Sealium Logo

PyPI License Python


🔒 Sealium

Secure license key generation, software activation, and hardware binding.


✨ Features

Feature Description
🔐 Hybrid Encryption RSA-4096-OAEP key wrapping + AES-256-GCM payload
🎫 License Keys Cryptographically secure random keys (128-bit)
💻 Hardware Binding Bind licenses to specific machines (SHA-256 fingerprint)
Expiration Control Set expiry dates and feature flags
🛡️ Anti-Replay Timestamp window + nonce deduplication
🌐 Client-Server Ready-to-use FastAPI backend
🔁 Idempotent Same machine may reactivate safely

📦 Installation

pip install sealium

🚀 Quick Example

from sealium.client.activator import Activator

# Client only needs the server's PUBLIC key.
activator = Activator(
    server_url="http://localhost:8000/v1/activation",
    server_public_key_pem=open("data/server_public.pem").read(),
)

response = activator.activate("your-license-key")

if response.result == "success":
    print(f"✅ Activated until {response.authorized_until}")
    print(f"   Features: {response.features}")
else:
    print(f"❌ {response.error_msg}")

🧱 Architecture

src/sealium/
├── common/        # Shared primitives (crypto, models, machine_code, time_source)
├── client/        # Activator + hybrid-encryption key manager
├── server/        # FastAPI app factory, routes, services, database, config
│   ├── routes/    # Thin HTTP layer
│   ├── services/  # activation_service, replay_guard (pure, injectable)
│   └── ...
└── scripts/       # generate_keys, generate_activation_codes

Key principle: no import side effects. Importing the package performs no I/O, no network calls, no hardware reads. Server resources (private key, DB) are initialized in the FastAPI lifespan and are injectable for testing.

See src/docs/mechanism.md for the full protocol specification.


🔧 Requirements

  • Python 3.13+
  • cryptography, requests, fastapi, uvicorn (wmi on Windows only)

🧪 Testing

pip install -e ".[dev]"
pytest

The test suite runs fully offline: the FastAPI server is driven in-process via TestClient, the database is a throwaway SQLite file, and the timestamp source is injected — no live server or network required.


🛡️ Deployment Hardening

Sealium is designed to run behind a reverse proxy / firewall, not exposed bare to the public network:

  • Bind address — defaults to 0.0.0.0; restrict via HOST=127.0.0.1 when running co-located with the proxy.
  • TLS — the app-layer hybrid encryption protects every payload end-to-end, but you should still terminate TLS at the reverse proxy (with HSTS) to hide metadata.
  • Rate limiting — enabled by default (RATE_LIMIT_ENABLED, 60 req / 60 s per IP); tune via RATE_LIMIT_MAX_REQUESTS / RATE_LIMIT_WINDOW_SECONDS. In multi-worker deployments the limiter is per-process — inject a shared backend for global limits.
  • Docs/docs, /redoc, /openapi.json are auto-disabled when DEBUG=false.
  • Key materialdata/server_private.pem and the SQLite DB are created with 0600 permissions; never commit them (already gitignored).
  • Multi-worker caveat — the in-memory replay guard and rate limiter are per-process; for cross-worker consistency, inject a shared store (Redis).

📄 License

GPLv3 © Sealium Contributors


Built with ❤️ for Python developers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sealium-1.2.1.tar.gz (45.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sealium-1.2.1-py3-none-any.whl (54.0 kB view details)

Uploaded Python 3

File details

Details for the file sealium-1.2.1.tar.gz.

File metadata

  • Download URL: sealium-1.2.1.tar.gz
  • Upload date:
  • Size: 45.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sealium-1.2.1.tar.gz
Algorithm Hash digest
SHA256 9eecba122291afb6c25cb232f47116408ae3d8f8f349499981cf0d68dfcadd64
MD5 cdf27a945018a82fd0eeb0ccf35acb40
BLAKE2b-256 7d41a71515a7dd59310901873e26d95f67d5221a78d2f41c7c4570656e4995eb

See more details on using hashes here.

File details

Details for the file sealium-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: sealium-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 54.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sealium-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd5c33b68d813e71d3fce3bcaac575b50bc68b40ca4dc4b6c22b30ff97d007b1
MD5 7c9bfd560cdd0c63f226058e5e15920f
BLAKE2b-256 263cb74a94e4b311197e8380abf40a04c90cf4b669384f333824ad7230247174

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page