Git Product home page Git Product logo

trng's Introduction

trng

Adapted from www.kerrywong.com/2014/10/19/using-arduino-dues-true-random-number-generator/

trng is a small Go package that provides an io.ReadCloser of random entropy which can be used for cryptographic purposes.

The project is based on the work of Kerry D. Wong, who demonstrated how to extract the random data from the onboard TRNG generator on the SAM3X chip that powers the Arduino Due.

The major change from Wong's work is the raw 32bit output of the TRNG is transmitted to the host and can be directly used as a source of random entropy (Wong's work transmitted the data as string representation of a 32bit signed integer).

documentation

godoc.org/github.com/davecheney/trng

performance

The serial connection between the atmel and the host computer runs at 230,400 baud, which is slightly faster than the SAM3X can produce random data. In benchmarking entropy is produced at a rate of 18kB/sec.

% random-bits | dd of=/dev/null bs=1k count=1k iflag=fullblock
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 58.1198 s, 18.0 kB/s

usage

  1. Load the ardunio-due-trng sketch onto your Ardunio Due. It has to be a SAM3X powered device, older 8bit Atmega Arduinos do not have the hardware trng device.

  2. Either use this package, see the example in godoc, or use the supplied random-bits example program.

    % random-bits | dieharder -a -g 200

security

"Is this really secure? Can I trust you?"

No, this probably isn't secure. No, you shouldn't trust me, it's possible that i've screwed up and the random data isn't actually that random.

trng's People

Contributors

davecheney avatar morontt avatar

Watchers

Peter avatar

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.