skillfed

pyffx

pure Python format preserving encryption

pyffx v0.3.0 84.0K downloads/30d#14,036 on PyPI55
Permissive license MIT License Abandoned released

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 pyffx

uv

uv add pyffx

poetry

poetry add pyffx

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2.7Programming Language :: Python :: 3

Tags

format preserving encryptionfeistel cipherffx encryptionencrypt integers stringsformat-preserving cryptographydata format encryptionreversible encryption same format
encryptionformat-preservingabandoned

More Cryptography packages