Building in serial number scheme

Nelson Zink zink at newmex.com
Sun Jan 20 03:05:01 EST 2002


Richard,

> I'd appreciate hearing any thoughts on ways to build in serial number
> protection.

Have the serial number met one or more tests.  Credit card numbers aren't
random, they're selected (generated?) to fulfill several tests. The
following will authenticate a 16 digit credit card number such as Visa. This
is what stops someone from making up a number and using it online.

put the CreditCardNumber into temp
repeat with zz=1 to 8
    put 2*(char ((2*zz)-1) of temp) into CC
    if CC>=10 then put (cc mod 10)+1 into char ((2*zz)-1) of temp
    else put CC into char ((2*zz)-1) of temp
  end repeat
  put empty into TT  # sum all digits
  repeat with zz=1 to the number of chars of temp
    add char zz of temp to TT
  end repeat
  if TT mod 10 is not 0 then put "Number in error, re-enter Credit Card"
number."

As long as you're not going for ultra security, the kinds of tests can be
about anything you can devise. The even digits totaled mod something and the
odd digits totaled mod something. Every third digit totaled has to end in 7.
And so on. The scheme for Revolution uses your name, etc. Some charToNum
stuff going on there. It could be as simple as using your name and company
name to generate a number, the serial number.  When entered, all must match.

Nelson





More information about the use-livecode mailing list