Skip to main content

Encrypts and decrypts files using a pass phrase.

Project description

This Python package provides tools for encrypting and decrypting files with Daniel Bernstein’s ChaCha20 stream cipher, using a key derived from a pass phrase. Encrypted files include a Poly1305 authentication tag to detect tampering with an encrypted file.

Warning

This is still a work in progress, published here for testing only. Do not use it for anything important. The file formats and encryption algorithms are subject to change, which could leave you with encrypted files that you cannot decrypt.

Installation

Install this package with pip:

python3 -m pip install --pre chafe

The pypi package name is “chafe”. The python module installed with this command is named “chacha”. The –pre option is needed because the current version of this package is a pre-release.

Usage

The package provides two entry points named encrypt and decrypt. That means that if this module is in your Python path then the module can be used as follows:

To encrypt a file named myfile:

% python3 -m chacha.encrypt myfile

You will be prompted for a password, and an encrypted file named myfile.cha will be created. The password will be visible until the encryption is finished, then erased. (So write it down on a piece of paper before it disappears!) Note that the erasure uses ANSI escape sequences which will not work correctly if the terminal window is too narrow.

To decrypt myfile.cha:

% python3 -m chacha.decrypt myfile.cha

You will be prompted for the password, and a decrypted file named myfile will be created. The password will be visible until the decryption is finished, then erased.

If you install this module with pip and have configured your path to make your pip-installed scripts available, then the commands will simply be:

% chacha-encrypt myfile

and

% chacha-decrypt myfile.cha

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

chafe-1.0.0b2.tar.gz (67.2 kB view details)

Uploaded Source

Built Distribution

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

chafe-1.0.0b2-cp313-cp313-macosx_10_13_universal2.whl (121.4 kB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

File details

Details for the file chafe-1.0.0b2.tar.gz.

File metadata

  • Download URL: chafe-1.0.0b2.tar.gz
  • Upload date:
  • Size: 67.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for chafe-1.0.0b2.tar.gz
Algorithm Hash digest
SHA256 06679169dc0738ad78f173ca41af83a99a4c2c3782551c1ac9d171ffbc87bc6c
MD5 182686b1fa0744233d6cf461491c8c92
BLAKE2b-256 7a18c78cea285ba4d5bfca666ea9aec34829f7abc32aa201e388ede7b13b94b3

See more details on using hashes here.

File details

Details for the file chafe-1.0.0b2-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for chafe-1.0.0b2-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 9fa32300273f0421c4856dd3087b2c0c2b49796982d1281972df85518e535cb7
MD5 63ebaf1548c8793b9d94de88a7562746
BLAKE2b-256 89f496e0d97189baa5d36197847880fd97f0214e954df95e2a662791a0bd5253

See more details on using hashes here.

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