Balance Reader and ZC3.9 Cards


[ Follow Ups ] [ BasicCard User Forum ]

Posted by johnd (82.70.141.126) on December 23, 2008 at 11:13:15:

Hi;

I'm developing an SHA-1 based OTP solution, using ZC3.9 cards and the ZeitControl balance reader, and I'm having a little trouble!

My algorithm seems OK, but I have two code instances which execute fine in the debugger, or when executed from a terminal program, but which fail using the balance reader.

1) I want to generate 8 character numeric passwords, and Str$() supresses leading zeroes.

Using the Balance Reader Example (where Data is a String to be displayed)

OTP = Str$(Abs(Count) Mod 100000000)
Data = OPT

works in the debugger and the reader,

as does

OTP = Str$(Abs(Count) Mod 100000000)
Data = "0" + OPT

But

eeprom Zeroes as String *7 = "0000000"
prefix$ = Left$(Zeroes,(8-Len(OTP)))
Data = prefix$ + OTP

works in the debugger and terminal, but displays "ERROR" in the balance reader.

2) And probably entirely unconnected (?)

call ShaStart()
call ShaAppend(CardKey)
call ShaAppend(CountString)
HashArray = ShaEnd()

Reports "Error" using the reader (but not the Terminal)

and
call ShaStart()
call ShaAppend(CardKey + CountString)
HashArray = ShaEnd()

works with both.

Has anyone any idea what might be going on ?

jd




Follow Ups:


[ Follow Ups ] [ BasicCard User Forum ]