Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/04/01 15:42
Read: times


 
#17244 - smart card security code randomization
I am working on an 8051 based product which will add monetary value to a smart card. The user will insert their smart card and punch in a 10 digit authorization code which has been generated from a Windows app. This code contains the amount of value to add along with some other important data.

My main obstacle is determining how to encode this data so as to make these authorization codes both unique and random. Each smart card has a 10-digit serial number. I am thinking of using this serial number along with a table of 100 random values to generate the authorization code using the following algorithm.


Given:

serial_number[] = 10 character array, each character contains a digit of the serial number

Data = 4 bytes (2 bytes of info + 2 byte CRC)

Table[][] = an array of 10 arrays each containing 10 4-byte random value (2 dimensional table of 100 random 4-byte values)

Digit = current digit of 10-digit serial number

Value = variable to hold value of current serial number digit

^ = bitwise exclusive OR operator

Code = 10 digit authorization code to be generated


Algorithm:

Code = Data

for Digit = 0 to Digit = 9

Value = serial_number[Digit]

Code = Code ^ Table[Digit][Value]



Questions:

1) How effective is this algorithm in terms of randomization and uniqueness?

2) What's the best way to generate 100 4-byte random values?

3) How happy am I that I get to do this in C vs assembly?


List of 4 messages in thread
TopicAuthorDate
smart card security code randomization            01/01/70 00:00      
RE: smart card security code randomization            01/01/70 00:00      
RE: smart card security code randomization            01/01/70 00:00      
RE: smart card security code randomization            01/01/70 00:00      

Back to Subject List