Skip to main content

RSA Encryption

Project description


This module implements the RSA encryption algorithm. Functions included are generate_key_pair(bits) which returns a dictionary containing p, q, phi, public, private, modulus, and the time it took to generate the key pair ("time"). encrpyt(message, encryption_key, modulus) to encrypt a message, and decrypt(cipher, decryption_key, modulus) to decrypt a cipher. To install the module, run pip install rsa_python. Below is an example how to use the module.

from rsa_python import rsa
key_pair = rsa.generate_key_pair(1024)
cipher = rsa.encrypt("Hello World!", key_pair["public"], key_pair["modulus"])
decrypted_message = rsa.decrypt(cipher, key_pair["private"], key_pair["modulus"])

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

rsa_python-0.1.1.tar.gz (3.1 kB view hashes)

Uploaded source

Built Distribution

rsa_python-0.1.1-py3-none-any.whl (3.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page