Skip to content

EarthCam-TRNG is a True Random Number Generator utilizing camera feeds from around the globe as a source of entropy for a custom Node.js blockchain, EarthChain

Notifications You must be signed in to change notification settings

michaelkazman/earthcam-trng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EarthCam-TRNG

Earthcam-TRNG Logo

Runtime Environment

The tested operating environment(s) are listed below:

  • Ubuntu 20.04.1 LTS

Installation

To install all required dependencies, execute the bash installation script (from the project's root directory):

./install.sh

NodeJS is also required for executing the EarthCoin blockchain, and can be installed with the following:

apt-get install nodejs

Execution

Earthcam-TRNG is being utilized in a simple blockchain application, courtesy of Alfrick Opidi, known as Earthcoin.

Images from around the world are scraped, permuted, and combined to create a series of random bytes.

The bytes are then fed into the blockchain application in the form of a nonce (number used once) for SHA256 hash generation.

The process described above can be executed with the following command (may take ~1 minute for execution to complete):

node blockchain/main.js

Image Scraper

The image scraper uses OpenCV and Streamlink to establish a connection with multiple sources like EarthCam and YouTube. From this, a multitude of streams are looked at, and the current frame of that stream is grabbed and passed to the rest of the pipeline.

The following images show images taken from the corresponding streams here.

Shibuya, Japan Las Vegas, U.S.A
Cryptographic Tux Shuffled Cryptographic Lenna Image

Image Scrambler

The image scrambler permutes every pixel of the provided images (down to the individual RGB values).

An example of an image before and after scrambling is provided below.

Source Image Shuffled Image
Cryptographic Tux Shuffled Cryptographic Lenna Image
Cryptographic Lenna Image Shuffled Cryptographic Lenna Image

Image Converter

After xoring the scrambled images, the resulting image is measured in terms of entropy. Specifically the R, G, and B channels of the image are measured for entropy separately and averaged to generate a single output value. If the image contains enough entropy, the image is converted to a series of bytes (to be used elsewhere).

The histogram below showcases the frequency of byte values taken from images processed through the entire system.

Architecture

The system's entire architecture can be seen in the following image. Architecture Diagram

Dependencies

  • opencv-python (4.5.1.48)
  • streamlink (2.0.0)
  • numpy (1.20.1)
  • pandas (1.2.3)
  • scipy (1.6.1)

About

EarthCam-TRNG is a True Random Number Generator utilizing camera feeds from around the globe as a source of entropy for a custom Node.js blockchain, EarthChain

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages