Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Java Truly Random Number Generator  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 9511
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Paul Cowan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh, very cool. Thanks! I always though /dev/random was more complicated than that.
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can obtain random number manually or automatically through a java program from Random.org. They accept HTTP or CORBA connections.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!