📄 099-100.html
字号:
<!-- Edit EirGrabber 3.01 -->
<HTML>
<HEAD>
<TITLE>Smart Card Developer's Kit:The Schlumberger Multiflex Smart Card</TITLE>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="096-098.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="100-102.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>Next, because we want to write the key values (PIN code and unblocking key) into the file, we select the file we just created:
</P>
<P>C0<SUB>16</SUB> A4<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB> 02<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB></P>
<P>We issue a <TT>Get Response</TT> command to retrieve the description of the file just to make sure that everything is okay:</P>
<P>C0<SUB>16</SUB> C0<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB> 0F<SUB>16</SUB></P>
<P>And we get back</P>
<P>00<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB> 17<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB> 01<SUB>16</SUB> 3F<SUB>16</SUB> 44<SUB>16</SUB> FF<SUB>16</SUB> 44<SUB>16</SUB> 01<SUB>16</SUB> 01<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB></P>
<P>which you can read like your name by now.</P>
<P>Everything looks fine, so we’ll go ahead and write the PIN code, the unblocking key, and their attempt parameters into the file using the <TT>Update Binary</TT> command:</P>
<TABLE WIDTH="100%"><TR>
<TH WIDTH="13%" ALIGN="LEFT" VALIGN="BOTTOM">CLS
<TH WIDTH="13%" ALIGN="LEFT" VALIGN="BOTTOM">INS
<TH WIDTH="13%" ALIGN="LEFT" VALIGN="BOTTOM">Offset High
<TH WIDTH="11%" ALIGN="LEFT" VALIGN="BOTTOM">Offset Low
<TH WIDTH="20%" ALIGN="LEFT">No. Bytes to Write
<TH WIDTH="30%" ALIGN="LEFT" VALIGN="BOTTOM">Data to Write
<TR>
<TD COLSPAN="6"><HR>
<TR>
<TD VALIGN="TOP">C0<SUB>16</SUB>
<TD VALIGN="TOP">D0<SUB>16</SUB>
<TD VALIGN="TOP">00<SUB>16</SUB>
<TD VALIGN="TOP">00<SUB>16</SUB>
<TD VALIGN="TOP">17<SUB>16</SUB>
<TD>01<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB> 31<SUB>16</SUB> 32<SUB>16</SUB> 33<SUB>16</SUB> 34<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB> 0F<SUB>16</SUB> 0F<SUB>16</SUB> 31<SUB>16</SUB> 32<SUB>16</SUB> 33<SUB>16</SUB> 34<SUB>16</SUB> 35<SUB>16</SUB> 36<SUB>16</SUB> 37<SUB>16</SUB> 38<SUB>16</SUB> 0F<SUB>16</SUB> 0F<SUB>16</SUB>
</TABLE>
<P>The 23 bytes written into the PIN file exactly match the description of the PIN file given in Table 5.11.
</P>
<P>If we now read back the 23 bytes we put into the PIN file</P>
<P>C0<SUB>16</SUB> B0<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB> 17<SUB>16</SUB></P>
<P>we get this:</P>
<P>01<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB> 31<SUB>16</SUB> 32<SUB>16</SUB>33<SUB>16</SUB> 34<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB> 0F<SUB>16</SUB> 0F<SUB>16</SUB> 31<SUB>16</SUB>32<SUB>16</SUB> 33<SUB>16</SUB> 34<SUB>16</SUB> 35<SUB>16</SUB> 36<SUB>16</SUB> 37<SUB>16</SUB> 38<SUB>16</SUB> 0F<SUB>16</SUB> 0F<SUB>16</SUB></P>
<P>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 FF<SUB>16</SUB>, we have indicated that this is only a 4-digit PIN, since the default fill byte for keys is FF<SUB>16</SUB>. The <TT>Verify</TT> PIN command:</P>
<TABLE WIDTH="100%"><TR>
<TH WIDTH="10%" ALIGN="LEFT">CLA
<TH WIDTH="10%" ALIGN="LEFT">INS
<TH WIDTH="10%" ALIGN="LEFT">P1
<TH WIDTH="21%" ALIGN="LEFT">Key Number
<TH WIDTH="21%" ALIGN="LEFT">Key Length
<TH WIDTH="28%" ALIGN="LEFT">PIN
<TR>
<TH COLSPAN="6"><HR>
<TR>
<TD VALIGN="TOP">C0<SUB>16</SUB>
<TD VALIGN="TOP">20<SUB>16</SUB>
<TD VALIGN="TOP">00<SUB>16</SUB>
<TD VALIGN="TOP">01<SUB>16</SUB>
<TD VALIGN="TOP">08<SUB>16</SUB>
<TD>31<SUB>16</SUB> 32<SUB>16</SUB> 33<SUB>16</SUB> 34<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB>
</TABLE>
<P>now returns this:
</P>
<P>90<SUB>16</SUB> 00<SUB>16</SUB></P>
<P>While we’re at it, let’s go ahead and use the <TT>Update Binary</TT> command to add keys 0 and 2 into the external authorization key file, 0011<SUB>16</SUB>, in the root directory. Set key 0 to <TT>SCDK1997</TT>:</P>
<P>C0<SUB>16</SUB> D6<SUB>16</SUB> 00<SUB>16</SUB> 01<SUB>16</SUB> 0C<SUB>16</SUB> 08<SUB>16</SUB> 00<SUB>16</SUB> 53<SUB>16</SUB> 43<SUB>16</SUB> 44<SUB>16</SUB> 4B<SUB>16</SUB> 31<SUB>16</SUB> 39<SUB>16</SUB> 39<SUB>16</SUB> 37<SUB>16</SUB> 05<SUB>16</SUB> 05<SUB>16</SUB></P>
<P>and key 2 to <TT>37743128</TT>:</P>
<P>C0<SUB>16</SUB> D6<SUB>16</SUB> 00<SUB>16</SUB> 19<SUB>16</SUB> 0C<SUB>16</SUB> 08<SUB>16</SUB> 00<SUB>16</SUB> 33<SUB>16</SUB> 37<SUB>16</SUB> 37<SUB>16</SUB> 34<SUB>16</SUB> 33<SUB>16</SUB> 31<SUB>16</SUB> 32<SUB>16</SUB> 38<SUB>16</SUB> 07<SUB>16</SUB> 07<SUB>16</SUB></P>
<P>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.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="096-098.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="100-102.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -