Cryptum is a simple Python encryption library that generates RSA public/private keys and encrypts data for easy transport between applications and languages. It provides a straightforward CLI interface for key management and file encryption/decryption.
- Generate RSA public/private key pairs
- Encrypt files using public keys
- Decrypt files using private keys
- Command-line interface for easy use
Install Cryptum using pip:
pip install cryptum
Cryptum provides a command-line interface cryptcli.py
for easy use.
cryptcli.py --help
Output:
Usage: cryptcli.py [OPTIONS]
Options:
-e, --encrypt Encrypt input file.
-f, --input_file FILENAME The Input File.
-k, --input_key FILENAME The Public/Private Key to use.
-d, --decrypt Decrypt input file.
-o, --output TEXT Output file.
-g, --generate Generate Encryption Keys.
--version
--help Show this message and exit.
cryptcli.py -g
cryptcli.py -e -f test.txt -k pub.txt
This command encrypts test.txt
using the public key in pub.txt
.
cryptcli.py -d -f test.txt.enc -k priv.txt
This command decrypts test.txt.enc
using the private key in priv.txt
.
You can also use Cryptum as a Python library in your projects. Here's a basic example:
from cryptum import generate_keys, encrypt_file, decrypt_file
# Generate keys
public_key, private_key = generate_keys()
# Encrypt a file
encrypt_file('input.txt', 'input.txt.enc', public_key)
# Decrypt a file
decrypt_file('input.txt.enc', 'output.txt', private_key)
To set up the development environment:
- Clone the repository
- Install development dependencies:
pip install -r requirements-dev.txt
- Run tests:
pytest
This project uses GitHub Actions for continuous integration and deployment. The workflow does the following:
- Runs tests on multiple Python versions (3.7, 3.8, 3.9, 3.10)
- Lints the code using flake8
- Builds the package
- Publishes the package to PyPI on pushes to the main branch
You can view the detailed workflow in the .github/workflows/test-and-publish.yml
file.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Added Python API documentation
- Added proper test suite with pytest
- Improved error handling in CLI
- Initial release
For questions and support, please open an issue on the GitHub repository.