Skip to content

BahirHakimy/rsa_encryptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📖 RSA Encryptor

RSA Encryptor A minimal implemetation of asymetric encryption operations using RSA

Functionalities include:

  • File encryption and decryption
  • File signature and verification

Setup

Prerequisites

In order to run this project you need to:

Install

Install the package via pip

pip install rsa_encryptor

Usage

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')

👆

Authors

Bahir Hakimi

  • LinkedIn
  • Gmail
  • Twitter

👆

Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

👆

Show your support

If you like this project leave a start for it.

👆

Acknowledgments

The package functionalities are based on rsa by sybrenstuvel.

👆

License

This project is MIT licensed.

👆

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages