Method of effecting mutual authentication

Abstract: A random number generated from a host device upon a first mutual authentication or a random number obtained by processing the generated random number is stored in a random number storage area of an IC apparatus and used upon a second mutual authentication.

Description: This invention relates to an IC card system that needs high security, and particularly to a method of mutually authenticating both an IC card and a host device suitable for use in the IC card. This type of mutual authenticating method has heretofore comprised a first certification or authentication for confirming the validity of a host or high level device on the IC card side and a second certification or authentication for confirming the validity of an IC card on the host device side. The first authentication will first be described. The IC card generates a random number RI using a random number generating means incorporated therein and effects an encoding (e.g., enciphering by way of example) process on the generated random number R1 to create data X. Further, the host device receives the random number R1 from the IC card and effects the encoding process on the random number R1 to create data X'. The IC card receives the data X' from the host device and makes a comparison between the data X and X' so as to authenticate the validity of the host device. The second authentication will next be described. The host device generates a random number R2 using a random number generating means provided therein and effects an encoding process on the generated random number R2 to create data Y'. Further, the IC card receives the random number R2 from the host device and effects an encoding process on the random number R2 to create data Y. The host device receives the data Y from the IC card and performs a comparison between the data Y and Y' so as to certify the validity of the IC card. At this time, the generation of the random number for each mutual authentication and the creation of the different X and Y values for each mutual authentication are intended to prevent a malicious third party who has monitored the exchange of telegraphic messages used during the previous mutual authentication, from obtaining the mutual authentication through the exchange of the previously-used same messages with one another. In an IC card system that needs higher security, a process for creating the X and Y values using different encipherment keys is commonly performed in accordance with the first and second authentications. EP-A-0440158 and EP-A-0479617 disclose methods of mutual authentication that use a CPU on the IC card to process a random number received from the host device. An object of the present invention is to provide a method of effecting mutual authentication, which is suitable for eliminating the need of random number generating means such as a hard random number generator, a means for generating a random number by software using a microprocessor, etc. from an IC apparatus. According to the present invention, there is provided a method of mutual authentication for a first device and a second device to be coupled thereto, comprising a first mutual authentication and a second mutual authentication, each authentication comprises first and second authentication processes, the first authentication process comprising encoding a first random number in the first device to provide a first item of data, encoding the first random number in the second device to provide a second item of data and comparing the first and second items of data, the second authentication process comprising encoding a second random number in the second device to provide a third item of data, encoding the second random number in the first device to provide a fourth item of data and comparing the third and fourth items of data wherein during the first mutual authentication deriving a third random number from the second random number and storing the third random number in storage means in the first device during and the second mutual authentication retrieving from the storage means the third random number and using it as the first random number. The deriving the third random number from the second random number may comprise equating the third random number to the second random number. The deriving the third random number from the second random number may comprise processing the second random number to obtain the third random number. The storing of the third random number may be dependent upon the comparison of the first and second items of data in the first authentication process of the first mutual authentication. While the specification concludes with claims particularly pointing out and distinctly claiming the subject matter which is regarded as the invention, it is believed that the invention, the objects, features of the invention and further objects, features and advantages thereof will be better understood from the following description taken in connection with the accompanying drawings in which: Fig. 1 is a view showing a mutual authentication processing procedure of a first embodiment of the present invention; Fig. 2 is a view illustrating a mutual authentication processing procedure of a second embodiment of the present invention; and Fig. 3 is a view depicting a mutual authentication processing procedure of a third embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Fig. 1 shows a mutual authentication processing procedure of a first embodiment of the present invention. The first embodiment will be described with reference to Fig. 1. An IC card(corresponding to IC apparatus)comprises at least a random number storage area 1 composed of an electrically rewritable storing means such as an Electrically Erasable Programmable Read Only memory(hereinafter called an EEPROM) or the like, first and second authentication keys 2 and 3, an encipherment processing means 4 for performing an enciphering process, a comparing means 5 for making a comparison between data, and a first flag 6 for judging whether the validity of a host or high level device has been normally authenticated. On the other hand, the host device includes a first authentication key 2' identical to the first authentication key 2, a second authentication key 3' identical to the second authentication key 3, an encipherment processing means 4', a comparing means 5' and a random number generating means 7. The operation of the first embodiment will now be described. Firstly, the host device requires the IC card to output the data stored in the random number storage area 1. In doing so, the IC card outputs a random number R1 corresponding to the data stored in the random number storage area 1 to the host device (Step 1). Using the encipherment processing means 4', the host device enciphers the random number R1 with the first authentication key 2' to create enciphered data X' and outputs the created enciphered data X' to the IC card (Step 2). Using the encipherment processing means 4, the IC card enciphers the random number R1 with the first authentication key 2 to create enciphered data X. Next, the IC card compares the enciphered data X and the enciphered data X' output from the host device through the use of the comparing means 5. If they match with each other, then the IC card sets "1" to the first flag 6 (Step 3). Next, the host device generates a random number R2 using the random number generating means 7 and outputs it to the IC card (Step 4). Using the encipherment processing means 4, the IC card enciphers the random number R2 with the second authentication key 3 to create enciphered data Y and outputs the created enciphered data Y to the host device. Further, the IC card allows the random number storage area 1 to store the random number R2 therein as a substitute for the random number R1 (Step 5). Using the encipherment processing means 4', the host device enciphers the random number R2 with the second -authentication key 3' to create enciphered data Y'. Next, the host device compares the enciphered data Y and the enciphered data Y' using the comparing means 5'. If they coincide with each other, then the host device judges that the mutual authentication has been completed and proceeds to the next process using an IC card for transactions or the like (Step 6). Incidentally, the first flag 6 is cleared to "0" upon suppliment of the power to the IC card or on its reset. In the case of a process necessary to make a decision as to the validity of the host device subsequent to Step 6, the IC card judges whether the first flag 6 is "1" and the process should be done. According to the first embodiment as described above, since the IC card allows the random number storage area to store the random number R2 generated from the host device as the substitute for the random number R1 upon the present mutual authentication, the IC card outputs the random number R2 corresponding to the data stored in the random number storage area to the host device upon the next mutual authentication when the host device requires the IC card to output the data stored in the random number storage area. Thus, upon the next mutual authentication, the random number R2 is used as a random number utilized for judging the validity of the host device as in the case of the random number R1 used upon the present mutual authentication. Thus, in the first embodiment, the IC card is not required to have the random number generating means therein and hence a chip for the IC card can be simplified in structure. Accordingly, even an IC card with no microprocessor, which is composed of only both simple logic capable of providing enciphering/encoding and a comparison decision and an EEPROM, enables the mutual authentication, whereby a cost-reduced and high-security IC card system can be achieved. Fig. 2 shows a mutual authentication processing procedure of a second embodiment of the present invention. The same elements of structure as those shown in Fig. 1 are identified by the same reference numerals and their description will therefore be omitted. In the second embodiment, a random number processing data area 8 and an XOR circuit 9 are further added to the IC card shown in Fig. 1. The second embodiment is identical in operation to the first embodiment at Steps 1 through 4 but different in operation from the first embodiment at Step 5. In the first embodiment, at Step 5, the random number R2 input from the host device has been stored in the random number storage area as it is. In the second embodiment on the other hand, the random number processing data area 8 and the XOR circuit 9 are provided. The XOR circuit 9 executes exclusive-OR function as to the random number R2 input from the host device and the data stored in the random number processing data area 8. The resultant random number is stored in a random number storage area as a substitute for a random number R1. Thus, when the host device requires the IC card to output the data stored in the random number storage area upon the next mutual authentication, the IC card outputs a random number (corresponding to the random number obtained by executing exclusive-OR function as to the random number R2 and the data stored in the random number processing data area 8) to the host device. Thus, upon the next mutual authentication, the random number obtained by executing the exclusive-OR function referred to above is used as a random number utilized for judging the validity of the host device as in the case of the random number R1 used upon the present mutual authentication. According to the second embodiment as described above, since it is difficult to externally understand that the random number R2 for the present mutual authentication is being used to make a decision as to the validity of the host device at the time of the next mutual authentication, security higher than that obtained in the first embodiment can be achieved. In the second embodiment, even if first and second authentication keys are integrated into one, enciphered data input from the IC card to a comparing means of the host device upon a certain mutual authentication is different in value from enciphered data input from the host device to a comparing means of the IC card upon the next mutual authentication. Thus, in the second embodiment, the IC card can be simplified in structure without decreasing security against those respectively provided with the first and second authentication keys even if the authentication keys are integrated into one. In the second embodiment, the XOR circuit 9 is provided but an AND circuit, an OR circuit or a bit inverter or the like may be provided in place of the XOR circuit 9. Further, the data stored in the random number processing data area 8 may be stored in a mask ROM or the like. Alternatively, the data may be provided within an EEPROM so as to change at regular intervals. Furthermore, the balance data or the like stored in the EEPROM may be utilized as it is without specially providing the random number processing data area 8. Since the balance data is changed in this case each time the IC card is used, an improvement in security can be yielded without the need for changing the data at regular intervals. Further, even if the random number R2 is stored in the random number storage area 1 as it is and the random number R2 and the data stored in the random number processing data area 8 are executed exclusive-OR function at the time of the next mutual authentication and the resultant random number is output to the host device at Step 1 , the same effect as described above can be obtained. Fig. 3 shows a mutual authentication processing procedure of a third embodiment. The third embodiment will be described below with reference to Fig. 3. An IC card comprises at least a random number storage area 1 composed of an electrically rewritable storing means such as an EEPROM or the like, first and second authentication keys 2 and 3, an encipherment processing means 4 for performing an enciphering process, a comparing means 5 for performing a comparison between data, first and second flags 6 and 10, a random number processing data area 8 and an XOR circuit 9. On the other hand, a host device comprises a first authentication key 2' identical to the first authentication key 2, a second authentication key 3' identical to the second authentication key 3, an encipherment processing means 4', a comparing means 5' and a random number generating means 7. The operation of the third embodiment will now be described. First of all, the host device requires the IC card to output the data stored in the random number storage area 1. In doing so, the IC card outputs a random number R1 corresponding to the data stored in the random number storage area 1 to the host device (Step 1). Using the encipherment processing means 4', the host device enciphers the random number R1 with the first authentication key 2' to create enciphered data X' and outputs the created enciphered data X' to the IC card (Step 2). Using the encipherment processing means 4, the IC card enciphers the random number R1 with the first authentication key 2 to create enciphered data X. Next, the IC card compares the enciphered data X and the enciphered data X' output from the host device through the use of the comparing means 5. If they match with each other, then the IC card sets "1" to the first flag 6 and the second flag 10 (Step 3). Next, the host device generates a random number R2 using the random number generating means 7 and outputs it to the IC card (Step 4). Using the encipherment processing means 4, the IC card generates enciphered data Y obtained by enciphering the random number R2 with the second authentication key 3 and outputs the created enciphered data Y to the host device. Further, the IC card checks the second flag 10. If the second flag 10 is found to have been set to "1", then the IC card allows the random number storage area 1 to store therein data obtained by exclusive-ORing the data stored in the random number processing data area 8 and the random number 2 as a substitute for the random number R1, and clears the second flag 10 to "0". Further, if the second flag 10 is found to have been set to "0", then the IC card prohibits a new random number from being stored in the random number storage area 1 (Step 5). Using the encipherment processing mean 4', the host device enciphers the random number R2 with the second authentication key 3' to create enciphered data Y'. Next, the host device compares the enciphered data Y and the enciphered data Y' using the comparing means 5'. If they coincide with each other, then the host device judges that the mutual authentication has been completed and proceeds to the next process for transactions or the like (Step 6). Incidentally, the first flag 6 and the second flag 10 are respectively cleared to "0" upon application of the power to the IC card or upon its reset. In the case of a process needed to perform the mutual authentication subsequent to Step 6, the IC card confirms whether the first flag 6 and the second flag 10 are respectively "1" and "0" and judges whether the next process should be done. According to the third embodiment as described above, the second flag 10 is provided. When the second flag 10 is "0', no new random number is stored in the random number storage area 1. Thus, even if a malicious third party recognizes a method of generating a random number to be stored in a random number storage area and monitors the previously-executed mutual authentication, the third party is not able to store the random number R1 stored ir the random number storage area 1 upon the previous interauthentication in the random number storage area again and execute a first certification or authentication (corresponding to the authentication for judging the validity of the host device) in the same method as described previously. In the third embodiment, the second flag 10 is further added to the second embociment. However, the second flag 10 may be provided in the first embodiment. Namely, the IC card compares the enciphered data X and the enciphered data X' output from the host device through the used of the comparing means 5 at Step 3 in the first embodiment. If they- match with each other, then the IC card sets "1" to the first flag 6 and also sets "1" to the second flag 10. At Step 5, the IC card checks the second flag 10. If the second flag 10 is found to have been set to "1', then the random number R2 is stored in the random number storage area 1 and the second flag 10 is cleared to "0". It is needless to say that the idea of the third embodiment may be applied to the first embodiment in this way. In the IC card system, the mutual authentication is effected on a partial process such as a monetary process or the like according to purposes. There may be cases where most of processes are subjected to only card authentication (second authentication) by the host device. Since no random number is stored in the random number storage area 1 in this case, the number of times that the EEPROM corresponding to the random number storage area is renewed, can be reduced as compared with the first and second embodiments, whereby the effect of increasing the life of the IC card can be brought about. In the first through third embodiments, the enciphering process is performed using the authentication keys. However, an encoding process for executing a given specific process may be performed as an alternative to the enciphering process. If the random number storage area 1 is of an electrically rewritable nonvolatile storing means, then any one may be used. Further, the comparing means 5 and 5' may be-hard means such as a comparator or the like or may be a soft process executed by a microprocessor. However, the use of the comparator as the comparing means 5 on the IC card side makes it possible to simplify the IC card in structure. Incidentally, the polarities of the first flag 6 and the second flag 10 are not necessarily limited to the polarity shown in the embodiment. In the third embodiment, whether or not the second flag 10 is "1" is judged by the comparing means 5 but may be determined by a simple gate means. In the embodiments according to the present invention, the encoding has been described by using the term encipherment by way of example. It is however needless to say that the encipherment processing means may perform the encoding process other than the enciphering process. Incidentally, the present invention is applicable to a system using all sorts of portable data carriers and are not necessarily limited to card forms. While the present invention has been described with reference to the illustrative embodiments, this description is not intended to be construed in a limiting sense. Various modifications of the illustrative embodiments, as well as other embodiments of the invention, will be apparent to those skilled in the art on reference to this description. Therefore the appended claims define the matter for which protection is sought.

