Pure Python implementation of Format Preserving Encryption (FPE) using the FF1 algorithm from NIST SP 800-38G. Supports integer and string alphabets. Current version 0.3.0, no recent releases.
pip install pyffxVerified import paths — ran on the pinned version, not inferred.
Basic usage of Integer and String FPE
Ensure key is bytes and length is 16, 24, or 32.
Cast to int: fpe_int.encrypt(int('123456'))Use alphabet with unique characters, e.g., '0123456789'.
Consider using alternatives like 'pycryptodome' or 'mbi-omapi' for FPE.
pip install pyffx
Generate a key of exactly 16, 24, or 32 bytes: key = b'0123456789abcdef'
Ensure alphabet length is >= the length parameter. For Integer, radix is fixed.
Pass an integer: fpe_int.encrypt(12345)
No dependency data recorded yet.