Inspired by Cloudflare's LavaRand, this project is a conceptual implementation of how to stream an image data taken from a webcam to feed the system entropy pool (/dev/urandom). The goal of this project is to flood the entropy pool with more random data which can be used for cryptographycally secure random number generator. Keep in mind that since this is just a conceptual, this project might consists of an imperfect and inefficient implementation.
The project consists of 3 programs:
stream
: The main program which streams image data captured from the webcam into /dev/urandom entropy poolencryption
: Example of how you might use the entropy pool for encryption processdecryption
: Example of how you might use the entropy pool for decryption process
To make this work, a webcam is required to capture an image of external environment. The captured image will be read as a multichannel matrix which represents pixel values in every color channels (red, green, blue). Let's say that the matrix is called an "image matrix". The next step is to split the channels within the image matrix into individual matrix and stream the value concurrently into the entropy pool. The purpose of this concurrent streaming is to take advantage of race condition, thus add more chaotic factor to the entropy pool.
Below is the diagram which represents the flow of the stream process.
This project uses Gocv to ease the webcam access and image processing operations, thus you are required to install Gocv first before running this project. The installation process could be found in its github page.