pyseto
A Python implementation of PASETO/PASERK.
What it is and what it does
PySETO is a complete Python implementation of the PASETO and PASERK standards, which define secure token formats for authentication and key serialization. It supports all four PASETO protocol versions (v1, v2, v3, v4) and both use cases: v*.public for asymmetric public-key signatures and v*.local for symmetric authenticated encryption. The package also implements PASERK, a standard for serializing and wrapping cryptographic keys, including password-based key encryption and key wrapping.
The library is built on top of cryptography, argon2-cffi, iso8601, and pycryptodomex, delegating the actual cryptographic operations to these battle-tested dependencies. It provides a simple API: create a Key object with a version and purpose, then call encode() to sign or encrypt a payload and decode() to verify and decrypt. The package has passed all official PASETO test vectors and supports both raw bytes and JSON serialization of payloads and footers.
Use it for:
- Generate and verify stateless authentication tokens for REST APIs or microservices using v4.public asymmetric signing.
- Encrypt and authenticate session data or sensitive payloads using v4.local symmetric encryption without a database.
- Serialize and store cryptographic keys securely using PASERK with password-based or key-wrapping protection.
- Build multi-version token support for gradual protocol migration (e.g., from v2 to v4) across distributed systems.
- Implement registered claims (exp, iat) and custom footers (e.g., key IDs) in tokens for standards-compliant authentication.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PySETO implements PASETO (Platform-Agnostic SEcurity TOkens) and PASERK (Platform-Agnostic Serialized Keys) standards in Python, supporting all protocol versions (v1–v4) for both public-key signing and symmetric authenticated encryption.
Yes. PySETO is actively maintained, has no known vulnerabilities, uses permissive MIT licensing, and provides a complete, spec-compliant implementation of PASETO/PASERK with low install friction. Install it if you need stateless token authentication or secure key serialization and prefer a standards-based alternative to JWT or custom token schemes.
Install
pyseto on PyPI
pip
pip install pysetouv
uv add pysetopoetry
poetry add pysetoInstalling pyseto
Before you install
Low install friction with a pure-wheel distribution. The package is actively maintained with a recent release (26 days old) and an active repository. Dependencies on cryptography, argon2-cffi, iso8601, and pycryptodomex are all standard, well-maintained cryptographic libraries.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely as long as you include the license notice.
Quickstart
pip install pyseto
import pyseto
from pyseto import Key
private_key = Key.new(version=4, purpose="public", key=private_key_pem)
token = pyseto.encode(private_key, b'{"data": "message"}')
public_key = Key.new(version=4, purpose="public", key=public_key_pem)
decoded = pyseto.decode(public_key, token)
Requires Python 3.10 or later; PEM-formatted keys must be provided as bytes.
Verify before relying
- Whether the package has undergone independent security audit or formal verification of PASETO spec compliance beyond the official test vectors.
- Performance characteristics (token generation/verification latency) under typical workloads.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — argon2-cffi, cryptography, iso8601, pycryptodomex |
| Maintenance | actively maintained — 26 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 195,383/month — #9,816 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyseto-1.10.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
sslcryptoProvides AES, ECIES, and ECDSA cryptographic…
unclear · top 15,000 on PyPI
josepyImplements the JOSE (JSON Object Signing and…
permissive · top 5,000 on PyPI
pysequoiaPySequoia provides OpenPGP encryption,…
permissive · top 15,000 on PyPI
jwskateImplements the JOSE family of IETF standards…
permissive · top 5,000 on PyPI
eth-keysProvides a unified API for Ethereum key…
permissive · top 5,000 on PyPI
pqcryptoProvides Python bindings to post-quantum…
permissive · top 15,000 on PyPI
starkbank-ecdsaPure Python ECDSA implementation supporting…
permissive · top 5,000 on PyPI
fernetA pure Python implementation of the Fernet…
permissive · top 15,000 on PyPI
joseImplements JSON Web Signature (JWS) and JSON…
permissive · top 15,000 on PyPI
python-joseImplements JOSE (JSON Object Signing and…
permissive · top 1,000 on PyPI