ericlearning / Quick-RSA

A concise implementation of a textbook version RSA.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quick-RSA

A concise implementation of a textbook version RSA. Supports encryption and decryption of an english sentence.

Installation

Use the package manager pip to install Quick-RSA.

pip install quickrsa

Usage

max_len = 128
public_key, private_key = generate.generate_keys(max_len)

message = 'HELLO WORLD'
encrypted_message = encdec.encrypt(public_key, message, max_len)
decrypted_message = encdec.decrypt(encrypted_message, private_key, public_key)

Example code in run.py

usage: run.py [-h] [-l MAX_LEN] [-m MESSAGE]

optional arguments:
  -l MAX_LEN, --max-len MAX_LEN
                        maximum message length
  -m MESSAGE, --message MESSAGE
                        message to encrypt

About

A concise implementation of a textbook version RSA.

License:MIT License


Languages

Language:Python 100.0%