pyescrypt
raw JSON → 0.1.0 verified Fri May 01 auth: no python
Python bindings for yescrypt, a memory-hard, NIST-compliant password hashing scheme. Version 0.1.0 is the initial release, supporting all features except shared memory (ROM).
pip install pyescrypt Common errors
error ModuleNotFoundError: No module named 'yescrypt' ↓
cause Importing using the package name instead of the actual module name.
fix
Use 'from pyescrypt import Yescrypt' (package is pyescrypt).
error AttributeError: 'bytes' object has no attribute 'hex' ↓
cause Python 3.4 or earlier (hex method added in 3.5).
fix
Upgrade to Python 3.5+ or use binascii.hexlify().
error cffi.error.CDefError: cannot parse '...' ↓
cause Missing shared library libyescrypt or incompatible version.
fix
Install libyescrypt from your system package manager (e.g., apt install libyescrypt-dev).
Warnings
gotcha The hash output is raw bytes (not a string). You are responsible for encoding (e.g., hex) for storage. ↓
fix Use .hex() on the hash bytes before storing, and .fromhex() when loading.
deprecated The verify method currently returns True/False. The signature may change in future versions to raise exceptions for invalid input. ↓
fix Check return value and handle explicitly; watch for updates.
gotcha No default parameters for memory cost, block size, or parallelism. You must pass them or accept library defaults that may be weak. ↓
fix Always specify parameters: hash(password, salt, N=2**14, r=8, p=1) for recommended settings.
Install
pip install git+https://github.com/0xcb/pyescrypt.git Imports
- Yescrypt wrong
from yescrypt import Yescryptcorrectfrom pyescrypt import Yescrypt
Quickstart
from pyescrypt import Yescrypt
yescrypt = Yescrypt()
password = b"correct horse battery staple"
salt = b"unique_salt"
hashed = yescrypt.hash(password, salt)
print("Hashed:", hashed.hex())
verified = yescrypt.verify(password, salt, hashed)
print("Verified:", verified)