RSA Encryption Python Package
A Python package for asymmetric encryption using RSA.
Installation
pip install rsa-crypto-python
Usage
from rsa_crypto_python.rsa_crypto_python import RSAEncryption
# Create an instance of the RSAEncryption class
rsa = RSAEncryption()
# rsa = RSAEncryption(env_file_path=None)
# crypt private_to_public
original_text = 'Hello, this is a secret message!'
encrypted_text = rsa.encrypt_with_private_key(original_text)
print('Encrypted Text:', encrypted_text)
decrypted_text = rsa.decrypt_with_public_key(encrypted_text)
print('Decrypted Text:', decrypted_text)
# crypt public_to_private
original_text = 'Hello, this is a secret message!'
encrypted_text = rsa.encrypt_with_public_key(original_text)
print('Encrypted Text:', encrypted_text)
decrypted_text = rsa.decrypt_with_private_key(encrypted_text)
print('Decrypted Text:', decrypted_text)
Configuration
Set your public and private key paths in a .env file:
PUBLIC_KEY_PATH=/path/to/your/keys/public_key.pem
PRIVATE_KEY_PATH=/path/to/your/keys/private_key.pem
To generate keys
Generate Private Key
openssl genpkey -algorithm RSA -out keys/private_key.pem
Generate Public Key
openssl rsa -pubout -in keys/private_key.pem -out keys/public_key.pem
Contributing
- Fork the repository
- Create a new branch (
git checkout -b feature/awesome-feature) - Commit your changes (
git commit -am 'Add awesome feature') - Push to the branch (
git push origin feature/awesome-feature) - Create a new Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Thanks to the cryptography library for providing the tools for secure communication.
Author
Ukweh Everest
Contact
For any inquiries, please contact [exrelativity@gmail.com].
Metadata
Release files for rsa-crypto-python 2.0.4
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 | |
|---|---|---|---|---|
| rsa-crypto-python-2.0.4.tar.gz | 3.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rsa_crypto_python-2.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / rsa-crypto-python-2.0.4.tar.gz
| Download URL | rsa-crypto-python-2.0.4.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8e4121d82f5c4b6d18f63b3c4421737be891bf49edf8e2ab0b76d82ea6d15e8
|
|
BLAKE2b-256 checksum How to use checksums |
17a23b36c7501041672df1869e255dbe9b68d0954a131f12988472c3e1ba48af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Release files / rsa_crypto_python-2.0.4-py3-none-any.whl
| Download URL | rsa_crypto_python-2.0.4-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e838ac3887436f8f1d67f213ea76d8c90a3e2ecfce8fe3cb9f095b6f34ac488
|
|
BLAKE2b-256 checksum How to use checksums |
c764d18546a6fda57dc1d71fb5defd0091d346ac104e1deb293a3b2b03cca2c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Security for rsa-crypto-python 2.0.4
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.