pyffx
pure Python format preserving encryption
What it is and what it does
pyffx is a pure Python implementation of Format-Preserving Encryption (FFX) based on Feistel networks. It lets you encrypt data in a way that preserves its structure: integers encrypt to integers of the same length, and strings encrypt to strings of the same length using the same alphabet. This is useful when you need to encrypt values while keeping them compatible with systems that expect a specific format.
The package implements only method 2 of the FFX specification. It has no external runtime dependencies, making it straightforward to install, but it has been unmaintained since 2019. The lack of recent updates means it may not be compatible with the latest Python versions, and any cryptographic improvements or security patches will not be applied.
Use it for:
- Encrypt credit card or account numbers while keeping them as numeric strings for legacy database systems
- Tokenize personally identifiable data (PII) while preserving format for analytics or reporting
- Encrypt database values in-place without changing column types or data structure
- Generate format-compliant encrypted identifiers for APIs or external systems
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pyffx implements Format-Preserving Encryption (FFX) using Feistel-based methods, allowing you to encrypt data while preserving its format—integers stay integers, strings stay strings of the same length and alphabet.
No. The package is abandoned (last update 2019) with no maintenance signal, making it unsuitable for production use. While it has no known vulnerabilities and uses a permissive license, the lack of updates means it will not receive security patches, Python compatibility fixes, or bug corrections. Use only if you are certain the 2019 codebase works with your Python version and you accept the risk of unmaintained cryptographic code.
Install
pyffx on PyPI
pip
pip install pyffxuv
uv add pyffxpoetry
poetry add pyffxInstalling pyffx
Before you install
Installation friction is high; the package has been abandoned since 2019 with no recent maintenance. Last commit was 2019-05-12, over six years ago. No runtime dependencies ease installation, but the lack of active maintenance means security updates and Python compatibility fixes are unlikely.
License in practice
Licensed under MIT License (permissive), so you can use, modify, and distribute pyffx with minimal restrictions—suitable for both open and closed projects as long as you include the license notice.
Quickstart
import pyffx
e = pyffx.Integer(b'secret-key', length=4)
encrypted = e.encrypt(1234)
decrypted = e.decrypt(encrypted)
Verify before relying
- Whether the package works reliably with modern Python versions (3.10+) given the last release was 2019
- Whether FFX method 2 implementation meets current cryptographic standards and best practices
- Real-world performance characteristics and whether format preservation is suitable for your security model
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,651 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 83,991/month — #14,036 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyffx-0.3.0.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
ff3Implements NIST FF3 and FF3-1 format-preserving…
permissive · top 15,000 on PyPI
pyDesPure Python implementation of DES and Triple…
permissive · top 15,000 on PyPI
aes-pkcs5Provides AES encryption and decryption with…
permissive · top 15,000 on PyPI
py3rijndaelpy3rijndael provides a pure-Python…
permissive · top 15,000 on PyPI
pyaesPure-Python implementation of AES encryption…
permissive · top 5,000 on PyPI
pyAesCryptEncrypts and decrypts files and binary streams…
permissive · top 15,000 on PyPI
cryptoProvides command-line tools to encrypt and…
permissive · top 5,000 on PyPI
fernetA pure Python implementation of the Fernet…
permissive · top 15,000 on PyPI
PyPDF4PyPDF4 is a pure-Python PDF toolkit for…
permissive · top 15,000 on PyPI
django-cryptography-django5Encrypts and decrypts data in Django models…
permissive · top 15,000 on PyPI