pyscrypt
Pure-Python Implementation of the scrypt password-based key derivation function and scrypt file format library
What it is and what it does
pyscrypt is a pure-Python reference implementation of the scrypt password-based key derivation function (PBKDF). It provides two main capabilities: hashing passwords with configurable work factors (N, r, p parameters) to produce cryptographic keys, and reading/writing files encrypted with the scrypt file format. The package has no external dependencies and supports both Python 2 and 3, though it is intentionally slow—the documentation explicitly states it is 'not meant to be fast, more of a reference solution.' The scrypt algorithm itself is CPU and memory intensive by design, making brute-force password attacks computationally expensive.
The package includes a ScryptFile class for transparent file encryption/decryption and a hash function for key derivation. It comes with test cases that can be validated against the command-line scrypt utility. However, the project has been abandoned since 2015, with the maintainer noting that faster C-wrapper implementations exist for production use. For most real-world applications requiring scrypt, a maintained C-based library would be preferable.
Use it for:
- Hashing user passwords for authentication systems where you need a slow, memory-hard key derivation function.
- Encrypting sensitive files using the scrypt file format for compatibility with the command-line scrypt utility.
- Educational or reference purposes to understand how scrypt works without external C dependencies.
- Legacy system maintenance where existing code depends on pyscrypt's pure-Python implementation.
- Scenarios where you cannot use compiled C extensions and need scrypt functionality despite performance trade-offs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pure-Python implementation of the scrypt password-based key derivation function that hashes passwords and encrypts/decrypts files using the scrypt algorithm.
No, unless you have a specific legacy dependency or educational need. The package is abandoned (last release 2015), explicitly slow by design, and the maintainer recommends C-wrappers for production use. For new projects, use a maintained scrypt library or bcrypt/argon2 instead. The lack of maintenance and known performance limitations make it unsuitable for most modern applications.
Install
pyscrypt on PyPI
pip
pip install pyscryptuv
uv add pyscryptpoetry
poetry add pyscryptInstalling pyscrypt
Before you install
High install friction: the package is abandoned (last release 2015-02-03, last commit 2022-07-02) with no external dependencies but relies on pure Python, making it slow by design. The maintainer explicitly notes it is 'not meant to be fast, more of a reference solution.' Consider a maintained C-wrapper alternative for production use.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions, provided you include the license notice.
Quickstart
import pyscrypt
# Hash a password
hashed = pyscrypt.hash(password=b"correct horse battery staple",
salt=b"seasalt",
N=1024, r=1, p=1, dkLen=32)
# Encrypt a file
with pyscrypt.ScryptFile('file.scrypt', b'password', 1024, 1, 1) as f:
f.write(b"Hello World")
Python 3 requires password and salt as byte objects (b"..."), not strings. ScryptFile mode must be 'rb' or 'wb'.
Verify before relying
- Whether the pure-Python implementation is suitable for your security requirements or if a C-wrapper is necessary for production.
- Current compatibility with modern Python versions beyond the 2.x/3.x support stated in documentation.
- Whether the reference implementation has been audited for cryptographic correctness.
Package facts
| License | License :: OSI Approved :: MIT License (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 4,210 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 246,727/month — #8,705 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyscrypt-1.6.2.tar.gz
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
hkdfImplements HMAC-based Key Derivation Function…
permissive · top 15,000 on PyPI
pyaesPure-Python implementation of AES encryption…
permissive · top 5,000 on PyPI
scryptPython bindings for the scrypt key derivation…
permissive · top 15,000 on PyPI
eth-keyfileLoads, creates, and decrypts Ethereum…
permissive · top 5,000 on PyPI
pyAesCryptEncrypts and decrypts files and binary streams…
permissive · top 15,000 on PyPI
pyDesPure Python implementation of DES and Triple…
permissive · top 15,000 on PyPI
bcryptbcrypt provides modern password hashing using…
permissive · top 1,000 on PyPI
twofishProvides Python bindings to the Twofish block…
permissive · top 15,000 on PyPI
argon2-cffiProvides a simple Python interface to Argon2, a…
permissive · top 1,000 on PyPI
pysodiumPysodium is a Python wrapper around libsodium…
permissive · top 15,000 on PyPI