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.
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.
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
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.
Continue reading Bash script to install python locally without root permissions
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
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.
Continue reading Bash script to install gcc 4.8.4 and boost 1.57 on CentOS and Mac OS X
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
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
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.
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
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)
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
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.
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 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.
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
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.
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
Continue reading Automatically install a webserver based on django, nginx and gunicorn on a CentOS 6.5 VPS
I recently had to install virtualbox on CentOS 6.5 to debug a problem. It was a bit tricky so I decided to blog what I did.
Continue reading How I installed virtualbox 4.3 on CentOS 6.5 x86_64
This blog describes how I set up a CentOS 6.5 VPS dev host for RDP access using “Microsoft Remote Desktop” from my Mac.
Continue reading How I setup my CentOS 6.5 VPS for RDP access