Registry / security / srp

srp

JSON →
library1.0.22pypypi✓ verified 34d ago

Python implementation of the Secure Remote Password protocol (SRP-6a) for password-authenticated key exchange. Current version 1.0.22, released sporadically; last update 2021.

security
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Use 'import srp' to access the module.

import srp

Verifier class for server-side authentication.

from srp import verifier

User class for client-side authentication.

from srp import User

Generate salt and verifier for SRP registration using SHA256 and 2048-bit group.

import srp # Client side username = 'testuser' password = 'password123' salt, vkey = srp.create_salted_verification_key(username, password, hash_alg=srp.SHA256, ng_type=srp.NG_2048) # Server side: store salt and vkey in database # Then perform authentication protocol (omitted for brevity) print('Registration done successfully')
Debug
Known footguns
gotchaThe library uses a global hash algorithm context; reusing an srp object after authentication may lead to errors. Create new instances per session.
gotchaDefault hash algorithm is SHA1. Always specify a stronger hash (e.g., srp.SHA256) to avoid weak security.
deprecatedThe 'NG_*' group constants are deprecated in favor of the new 'NG_*' naming, but still work.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
17 hits · last 30 days
bytedance
4
gptbot
3
ahrefsbot
1
amazonbot
1
Resources