Any relevant experience I have has been legally protected from disclosure (should be obvious why). However, I can give a few pointers:-

1) although random generation would be a headache (gets slower as it has to check more and more used codes), pseudo random generation can work because it covers each possibility once for a consecutive set of integers. But you want much larger primes than are used in the trivial linked example.

2) use a secret, obscure but consistent filter to remove the majority of generated codes and enable a validity test e.g. filter out anything that isn't a factor of a certain prime (not a suggestion -- too insecure -- but an indication of what such a filter is). The test should significantly reduce the candidate valid codes, so plenty of size is needed for each code to leave enough left over - 16 bytes is popular for codes which are matched against a validity list but more are needed for unmatched codes which rely on a validity algorithm, depending on the inclusion percentage of the filter you select, so that enough valid codes remain over a significant period of possible usage.

3) Two-way encryption is needed after that, because filtering after encryption is arguably too transparent and one-way encryption after filtering would prevent validity testing. GnuPG contains enough ammunition for this.

-M

Free your mind


In reply to Re: Serial Generation and Validation by Moron
in thread Serial Generation and Validation by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.