ZXTX
ZXTX is a secure, compressed, and verifiable file format for structured text and binary data. It supports optional encryption, compression, and cryptographic signing, making it ideal for transmitting sensitive files safely.
Built in Python (3.10+). Powered by
cryptography.
Features
- AES-256-CTR + HMAC, AES-256-GCM, and ChaCha20-Poly1305 authenticated encryption
- LZMA, Zlib, and Brotli compression support
- Ed25519 and RSA signing and verification
- Signatures cover the header and the body (format v1.1)
- AEAD associated-data binding between header and body prevents ciphertext splicing
- Structured file format with typed headers and bodies
- Command-line interface (CLI) for reading, writing, and inspecting
.zxtxfiles
Installation
pip install zxtx
Or with PDM:
pdm add zxtx
Usage
Writing a ZXTX file
Methods are passed as numeric ids (run zxtx -h for the full list):
# id 3 = aes256_ctr_hmac, id 2 = lzma
zxtx write input.txt output.zxtx --cipher 3 --compression 2 \
--private-key mykey.pem --certificate mycert.pem --public-key mykey_pub.pem \
--password "key-file-password"
--private-keysigns the file (a file without it remains unsigned).--public-keywraps the content-encryption session key (required for ciphers 1–3).--passworddecrypts a password-protected private key file.
Reading a ZXTX file
zxtx read example.zxtx output.txt --private-key mykey.pem --public-key pubkey.pem --password "key-file-password"
Providing --public-key or --certificate turns on signature verification:
a modified or foreign-signed file is rejected, and an unsigned file read with those flags fails loudly (re-run without verification flags to read unsigned files).
Dumping metadata
zxtx dump example.zxtx --public-key pubkey.pem
Supported Methods
Cipher Methods
0—none1—aes256_gcm2—chacha20_poly13053—aes256_ctr_hmac
Compression Methods
0—none1—zlib2—lzma3—brotli
Format Specification
The ZXTX file format is formally documented in SPECIFICATION.md. It defines:
- Magic header
- Versioning (
v1.1current;v1.0files remain readable) - Field layout
- Signature coverage (header + body) and AAD binding
- Session-key wrapping and HKDF subkey derivation, etc
Security Notes
- ZXTX uses AEAD or encrypt-then-MAC (authenticated encryption) to prevent tampering.
- Since format v1.1, signatures cover the header and the body, and encrypted bodies are cryptographically bound to their header via associated data. Verifying a file therefore detects any tampering — provided the verification key is pinned outside the file (pass
--public-key/--certificatewhen reading). A certificate merely embedded in the file is not a trust anchor by itself. - CRC32 is a transport-integrity convenience only, never a security check.
- Decompression is bounded by the declared original size to blunt decompression bombs.
- Private keys can be password-encrypted; passwords are only used to unlock PEM files and are not kept after loading.
- Writes are atomic (temp file + rename), so an interrupted write cannot corrupt the previous file.
- Don't share your private key. Use a certificate for signing and a public key for verification.
Python API
from zxtx.highlevel import open
with open("file.zxtx", password=b"secret", public_key=b"...") as f:
data = f.read_bytes()
ZXTXFileHandle.signature_verified reports the verification state of the loaded file: True (verified), False (signed but no verification key given), or None (unsigned). When writing, pass create=True to replace an existing file without parsing its previous contents.
See the zxtx.highlevel module for full API details.
License
MIT License – Copyright (c) 2025 voyager-2021 (ZXTX)
Metadata
Release files for zxtx 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| zxtx-0.3.0.tar.gz | 69.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zxtx-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 94.3 kB
Release files / zxtx-0.3.0.tar.gz
| Download URL | zxtx-0.3.0.tar.gz |
|---|---|
| Size | 69.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0203a84b09941349ba2e882060384e477c02951bdfd6adfb71dc2a9f5effb24
|
|
BLAKE2b-256 checksum How to use checksums |
66498a3dd94f14e2de4cf8cbb436f7e4735fa75661ade0603c444cba41c87991
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logRelease files / zxtx-0.3.0-py3-none-any.whl
| Download URL | zxtx-0.3.0-py3-none-any.whl |
|---|---|
| Size | 25.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e1876a39c9e1235d3931b0dfb780f8377f1dd7ab79be4afb6e0a7945732ea15
|
|
BLAKE2b-256 checksum How to use checksums |
36b033bba3877ea82bda4830a5ad1dc669bc5a1cb52419e3c26e977a8af831ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logSecurity for zxtx 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for zxtx-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.