It must have been a long day and a late night butand after reading all the great responses (i.e. sanity checks) below, I seem to have come back to my senses and jettisoned the poorly thought out, home-made crypto idea. :)
- Generate a unique shared symmetric key (K)
- Generate a TAN (Transaction Authentication Number) File (S)
- Copy K and S into the server's database and the device'ssmart card's secure element
- It loads the S file and selects a nonce (n) i.e. n = S[0]
- It invalidates the nonce by deleting it from the S file (prevents replay attacks)
- It creates a message by concatenating the amount and the nonce i.e. m = v || n
- It creates an enciphered text (e1) i.e. e1 = H(K,m) where H = "HMAC-SHA-1" or "CBC-MAC-Y" i.e ISO/IEC 9791-1 Algorithm 3
- It converts the encipherenciphered text to base 10 and sends it (via SMS) to the linkeduser's mobile phone
- It deducts the amount from the user's server-side balance
- It loads the S file and selects a nonce (n) i.e. n = S[i] where i = 0
- It creates a message by concatenating the amount and the nonce i.e. m = v || n
- It creates an enciphered text (e2) i.e. e2 = H(K,m) where H = "HMAC-SHA-1" or "CBC-MAC-Y" i.e ISO/IEC 9791-1 Algorithm 3
- If e1 != e2, it repeats steps (1)-(3) whilst incrementing (i) up to 20 times (to allow for drift). If a match does not exist, if outputs an error message and quits
- If e1 == e2, it accepts the value as a credit to the user's client-side balance
- Finally, it invalidates all the nonces tried in step (1) by deleting them from the S file