RSA Encryptor A minimal implemetation of asymetric encryption operations using RSA
Functionalities include:
- File encryption and decryption
- File signature and verification
In order to run this project you need to:
- Install Python
Install the package via pip
pip install rsa_encryptor
Encryption
from rsa_encryptor import Encryption
# Create an object
encryptor = Encryption()
# Generate keys or load recivers public key using encryptor.load_keys(public_key_path='path_to_public_key.pem')
encryptor.generate_key_pair()
# You can export keys as .pem
encryptor.export_keys()
# Encrypt a file
encryptor.encrypt_file('path_to_file')
Decryption
from rsa_encryptor import Encryption
# Create an object
encryptor = Encryption()
# Load your private key
encryptor.load_keys(private_key_path='path_to_private_key.pem')
# Decrypt an encrypted file
encryptor.decrypt_file('path_to_encrypted_file')
Signature
from rsa_encryptor import Signature
# Create an object
signer = Signature()
# Generate keys or load your private key using encryptor.load_keys(private_key_path='path_to_private_key.pem')
encryptor.generate_key_pair()
# Sign a file
signer.sign('path_to_file')
Signature Verfication
from rsa_encryptor import Signature
# Create an object
signer = Signature()
# Generate keys or load your private key using encryptor.load_keys(private_key_path='path_to_private_key.pem')
# Load senders public key
encryptor.load_keys(public_key_path='path_to_public_key.pem')
# Verify the signature
signer.verify('path_to_file','path_to_signature')
Bahir Hakimi
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
If you like this project leave a start for it.
The package functionalities are based on rsa by sybrenstuvel.
This project is MIT licensed.