Format-Transforming Encryption — encrypt data so the ciphertext matches any format you specify.
Unlike standard encryption that produces random-looking output, FTE produces ciphertext that looks like whatever format you specify with a regular expression—hex strings, alphanumeric tokens, or any regex-expressible pattern.
pip install fteWorks out of the box with pure Python—no compilation required.
Encrypt a secret so the ciphertext looks like words:
import fte
# Create encoder: output will be lowercase "words" with spaces
encoder = fte.Encoder(regex=r'^([a-z]+ )+[a-z]+$', fixed_slice=80)
# Encrypt
ciphertext = encoder.encode(b'Attack at dawn')
print(ciphertext.decode())
# → "kqpvx mzbjw tnrdc fyhls wqaem xocgi znvub pdkry lfstj bhwce"
# Decrypt
plaintext, _ = encoder.decode(ciphertext)
# → b'Attack at dawn'- Protocol obfuscation: Make encrypted traffic look like benign data
- Bypassing filters: Evade systems that block encrypted-looking content
- Steganography: Hide data within expected formats
Full docs and examples: github.com/kpdyer/libfte
Based on Protocol Misidentification Made Easy with Format-Transforming Encryption (ACM CCS 2013).
MIT