altcha
A library for creating and verifying challenges for ALTCHA.
What it is and what it does
ALTCHA is a zero-dependency Python library for creating and verifying proof-of-work challenges designed to protect against automated attacks. It implements PoW v2, which uses key derivation functions (KDFs) instead of simple hash matching—clients must find a counter value whose derived key starts with a required prefix. The library supports multiple algorithms: fast iterated SHA variants for testing, PBKDF2 for general use, and memory-hard algorithms like scrypt and Argon2id that resist GPU/ASIC attacks.
The typical workflow is server-side: create a challenge with a chosen algorithm and cost, send it to the client, which solves it by brute-forcing counter values, then transmit the solution back to the server for verification. The library handles challenge expiry, optional HMAC signing for tamper detection, and a fast verification path when you pre-solve challenges server-side. It also supports custom KDF functions and server signature verification via the ALTCHA Sentinel API.
Use it for:
- Protect web forms and APIs from bot submissions by requiring clients to solve a proof-of-work challenge before accepting requests.
- Implement rate limiting or anti-spam mechanisms that are resistant to GPU-accelerated attacks using memory-hard algorithms.
- Verify that a client performed computational work before granting access to expensive resources or rate-limited endpoints.
- Embed tamper-proof challenges in web applications by signing them with HMAC and verifying the signature server-side.
- Test proof-of-work implementations quickly using fast SHA-based algorithms without deploying memory-hard variants.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Creates and verifies ALTCHA proof-of-work challenges using key derivation functions like PBKDF2, Argon2id, and scrypt to defend against automated attacks.
Yes. The library is actively maintained, has zero runtime dependencies, installs easily, carries no known vulnerabilities, and solves a real problem (bot protection via proof-of-work). It is permissively licensed and supports current Python versions. Install it if you need ALTCHA challenge generation and verification; the API is straightforward and the documentation includes working examples.
Install
altcha on PyPI
pip
pip install altchauv
uv add altchapoetry
poetry add altchaInstalling altcha
Before you install
Installs with no runtime dependencies and is actively maintained; last release was 18 days ago with a recent commit on 2026-07-27.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute it freely in commercial and open-source projects.
Quickstart
pip install altcha
from altcha import create_challenge, solve_challenge, verify_solution, Payload
challenge = create_challenge(algorithm="PBKDF2/SHA-256", cost=5_000, hmac_secret="secret")
solution = solve_challenge(challenge)
payload_b64 = Payload(challenge, solution).to_base64()
result = verify_solution(payload_b64, "secret")
print(result.verified)
Requires Python 3.9 or later. Argon2id support requires optional argon2-cffi dependency.
Verify before relying
- Whether the library is suitable for production web applications at scale beyond the stated monthly download volume.
- Performance characteristics and typical solve times for different algorithm/cost combinations in real deployments.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 18 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 296,462/month — #7,897 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: altcha-2.1.0-py3-none-any.whl
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
argon2-cffiProvides a simple Python interface to Argon2, a…
permissive · top 1,000 on PyPI
pkceGenerates PKCE (Proof Key for Code Exchange)…
permissive · top 5,000 on PyPI
eth-keyfileLoads, creates, and decrypts Ethereum…
permissive · top 5,000 on PyPI
bcryptbcrypt provides modern password hashing using…
permissive · top 1,000 on PyPI
hkdfImplements HMAC-based Key Derivation Function…
permissive · top 15,000 on PyPI
scryptPython bindings for the scrypt key derivation…
permissive · top 15,000 on PyPI
pyscryptA pure-Python implementation of the scrypt…
permissive · top 15,000 on PyPI
standardwebhooksProvides webhook payload verification and…
permissive · top 5,000 on PyPI
eth-keysProvides a unified API for Ethereum key…
permissive · top 5,000 on PyPI