The `crypto` library provides a simple command-line interface for symmetric Gnu Privacy Guard (gpg) encryption and decryption of one or more files on Unix and Linux platforms. It acts as a wrapper around the external `gpg` command-line tool. Encryption is performed using the AES256 cipher algorithm. The current version is 1.4.1. While the GitHub repository shows some minor activity, the last PyPI release was in 2015, indicating a low maintenance or stable (feature-complete but not actively developed) status for this specific Python package.
pip install cryptoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `crypto` library via its command-line interface from within a Python script using `subprocess`. It encrypts a temporary file and then decrypts it to standard output. Note that `gpg` must be installed on your system, and the `crypto` and `decrypto` commands must be in your system's PATH. You will be prompted for a passphrase by `gpg` during execution.
Evaluate your actual cryptographic needs. If you require programmatic access to low-level crypto primitives or a modern, actively maintained library, use `cryptography` or `PyCryptodome`. If you specifically need to interact with `gpg` from Python, `python-gnupg` might be a more suitable library.
Always verify the source and purpose of a cryptographic library. For new projects, prefer `cryptography` or `PyCryptodome` which are actively maintained and clearly distinguish themselves.
Install `gpg` on your operating system (e.g., `brew install gpg` on macOS, `sudo apt-get install gnupg` on Debian/Ubuntu) and ensure it's accessible in your system's PATH.
For critical applications, assess the risks of using an un-updated library for encryption. Consider alternatives like `cryptography` or `PyCryptodome` which have active development and regular security updates. If using `chrissimpkins/crypto`, ensure your underlying `gpg` installation is kept up-to-date independently.