Generating a large sequence of unique, random numbers

From: Ulrich Eckhardt (doomster_at_knuut.de)
Date: 05/27/03


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 !


Relevant Pages

  • Ontracks - still very unimpressed
    ... You have lost the argument so you resort to abuse. ... surprise me! ...
    (uk.rec.models.rail)
  • Re: RAP!!!
    ... lost, unless they have (surprise, surprise) a marketing company to ... We all know that talented musicians are not necessarily great self-promoters or business people, so if they don't get good support, they are lost. ... Suppression implies actively holding someone down against their will, or in some circumstance in which holding them down doesn't make sense. ...
    (alt.guitar.bass)
  • Re: Culpability Brown
    ... which are beyond the imagination of most economists to predict. ... Deflation means falling ... Surprise, surprise, ... They have lost control, lost the plot, and lost confidence ...
    (uk.local.kent)
  • Re: The WB announces midseason changes (Related is toast)
    ... > No surprise that The WB has finally dumped Related. ... The show lost an ... > amazing 60% of its lead-in last night. ... > drama then returns to its original Monday time period, following 7TH HEAVEN, ...
    (rec.arts.tv)
  • Re: Hs-124V-1
    ... On Mar 29, 12:09?pm, "Jukka O. Kauppinen" ... ...lost out to the Me Bf 110 ... No surprise:) ... bombers. ...
    (rec.aviation.military)

Quantcast