Computer Systems Security

Demos

Demo

Date

Biased Stream Cipher

1/25/2018

This demo is a small program which will encrypt an image by generating a stream of pseudorandom pixels, and adding it to the image to obtain a ciphertext. You can set the bias of the pseudorandom number generator (PRNG) used to produce this stream using the slider bar. Download the script: stream.py

You can invoke the script like this:
./stream.py [--pre-cache] <jpeg>

Note that this program only works for JPEGs, and the encryption is very slow. Use it only on small images. The –pre-cache flag tells the program to first compute all of the encrypted images it will display before showing the UI so that the UI is more responsive once it loads.

NOTE: You will need to install scipy, numpy, and PIL. If you have the pip installer for Python, you can install these as follows (note that you may need to install these as root (i.e., using sudo)):

pip install scipypip install numpypip install PIL

One Time Pad

1/25/2018

This demo is a small program will demonstrate the pitfalls of key re-use with one time pads.
Download the script: pad.py

You can invoke the script like this:
python pad.py <imageKey-path> <image1-path> <image2-path>

NOTE: You will need to install cv2 and numpy. If you have the pip installer for Python, you can install these as follows (note that you may need to install these as root (i.e., using sudo)):

pip install opencv-pythonpip install numpy

openSSL: A command line cryptography toolbox

2/2/2018

If you don’t yet have openSSL installed on you machine, you can get it using the instructions on their download page here.
It is installed on the department machines already.

Once you have openSSL installed, you can run any of the scripts from this directory. To view the scripts you can use cat and to edit them, type “vi ” and press i and you will be able to edit it. You can always use the man pages for each command to find what it does and what the arguments are. We provide the demos as a starting point and urge you to explore on your own!