Need True Random number Generator
-
- Member
- Posts: 73
- Joined: Wed Dec 23, 2015 10:42 pm
Need True Random number Generator
The OSDev wiki states that "True random number generators use physical devices to generate random numbers, whose unpredictability can be traced to the laws of quantum mechanics." Okay, unpredictability is in every part of the laws of quantum mechanics which itself is probabilistic. But how to actually use it to get the random numbers? How to use the 'physical devices'? any example in C please? Please help me, cant find any help on google as of yet :p
The best method for accelerating a computer is the one that boosts it by 9.8 m/s2.
My OS : https://github.com/AshishKumar4/Aqeous
My OS : https://github.com/AshishKumar4/Aqeous
Re: Need True Random number Generator
Hello,
There are plenty of resources on hardware random number generators and quantum random number generators, such as the Quantis TRNG. You would need to interface with these hardware devices which is independent of the language and is specific to that device thus making any common example impossible.
There are plenty of resources on hardware random number generators and quantum random number generators, such as the Quantis TRNG. You would need to interface with these hardware devices which is independent of the language and is specific to that device thus making any common example impossible.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
-
- Member
- Posts: 73
- Joined: Wed Dec 23, 2015 10:42 pm
Re: Need True Random number Generator
Means using specific hardwares and not any hardware? :/ Any other way to generate truly random numbers (not the RTC one)
The best method for accelerating a computer is the one that boosts it by 9.8 m/s2.
My OS : https://github.com/AshishKumar4/Aqeous
My OS : https://github.com/AshishKumar4/Aqeous
Re: Need True Random number Generator
You need special hardware to generate true random numbers. There is no way to do it without such hardware; the most you can do is pseudorandom. This is fine for most applications and video games, so I really don't quite see a problem personally. RTC (and other timers) has nothing to do with random numbers but the current clock tick can certainly be used to seed a base value for generating a pseudorandom number.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
-
- Member
- Posts: 73
- Joined: Wed Dec 23, 2015 10:42 pm
Re: Need True Random number Generator
ya was talking about that only. how does Linux does it?? atleast I can make pretty hard to prefict pseudo randoms :p for my lottery scheduling :p
The best method for accelerating a computer is the one that boosts it by 9.8 m/s2.
My OS : https://github.com/AshishKumar4/Aqeous
My OS : https://github.com/AshishKumar4/Aqeous
-
- Member
- Posts: 1146
- Joined: Sat Mar 01, 2014 2:59 pm
Re: Need True Random number Generator
I'm not sure of the implementation details but in short Linux uses arbitrary pieces of data from as many sources as possible (including, most importantly, device drivers) as a source of "random noise" for the random number generator. The more sources of data there are, the better this works. A lot of the randomness comes down to the randomness of the user - for example, one source of data is the mouse driver, and the randomness therein lies in the many different ways that the user moves the mouse, and likewise with the hard drive driver, where the randomness comes from the user's interaction with the computer and what hard drive activity that causes.ashishkumar4 wrote:ya was talking about that only. how does Linux does it?? atleast I can make pretty hard to prefict pseudo randoms :p for my lottery scheduling :p
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Re: Need True Random number Generator
There is an interesting paper on the topic here. I have not read through all of it yet but it is quite complicated.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
- Schol-R-LEA
- Member
- Posts: 1925
- Joined: Fri Oct 27, 2006 9:42 am
- Location: Athens, GA, USA
Re: Need True Random number Generator
Wikipedia: Hardware Random Number Generator
Some, though AFAIK not all or even most, modern motherboards do incorporate a thermal-noise HRNG; if yours does, you would need the details of the specific hardware, or its chipset API, in order to access it. Since this is not well standardized, it would have to a hardware-specific driver, so it could not be relied on for general use on stock hardware.
Perhaps more fruitfully, the latest Intel (since 2013) and AMD (since 2015) x86-64 CPUs incorporate an instruction, RDRAND, that combines multiple entropy sources with an AES conditioning algorithm and a pseudo-random number algorithm to produce (supposedly) cryptographically secure random values. There is some controversy in using it, however,; while AFAIK no backdoors have been reproducibly reported in the Intel or AMD entropy production mechanisms, there's enough doubt of their honestly and lack of faults that hardly anyone wants to use the output without some sort of additional entropy generation. Most RNGs that use it only take as one randomness source out of many, for example using it to select from a set of several PRNGs for generating a sequence numbers over a given time frame (say, half a second), shuffle the PRNG list, generate a seed for the PRNG, and/or set the time for the next re-seeding.
Some, though AFAIK not all or even most, modern motherboards do incorporate a thermal-noise HRNG; if yours does, you would need the details of the specific hardware, or its chipset API, in order to access it. Since this is not well standardized, it would have to a hardware-specific driver, so it could not be relied on for general use on stock hardware.
Perhaps more fruitfully, the latest Intel (since 2013) and AMD (since 2015) x86-64 CPUs incorporate an instruction, RDRAND, that combines multiple entropy sources with an AES conditioning algorithm and a pseudo-random number algorithm to produce (supposedly) cryptographically secure random values. There is some controversy in using it, however,; while AFAIK no backdoors have been reproducibly reported in the Intel or AMD entropy production mechanisms, there's enough doubt of their honestly and lack of faults that hardly anyone wants to use the output without some sort of additional entropy generation. Most RNGs that use it only take as one randomness source out of many, for example using it to select from a set of several PRNGs for generating a sequence numbers over a given time frame (say, half a second), shuffle the PRNG list, generate a seed for the PRNG, and/or set the time for the next re-seeding.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
-
- Member
- Posts: 73
- Joined: Wed Dec 23, 2015 10:42 pm
Re: Need True Random number Generator
:O never knew about that. gonna search more on this
The best method for accelerating a computer is the one that boosts it by 9.8 m/s2.
My OS : https://github.com/AshishKumar4/Aqeous
My OS : https://github.com/AshishKumar4/Aqeous