Skip to content

patrick1011/py_rsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toy RSA Implementation

THIS IMPLEMENTATION OF THE RSA ALGORITHM IS MISSING VITAL SECURITY FEATURES. IT IS NOT SECURE. FOR EDUCATIONAL PURPOSES ONLY.

This project includes:

  • An RSA key generator.
  • A Flask server which listens for incoming encrypted messages.
  • A client which sends encrypted messages to the above server.

The project is inspired by the exposition of the RSA cryptosystem in 'Understanding Cryptography', A Textbook for Students and Practitioners by Christof Paar, Jan Pelzl, Bart Preneel (ISBN: 8601406549616).

Generating RSA keys

Run the following to log a set of RSA keys to the terminal:

python -m key_generator.main

Lanching the server to listen for messages

Paste the PRIVATE_EXPONENT and MODULUS generated above into server/settings.py then run

python -m server.api.main

Incoming messages are listened to at /. To be processed POST the following to /

{
  "ciphertext": CIPHERTEXT GOES HERE
}

Incoming messages will be logged to server/message_log.txt

Using the client to send messages to the server

Paste the PUBLIC_EXPONENT and MODULUS generated above into client/settings.py. Also specify a URI to send the encrypted message to.

Insert some plaintext into client/plaintext_payload.txt and run

python -m server.api.main

About

RSA key generator with toy server and client.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages