Previous | Table of Contents | Next |
Next, because we want to write the key values (PIN code and unblocking key) into the file, we select the file we just created:
C016 A416 0016 0016 0216 0016 0016
We issue a Get Response command to retrieve the description of the file just to make sure that everything is okay:
C016 C016 0016 0016 0F16
And we get back
0016 0016 0016 1716 0016 0016 0116 3F16 4416 FF16 4416 0116 0116 0016 0016
which you can read like your name by now.
Everything looks fine, so well go ahead and write the PIN code, the unblocking key, and their attempt parameters into the file using the Update Binary command:
CLS | INS | Offset High | Offset Low | No. Bytes to Write | Data to Write |
---|---|---|---|---|---|
C016 | D016 | 0016 | 0016 | 1716 | 0116 FF16 FF16 3116 3216 3316 3416 FF16 FF16 FF16 FF16 0F16 0F16 3116 3216 3316 3416 3516 3616 3716 3816 0F16 0F16 |
The 23 bytes written into the PIN file exactly match the description of the PIN file given in Table 5.11.
If we now read back the 23 bytes we put into the PIN file
C016 B016 0016 0016 1716
we get this:
0116 FF16 FF16 3116 32163316 3416 FF16 FF16 FF16 FF16 0F16 0F16 31163216 3316 3416 3516 3616 3716 3816 0F16 0F16
This is exactly what we wanted. The PIN code is 1234, the unblocking key is 12345678, and both will take 15 sequential failures before blocking. Notice that by making the trailing 4 bytes of the PIN code FF16, we have indicated that this is only a 4-digit PIN, since the default fill byte for keys is FF16. The Verify PIN command:
CLA | INS | P1 | Key Number | Key Length | PIN |
---|---|---|---|---|---|
C016 | 2016 | 0016 | 0116 | 0816 | 3116 3216 3316 3416 FF16 FF16 FF16 FF16 |
now returns this:
9016 0016
While were at it, lets go ahead and use the Update Binary command to add keys 0 and 2 into the external authorization key file, 001116, in the root directory. Set key 0 to SCDK1997:
C016 D616 0016 0116 0C16 0816 0016 5316 4316 4416 4B16 3116 3916 3916 3716 0516 0516
and key 2 to 37743128:
C016 D616 0016 1916 0C16 0816 0016 3316 3716 3716 3416 3316 3116 3216 3816 0716 0716
The first key allows 5 failed attempts before blocking and the second key allows 7. Obviously, you can use these commands with your own key values to set and reset the keys on your own card.
Previous | Table of Contents | Next |