srptools
Tools to implement Secure Remote Password (SRP) authentication
What it is and what it does
srptools provides a complete implementation of the Secure Remote Password (SRP) protocol, a password-authenticated key agreement (PAKE) mechanism that allows two parties to authenticate each other and establish a shared session key without ever transmitting the password over the network. The package supports both Python 2 and 3 and offers two interfaces: a programmatic API via SRPContext, SRPServerSession, and SRPClientSession classes, and a command-line utility for testing and integration.
The library handles the cryptographic details of SRP authentication, including user data triplet generation (username, password verifier, and salt), session key derivation, and optional proof verification for mutual authentication. It supports both hex and base64 encoding of values, allows session restoration via private key storage, and can raise SRPException to signal authentication failures that should halt the process. The package has no external runtime dependencies for API use, making it lightweight for embedding in applications.
Use it for:
- Implement password-based authentication in web applications or APIs where you want to avoid transmitting passwords over the network.
- Build peer-to-peer or distributed systems requiring mutual authentication without relying on a central certificate authority.
- Add SRP-based authentication to IoT or embedded systems where password security and key exchange are critical.
- Test or prototype SRP protocol implementations using the command-line utility for debugging authentication flows.
- Replace basic password authentication in legacy systems with a cryptographically stronger PAKE mechanism.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements Secure Remote Password (SRP) protocol for password-authenticated key agreement, providing both programmatic API and command-line tools for client-server authentication without transmitting passwords.
Yes, if you need SRP authentication. The package is stable, has no runtime dependencies, and is actively maintained. However, note that the latest release was in 2020 and Python 2 support is included; verify that the supported Python versions and any cryptographic assumptions align with your security requirements before production use.
Install
srptools on PyPI
pip
pip install srptoolsuv
uv add srptoolspoetry
poetry add srptoolsInstalling srptools
Before you install
Low install friction with no runtime dependencies. Package is actively maintained with recent commits, though the latest release was in 2020; the repository remains active and unarchived.
License in practice
BSD 3-Clause License is permissive, allowing commercial and private use with minimal restrictions; you may use and modify the code freely provided you include the license notice.
Quickstart
from srptools import SRPContext, SRPServerSession, SRPClientSession
context = SRPContext('alice', 'password123')
username, password_verifier, salt = context.get_user_data_triplet()
server_session = SRPServerSession(SRPContext(username, prime=context.prime, generator=context.generator), password_verifier)
client_session = SRPClientSession(SRPContext('alice', 'password123', prime=context.prime, generator=context.generator))
client_session.process(server_session.public, salt)
server_session.process(client_session.public, salt)
assert server_session.key == client_session.key
CLI usage requires the click package to be installed separately; API usage has no external dependencies.
Verify before relying
- Whether the package's Python 2.7 and 3.5-3.7 support claims remain accurate for modern environments.
- Current security audit status or any known cryptographic implementation concerns beyond OSV records.
Package facts
| License | BSD 3-Clause License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 2,162 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 473,669/month — #6,460 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: srptools-1.0.1-py2.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
srpImplements the Secure Remote Password (SRP)…
permissive · top 15,000 on PyPI
spake2Implements SPAKE2, a password-authenticated key…
permissive · top 15,000 on PyPI
scrampScramp implements the SCRAM authentication…
permissive · top 1,000 on PyPI
PyOTPPyOTP generates and verifies one-time passwords…
permissive · top 1,000 on PyPI
pkceGenerates PKCE (Proof Key for Code Exchange)…
permissive · top 5,000 on PyPI
prime-tunnelExposes local services via secure tunnels on…
permissive · top 15,000 on PyPI
pwdlibProvides a modern, easy-to-use wrapper for…
permissive · top 5,000 on PyPI
bcryptbcrypt provides modern password hashing using…
permissive · top 1,000 on PyPI
secure-smtplibProvides secure SMTP subclasses with TLS/SSL…
unclear · top 15,000 on PyPI
rfc3987Provides RFC 3986 and RFC 3987 compliant…
copyleft · top 5,000 on PyPI