Cryptum
Overview
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.
Features
- Generate RSA public/private key pairs
- Encrypt files using public keys
- Decrypt files using private keys
- Command-line interface for easy use
Installation
Install Cryptum using pip:
pip install cryptum
Usage
Command-line Interface
Cryptum provides a command-line interface cryptcli.py for easy use.
Help
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.
Generate New Private/Public Keys
cryptcli.py -g
Encrypt a File
cryptcli.py -e -f test.txt -k pub.txt
This command encrypts test.txt using the public key in pub.txt.
Decrypt a File
cryptcli.py -d -f test.txt.enc -k priv.txt
This command decrypts test.txt.enc using the private key in priv.txt.
Python API
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)
Development
To set up the development environment:
- Clone the repository
- Install development dependencies:
pip install -r requirements-dev.txt
- Run tests:
pytest
Continuous Integration and Deployment
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.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
[0.0.3] - 2024-08-15
- Added Python API documentation
- Added proper test suite with pytest
- Improved error handling in CLI
[0.0.1] - 2020-02-02
- Initial release
Contact
For questions and support, please open an issue on the GitHub repository.
Metadata
Release files for cryptum 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cryptum-0.0.3.tar.gz | 15.9 kB | Without provenance | Details for cryptum-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cryptum-0.0.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for cryptum-0.0.3-py2.py3-none-any.whl |
Total release size: 29.5 kB
Release files / cryptum-0.0.3.tar.gz
| Download URL | cryptum-0.0.3.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
503834b43771bf10e8d21930bf08618cde4bf4d73b21f92a8639d4d50e5d86d5
|
|
BLAKE2b-256 checksum How to use checksums |
d7059128a20a4bca1b5d4e702dc07d2a1eebf5fc4fd740ec2b4dd43e02e699ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Release files / cryptum-0.0.3-py2.py3-none-any.whl
| Download URL | cryptum-0.0.3-py2.py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c6300c356c80bfc9ef206666a1d156420f7dc868fce8935eaa1b2cd6426eb7db
|
|
BLAKE2b-256 checksum How to use checksums |
d97731052caf28db6d0615adc9d804dc4a04599f5a57c560459d6a8a28400988
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Security for cryptum 0.0.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.