A package that implements assymetric encryption and description using rsa
Project description
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 import RSAEncryption
# Create an instance of the RSAEncryption class
rsa = RSAEncryption()
# Encrypt with public key
original_text = 'Hello, this is a secret message!'
encrypted_text = rsa.encrypt_with_public_key(original_text)
print('Encrypted Text:', encrypted_text)
# Decrypt with private key
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 = "-----BEGIN PUBLIC KEY-----
YOUR_PUBLIC_KEY_HERE
-----END PUBLIC KEY-----"
PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----
YOUR_PRIVATE_KEY_HERE
-----END PRIVATE KEY-----"
To generate keys
Generate Private Key
openssl genpkey -algorithm RSA
Generate Public Key
openssl rsa -pubout -in <(openssl genpkey -algorithm RSA)
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].
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
Built Distribution
Close
Hashes for rsa_crypto_python-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96d9716f2850bc241779ca06c20efe0403092f740370b40556a46b52d9ce2f4e |
|
MD5 | 4580be9b55a72a6912426f99af782468 |
|
BLAKE2b-256 | 46309cf20f66972c8a1e27edc53ac597197f0baad02052bba6584b21bb6cd836 |