Claims: A method of mutual authentication for a first device and a second device to be coupled thereto, comprising a first mutual authentication and a second mutual authentication, each authentication comprises first and second authentication processes, the first authentication process comprising: encoding a first random number (R1) in the first device to provide a first item of data (X), encoding the first random number in the second device to provide a second item of data (X') and comparing the first and second items of data (X, X'), the second authentication process comprising: encoding a second random number (R2) in the second device to provide a third item of data (Y'), encoding the second random number in the first device to provide a fourth item of data (Y) and comparing the third and fourth items of data (Y, Y'), characterised by during the first mutual authentication deriving a third random number from the second random number and storing the third random number in storage means in the first device and during the second mutual authentication retrieving from the storage means the third random number and using it as the first random number (R1). A method according to claim 1 wherein the deriving the third random number from the second random number comprises equating the third random number to the second random number. A method according to claim 1 wherein the deriving the third random number from the second random number comprises processing the second random number to obtain the third random number. A method according to any one of claims 1 to 3 wherein the storing of the third random number is dependent upon the comparison of the first and second items of data in the first authentication process of the first mutual authentication.

Inventors: SHONA YOSHIHIRO, SHONA, YOSHIHIRO, Shona, Yoshihiro, Oki Electric Industry Co., Ltd.
Applicants: OKI ELECTRIC IND CO LTD, OKI ELECTRIC INDUSTRY CO., LTD.
Application year: 1996
Main classification: G07F7
IPC codes: G06K17, G07F7