/Camerash

Little educational app to create entropy/randomness from a video input

Primary LanguageKotlinMIT LicenseMIT

Camerash

GitHub license

A simple app that creates randomness from camera frames

Screenshot

Motivations & Background

In France , for our equivalent to A Levels or High-School Degree, one of the exam (TPE - "Tutored Personal Work"), consists of a group work on a specific subject, leading to an oral presentation. Me and my group decided to work on randomness, and among other experiments, like a double pendulum, I made this app, to show how entropy could be created from a video feed. Given that videos are often influenced by a lot of factors, such as lighting, weather, moving objects or even noise from the camera sensor itself, it's safe to assume that the stream is extremely chaotic. For instance, Cloudflare uses lava lamps to produce unpredictable cryptographically-secure encryption keys.

How does it work ?

The camera of the phone captures a video. For each frame:

  • The raw image is acquired as a byte array
  • This byte array is hashed using SHA1
  • We take the first byte of the digest and show it in a TextView
  • We add all the other bytes to a graph that show the good distribution of numbers

Release History

  • Be patient. I'm lazy.