Making a TRNG from my PSU?

Gabis1207

Awkward moment when...
Messages
252
Location
Tennessee
Number theorists, this one's for you!

I have been watching a college lecture series on cryptography, by a professor, named Christof Paar, at the University of Bochum, Germany. In one of his lectures, he goes into detail about the internal workings of PRNGs and TRNGs (Pseudo-random number generators, and Truly-random number generators, respectively), how they're implemented, and so on and so forth.

Being the curious person that I am, I'm looking to create my own TRNG. The problem with this is, I need an outside source of data, that is fundamentally unpredictable. Since I don't have a spare geiger counter and some uranium laying around, nor do I have any equipment to measure atmospheric noise, I thought I would use something a little easier to measure, electric current.

As you may have inferred from the title of my post, the source of the electric current that I thought I might use is my very own PSU (The 5v rail, in particular).
I have noticed, based on a graph that I generated over about a 2-minute span, using HWMonitor, that the voltage output bounces between 5.00 volts and 5.04 volts, at seemingly random intervals. While two minutes is probably not long enough to arrive at a definitive answer, it illustrates the point I am trying to get at.

--Click here for graph--

Cue questions:

  1. Based on the graph, linked above, is there a possibility that the data captured by HWMonitor could be used to generate random bits?
  2. Also based on the graph, would using the change in voltage generate enough entropy to be considered "Truly random"?
  3. Aside from using a 3rd party application, like HWMonitor, is there a way to read sensor output, using C/C++, or a similar O.O. language?

Thanks in advance,
Gabis
 
Would be more reliable to get the data via a dedicated voltage probe rather than through software - software has quite a large margin of error and you'll be able to pick up more "noise" directly through the probe, creating a better random-number generation IMO.

You can then use that data as a seed value to generate random numbers.
 
Is there some sort of expansion card for that, or do you think I'd have to jurry rig something out of some multimeter probes
 
Is there some sort of expansion card for that, or do you think I'd have to jurry rig something out of some multimeter probes

I'm sure that USB or serial multimeter probes are available - would most likely come with software as well. If you could log that data as raw values to something like a text file...then you could create a simple program to read those values in and use them as seed values or whatever.
 
Even if an external device would help pick up more noise, my computer can already measure the voltage coming from my 5v rail, and it would seem that there's enough entropy to power a TRNG. "If HWMonitor didn't require an external voltage meter, why should I?" is what I'm thinking here. :p
 
Because software sensors aren't very accurate nor necessarily reliable.

Noise coming from an electrical line will be quite random, and give a nice seed value, or even could be used as a random number generator itself.
 
to clarify, you mean an electrical line in my PSU, not coming from my wall, correct? :p

Well...either honestly.

There'll be more noise coming directly from the wall versus coming out one of the rails of the PSU. If it's a good PSU, at least, it's going to have some filtering inside so there won't be as much noise coming out of one of the rails.

Also, measuring directly from the rail with a dedicated hardware probe will give more accurate results, may result in the 5v rail you're watching not actually bouncing around as much as HWMonitor shows.
 
A good 5v dc voltage would be a straight line, with no fluctuations.
A wall current which should be around 120v will have an alternating current and your graph would look like a oscilloscope, with 120 going negative and 120 going positive @ 60 hrtz (approximately) and this may vary as per load placed on the line. There is a 10% variance excepted for service from your power utility company
 
Last edited:
Back
Top Bottom