Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SecureRandom

 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey -- um, anybody know what the heck this baby does? I'm actually just concerned with it in the context of:

I'm using it with the commons-id framework and wondering how likely it is to get two identical random numbers if they're called close enough together, or if Sun's implementation of this algorithm magically does something to make it "unlikely."

Well, any help would be wonderful.
 
john guthrie
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
secure random is a pretty solid implementation of a PRNG. it's not based at all on system clock, so when you try to generate the random numbers should have nothing to do with the RNs you get. also, from the name it looks like it hashes the entropy value, so even if the two values were time-based (and close together) the hash would change that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic