Skip to content

Latest commit

 

History

History
58 lines (37 loc) · 1.84 KB

File metadata and controls

58 lines (37 loc) · 1.84 KB

libfte

PyPI version Tests Python 3.10+ License: MIT

Format-Transforming Encryption — encrypt data so the ciphertext matches any format you specify.

What is FTE?

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.

Installation

pip install fte

Works out of the box with pure Python—no compilation required.

Quick Example

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'

Use Cases

  • Protocol obfuscation: Make encrypted traffic look like benign data
  • Bypassing filters: Evade systems that block encrypted-looking content
  • Steganography: Hide data within expected formats

Documentation

Full docs and examples: github.com/kpdyer/libfte

Reference

Based on Protocol Misidentification Made Easy with Format-Transforming Encryption (ACM CCS 2013).

License

MIT