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!

Ever wonder how Standard Normal and Student-t Distribution z-tables are generated?

I have created a program on github to answer this question with examples and code samples: https://github.com/jlinoff/ztables. It shows how to generate z-tables for Standard Normal Distributions and Student-t Distributions. It also shows how to generate the z-values for specific probabilities from those distributions without using any special libraries.

The program has been tested using Python 2.7.10 and 3.5.

Simple python web server to demonstrate GET/POST handling and support for embedded Python- round 2

I created a simple python based web server to demonstrate how to use SimpleHTTPServer.SimpleHTTPRequestHandler for handling GET/POST requests. It also demonstrates how to build a system that supports embedded python, templates, create custom URLs, execute local scripts and a number of other things.

It is a single script that acts like a web server, a web server gateway interface and server code so the solution is completely self contained.
Continue reading Simple python web server to demonstrate GET/POST handling and support for embedded Python- round 2