Skip to main content

Format-Transforming Encryption

Project description

libfte

PyPI version Tests Python 3.8+ 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

Performance

For ~3x better performance, enable the optional native extension:

sudo apt-get install libgmp-dev  # or: brew install gmp
FTE_BUILD_NATIVE=1 pip install --force-reinstall fte
export FTE_USE_NATIVE=1

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fte-0.2.1.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fte-0.2.1-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file fte-0.2.1.tar.gz.

File metadata

  • Download URL: fte-0.2.1.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fte-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2331ec0ff99777d394e5b60a156a08ad3acbe8f4f74922ce117e82c21ae55feb
MD5 c27f2931267af47d45baa148a1e64760
BLAKE2b-256 502ecd9ec0a5e603b21556f1095dd02409b558d65f28bc0ea8a62da74444cfc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for fte-0.2.1.tar.gz:

Publisher: publish.yml on kpdyer/libfte

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fte-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: fte-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fte-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae0a9f8182dbb2da6499d73e048970328ae1ac73c1d3d5dd3396e848495dc08e
MD5 cd4a8598ba9155d4c1c7b8b02ea5190e
BLAKE2b-256 a49cc2228eb5a266bf968afeb1932d8a139566dcbaff4d4c2897d4c4bd35ae89

See more details on using hashes here.

Provenance

The following attestation bundles were made for fte-0.2.1-py3-none-any.whl:

Publisher: publish.yml on kpdyer/libfte

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page