Giter VIP home page Giter VIP logo

redoubler's Introduction

REDOUBLER

REDOUBLER is a Random Number Generator based on Modular Entropy Multiplication. It is Open Source Hardware. The device plugs into a host's USB port, and enumerates as a standard microphone. When the microphone is sampled it produces white noise which contains a high proportion of random entropy. The digital data behind that white noise is random numbers, and they can be recorded and used for any purpose that requires a non-deterministic entropy source.

REDOUBLERs, Shucked and Not

By enumerating as a standard USB microphone (sound card with one input) REDOUBLER does not require drivers on any major operating system. This simplifies development, and reduces the "attack surface" that an adversary can use to compromise security. Moreover, the data paths used by microphones are highly optimized for efficiency.

Modular Entropy Multiplication

Non-deterministic random number generators use various methods to gather entropy. Avalanche noise from reverse-biased semiconductor junctions is popular, but others include video of Lava Lamps, radios tuned away from stations, quantum effects, digital logic race conditions, and radioactive decay events. Modular Entropy Multiplication (MEM) is a new method.

Invented by the author, Peter Allan, in the late 1990's and independently by Bill Cox in the early 2010's, MEM repeatedly compares a voltage with the midpoint of its range, then doubles either the voltage or excess over the midpoint as appropriate, and stores the result. Depending on the comparison, either a '0' or a '1' bit is output.

As a circuit, the analog part of MEM looks like this

Analog part of MEM Circuit

The Track and Holds store the voltages, one for the source voltage and one for the result. The Comparators compare the stored voltages with the midpoint of their range, and produce a digital output based on the result. The Opamps double the input voltage and, depending on the result of the comparison, shift it by the voltage range. The clocks q and qp are symmetric and non-overlapping and control the pace of the circuit, while the output bits are collected at c0 and c1. When recorded over time, the analog voltages have characteristic time traces like this.

MEM Traces

In the REDOUBLER, all of the components except the resistors are reconfigurable analog blocks on a Cypress Semiconductor PSoC 5LP chip. It has two such generators operating simultaneously at 768,000 bps, for a combined output of 1,536,000 bps. The bit-stream has about 7.9 bits/byte of entropy, and is not whitened, leaving the host to apply a whitening filter if required. Here is one second worth of data as an image (click twice to see it full-scale).

One Second of Data

Modular Entropy Multiplication has advantages over all other methods because it is simultaneously simple, efficient, fast, and robust. It uses common components, used within their specified ranges. It is amenable to implementation on silicon, and has proven resistant to external electrical influence, even when unshielded. Bill and I hope that REDOUBLER and his Infinite Noise TRNG are just the beginning for this method, and we have disclaimed any patent rights to the technology.

The Circuit

The REDOUBLER circuit is designed in the latest free version of CadSoft Eagle and files are in the circuit branch of this repository.

Schematic

The PSoC chip contains both reconfigurable analog components and digital logic, so the only components unique to REDOUBLER are the eight resistors at top-right.

Board

A Bill Of Materials is also disclosed. Boards are available from OSH Park.

The Firmware

The firmware for REDOUBLER is written in the highly integrated and free-to-use Cypress PSoC Creator development environment. The source code is in the psoc_creator_firmware branch of this repository. I highly recommend this toolchain and microcontroller product line. The current state of the firmware source is efficient and reliable, but a little rough looking. The USB audio functions were culled from an example project, and much of that code remains in comments.

Once the firmware is built, it can be programmed onto a REDOUBLER using the $90 MiniProg3 or the left portion of the $10 CY8CKIT-059. Pogo Pins are useful for connecting to the 5 pads on the REDOUBLER board.

REDOUBLER uses a USB product ID granted by openmoko.org.

Host Software

As open source software, users are asked to contribute their developments back to this repository. For now support is sparse. Anything that can be done with a USB microphone can be done with REDOUBLER. Linux is likely to be best supported, but Windows and Mac OS-X will have branches here too. Audacity runs on all three platforms, and can be used to record, view, manipulate and save data from REDOUBLER, so we know everything's possible.

Ultimately the goal is for REDOUBLER to be plugged into any flavor of machine, and have the operating system's random number generator immediately enhanced with copious high-quality entropy.

redoubler's People

Contributors

alwynallan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redoubler's Issues

Doesn't seem to be working.

Hi Peter,

When I plug my DIY version into USB, it enumerates as a microphone, and the light starts up when I start monitoring the microphone's levels' but listening to it through PC speakers sounds like a square wave. Similarly when I probe the external resistors around the op amps I see square wave at about 19.23 Hz, 4.8V peak-to-peak.

I tried both 8.2K and 9.1K resistors paired with the 10K's per your diagram. at the op amps I should be seeing something more like the scope-like traces you put in the README, right?

I'm thinking there may be something wrong with the clock generation that is feeding the S/H's. Any ideas or suggestions? I'll see if I can send that out to a pin as well.

P.S. the blue LED on the board is flickering, but the pulse width is rather narrow, so it doesn't get very bright. It is at least interesting in that the pulse width in varying.

Integration with Linux

On a Debian system I can install the package 'rng-tools5' and use this tool to redirect the entropy from a device (like /dev/video0) to the random device (/dev/random). I was wondering what is the correct device under /dev/ for the microphone.

Modular Entropy Multiplication?

This is very interesting, I was considering prototyping something similar using a CY8CKIT-059 I have sitting around unused. I'm glad I found your project, thank you Peter.

I'm interested why you use the term MEM to describe it. It doesn't seem to involve modular arithmetic, have I missed something?

10 K ohm vs 9.53K ohm

The schematic diagram in the readme shows the values of R4, R6, R8, and R10 as 9.53K, but the block diagram shows these as all 10K. Is this critical?

Solderless breadboard implementation?

I've got a couple of CY8CKIT-059 modules handy, is there any reason I shouldn't be able to breadboard the external resistors in order to try this out?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.