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.
- 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.
- It provides the encrypt program to demonstrate how to encrypt plaintext input using the key files.
- It provides the decrypt program to demonstrate how to decrypt encrypted file.
- It talks about how the RSA encryption/decryption process works, what vulnerabilities exist and how to mitigate them.
- It provides a number of tools to read and dump key files.
- It provides a data generation program: gendata to generate random data using the python faker package.
- It shows how to create a wheel and install it locally using pipenv.
- 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.