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

Bash script to install python locally without root permissions

This bash script downloads, builds and installs a particular version of python in the location of your choice without requiring root permissions. It also creates a virtual environment that you can activate to use it. It is licensed under the terms of MIT open source license.

This script is also available on github: https://github.com/jlinoff/pybld.git

Continue reading Bash script to install python locally without root permissions

Bash function that accepts white space arguments

This example shows how to create a bash function that will accept white space arguments. This doesn’t come up often but when it does I have to re-discover how to do it. This little reminder will make that rediscovery process unnecessary.
Continue reading Bash function that accepts white space arguments

Bash script to install gcc 4.8.4 and boost 1.57 on CentOS and Mac OS X

The bld.sh script provided installs gcc 4.8.4 and boost 1.57.0 on CentOS and Mac OS X for testing. It is another entry in my continuing series of releases for different versions of g++. Hopefully this will make it easier for folks that want to experiment with this version of the GNU C++ compiler to use C++-11 constructs.

This script is also available on github: https://github.com/jlinoff/gcc-4.8.4-boost-1.57.

Continue reading Bash script to install gcc 4.8.4 and boost 1.57 on CentOS and Mac OS X

Simple python web server to demonstrate GET/POST handling

This blog describes a simple open source (MIT licensed) web server that demonstrates how browser/server interactions work for GET and POST requests using the python BaseHTTPServer package. It was updated to version 1.2 on 20-May-2015. This software is licensed under the term of the MIT license. Feel free to use it however you wish.

Use it as a starting point to understand the package when creating your own custom web server for handling specific types of requests but recognize that it is not suitable for a production environment. To use it in such an environment you would, at the very least, want to add improve the error handling and add threading support. You would probably also want to add SSL/TLS support.
Continue reading Simple python web server to demonstrate GET/POST handling

p4-whodunit.py – a python script to display who changed each line of code in a perforce depot file

This script (p4-whodunit.py) will analyze a perforce depot file to determine and report who changed each line of code. It is useful for tracking down recent changes that might have caused a problem. It is covered by the MIT license. You can download it here.
Continue reading p4-whodunit.py – a python script to display who changed each line of code in a perforce depot file

Javascript example that shows how to use the forge package to encrypt/decrypt objects

This example shows how to use the forge package to encrypt and decrypt objects. It also shows how to define a number of useful prototypes and other utility functions.
Continue reading Javascript example that shows how to use the forge package to encrypt/decrypt objects

Bash script to install gcc-4.9.2 with boost 1.57 on CentOS 5.x, CentOS 6.x and Mac OS X

This week I created a script to install the gcc-4.9.3 compiler and linker with boost 1.5.7. A very simple Makefile is also available. Both files are based on scripts I have created for earlier versions of the compiler. This version also includes tcmalloc for linux platforms.
Continue reading Bash script to install gcc-4.9.2 with boost 1.57 on CentOS 5.x, CentOS 6.x and Mac OS X

Bash script to fix the shellshock vulnerability on Mac OS X 10.9.5 (CVE-2014-6271)

This script will build and install a new version of bash and sh from source that will fix the bash shellshock vulnerability on Max OS X 10.9.5 until the official patch is released from Apple. It requires the XCode command line tools. If you do not have the XCode command line tools installed, I have made pre-built versions of bash and sh available for download.
Continue reading Bash script to fix the shellshock vulnerability on Mac OS X 10.9.5 (CVE-2014-6271)

Bash files to install gcc-4.8.3 and gcc-4.9.1 with boost 1.56 on CentOS 5.x, CentOS 6.x and Mac OS X

This week I created scripts to install gcc-4.8.3 and gcc-4.9.1 with boost 1.56. Here is the simple Makefile.
Continue reading Bash files to install gcc-4.8.3 and gcc-4.9.1 with boost 1.56 on CentOS 5.x, CentOS 6.x and Mac OS X

Bash script to build and install valgrind 3.9.0 with memory limits of 128GB, 256GB and 512GB on linux-x86_64

Valgrind must have fixed memory limits so that it can accurately track the memory allocations of the program under test. On 64 bit architectures it is limited to 64GB. This script will download, modify and build valgrind for larger memory configurations.
Continue reading Bash script to build and install valgrind 3.9.0 with memory limits of 128GB, 256GB and 512GB on linux-x86_64

Bash script to install gcc 4.9.1 and boost 1.55.0 on CentOS 6.x, CentOS 5.x and Mac OS X 10.9

The bld.sh script provided installs gcc 4.9.1 and boost 1.55.0 on CentOS 6.x, CentOS 5.x and Mac OS X for testing. It is another entry in my continuing series of releases for different versions of g++. Hopefully this will make it easier for folks that want to experiment with this version of the GNU C++ compiler.

This script is also available on github: https://github.com/jlinoff/gcc-4.9.1-boost-1.55.

Continue reading Bash script to install gcc 4.9.1 and boost 1.55.0 on CentOS 6.x, CentOS 5.x and Mac OS X 10.9

lock_files.py – a python command line tool to encrypt or decrypt files using AES encryption and a common password

lock_files.py is a python command line tool to encrypt or decrypt files using AES encryption and a common password. You can use it lock files before they are uploaded to storage services like DropBox or Google Drive.

It is available from github: https://github.com/jlinoff/lock_files. You will find a more complete description of the tool including the command line options there.

Phonegap barcode scanner app using ionic and angularjs

I created a full implementation of a phonegap barcode scanner app using the ionic and angularjs frameworks for the platforms supported by com.phonegap.plugins.barcodescanner. The platforms supported are Android, iOS and Windows Mobile. It is available from github: https://github.com/jlinoff/PgBarcodeScanner.git.
Continue reading Phonegap barcode scanner app using ionic and angularjs

Bash script to install gcc 4.8.3 and boost 1.55.0 on CentOS 6.x, CentOS 5.x and Mac OS X 10.9

The bld.sh script provided installs gcc 4.8.3 and boost 1.55.0 on CentOS 6.x, CentOS 5.x and Mac OS X for testing. It is another entry in my continuing series of releases for different versions of g++. Hopefully this will make it easier for folks that want to experiment with this version of the GNU C++ compiler.

This script is also available on github: https://github.com/jlinoff/gcc-4.8.3-boost-1.55.

Continue reading Bash script to install gcc 4.8.3 and boost 1.55.0 on CentOS 6.x, CentOS 5.x and Mac OS X 10.9

Automatically install a webserver based on django, nginx and gunicorn on a CentOS 6.5 VPS

This blog presents a bash script that I created to automate the installation of a webserver based on django, nginx and gunicorn on a CentOS 6.5 VPS. The installation installs and configures the necessary system packages, and it installs a number of javascript tools like jquery, jquery-ui, datatables, flot, fancytree and others.
Continue reading Automatically install a webserver based on django, nginx and gunicorn on a CentOS 6.5 VPS