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.0b1.tar.gz (67.1 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.0b1-cp313-cp313-macosx_10_13_universal2.whl (121.3 kB view details)

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

File details

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

File metadata

  • Download URL: chafe-1.0.0b1.tar.gz
  • Upload date:
  • Size: 67.1 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.0b1.tar.gz
Algorithm Hash digest
SHA256 b5917324021544676d5116d393be49eac89a1cdf52fc88215b3831660f07cdc6
MD5 b3c26e8ad1a434538ff6c89b195463a2
BLAKE2b-256 3986dd1cb3434cfb47fa2a5d7952f4f40b6b2cfe5a64360dfed168ccdb5f62aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chafe-1.0.0b1-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 f512b6ac5e5d34139de577c6411127aa3ae5d33ed19296fd429b57b31b08696c
MD5 7f9f437c6a5d3ea10d4e97913bfc72bc
BLAKE2b-256 a5712e1d46543b49c8074cd8240078ab4f8908d025eefc84c8d7f676891a11f0

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