AUTHENTICATION OF SUBSCRIBER STATION

Abstract: The present invention relates to a telecommunication system comprising: at least one subscriber station (MS) in the memory (9, 9') of which a secret key (Ki) is stored, and authentication means (1, 3, 4, VLR) for authenticating said subscriber station. In order to make the subscriber-station-specific secret key even more difficult to crack, the subscriber station (MS) is arranged to check the correctness of a received input (RAND) by computing a message authentication code (MAC) by utilizing the input (RAND) and a checking algorithm (f), and to compute a response to be transmitted to the authentication means (VLR) by the subscriber station (MS) by utilizing an authentication algorithm (A3), said secret key (Ki) stored in the memory (9) of the subscriber station (MS) and the input (RAND) if the input (RAND) is correct on the basis of the message authentication code (MAC).

Description: AUTHENTICATION OF SUBSCRIBER STATION The present invention relates to authenticating a subscriber station, wherein the identity of the subscriber station is verified on the basis of a sub- scriber-station-specific secret key stored in the subscriber station. The invention particularly relates to a solution for identifying an authentication message generated by an external attacker, and for guaranteeing that no such information on processing such authentication message reaches the external attacker that would enable the attacker to crack the secret key. The invention primarily relates to authenticating a subscriber station in a GSM (Global System for Mobile Communications) system. It is to be noted, however, that the invention may also be applied in other connections although in the following the invention will be described mainly referring to the GSM system. In the GSM system, authentication of a subscriber station is based on a request-response procedure. For the authentication, a subscriber-station- specific secret key Ki and authentication algorithm A3 have been stored on the SIM (Subscriber Identity Module) card of the subscriber station. The subscriber-station-specific secret key Ki of the subscriber station and the corre- sponding authentication algorithm A3 have also been stored in an authentication centre of a GSM network. In order to carry out the authentication, a random number generator arranged in the authentication centre first generates a random number and transmits it to a counter as an input. Next, the counter computes a response SRES on the basis of the random number, authentica- tion algorithm A3 and secret key Ki. The authentication centre then transmits the random number and the response SRES to a network element which carries out the actual authentication, which, as regards the GSM system, is a VLR (Visitor Location Register). The visitor location register forwards the received random number to the subscriber station to be authenticated. The subscπber station comprises a counter, which computes a response SRES on the basis of the received random number, secret key Ki of the subscriber station and authentication algorithm A3, and the subscriber station transmits the response SRES to the VLR. The VLR then compares the response transmitted by the authentication centre with the response transmitted by the subscriber station. Since the secret key Ki stored in the memory of the subscriber station is subscriber-station- specific, there is only one subscriber station capable of generating a correct response to the input transmitted thereto. If the responses of the subscriber station and the authentication centre are identical, the subscriber station has thus been authenticated. A drawback of the known authentication procedure described above is that it is possible for an external attacker who desires to crack the secret key stored in the subscriber station to try to crack the secret key by supplying different inputs to the subscπber station (or the SIM card thereof) again and again and monitoring the responses being transmitted from the subscriber sta- tion. When this procedure is repeated frequently enough and statistics is collected about the inputs and responses, the secret key Ki may be revealed on the basis of the collected data. If the external attacker cracks the key, he or she is capable of cloning the subscriber station (or the SIM card) by producing a second subscriber station which has an identical secret key, in which case the cloned subscπber station can be used for making calls, for which the owner of the original subscriber station is billed. An object of the present invention is to alleviate the above- mentioned problem and to provide a solution owing to which it is more difficult for an external attacker to crack a secret key of a subscriber station. The ob- ject is achieved by a method of the invention for identifying an authentication message generated by an external attacker, the method comprising receiving the authenticating message comprising an input. The method of the invention is characterized by checking the correctness of the input by computing a message authentication code by utilizing the input and a checking algorithm, and identifying the authentication message as being generated by the external attacker if the input is incorrect on the basis of the message authentication code. The invention further relates to a telecommunication system wherein a method of the invention can be utilized. The telecommunication system of the invention comprises: at least one subscriber station comprising a counter and a memory with a subscriber-station-specific secret key stored therein, and authentication means for authenticating said subscriber station, the authentication means comprising a random number generator, a counter and a memory with the subscriber-station-specific secret key of said at least one subscπber station stored therein, the authentication means being ar- ranged to: compute a response on the basis of an input, an authentication algorithm and the subscriber-station-specific secret key stored in the memory of the authentication means, transmit said input to said subscriber station, and indicate that the subscriber station has been authenticated if the authentication means receive from the subscriber station a response which corresponds to the response computed by the authentication means. The telecommunica- tion system of the invention is characterized in that the authentication means are arranged to compute said input by utilizing a random number generated by the random number generator and a first algorithm, and that the subscriber station is arranged to check the correctness of the received input by computing a message authentication code by utilizing the input and a checking algo- rithm, compute a response to be transmitted to the authentication means by the subscriber station by utilizing the authentication algorithm, said secret key stored in the memory of the subscriber station and the input if the input is correct on the basis of the message authentication code. The invention further relates to an authentication centre in a tele- communication system, the authentication centre comprising: a random number generator, a counter and a memory with subscriber-station-specific secret keys of subscriber stations stored therein, and generating an input and a response necessary for authenticating a particular subscriber station, whereby in order to produce the response, the authentication centre is arranged to re- trieve from the memory the secret key of the subscriber station to be authenticated and compute the response on the basis of the secret key retrieved from the memory, said input and an authentication algorithm. The authentication centre of the invention is characterized in that the authentication centre is arranged to produce said input by utilizing a random number generated by the random number generator and a first algorithm. The invention still further relates to a subscriber station in a telecommunication system which, for authenticating the subscriber station, comprises: a memory with a secret key stored therein, means for receiving an input, and a counter. The subscriber station of the invention is characterized in that the subscπber station is arranged to check the correctness of the input by computing a message authentication code by utilizing the input and a checking algorithm, and the counter is arranged to compute a response to be forwarded by the subscriber station by utilizing an authentication algorithm, said secret key and said input if the input is correct on the basis of the message authenti- cation code. The invention still further relates to an SIM card comprising a counter and a memory with a secret key stored therein, and an inlet for receiving an input. The SIM card of the invention is characterized in that the SIM card is arranged to check the correctness of the received input by computing a message authentication code by utilizing the input and a checking algorithm, and compute a response to be forwarded by the SIM card by utilizing an authentication algorithm, said secret key and said input if the input is correct on the basis of the message authentication code. The idea underlying the invention is that when, while authenticating a subscriber station, an input whose correctness can be checked by the subscriber station is used as the input instead of a random number, a solution for making it even more difficult to crack a subscriber-station-specific secret key is achieved. The subscriber station can then identify an incorrect input, i.e. an input which in all probability originates from an external attacker trying to crack the secret key of the subscriber station. According to the invention, the subscriber station can be programmed to operate such that cracking the secret key is made significantly more difficult when the subscriber station has identified an input originating from an external attacker. The most important advantages of the solution of the invention thus are that it is even more difficult for the external attacker to crack the secret key used in authenticating a particular subscriber station, and that the invention can with extremely slight changes be applied to existing systems. In the GSM system, for example, the invention can be directly implemented in the authentication centre of the system, which means that new telephones can right from the start be equipped with SIM cards capable of checking the input according to the invention. It is not necessary to change the SIM cards in old telephones since the old SIM cards are capable of processing the input produced by an authentication centre operating according to the invention. The old telephones simply assume that the input is a random number to be processed as before in connection with authentication. In a first preferred embodiment of the invention, the subscriber station produces and forwards an input only if the subscriber station has checked and concluded that the input is correct. Consequently, it is more difficult to crack the secret key since an external attacker does not know how to choose the input so that the checking carried out by the subscπber station would indicate that the input is correct. The authentication centre of the telecommunica- tion system, for example, comprises information on the checking procedures used by the subscriber station, which means that the authentication centre is capable of producing an input to be transmitted to the subscriber station which is correct on the basis of the checking carried out by the subscriber station. In a second preferred embodiment of the invention, the subscriber station computes and forwards a random response if it detects that the received input is incorrect. The random response may be computed by another algorithm than the authentication algorithm. Alternatively, the random response may be computed by the authentication algorithm but, instead of the secret key of the subscriber station, the computation utilizes another key which is a "pseudo key", or, alternatively, the random response may comprise a random number generated by a random number generator. The point is that the random response resembles a real response such that an external attacker does not, on the basis of the length of the response, for example, know that the random response is not a real response equipped with an authentication algorithm and a secret key. In a third preferred embodiment of the invention, the subscriber station maintains a counter function to compute the number of inputs that are incorrect on the basis of a message authentication code. In such a case, when a predetermined limit value is exceeded, the subscriber station locks such that it no longer provides a correct response to the input. In this embodiment, the subscriber station can thus produce and forward a response which is either correct or incorrect regardless of whether the input is correct until the counter function indicates that the maximum number of incorrect inputs is exceeded, whereby the authentication function of the subscriber station locks. The locking may take place either such that the subscriber station no longer provides responses at all or, alternatively, in order to mislead, the subscriber station may continue by producing incorrect responses only, such as random responses. This prevents the external attacker from having the possibility to crack the secret key of the subscriber station by utilizing statistics, for example. The counter function of the subscriber station may be implemented, for example, such that when being set up, the counter function has been set to a certain initial value, and it has also been made sure that the counter function cannot be manipulated later (in order to reset the counter function to the initial value, for instance). Next, when the counter function of the subscriber station reaches a predetermined limit value which, depending on the application, may range from 100 to 10 000, its authentication functions will be permanently locked such that the subscriber station no longer provides correct responses. When the subscriber station is one in which the authentication functions are arranged on the SIM card, such as in a GSM mobile station, the subscriber station must next be provided with a new SIM card to replace the locked one. Preferred embodiments of the method, system, subscriber station and SIM card of the invention are disclosed in the attached dependent claims 2 to 6, 8 to 11 , 14 to 17, 19 and 20. In the following, the invention will be described in closer detail with reference to the accompanying drawings, in which Figure 1 is a flow diagram showing a first preferred embodiment of a method of the invention, Figure 2 is a block diagram showing a first preferred embodiment of a system of the invention, Figure 3 illustrates an input utilized in authenticating a subscriber station, Figure 4 is a flow diagram showing the first preferred embodiment of the method of the invention, Figure 5 is a block diagram showing a third preferred embodiment of the system of the invention, and Figure 6 is a flow diagram showing a second preferred embodiment of the method of the invention. Figure 1 is a flow diagram showing a first preferred embodiment of a method of the invention. The flow diagram of Figure 1 can be utilized, for example, in processing an authentication message received by a GSM subscriber station/SIM card. In block A in Figure 1 , an authentication message comprising an input RAND is received. In block B, a message authentication code is computed according to the input RAND and a predetermined checking algorithm. The checking algorithm used should be selected such that it can be concluded whether or not the input is correct on the basis of the result of the computation. Such a checking can be carried out, for example, by predetermining that the input RAND always consists of two parts (as shown by Figure 3), thus comprising a random number RND and message authentication code MAC computed by the predetermined checking algorithm. Hence, in block B, the part RND used for computing the message authentication code can be retrieved from the input RAND. After computing the message authentication code, it is checked in block C whether the part MAC remaining of the input corresponds to the computed message authentication code. If the input is incorrect on the basis of the computed message authentication code, it can be concluded that the input originates from an external attacker. The flow diagram of Figure 1 thus enables an input originating from an external attacker to be identified, which means that the authentication process may from now onwards proceed such that the external attacker will not be provided with a sufficient amount of information for him or her to crack the secret key. Figure 2 is a block diagram showing a first preferred embodiment of a system of the invention. The system of Figure 2 may be a GSM system, for example. In the case of Figure 2, a majority of the authentication equipment of the system is arranged in a special authentication centre AC which, in connection with the GSM system, may be located in connection with an HLR (Home Location Register), for example. In the GSM system, the subscriber station is authenticated by a VLR such that the VLR receives from the authentication centre AC an input RAND and response SRES enabling the VLR to authenticate the subscriber station MS. The authentication centre AC of Figure 2 comprises a random num- ber generator 1 for generating a random number RND to a counter 2. The counter 2 computes an MAC (Message Authentication Code) on the basis of the random number RND and a first predetermined algorithm g. Next, the counter 2 forms an input RAND from the random number RND and the message authentication code MAC. In the exemplary case of Figure 2, the input RAND thus consists of two parts. The input is illustrated in Figure 3. The authentication centre AC comprises a memory 4 with the secret key stored therein of all those subscriber stations in the authentication of which the authentication centre participates. In practice, the authentication centre can be operator-specific, in which case all secret keys of the subscriber stations of the operator have been stored in the memory of the authentication centre. In the case of Figure 2, the secret key Ki of the subscriber station MS consisting of a mobile station has been stored in the memory. The authentication centre supplies the secret key Ki retrieved from the memory 4 and the input RAND produced by the counter 2 to a counter 3. The counter 3 computes a response SRES on the basis of the se- cret key Ki, input RAND and authentication algorithm A3. The authentication centre transmits the input RAND and response SRES to the VLR. In order to authenticate the subscriber station MS, the VLR transmits the input RAND received from the authentication centre to the subscriber station MS. The VLR stores the response received from the authentication centre in the memory such that it is available for a comparing element 10. The input RAND received by the subscriber station MS is conveyed to a counter 5 located on the SIM card of the subscriber station MS. The counter 5 then computes a message authentication code by utilizing the predetermined part of the input and a checking algorithm f. In the embodiment of Figure 2, it is assumed that the structure of the input RAND produced by the authentication centre AC is similar to that in Figure 2, i.e. the input consists of the random number RND generated by the random number generator 1 and the message authentication code MAC computed by the algorithm g(RND). The subscriber station checking algorithm f then retrieves the first part RND of the input RAND and next computes a message authentication code MAC in a similar manner to that used by the counter 2 of the authentication centre, i.e. by the algorithm g(RND). The counter 5 supplies the computed message authentication code MAC to a comparing unit 6. Next, the comparing unit compares the message authentication code MAC computed by the counter 5 with the message authentication code MAC in the input RAND. If the comparing unit 6 detects that the message authentication code computed by the counter corresponds to the part MAC remaining of the input, the comparing means 6 indicates to a control unit 7 that the input RAND is correct. If the control unit 7 detects that the input is correct, it activates a counter 8 to compute a response to the input RAND. The counter 8 computes the response SRES on the basis of the input RAND, subscriber-station- specific secret key Ki stored in a memory 9 and authentication algorithm A3. The algorithm is thus the same algorithm A3 and the parameters are thus the same parameters as the counter 3 of the authentication centre used. The sub- scriber station MS thus produces the response SRES transmitted to the VLR which corresponds to the response SRES transmitted by the authentication centre. When, after the comparison, the comparing unit 10 of the VLR detects that the responses are identical, it concludes that the subscriber station MS has been authenticated. If, on the other hand, the comparing unit 6 indicates to the control unit 7 that the input RAND is incorrect, the input has most likely been supplied by an external attacker. In such a case, the control unit interrupts the process for authenticating the subscπber station such that no response will be transmitted by the subscriber station. Alternatively, the control unit 7 can then activate a random response to be forwarded. The random response herein refers to any response which resembles a correct one. Such a random response may, for example, comprise a random number or a response computed by an algorithm. The point is that the response is not computed by the authentication algorithm A3, secret key Ki and input RAND. If this was the case, the external attacker would be provided with the real response to the supplied input, which might assist in cracking the secret key. If, on the other hand, the external attacker is provided with a random response resembling (i.e. the length of the response equals the length of the real response, etc.) the real response, the external attacker will never know that the response is an incorrect one. The system of Figure 2 is preferable in that the authentication cen- tre of the invention shown therein can also be used in connection with existing, in other words old, subscriber stations. This is also feasible when the input RAND is selected such that its length corresponds with the input supplied to the old subscriber stations. Naturally, the old subscriber stations are incapable of checking whether or not the response SRES is correct but they are, how- ever, capable of computing the response SRES from the input comprising the message authentication code. The blocks shown in the block diagram of Figure 2 may comprise electronic circuits or, alternatively, one or more blocks may be implemented by software. Hence, no two separate counters, for example, are necessary at the subscriber station or the authentication centre, for example, but the counters can be implemented, for example, by one processor and computer program in a manner known per se. Although it has been described in connection with Figure 2 that the SIM card of the subscriber station comprises the necessary parts for producing a response in connection with authentication, it is, of course, possible that these parts are, instead of the SIM card, arranged in the subscriber station. Such a solution is relevant particularly in a system comprising no SIM cards at all. Figure 3 illustrates an input utilized in authenticating a subscriber station. In the system of Figure 2, for example, the counter 2 can produce such an input by utilizing a random number RND and algorithm g. Applied to the GSM system, the total length of the input RAND is 16 bytes. According to the invention, the length of the random number RND can then be 8 to 14 bytes, for example. The length of the message authentication code MAC computed on the basis of the random number and algorithm g can correspondingly be 2 to 8 bytes. When the subscriber station of the invention receives the input of Figure 3, it computes a message authentication code by utilizing the checking algorithm and the predetermined part of the input, i.e. the random number RND of the input. If the message authentication code computed by the sub- scriber station corresponds to the part remaining of the input, i.e. the message authentication code MAC, the subscπber station concludes that the input is correct. Figure 4 is a flow diagram showing a second preferred embodiment of the method of the invention. The flow diagram of Figure 4 can be utilized in processing an authentication message in the subscriber station of Figure 2, for example. Blocks A to C in Figure 4 are similar to blocks A to C in Figure 1 , i.e. in those blocks, it is checked whether or not the received input is correct on the basis of the computed message authentication code. If, in block C, it is found out that the input is correct on the basis of the computed message authentication code, a response SRES is computed and forwarded in block D'. The response is computed on the basis of the predetermined authentication algorithm A3, secret key Ki and input RAND. If, on the other hand, it is detected in block C that the input RAND is incorrect on the basis of the message authentication code, the input RAND most likely originates from an external attacker who tries to crack the secret key used in the authentication. According to the invention, two alternate ways exist as to how to proceed. The first alternative is designated by arrow E', wherein the proc- essing of the authentication message is interrupted. No response will then be transmitted to the authentication message. Consequently, the external at- tacker receives no response to the input, which means that the attacker is unable to collect any statistics about the inputs and responses or use such statistics for cracking the secret key. The second alternative is shown in block F', wherein a random re- sponse is produced to the input RAND and forwarded. The random response can be any response which resembles a real response and which has not been computed in a similar manner to the real response (cf. block D'). Consequently, the random response can be directly produced by the random number generator, or it can be computed from the input by utilizing a suitable algorithm and input. The external attacker will thus receive an incorrect response, the attacker not knowing this, however. Figure 5 is a block diagram showing a second preferred embodiment of the system of the invention. In the embodiment of Figure 5, the authentication centre AC and the visitor location register VLR are similar to the authentication centre and visitor location register VLR shown in the embodiment of Figure 2. A similar input to that described in connection with the embodiment of Figure 2 is thus transmitted to a subscriber station MS'. An SIM card SIM' located in the subscriber station MS' of Figure 5 is also highly similar to the SIM card described in connection with Figure 2. The embodiment of Figure 5 differs from the case of Figure 2 in that the SIM' card of the subscriber station maintains a counter function concerning the number of incorrect inputs. The input RAND received by the subscriber station MS' is conveyed to the counter 5 in the SIM card thereof. The counter 5 then computes a mes- sage authentication code by utilizing the predetermined part of the input and checking algorithm f. In the embodiment of Figure 5, it is assumed that the structure of the input RAND produced by the authentication centre AC is similar to that of Figure 3, i.e. the input consists of the random number RND generated by the random number generator 1 and message authentication code MAC computed by the algorithm g(RND). The subscriber station checking algorithm f then retrieves the first part RND of the input RAND, and then computes a message authentication code MAC in a similar manner to that used by the counter 2 of the authentication centre, i.e. by the algorithm g(RND). The counter 5 supplies the computed message authentication code MAC to the comparing unit 6. Next, the comparing unit compares the message authentication code MAC computed by the counter 5 with the message authentication code MAC in the input RAND. If the comparing unit 6 detects that the message authentication code computed by the counter corresponds to the part MAC remaining of the input, the comparing means 6 indicates to a control unit 7' that the input RAND is correct. If the control unit 7' detects that the input is correct, it activates a counter 8' to compute a response to the input RAND. The counter 8' computes the response SRES on the basis of the input RAND, subscriber-station- specific secret key Ki stored in a memory 9' and authentication algorithm A3. The algorithm is thus the same algorithm A3 and the parameters are thus the same parameters as the counter 3 of the authentication centre used. Consequently, the subscriber station MS produces the response SRES transmitted to the VLR which corresponds to the response SRES transmitted by the authentication centre. When, after the comparison, the comparing unit 10 of the VLR detects that the responses are identical, it concludes that the sub- scriber station MS has been authenticated. If, on the other hand, the comparing unit 6 indicates to the control unit 7' that the input RAND is incorrect, the response is most likely supplied by an external attacker. The control unit 7' then updates the counter function of the subscriber station for keeping a record of the number of received incorrect inputs. In the exemplary case of Figure 5, this may be carried out by means of variable C stored in the memory 9' and a limit value Cmax. When the SIM card SIM' was first put to use, variable C was given an initial value of zero stored in the memory 9'. Similarly, the variable Cmax was given e.g. a value of 1000 stored in the memory 9'. When the comparing unit 6 indicates that the received input is incorrect, the control unit 7' increases the value of variable C by one, and it further compares the new value of variable C with the maximum value Cmax. If the maximum value has been reached, the control unit locks the operation of the SIM card such that the SIM card no longer produces correct responses to the received inputs RAND. In practice, this may be carried out such that the SIM card no longer produces responses at all, or the SIM card will continue by producing random responses only, or the SIM card will only produce an announcement indicating that it is locked. If the control unit 7' has been informed of an incorrect response by the comparing unit, and if variable C has not reached the maximum value Cmax in connection with the counter function update, the control unit may operate in many alternate ways, depending on the case. An alternative is that the control unit interrupts the process of authenticating the subscriber station such that the subscriber station will no longer transmit responses. Alternatively, the control unit 7' may in a similar case activate a random response to be forwarded. The random response herein refers to any response which resembles a real response. Such a random response may, for example, comprise a random number and a response computed by an algorithm. The point is that the response is not computed by the authentication algorithm A3, secret key Ki and input RAND. If this was the case, the external attacker would be provided with the real response to the supplied input, which might assist in cracking the secret key. If, on the other hand, the external attacker is provided with a random response resembling (i.e. the length of the response equals the length of the real response, etc.) the real response, the external attacker will never know that the response is an incorrect one. The blocks shown in the block diagram of Figure 5 may consist of electronic circuits, or, alternatively, one or more blocks may be implemented by software. Hence, no two separate counters, for example, are necessary at the subscriber station or the authentication centre, for example, but the counters can be implemented by one processor and computer program in a manner known per se. Although it has been described in connection with Figure 5 that the SIM card of the subscriber station comprises the necessary parts for producing a response in connection with authentication, it is, of course, possible that these parts are, instead of the SIM card, arranged in the subscriber station. Such a solution is relevant particularly in a system comprising no SIM cards at all. Figure 6 is a flow diagram showing a third preferred embodiment of the method of the invention. The flow diagram of Figure 6 may be utilized, for example, in the subscriber station of Figure 5 for processing an authentication message. A predetermined variable Cmax indicating the highest allowed num- ber of incorrect inputs has then been stored in the subscriber station (or the SIM card thereof) when they were being set up. In addition, variable C to keep a record of received incorrect responses is set to a predetermined initial value. In block A" of Figure 6, an authentication message comprising the input RAND is received. In block B", it is checked whether or not variable C utilized by the counter function has received the limit value Cmax. If so, this means that the highest allowed number of received incorrect inputs Cmax has already been reached, which means that the authentication process is interrupted. Otherwise, the process proceeds to block C". In block C", a message authentication code is computed according to the input RAND and a predetermined checking algorithm. The checking algorithm used should be selected such that it can be concluded whether or not the input is correct on the basis of the result of the computation. Such a checking can be carried out, for example, by predetermining that the input RAND always consists of two parts (as shown in Figure 3), thus comprising a random number RND and a message authentication code MAC computed by the predetermined checking algorithm. In block C", the part RND used for computing the message authentication code can then be retrieved from the input RAND. After computing the message authentication code, it is checked in block D" whether or not the part MAC remaining of the input corresponds to the computed message authentication code. If it is concluded in block D" that the input is correct on the basis of the computed message authentication code, a response SRES is computed and forwarded in block E". The response is computed on the basis of the predetermined authentication algorithm A3, secret key Ki and input RAND. If, on the other hand, it is detected in block D" that the input RAND is incorrect on the basis of the message authentication code, the input RAND most likely originates from an external attacker trying to crack the secret key used in the authentication. The process then proceeds to block F". In block F", the value of variable C used in the counter function is updated by, for example, increasing or decreasing the value thereof by one (depending on how the initial value of C and Cmax were determined when the counter function was being set up). When the value of variable C has been changed, four alternate ways exist as to how to proceed according to the invention. The first alternative is designated by arrow G1", wherein the response is computed and forwarded as usual. An external attacker is then provided with the correct response to the input used by the attacker. The possibility of cracking the secret key by utilizing statistics has, however, been restricted since the counter function can be used for determining that the device to be authenticated only produces e.g. 1000 responses before being locked and stopping the production of correct responses. The second alternative is designated by arrow G2", wherein a random response is produced and transmitted in block H". The random response may be a response generated by the random number generator, or alternatively, a response computed by another key than the secret key used for authentication. The point is that the external attacker is unable to conclude whether or not the response is correct on the basis of the response. The third alternative is designated by arrow G3", i.e. an announcement is produced and transmitted in block I" to indicate that the input is incorrect. The fourth alternative is designated by G4", wherein the processing of the authentication message is interrupted. No response is then transmitted to the authentication message. The external attacker will thus receive no response to the input, which means that the attacker is unable to collect any statistics on the inputs and responses or utilize such statistics for cracking the secret key. The flow diagram in Figure 6 shows that the comparison of variable C with the limit value Cmax is carried out immediately after receiving the input in block B". Naturally, this is only one example of how the comparison can be implemented. Many different alternatives thus exist, an alternative being, for example, that the comparison between variable C used by the counter function and the limit value Cmax is carried out only after the received response has been found incorrect and the value of the counter function has been updated. It is to be understood that the above description and the related drawings are only intended to illustrate the present invention. It is obvious to one skilled in the art that the invention can be modified in various ways without deviating from the scope and spirit of the invention disclosed in the attached claims.

