Close
0%
0%

TRNG Zero: True Random Number Generator

True Random Number Generator Development Board with ARM Cortex M0 processor and Arduino-compatible.

Similar projects worth following
A TRNG is a device that approaches physical phenomena in order to generate noise, which is converted into numbers.
Normally, we don’t want noise in our signals, but that’s the basis of the TRNG Zero.
This development board will include a flip coin simulator, physical phenomena selector and 5 physical phenomena high precision sensors: Accelerometer, magnetometer, ambient light, temperature and a VLF receiver/amplifier.
The data outputs will be UART ports and GPIOs.

Introduction

Here is a comparison in an image between a TRNG and the PHP rand() function.

(Image from https://www.random.org/analysis/)

We can see a pattern… that is not true randomness.

Let’s see an example:

A temperature sensor gets this data:

21.19 ºC

21.35 ºC

21.41 ºC

21.17 ºC

21.82 ºC

Now we need only the noise in order to use the nature’s randomness:

19

35

41

17

82

Then we can, for example, generate a random bit by taking the last noise digit, n:

If (n <= 5), bit = 0;

Else if (n > 5), bit = 1

1

0

0

1

0

Also, we can generate, for example, SHA-1 hashes:

b3f0c7f6bb763af1be91d9e74eabfeb199dc1f1f

972a67c48192728a34979d9a35164c1295401b71

761f22b2c1593d0bb87e0b606f990ba4974706de

0716d9708d321ffb6a00818614779e779925365c

76546f9a641ede2beab506b96df1688d889e629a

Please follow this project and learn how to generate your own True Random Numbers with this open source development board, TRNG Zero.


ELF-VLF noise source:

The electromagnetic spectrum includes both natural and human generated waves at different frequencies. Fortunately, many of the human RF transmissions at very low frequencies has been stopped. We can hear natural noise between 0 to 2400Hz, which includes: Schumann resonances, Sferics, Tweeks and Whistlers (More info). Thereby, we can spect to get a good randomness quality, but there is a problem, our electrical grid produces a very high unnatural noise at 60Hz/50Hz. So, we have to filter out that noise and keep the remaining 0 to 2400Hz signals. This can be done with high quality filters: 1 low-pass and 1 notch. I have successfully calculated and simulated (LTspice) a good filter circuit:

* For 50Hz, change R1=R4=318.309kohm and R2=R3=6.366Megohm.

Now I have to add an antenna (loop) and amplify the clean noise... Coming up.


Accelerometer / magnetometer

I realized that accelerometers and magnetometers are good noise sources, even those with digital interfaces like TWI. My choice was the Bosch BMC150 sensor, which includes accelerometer and magnetometer in one chip.

I made an experiment like the image above, in order to check the randomness quality. This technique is not sophisticated, but it's a good start: I took the LSB of every sensor reading during 10,000 readings, then I made a 100 x 100 px bitmap representing whether a '0' with a white dot or whether a '1' with a black dot. I made sure to read the sensors not so fast, avoiding to read unchanged values. Here are the results:

View all 2 project logs

Enjoy this project?

Share

Discussions

Terry Daniels wrote 03/15/2016 at 17:12 point

I'd just like to point out that some of these sources might actually decrease the randomness (For example: The ambient lighting may introduce a 60hz sine wave into the mix) I'm not going to pretend to be some kind of expert, but you may want to check on it a bit. Good luck with the project!

  Are you sure? yes | no

Camilo Rojas wrote 03/16/2016 at 00:39 point

Hi Terry. Thank you for you comment. That's the first problem to be blunted. Each of these sources includes a component generated by humans. The 60/50 Hz wave is also introduced into ELF/SLF/ULF/VLF as well as submarine communications, etc. The hardware will include amplifiers and filters for the RF source. Also, the power of the Cortex-M0 processor should be enough to program some digital filters for each source. Anyway, it's a better idea to sense every source outdoors. The key is to know about all of the undesirable components at your location; every location on Earth has very different ones, thats why I called my project "development board". Off course you will get better results away from ovens, artificial light, magnets, RF devices, etc. For example, you can keep the board near to a volcano, light of stars, outside the city, etc (no problem with IoT). Please follow this project in order to get further details. Best regards.

  Are you sure? yes | no

Terry Daniels wrote 03/16/2016 at 18:04 point

So, I don't know if you've already thought of this, but avalanche noise might be really useful as well.

  Are you sure? yes | no

Camilo Rojas wrote 03/16/2016 at 19:07 point

Hi Terry. Yes, I have seen a couple of circuits with a diode as a noise source. There is a lot of natural noise sources, but I can't include all of them. E.g. The ionization chamber with Americium-241 inside some smoke detectors.

This project is in an early stage, then I might include the avalanche noise. However, the board will include a port with GPIOs/Analog inputs for external noise sources.
I'm currently designing a 60Hz notch filter for the VLF source. I'll post details today.
Thank you for your comment. Best regards, Camilo.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates