Demonstrate the RSA Algorithm

Released the rsa_demo project on github over the weekend to demonstrate how RSA works from key generation and data generation through encryption to decryption.

Here are some of the features.

  1. It provides the keygen program to generate PKCS#1 compatible keys and an ssh-rsa compatible public key from large prime numbers. The generated files can be read by openssl and openssh.
  2. It provides the encrypt program to demonstrate how to encrypt plaintext input using the key files.
  3. It provides the decrypt program to demonstrate how to decrypt encrypted file.
  4. It talks about how the RSA encryption/decryption process works, what vulnerabilities exist and how to mitigate them.
  5. It provides a number of tools to read and dump key files.
  6. It provides a data generation program: gendata to generate random data using the python faker package.
  7. It shows how to create a wheel and install it locally using pipenv.
  8. It shows how to create mypy stubs for pyasn1 and faker.

This system should not be used for production. It is only meant to help folks get started in the wonderful world of asymmetric encryption. See the disclaimer in the repository for more details.

Enjoy!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.