Communication between a SmartCard and a SodaMachine


This document describes the communication protocol between a smart card and a soda machine.


List of keys:
Km Issued by bank, common to all soda machines and all smart cards.
Ksc The unique shared key between the bank and a smart card.
Kasc Issued by bank, common to all smart cards, not known by soda machines.
Ksm The unique shared key between the bank and a soda machine.
Kasm Issued by bank, common to all soda machines, not known by smart cards.
Kses Session key for communication between a smart card and a soda machine


Each smart card has a unique id IDsc stored in plain text on the smart card. It also has IDsc' on it; IDsc' is { IDsc }Kasm, since the smart card does not know the key, it cannot decrypt IDsc'. This can be viewed as the digital signature of the smart card verified by the certifying authority, the bank. Similarly each soda machines has a unique id IDsm stored in plain text on it. It also has IDsm' on it, IDsm' is { IDsm }Kasc. This again cannot be decrypted by the soda machine, and is the digital signature of the soda machine signed by the bank.

Now the protocol between the smart card and the soda machine proceeds in the following manner: The protocol has two phases - Phase 1 and Phase 2. In Phase 1, the smart card and the soda machine establish a session key. In Phase 2, they use this session key to complete the transaction between them.
(In the following explanation SC stands for smart card and SM stands for soda machine)

Phase 1:

Steps Explanation
SC -> SM : IDsm, { Na }Km Smart card sends its ID and a nonce encrypted by the key Km to the soda machine
SM -> SC : { Kses, Na, Nb }Km Soda machine replies with the nonce and another nonce, alongwith a session key it generates, everything encrypted by the shared key
SC -> SM : { Nb } Km Smart card sends back the nonce to soda machine, from this point onwards both of them agree to use the session key for future communication i.e. in Phase 2

Phase 2:

Steps Explanation
SM -> SC : { IDsm, IDsm', Na }Kses Soda machine sends its ID in plain text and its digital signature alongwith a nonce to the smart card, everything encrypted by the session key established in Phase 1
SC -> SM : { IDsc, IDsc', B1, B2, Na, Nb }Kses Smart card verifies the signature of the soda machine, then sends its own ID and signature, together with the plain text balance, and its encrypted form. It also sends back the nonce sent by soda machine. It generates a second nonce and sends it to the soda machine, everything is encrypted by the session key
At this point the soda machine verifies the signature of the smart card, verifies that B1 and B2 are okay, verifies that the smart card has sent the correct nonce. Then it displays the balance and waits for the user to chose a soda. After the user selects a soda, the following is done
SM -> SC : { B1', B2', Logsm, Nb, Nc }Kses Soda machine computes the new balance B1', and its encrypted form B2', sends the log of the transaction encrypted by its shared key with the bank, sends back the nonce generated by the smart card, and sends a new nonce, everything is encrypted by the session key.
The log is of the following form:
  • IDsm : unique identifier of the soda machine.
  • {IDsm}KSodaMachine : unique identifier encrypted with a unique key known only to the machine and bank
  • Amount : self-explanatory. Cleartext amount of transaction.
  • {Amount}Ksm : amount encryted so that only the issuing soda machine and bank can read it.
At this point, the smart card checks if the nonce Nb sent by the soda machine is correct. It computes its own log from the difference in B1 and B1'. It commits B1', B2' and Logsm.
SC -> SM : { commit, Logsc, Nc }Kses The smart card commits the above log, it then generates its own log by looking at the difference of B1 and B1', and sends that encrypted by its shared key with the bank, along with the nonce sent by the smart card. Everything is encrypted by the session key.
The log is of the following form:
  • IDsc : unique identifier of the smart card.
  • {IDsc}Ksc : unique identifier encrypted with a unique key known only to the smart card and bank
  • Amount : self-explanatory. Cleartext amount of transaction.
  • {Amount}Ksc : amount encryted so that only the issuing smart card and bank can read it
At this point the soda machine checks if the nonce sent by the smart card is the correct one. Then it commits Logsc on its memory and dispenses the soda to the user.

Security Analysis:


Last updated on Sep 18th, 2002