aspose file tools*
The moose likes Java in General and the fly likes Java Truly Random Number Generator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Truly Random Number Generator" Watch "Java Truly Random Number Generator" New topic
Author

Java Truly Random Number Generator

Paul Cowan
Greenhorn

Joined: Nov 01, 2002
Posts: 9
Hi,
While working on a Perl project, I came across the Math::TrulyRandom library that claims to be able to generate truely random number from reading interrupt timing discrepancies. Sounds like a very cool idea, which leads me to wonder if this is possible in Java. Has anyone seen a Java library that can do this? Seems like if you can do it in Perl, you should be able to do it in Java, (or C and use JNI to access it.)
... Or on top of that, anyone know what an interrupt timing discrepancy is? :roll:
As an aside, I ran across a serial port device which generates random bits from "two independent analogue Zener diode based noise sources". Costs like $650. (I think... the site is in Europe).
http://valley.interact.nl/av/com/orion/rng/home.html
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Wow, how random do you have to get? I've heard of some high end encryption systems using electronic noise or heat variations to seed their RN generators. Pretty wild.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Originally posted by Paul Cowan:
Hi,
... Or on top of that, anyone know what an interrupt timing discrepancy is? :roll:

Anything that triggers an interrupt (activity on the keyboard, mouse, disk, network and so on) is assumed to occur with a random period, so one compiles that information as it occurs for later use. On Linux, this pool is stored in /dev/random, so to use it in Java, just open that pool as you would any file.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Paul Cowan
Greenhorn

Joined: Nov 01, 2002
Posts: 9
Ahh, very cool. Thanks! I always though /dev/random was more complicated than that.
Chris De Vries
Ranch Hand

Joined: Dec 05, 2002
Posts: 65
You can obtain random number manually or automatically through a java program from Random.org. They accept HTTP or CORBA connections.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Truly Random Number Generator