Generating a large sequence of unique, random numbers
From: Ulrich Eckhardt (doomster_at_knuut.de)
Date: 05/27/03
- Next message: Ulrich Wurst: "Re: Minimum memory footprint implementations"
- Previous message: Jean-Luc Cooke: "Re: Minimum memory footprint implementations"
- Next in thread: Ernst Lippe: "Re: Generating a large sequence of unique, random numbers"
- Reply: Ernst Lippe: "Re: Generating a large sequence of unique, random numbers"
- Reply: Kevin G. Rhoads: "Re: Generating a large sequence of unique, random numbers"
- Reply: Benjamin Goldberg: "Re: Generating a large sequence of unique, random numbers"
- Reply: Jean-Luc Cooke: "Re: Generating a large sequence of unique, random numbers"
- Reply: jsavard_at_ecn.ab.ca: "Re: Generating a large sequence of unique, random numbers"
- Reply: Stephan Neuhaus: "Re: Generating a large sequence of unique, random numbers"
- Reply: Danilo Gligoroski: "Re: Generating a large sequence of unique, random numbers"
- Reply: Bob Harris: "Re: Generating a large sequence of unique, random numbers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 27 May 2003 17:51:59 +0200
(f'up set)
Hi everybody!
One note up front, I'm not sure this really is the right place to ask but
I'm a bit lost as to where I should ...
The problem:
Generate n unique codes of length l so that they are non-predictable.
Every e.g. fifth code code gives you access (via the net) to a small
surprise. If challenged, the one that found a code could present a
badge/sticker/whatever to prove his rightful ownership of the code but the
goal is to make the codes hard to forge so that little or no abuse is
possible and those costly proves can be eliminated.
The whole background of where this is used and what those surprises are
and how they are securely transmitted over the web is an SEP[1], I only
need to generate these codes.
My first approach was to use brute force: create codes, ignoring duplicate
ones, but that approach requires large amounts of memory, entropy and
later complicates storing and finding the state (used/unused) in a
database.
My second approach was to simply take the numbers from 0 to n-1 and use
some encrypting or hashing algorithm on them to produce the requested
codes, but already there my knowledge ends. I have no idea whatsoever
which algorithm to use or how to start in general.
The web-interface would then simply decode the code back to the serial and
flip a bit for the state, of course signalling alerts when a code is
forged or (ab)used several times.
I'm thankful for any suggestion.
regards,
Ulrich Eckhardt
[1] SEP: someone elses poblem [D. Adams, Hitchhikers Guide to the Galaxy]
-- Questions ? see C++-FAQ Lite: http://parashift.com/c++-faq-lite/ first !
- Next message: Ulrich Wurst: "Re: Minimum memory footprint implementations"
- Previous message: Jean-Luc Cooke: "Re: Minimum memory footprint implementations"
- Next in thread: Ernst Lippe: "Re: Generating a large sequence of unique, random numbers"
- Reply: Ernst Lippe: "Re: Generating a large sequence of unique, random numbers"
- Reply: Kevin G. Rhoads: "Re: Generating a large sequence of unique, random numbers"
- Reply: Benjamin Goldberg: "Re: Generating a large sequence of unique, random numbers"
- Reply: Jean-Luc Cooke: "Re: Generating a large sequence of unique, random numbers"
- Reply: jsavard_at_ecn.ab.ca: "Re: Generating a large sequence of unique, random numbers"
- Reply: Stephan Neuhaus: "Re: Generating a large sequence of unique, random numbers"
- Reply: Danilo Gligoroski: "Re: Generating a large sequence of unique, random numbers"
- Reply: Bob Harris: "Re: Generating a large sequence of unique, random numbers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|