Skip to main content

ciph

PyPI Downloads Python CI License

Fast, streaming file encryption for large files. Works on files bigger than your RAM.

Install

pip install ciph
ciph setup

Requirements: Linux/Termux, Python >= 3.8, libsodium

# Debian/Ubuntu
sudo apt install libsodium-dev

# Termux
pkg install libsodium

Or build from source:

git clone https://github.com/ankit-chaubey/ciph
cd ciph && make && pip install .

Usage

ciph encrypt video.mp4          # -> video.mp4.ciph
ciph decrypt video.mp4.ciph     # -> video.mp4 (filename restored)

Set cipher or chunk size:

ciph encrypt file.bin --cipher chacha -c 8

Non-interactive (scripting):

CIPH_PASSWORD=yourpassword ciph encrypt file.bin

How it works

  • AES-256-GCM or ChaCha20-Poly1305 (auto-fallback if no AES-NI)
  • Argon2id key derivation from password
  • Data key is randomly generated per file, then wrapped with the password key
  • File is encrypted in chunks (default 4 MB) so memory usage is constant
  • Each chunk gets a unique derived nonce, authenticated with the full header as AAD
  • Original filename stored in header, restored on decrypt
  • Chunk size used during encrypt is baked into the header -- you can decrypt with any -c value

File format

Offset Size Field
0 4 Magic (CIPH)
4 1 Version
5 1 Cipher (1=AES, 2=ChaCha)
6 4 Chunk size MB (big-endian)
10 16 Argon2id salt
26 12 Nonce-derivation key
38 1 Filename length
39 N Original filename
39+N 2 Encrypted key length
41+N L Encrypted data key

Followed by repeating [4-byte chunk length][encrypted chunk]. A final zero-length authenticated chunk marks EOF.

The entire header is bound as AAD to every chunk -- tampering with any field breaks decryption.

Limitations

  • No resume support
  • Password-based only (public-key mode not yet implemented)

License

Apache 2.0 -- see LICENSE

Metadata

Release files for ciph 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ciph 1.2.2
File Size Uploaded Provenance
ciph-1.2.2.tar.gz 14.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ciph 1.2.2
File Interpreter ABI Platform
ciph-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 24.1 kB

Release files / ciph-1.2.2.tar.gz

Download URL ciph-1.2.2.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b37ccf72e26bc91ba642e4c434a8ddf1f78a2d025d0e54e3b021e6cfc336719f
BLAKE2b-256 checksum
How to use checksums
f67a82d134b7bc359dc2fdd8b71b4cf4094fe653ff6353ece73813d296dec8d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 9, 2026.

Transparency log

Release files / ciph-1.2.2-py3-none-any.whl

Download URL ciph-1.2.2-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab85650bee1844885e4603396f0d48b5f64658b5d40c9426a54a172ef031b784
BLAKE2b-256 checksum
How to use checksums
9e8ffe01a73fd574916f03876becca790c04ca52a6482529d2a00a8c20b634e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 9, 2026.

Transparency log

Security for ciph 1.2.2

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.

Select from 2 files

Attestation for ciph-1.2.2.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 Jun 9, 2026.

Transparency log

A 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page