Claims: CLAIMS 1. A method for identifying an authentication message generated by an external attacker, the method comprising receiving the authenticating message comprising an input, the method being characterized by checking the correctness of the input by computing a message authentication code by utilizing the input and a checking algorithm, and identifying the authentication message as being generated by the external attacker if the input is incorrect on the basis of the message authenti- cation code. 2. A method as claimed in claim 1, characterized by computing a response by utilizing an authentication algorithm, the input and a secret key, and forwarding said response if the input is correct on the basis of the message authentication code. 3. A method as claimed in claim 1 or 2, characterized by maintaining a counter function to keep a record of the number of inputs that are incorrect on the basis of the message authentication code, and locking the authentication function of the device to be authenticated such that the device to be authenticated no longer produces correct responses to the inputs in the authentication messages if the counter function indicates that the number of incorrect inputs has reached a predetermined limit value. 4. A method as claimed in any one of claims 1 to 3, characterized by producing and forwarding a random response if the input is incorrect on the basis of the message authentication code. 5. A method as claimed in claim 4, characterized in that said random response is a random number. 6. A method as claimed in claim 4, characterized in that said random response is computed by utilizing the input and a predetermined algorithm. 7. A telecommunication system comprising: at least one subscriber station (MS, MS') comprising a counter (8, 8') and a memory (9, 9') with a subscriber-station-specific (MS, MS') secret key (Ki) stored therein, and authentication means (1, 3, 4, VLR) for authenticating said sub- scriber station, the authentication means comprising a random number gen- erator (1 ), a counter (3) and a memory (4) with the subscriber-station-specific secret key (Ki) of said at least one subscπber station (MS, MS') stored therein, the authentication means being arranged to: - compute a response (SRES) on the basis of an input (RAND), an authentication algorithm (A3) and the subscriber-station-specific secret key (Ki) stored in the memory (4) of the authentication means, - transmit said input (RAND) to said subscriber station (MS), and - indicate that the subscriber station (MS, MS') has been authenticated if the authentication means (VLR) receive from the subscriber station (MS, MS') a response (SRES) which corresponds to the response (SRES) computed by the authentication means, c h a r a c t e r i z e d in that the authentication means are arranged to compute said input (RAND) by utilizing a random number (RND) generated by the random number generator (1 ) and a first algorithm (g), and that the subscriber station (MS, MS') is arranged to - check the correctness of the received input (RAND) by computing a message authentication code (MAC) by utilizing the input (RAND) and a checking algorithm (f), - compute a response to be transmitted to the authentication means (VLR) by the subscriber station (MS, MS') by utilizing the authentication algorithm (A3), said secret key (Ki) stored in the memory (9, 9') of the subscriber station (MS, MS') and the input (RAND) if the input (RAND) is correct on the basis of the message authentication code (MAC). 8. A system as claimed in claim 7, c h a r a c t e r i z e d in that the subscriber station (MS') is arranged to: - maintain a counter function (7', 9') to keep a record of the number (C) of inputs (RAND) that are incorrect on the basis of the message authentication code, and - lock such that the subscriber station no longer produces correct responses to the received inputs if the counter function (7', 9') indicates that the number (C) of incorrect inputs has reached a predetermined limit value (Cmax). 9. A system as claimed in claim 7 or 8, c h a r a c t e r i z e d in that the subscriber station (MS, MS') is arranged to compute a random response to be transmitted to the authentication means (VLR) by the subscriber station (MS, MS') if the input is incorrect on the basis of the message authentication code (MAC). 10. A system as claimed in claim 7 or 8, characterized in that the subscriber station (MS, MS') transmits no response to the authentica- tion means if the input (RAND) is incorrect on the basis of the message authentication code. 11. A system as claimed in any one of claims 7 to 10, characterized in that said system is a mobile communication system, preferably a GSM system. 12. An authentication centre (AC) in a telecommunication system, the authentication centre comprising: a random number generator (1 ), a counter (3), and a memory (4) with subscriber-station-specific secret keys of sub- scriber stations stored therein, and generating an input (RAND) and a response (SRES) necessary for authenticating a particular subscriber station (MS, MS'), and in order to produce the response the authentication centre is arranged to: - retrieve from the memory (4) the secret key (Ki) of the subscriber station (MS, MS') to be authenticated, and - compute the response (SRES) by utilizing the secret key (Ki) retrieved from the memory (4), said input (RAND) and an authentication algorithm (A3), characterized in that the authentication centre is arranged to produce said input (RAND) by utilizing a random number (RND) generated by the random number generator (1 ) and a first algorithm (g). 13. A subscriber station (MS, MS') in a telecommunication system which, for authenticating the subscriber station, comprises: a memory (9, 9') with a secret key (Ki) stored therein, means for receiving an input (RAND), and a counter (5, 8, 8'), characterized in that the subscriber station is arranged to check the correctness of the input by computing a message authentication code (MAC) by utilizing the input (RAND) and a checking algorithm (f), and the counter (8, 8') is arranged to compute a response (SRES) to be forwarded by the subscriber station (MS, MS") by utilizing an authentication algorithm (A3), said secret key (Ki) and said input (RAND) if the input is correct on the basis of the message authentication code (MAC). 14. A subscriber station as claimed in claim 13, characterized in that the subscriber station is arranged to: - maintain a counter function (7', 9') to keep a record of the number (C) of inputs (RAND) that are incorrect on the basis of the message authentication code, and - lock such that the subscriber station no longer produces correct responses to the received inputs if the counter function (7', 9') indicates that the number (C) of incorrect inputs has reached a predetermined limit value (Cmax). 15. A subscπber station as claimed in claim 13 or 14, characterized in that the subscriber station is arranged to check the correctness of the input by computing the message authentication code on the basis of a predetermined part (RND) of the input (RAND) and by comparing said message authentication code (MAC) with the part (MAC) remaining of the input, whereby the input (RAND) is correct if the part (MAC) remaining of the input corresponds to the message authentication code (MAC). 16. A subscriber station as claimed in any one of claims 13 to 15, characterized in that said subscπber station (MS, MS') is a subscriber station in a mobile communication system, preferably a GSM system, and that the memory (9, 9') and/or the counter (5, 8, 8') are arranged on an SIM card detachably attached to the subscπber station. 17. A subscriber station as claimed in any one of claims 13 to 16, characterized in that the counter (8, 8') is arranged to compute a random response to be forwarded by the subscriber station (MS, MS') if the input (RAND) is incorrect on the basis of the message authentication code (MAC). 18. An SIM card (SIM) comprising a counter (8, 8') and a memory (9, 9') with a secret key (Ki) stored therein, and an inlet for receiving an input (RAND), characterized in that the SIM card is arranged to: - check the correctness of the received input (RAND) by computing a message authentication code (MAC) by utilizing the input (RAND) and a checking algorithm (f), and - compute a response (SRES) to be forwarded by the SIM card by utilizing an authentication algorithm (A3), said secret key (Ki) and said input (RAND) if the input is correct on the basis of the message authentication code (MAC). 19. An SIM card as claimed in claim 18, characterized in that the SIM card is arranged to: - maintain a counter function (7', 9') to keep a record of the number (C) of inputs (RAND) that are incorrect on the basis of the message authentication code, and - lock such that the SIM card no longer produces correct responses to the received inputs if the counter function (7', 9') indicates that the number (C) of incorrect inputs has reached a predetermined limit value (Cmax). 20. An SIM card as claimed in claim 17 or 18, characterized in that the counter (8, 8') is arranged to compute a random response to be forwarded by the subscriber station (MS, MS') if the input (RAND) is incorrect on the basis of the message authentication code (MAC).

Inventors: PAATERO LAURI, RANTALA JANNE, PAATERO, LAURI, RANTALA, JANNE
Applicants: PAATERO LAURI, RANTALA JANNE, SETEC OY, PAATERO, LAURI, RANTALA, JANNE
Application year: 2000
Main classification: H04Q7
IPC codes: G06K19, G09C1, H04L9, H04W12