Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Problem running code until a user hits a key

by dsheroh (Parson)
on Dec 31, 2007 at 03:03 UTC ( #659695=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Problem running code until a user hits a key
in thread Problem running code until a user hits a key

Yep, I did catch that you're seeding multiple PRNGs. My criticism of the method is based on the notion that, since most users will let it run for about the same amount of time each time you do this 'press a key to seed next PRNG' process, you'll end up with a set of seeds which is more predictable than the output of rand. e.g., If the average user has a 0.1 second variance in their response times, then an attacker would only have a range of about 10,000 seeds (based on your "about 100K iterations per second") to check, with those near the middle of the range being much more likely to occur. Granted, each user may have a different range of likely response times, but many users would probably have similar enough ranges that the set of likely seeds would still be smaller than the set of possible results from a mere 16-bit PRNG.


Comment on Re^3: Problem running code until a user hits a key
Download Code
Re^4: Problem running code until a user hits a key
by davies (Vicar) on Dec 31, 2007 at 12:04 UTC
    Even if the range is only 1,000 for each PRNG, things explode exponentially. What I'm actually trying to do is deal Bridge hands. There are 5.36E28 different hands that can be dealt, so even a 24 bit PRNG could cover only a tiny fraction, which may not be representative. My strategy is based loosely on the Enigma coding machine, but with a variation.

    The idea is that the user will first select the sequence of PRNGs that will be used. The sequence will not be of fixed length (unlike Enigma, which had a set number of wheels) and PRNGs can be repeated within the sequence (again unlike Enigma, where a wheel could be used only once in any day's setting). Let's say that the attacker knows that a sequence of five PRNGs will be used without repeats, because he knows the Tournament Director. Even at a range of 1,000, that's 1.2E17 different series of deals that might come up. Since he won't see the first board before he starts playing, he won't have much time to work out what the other boards are likely to be. Getting access to the boards before play would be far easier, but that's beyond the scope of this lecture :-).

    Thanks again for all the help,

    John Davies

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://659695]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2014-07-10 06:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (202 votes), past polls