(19)
(11)EP 3 493 462 B1

(12)EUROPEAN PATENT SPECIFICATION

(45)Mention of the grant of the patent:
30.09.2020 Bulletin 2020/40

(21)Application number: 17845061.5

(22)Date of filing:  13.07.2017
(51)International Patent Classification (IPC): 
H04L 9/32(2006.01)
H04W 12/06(2009.01)
H04L 29/06(2006.01)
H04L 9/08(2006.01)
(86)International application number:
PCT/CN2017/092840
(87)International publication number:
WO 2018/040758 (08.03.2018 Gazette  2018/10)

(54)

AUTHENTICATION METHOD, AUTHENTICATION APPARATUS AND AUTHENTICATION SYSTEM

AUTHENTIFIZIERUNGSVERFAHREN, AUTHENTIFIZIERUNGSVORRICHTUNG UND AUTHENTIFIZIERUNGSSYSTEM

PROCÉDÉ D'AUTHENTIFICATION, APPAREIL D'AUTHENTIFICATION ET SYSTÈME D'AUTHENTIFICATION


(84)Designated Contracting States:
AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

(30)Priority: 05.09.2016 CN 201610803439

(43)Date of publication of application:
05.06.2019 Bulletin 2019/23

(73)Proprietor: Huawei Technologies Co., Ltd.
Longgang District Shenzhen, Guangdong 518129 (CN)

(72)Inventors:
  • ZHANG, Bo
    Shenzhen Guangdong 518129 (CN)
  • GAN, Lu
    Shenzhen Guangdong 518129 (CN)
  • YANG, Yanjiang
    Shenzhen Guangdong 518129 (CN)

(74)Representative: Epping - Hermann - Fischer 
Patentanwaltsgesellschaft mbH Schloßschmidstraße 5
80639 München
80639 München (DE)


(56)References cited: : 
WO-A1-2012/112124
US-A1- 2009 228 705
US-B2- 9 332 000
CN-A- 101 719 895
US-A1- 2012 023 334
  
      
    Note: Within nine months from the publication of the mention of the grant of the European patent, any person may give notice to the European Patent Office of opposition to the European patent granted. Notice of opposition shall be filed in a written reasoned statement. It shall not be deemed to have been filed until the opposition fee has been paid. (Art. 99(1) European Patent Convention).


    Description

    TECHNICAL FIELD



    [0001] The present invention relates to the communications field, and in particular, to an authentication method, an authentication apparatus, and an authentication system.

    BACKGROUND



    [0002] A future mobile communications network includes various services, where the services have different security requirements. A future mobile communications network has a key center, which can control and manage generation and distribution of keys, to satisfy security requirements of services.

    [0003] However, the following problem occurs if a 2G/3G/4G security protection mode continues to be used: Because all root keys are stored on a core node, that is, a home subscriber server (HSS), an authentication flexibility requirement of a service cannot be satisfied. If authentication of mass devices all requires participation of the HSS, system complexity is increased.

    [0004] Therefore, in view of a security requirement of a future service, a more flexible authentication manner needs to be designed to satisfy an authentication flexibility requirement of a service.

    [0005] WO2012/112124 A1 relates to a communication terminal of a cellular mobile communication system. The cellular mobile communication system comprises the communication terminal, another communication terminal and a communication network for providing a communication connection between the communication terminal and the other communication terminal via at least one base station of the communication network. The communication terminal comprises a determiner configured to determine an encryption key for secure communication between the communication terminal and the other communication terminal via a radio interface between the communication terminal and the other communication terminal; and a transceiver configured to perform secure communication with the other communication terminal via the radio interface between the communication terminal and the other communication terminal using the determined encryption key.

    SUMMARY



    [0006] Embodiments of the present invention are defined by the appended claims. An authentication method, an authentication apparatus, and an authentication system are provided, to satisfy an authentication flexibility requirement of a service.

    [0007] According to a first aspect, an authentication method is provided. The method includes:

    sending, by first user equipment, a first random parameter to second user equipment;

    obtaining, by the second user equipment, a first user identifier, a second user identifier, and a second random parameter, generating a second authentication feature based on the first user identifier, the second user identifier, the first random parameter, and the second random parameter, and sending the second authentication feature to the first user equipment;

    attempting to authenticate, by the first user equipment, correctness of the second authentication feature, generating a first authentication feature, and sending the first authentication feature to the second user equipment; and

    attempting to authenticate, by the second user equipment, correctness of the first authentication feature.



    [0008] In the authentication method performed between two user equipments provided in the embodiments of the present invention, in an authentication process, participation of an HSS is not required, so that an authentication flexibility requirement of a service can be satisfied.

    [0009] In this embodiment of the present invention, the first user equipment and the second user equipment may be various terminal devices including, but not limited to, mobile phones, computers, smart televisions, intelligent refrigerators, and the like.

    [0010] In this embodiment of the present invention, the second user equipment may obtain the first user identifier, the second user identifier, and the second random parameter in various different manners. In an obtaining manner, the second user equipment receives the first user identifier and the second user identifier from the first user equipment, and randomly generates the second random parameter. In another obtaining manner, the second user equipment obtains the first user identifier and the second user identifier in advance, for example, obtains the first user identifier and the second user identifier in a key distribution stage, and randomly generates the second random parameter.

    [0011] In this embodiment of the present invention, the authentication feature may be a message authentication code (Message Authentication Code, MAC), a ciphertext, or a digital signature. The following separately further describes these three cases.

    [0012] In a case, the authentication feature is a MAC. In this case, after a second MAC is generated, the authentication method may further include:

    sending, by the second user equipment, the first random parameter and the second random parameter to the first user equipment; and

    the generating, by the first user equipment, a first authentication feature includes: generating, by the first user equipment, the first MAC based on the first random parameter and the second random parameter.



    [0013] The first user equipment receives the first random parameter and the second random parameter, so that the first MAC can be conveniently calculated based on the first random parameter and the second random parameter.

    [0014] When the authentication feature is a MAC, correspondingly, the generating a second MAC may include:

    generating a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier; and

    generating the second MAC based on the communication shared key K com or the session key K session, the first random parameter, and the second random parameter.

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance.



    [0015] When the authentication feature is a MAC, correspondingly, the generating the first MAC may include:

    obtaining, by the first user equipment, the first user identifier and the second user identifier, and generating a communication shared key K com and/or a session key K session based on the first user identifier and the second user identifier; and

    generating the first MAC based on the communication shared key K com or the session key K session, the first random parameter, and the second random parameter, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the first user equipment in advance.



    [0016] The foregoing manner is a new MAC generation manner, and authentication between user equipments can be performed by using the generated MAC.

    [0017] In another case, the authentication feature is a ciphertext, and the generating a second authentication feature based on the first user identifier, the second user identifier, the first random parameter, and the second random parameter may include:

    encrypting the first user identifier, the second user identifier, the first random parameter, and the second random parameter by using the first user identifier, a communication shared key K com, or a session key K session, to generate a second ciphertext; and

    the attempting to authenticate, by the first user equipment, correctness of the second authentication feature includes: decrypting, by the first user equipment, the second ciphertext by using a first subscriber key, the communication shared key K_com, or the session key K session, to obtain a first random parameter and a second random parameter, and determining whether the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, where if the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, authentication succeeds, where

    the key used in encryption corresponds to the key used in decryption;

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and



    [0018] In the foregoing manner of authenticating the second ciphertext, matching between the first random parameter obtained by decryption and the first random parameter previously sent to the second user equipment is performed, to authenticate whether the first random parameter changes, thereby better authenticating the second user equipment.

    [0019] When the authentication feature is a ciphertext, correspondingly, the generating a first authentication feature includes:

    obtaining, by the first user equipment, the first user identifier and the second user identifier, and encrypting the first user identifier, the second user identifier, and the second random parameter by using the first user identifier, the communication shared key K_com, or the session key K_session, to generate a first ciphertext; and

    the attempting to authenticate, by the second user equipment, correctness of the first authentication feature includes:
    decrypting, by the second user equipment, the first ciphertext by using the first subscriber key, the communication shared key K_com, or the session key K session, to obtain a second random parameter, and determining whether the second random parameter obtained by decryption is the same as the previously encrypted second random parameter, where if the second random parameter obtained by decryption is the same as the previously encrypted second random parameter, authentication succeeds.



    [0020] In the foregoing manner of authenticating the first ciphertext, matching between the second random parameter obtained by decryption and the second random parameter previously sent to the first user equipment is performed, to authenticate whether the second random parameter changes, thereby better authenticating the first user equipment.

    [0021] When the authentication feature is a ciphertext, optionally, the first random parameter sent by the first user equipment to the second user equipment is an encrypted first random parameter. Correspondingly, the authentication method may further include: decrypting, by the second user equipment, the encrypted first random parameter to obtain the first random parameter.

    [0022] An encryption manner may include encryption based on the communication shared key K com and encryption based on an identifier. The first random parameter is encrypted, to better ensure security of the first random parameter.

    [0023] In another case, the authentication feature is a digital signature. Correspondingly, after a second digital signature is generated, the method may further include:

    sending, by the second user equipment, the first random parameter and the second random parameter to the first user equipment; and

    the generating, by the first user equipment, a first authentication feature includes: generating, by the first user equipment, the first digital signature based on the first random parameter and the second random parameter.



    [0024] When the authentication feature is a digital signature, optionally, the generating a second authentication feature may include:

    and when the authentication feature is a digital signature, the generating a first authentication feature may include:

    and
    SK_ID1 is a first subscriber key, SK_ID2 is a second subscriber key, and the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier may be obtained by the second user equipment in advance.

    [0025] The foregoing provides a new digital signature generation manner, and mutual authentication based on the digital signature can be subsequently conveniently performed.

    [0026] When the authentication feature is a digital signature, optionally, after the attempting to authenticate, by the second user equipment, correctness of the first authentication feature, the authentication method may further include:

    encrypting session communication between the first user equipment and the second user equipment by using a communication shared key K_com or a session key K_session, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance.



    [0027] Session communication is encrypted by using the communication shared key K com or the session key K_session, to better ensure security of a session between two terminals.

    [0028] According to a second aspect, another authentication method is provided. The method includes:

    sending, by first user equipment, a first random parameter to second user equipment;

    receiving, by the first user equipment, a second authentication feature from the second user equipment; and

    attempting to authenticate, by the first user equipment, correctness of the second authentication feature, generating a first authentication feature, and sending the first authentication feature to the second user equipment.



    [0029] In a case, the authentication feature is a message authentication code (MAC). In this case, before the first authentication feature is generated, the method further includes:

    receiving, by the first user equipment, the first random parameter and a second random parameter from the second user equipment; and

    correspondingly, the generating a first authentication feature includes:

    obtaining, by the first user equipment, the first user identifier and the second user identifier, and generating a communication shared key K com and/or a session key K session based on the first user identifier and the second user identifier; and

    generating, by the first user equipment, a first MAC based on the communication shared key K com or the session key K session, the first random parameter, and the second random parameter, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the first user equipment in advance or received from the first user equipment.



    [0030] In a case, the authentication feature is a ciphertext. In this case, the attempting to authenticate, by the first user equipment, correctness of the second authentication feature includes:
    decrypting, by the first user equipment, a second ciphertext by using a first subscriber key, a communication shared key K com, or a session key K_session, to obtain a first random parameter and a second random parameter, and determining whether the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, where if the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, authentication succeeds, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and



    [0031] When the authentication feature is a ciphertext, the generating a first authentication feature includes:
    obtaining, by the first user equipment, the first user identifier and the second user identifier, and encrypting the first user identifier, the second user identifier, and the second random parameter by using the first user identifier, the communication shared key K com, or the session key K session, to generate a first ciphertext.

    [0032] In a case, the authentication feature is a digital signature. In this case, before the first authentication feature is generated, the method further includes:

    receiving, by the first user equipment, the first random parameter and a second random parameter from the second user equipment; and

    the generating a first authentication feature includes: calculating a first digital signature based on the first random parameter, the second random parameter, and a first subscriber key, where

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance or received from the first user equipment.



    [0033] According to a third aspect, an authentication method is provided. The method includes:

    receiving, by second user equipment, a first random parameter from first user equipment;

    obtaining, by the second user equipment, a first user identifier, a second user identifier, and a second random parameter, generating a second authentication feature based on the first user identifier, the second user identifier, the first random parameter, and the second random parameter, and sending the second authentication feature to the first user equipment;

    receiving, by the second user equipment, a first authentication feature from the first user equipment; and

    attempting to authenticate, by the second user equipment, correctness of the first authentication feature.



    [0034] In a case, the authentication feature is a message authentication code (MAC). In this case, after a second MAC is generated, the method further includes:
    sending, by the second user equipment, the first random parameter and the second random parameter to the first user equipment.

    [0035] When the authentication feature is a message authentication code, the generating a second MAC includes:

    generating a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier; and

    generating the second MAC based on the communication shared key K com or the session key K session, the first random parameter, and the second random parameter, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance or received from the first user equipment.



    [0036] In a case, the authentication feature is a ciphertext. In this case, the generating a second authentication feature based on the first user identifier, the second user identifier, the first random parameter, and the second random parameter includes:

    encrypting the first user identifier, the second user identifier, the first random parameter, and the second random parameter by using the first user identifier, a communication shared key K_com, or a session key K session, to generate a second ciphertext; and

    when the authentication feature is a ciphertext, the attempting to authenticate, by the second user equipment, correctness of the first authentication feature may include:
    decrypting, by the second user equipment, a first ciphertext by using a first subscriber key, the communication shared key K_com, or the session key K session, to obtain a second random parameter, and determining whether the second random parameter obtained by decryption is the same as the previously encrypted second random parameter, where if the second random parameter obtained by decryption is the same as the previously encrypted second random parameter, authentication succeeds, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and



    [0037] In a case, the authentication feature is a digital signature. In this case, the generating a second authentication feature includes:

    and
    when the authentication feature is a digital signature, after the second digital signature is generated, the method further includes: sending, by the second user equipment, the first random parameter and the second random parameter to the first user equipment.

    [0038] According to a fourth aspect, an authentication apparatus is provided. The authentication apparatus includes:

    a sending module, configured to send a first random parameter to second user equipment;

    a receiving module, configured to receive a second authentication feature from the second user equipment; and

    a processing module, configured to: attempt to authenticate correctness of the second authentication feature, and generate a first authentication feature, where

    the sending module is further configured to send the first authentication feature to the second user equipment.



    [0039] In a case, the authentication feature is a message authentication code. In this case, before the first authentication feature is generated, the receiving module is further configured to: receive the first random parameter and a second random parameter from the second user equipment; and

    the processing module is specifically configured to: obtain the first user identifier and the second user identifier, generate a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier, and generate a first MAC based on the communication shared key K com or the session key K session, the first random parameter, and the second random parameter, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the first user equipment in advance or received from the first user equipment.



    [0040] In a case, the authentication feature is a ciphertext. In this case, the processing module is specifically configured to:
    decrypt a second ciphertext by using a first subscriber key, a communication shared key K com, or a session key K session, to obtain a first random parameter and a second random parameter, and determining whether the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, where if the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, authentication succeeds, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and



    [0041] When the authentication feature is a ciphertext, the processing module is specifically configured to:
    obtain the first user identifier and the second user identifier, and encrypt the first user identifier, the second user identifier, and the second random parameter by using the first user identifier, the communication shared key K_com, or the session key K session, to generate a first ciphertext.

    [0042] In a case, the authentication feature is a digital signature. In this case, the receiving module is further configured to: receive, by the first user equipment, the first random parameter and the second random parameter from the second user equipment; and

    the processing module is specifically configured to calculate a first digital signature based on the first random parameter, the second random parameter, and a first subscriber key, where

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance or received from the first user equipment.



    [0043] According to a fifth aspect, an authentication apparatus is provided. The authentication apparatus includes:

    a receiving module, configured to receive a first random parameter from first user equipment; and

    a processing module, configured to: obtain a first user identifier, a second user identifier, and a second random parameter, generate a second authentication feature based on the first user identifier, the second user identifier, the first random parameter, and the second random parameter, and send the second authentication feature to the first user equipment, where

    the receiving module is further configured to receive a first authentication feature from the first user equipment; and

    the processing module is further configured to attempt to authenticate correctness of the first authentication feature.



    [0044] In a case, the authentication feature is a message authentication code, and the authentication apparatus further includes a sending module, configured to:
    after the processing module generates a second MAC, send the first random parameter and the second random parameter to the first user equipment.

    [0045] When the authentication feature is a message authentication code, the processing module is specifically configured to:

    generate a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier; and

    generate the second MAC based on the communication shared key K com or the session key K session, the first random parameter, and the second random parameter, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance or received from the first user equipment.



    [0046] In a case, the authentication feature is a ciphertext, and the processing module is specifically configured to:

    encrypt the first user identifier, the second user identifier, the first random parameter, and the second random parameter by using the first user identifier, a communication shared key K com, or a session key K session, to generate a second ciphertext; and

    the attempting to authenticate correctness of the first authentication feature includes:
    decrypt a first ciphertext by using a first subscriber key, a communication shared key K com, or a session key K session, to obtain a second random parameter, and determining whether the second random parameter obtained by decryption is the same as the previously encrypted second random parameter, where if the second random parameter obtained by decryption is the same as the previously encrypted second random parameter, authentication succeeds, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and



    [0047] In a case, the authentication feature is a digital signature;

    the processing module is specifically configured to: generate a second digital signature in the following manner:

    and

    after the processing module generates the second digital signature, the authentication apparatus further includes a sending module, configured to: send the first random parameter and the second random parameter to the first user equipment.



    [0048] According to a sixth aspect, an authentication system is provided, including the first authentication apparatus according to the fourth aspect and the second authentication apparatus according to the fifth aspect.

    [0049] In the authentication method, the authentication apparatus, and the authentication system provided in the embodiments of the present invention, authentication is performed between two terminal devices by using a MAC, a ciphertext, or a digital signature, and in an authentication process, participation of an HSS is not required, so that an authentication flexibility requirement of a service can be satisfied.

    BRIEF DESCRIPTION OF DRAWINGS



    [0050] To describe the technical solutions in the embodiments of the present invention more clearly, the following briefly describes the accompanying drawings required for describing the embodiments. Apparently, the accompanying drawings in the following description show merely some embodiments of the present invention, and a person of ordinary skill in the art may derive other drawings from these accompanying drawings without creative efforts.

    FIG. 1 is an architectural diagram of a communications system according to an embodiment of the present invention;

    FIG. 2 is a flowchart of a key distribution method based on a KMS of an operator according to an embodiment of the present invention;

    FIG. 3 is a flowchart of a key distribution method based on a KMS of an operator according to an embodiment of the present invention;

    FIG. 4 is a flowchart of a key distribution method based on a KMS of an operator according to an embodiment of the present invention;

    FIG. 5 is a flowchart of a key distribution method based on a KMS of an operator according to an embodiment of the present invention;

    FIG. 6 is a flowchart of a key distribution method based on a KMS of a third party according to an embodiment of the present invention;

    FIG. 7 is a flowchart of a key distribution method based on a KMS of a third party according to an embodiment of the present invention;

    FIG. 8A is a flowchart of a three-round authentication method according to an embodiment of the present invention;

    FIG. 8B is a schematic diagram of a three-round authentication method for mutual authentication based on a MAC according to an embodiment of the present invention;

    FIG. 9 is a schematic diagram of a three-round authentication method for mutual authentication based on encryption according to an embodiment of the present invention;

    FIG. 10 is a schematic diagram of a three-round authentication method for mutual authentication based on a signature according to an embodiment of the present invention;

    FIG. 11 is a schematic diagram of a two-round authentication method for mutual authentication based on a MAC according to an embodiment of the present invention;

    FIG. 12 is a schematic diagram of a two-round authentication method for mutual authentication based on a signature according to an embodiment of the present invention;

    FIG. 13 is a structural block diagram of an authentication device according to an embodiment of the present invention;

    FIG. 14 is a structural block diagram of another authentication device according to an embodiment of the present invention;

    FIG. 15 is a schematic structural diagram of a terminal according to an embodiment of the present invention; and

    FIG. 16 is a schematic structural diagram of a terminal according to an embodiment of the present invention.


    DESCRIPTION OF EMBODIMENTS



    [0051] To make the objectives, technical solutions, and advantages of the present invention clearer, the following further describes the implementation manners of the present invention in detail with reference to the accompanying drawings.

    [0052] FIG. 1 is an architectural diagram of a communications system according to an embodiment of the present invention. Referring to FIG. 1, the key distribution system provided in this embodiment of the present invention may include UE 101, a communications network element 102, and an HSS 103. The communications network element 102 and the HSS 103 are devices belonging to an operator network. The communications network element 102 may be, for example, an authentication center or a control node. As shown in FIG. 1, the key distribution system provided in this embodiment of the present invention may further include a key management center (Key Management System, KMS) 104. The KMS 104 performs functions of generating, distributing, and managing a subscriber private key. In this embodiment of the present invention, the KMS 104 may be integrated into various network devices as a functional module, for example, is integrated into the communications network element 102 and the HSS 103, or may be used as an independent network device. When the KMS 104 is used as an independent network device, the KMS 104 may be deployed outside an operator, or may be disposed outside the operator network. There may be an interface between the KMS 104 and a network device (for example, the communications network element 102 and the HSS 103) of the operator network. Further, there may be an interface directly between the KMS and the UE 101, and in this case, the KMS can directly distribute a key to the UE 101 without using the operator network. In the key distribution system provided in this embodiment of the present invention, the UE 101 first communicates with the communications network element 102 and the HSS 103, to complete AKA network access authentication. After AKA network access authentication succeeds, a key is distributed.

    [0053] A key distribution method provided in an embodiment of the present invention may include a key distribution method based on a KMS of an operator and a key distribution method based on a KMS of a third party. In the key distribution method based on the operator KMS, the KMS is a network element of the operator, and in the key distribution method based on the third party KMS, the KMS may alternatively be controlled by the third party.

    [0054] In this embodiment of the present invention, the key distribution method based on the operator KMS may include the following several cases: (1) the KMS is deployed in a communications network element, and the communications network element distributes a private key; (2) the KMS is deployed in an HSS, and the HSS distributes a private key; (3) the KMS is deployed independent from a communications network element, but there is an interface between the KMS and the communications network element, the KMS generates a subscriber private key, and the communications network element distributes the subscriber private key to UE; and (4) the KMS is deployed independent from an HSS, but there is an interface between the KMS and the HSS, the KMS generates a subscriber private key, and the communications network element distributes the subscriber private key to UE.

    [0055] In this embodiment of the present invention, the key distribution method based on the third party KMS may include the following several cases: (1) a KMS is deployed as an independent network element, the KMS sends a message authentication code (Message Authentication Code, MAC) from UE to an operator network element for authentication, and after authentication of the operator network element succeeds, a subscriber private key is distributed; and (2) a KMS is deployed as an independent network element, the KMS sends a token (token) from UE to an operator network element for authentication, and after authentication of the operator network element succeeds, a subscriber private key is distributed.

    [0056] The following first describes the key distribution method based on a KMS of an operator provided in this embodiment of the present invention. FIG. 2 is a flowchart of a key distribution method based on a KMS of an operator according to an embodiment of the present invention. In the key distribution method based on the operator KMS shown in FIG. 2, a KMS is deployed in a communications network element, and the communications network element generates a subscriber private key (SK_ID1), and distributes the subscriber private key to UE after authentication of the UE succeeds.

    [0057] Referring to FIG. 2, the key distribution method based on the operator KMS provided in this embodiment of the present invention may include:
    201: UE initiates a request to a communications network element, where the request may carry an IMSI, a user identifier (ID1), and an indicator (indicator). Optionally, the request may carry only an IMSI and an indicator.

    [0058] In this embodiment of the present invention, the communications network element may be an authentication center or a control node, both of which includes a KMS functional module. The request may be specifically a user identity request (User Identity Request), or certainly may be various self-defined requests. A specific request name is not limited in this embodiment of the present invention, provided that the request carries the IMSI, the user identifier ID1, and the indicator.

    [0059] A user of the user identifier may be an industry user or a company, or may be a terminal user or a terminal. The user identifier may be any one of the following: an industry user identifier, a service identifier, a company identifier, and an identifier of an individual user. The identifier of the individual user may be, for example, an international mobile equipment identity (IMEI), an international mobile subscriber identity (IMSI), an IP multimedia private identity (IP Multimedia Private Identity, IMPI), a temporary mobile subscriber identity (Temporary Mobile Subscriber Identity, TMSI), an IP multimedia public identity (IP Multimedia Public Identity, IMPU), a Media Access Control (Medium Access Control, MAC) address, an IP address, a phone number and a GUTI, a service identifier (service ID), a user application identifier (user App ID), and a device ID. When the user identifier is the identifier of the individual user and the identifier of the individual user is an IMSI, the request may carry only the IMSI and the indicator. When the identifier of the individual user is not an IMSI, the request may carry the IMSI, the user identifier (ID1), and the indicator, or the request may carry the IMSI and the indicator.

    [0060] The indicator (Indicator) is used to indicate to a network that the request is used to initiate AKA authentication and obtain an identity-based private key.

    [0061] 202: The communications network element receives the request sent by the UE, and sends, to an HSS, the IMSI from the UE by using a message. After obtaining the request from the UE, the communications network element may learn, based on the indicator, that key distribution subsequently needs to be performed.

    [0062] In this step, the message sent by the communications network element to the HSS may further include the indicator in step 201.

    [0063] 203: The HSS receives the IMSI, and performs the following operation of calculating an authentication vector (Authentication Vector, AV), where AV = (RAND, AUTN, XRES, Kasme), the RAND is an authentication random number, the XRES is a response value, the AUTN is an authentication value, and the Kasme is an authenticated shared key.

    [0064] If the message in step 202 includes the indicator, the HSS may learn, based on the indicator, that a key needs to be distributed. Meanwhile, optionally, in a process of generating the AV, the HSS may set an Xth bit of an authentication management field (Authentication Management Field, AMF) parameter in the AUTN to 1, where 1≤X≤7. In this way, the communications network element may subsequently determine, by using the parameter, whether an authentication procedure of the UE includes identity-based key distribution. Certainly, in this step, the HSS may alternatively not perform the operation of setting a bit of the AMF parameter, that is, does not set a bit of the AMF parameter. In this way, the communications network element may still determine whether the received message includes the indicator in step 202, to determine whether the authentication procedure of the UE includes identity-based key distribution.

    [0065] If the message received by the HSS from the communications network element includes no indicator (indicator), the HSS may not set a bit of the AMF parameter, and performs authentication in a conventional AKA manner.

    [0066] 204: After generating the AV, the HSS sends the AV to the communications network element. Optionally, the HSS may further send the indicator to the communications network element.

    [0067] As can be learned from steps 201 to 204, the communications network element may send the indicator to the HSS or may not send the indicator to the HSS. After receiving the indicator from the communications network element, the HSS may set a bit of the AMF parameter, and may choose to send the indicator to the communications network element or not to send the indicator to the communications network element.

    [0068] 205: After receiving the AV from the HSS, the communications network element sends the RAND and the AUTN to UE.

    [0069] 206: The UE attempts to authenticate the AUTN, and after the AUTN is authenticated, calculates an RES as a response to the communications network element.

    [0070] 207: The UE sends the RES to the communications network element by using a message.

    [0071] 208: After receiving the RES, the communications network element authenticates whether the RES and an XRES in the AV are the same. If the RES and the XRES in the AV are the same, authentication succeeds; or if the RES and the XRES in the AV are different, an authentication failure is returned. When authentication succeeds, the communications network element generates a subscriber private key (SK_ID1) by using an identity-based algorithm.

    [0072] The communications network element may calculate SK_ID1 by using the following several identifiers: (1) a user identifier (ID1); (2) an operator identifier||a user identifier (ID||ID1), where || is a cascading form and indicates that the operator identifier and the user identifier are connected as one identifier, and the operator identifier may be a public land mobile network identifier (PLMN ID), a serving network identifier (serving network ID), a local operator network identifier, or the like; and (3) an operator identifier||a user identifier∥a time (ID||ID1||time) or a user identifier||a time (ID1||time).

    [0073] It should be noted herein that when the request sent by the UE to the communications network element carries only the IMSI and the indicator and the IMSI is not used as an identifier of an individual user, after the communications network element succeeds in authentication, the UE may send the user identifier to the communications network element. In this way, after receiving the user identifier, the communications network element may generate the subscriber private key (SK_ID1) based on the user identifier.

    [0074] 209: The communications network element sends SK_ID1 to the UE. In an optional manner, in this step, the communications network element may further send SK_ID1 and GPK to the UE, where GPK is a global public key.

    [0075] 210: The UE sends a response to the communications network element. This step is an optional step. In this embodiment of the present invention, the UE may alternatively not send the response to the communications network element.

    [0076] In the key distribution method based on a KMS (deployed inside the communications network element) of an operator provided in this embodiment of the present invention, the UE sends the indicator to the communications network element, the communications network element can learn, based on the indicator, that an authentication procedure of the UE needs to include identity-based key distribution, and when authentication of the UE succeeds, the communications network element may distribute the private key to the UE. In addition, in the key distribution method based on a KMS of an operator, because the KMS is deployed in the communications network element of the operator, after authentication of the UE succeeds, the private key may be distributed to the UE without further authentication by the operator, thereby reducing communication overheads.

    [0077] FIG. 3 is a flowchart of a key distribution method based on a KMS of an operator according to an embodiment of the present invention. In the key distribution method based on the operator KMS shown in FIG. 3, a KMS is deployed in an HSS, and the HSS generates a subscriber private key (SK_ID1), and distributes the subscriber private key to UE after authentication of the UE succeeds.

    [0078] Referring to FIG. 3, the key distribution method based on the operator KMS provided in this embodiment of the present invention may include:
    301: UE initiates a request to a communications network element, where the request may carry an IMSI, a user identifier (ID1), and an indicator (indicator). Optionally, the request may carry only an IMSI and an indicator. In this embodiment of the present invention, the request may be specifically a user identity request (User Identity Request), or certainly may be various self-defined requests. A specific request name is not limited in this embodiment of the present invention, provided that the request carries the IMSI, the user identifier ID1, and the indicator. For descriptions of the user identifier and the indicator, refer to corresponding content in step 201.

    [0079] 302: The communications network element receives the request sent by the UE, and sends, to an HSS, the IMSI, the indicator, and the user identifier from the UE by using a message. After obtaining the request from the UE, the communications network element may learn, based on the indicator, that key distribution subsequently needs to be performed.

    [0080] In this step, the message sent by the communications network element to the HSS may include only the IMSI and the user identifier. In this case, the HSS may determine, based on UE information stored by the HSS, whether identity-based key distribution needs to be performed. 303: The HSS receives the IMSI and the indicator, and performs the following operation of calculating an authentication vector (Authentication Vector, AV), where AV = (RAND, AUTN, XRES, Kasme), and a KMS generates a subscriber private key (SK_ID1) by using an identity-based algorithm.

    [0081] The RAND is an authentication random number, the XRES is a response value, the AUTN is an authentication value, and the Kasme is an authenticated shared key.

    [0082] The KMS may calculate SK_ID1 by using the following several identifiers: (1) a user identifier (ID1); (2) an operator identifier||a user identifier, (ID||ID1), where the operator identifier may be a public land mobile network identifier (PLMN ID), a serving network identifier (serving network ID), a local operator network identifier, or the like; and (3) an operator identifier||a user identifier||a time (ID||ID1||time) or a user identifier||a time (ID1||time).

    [0083] Optionally, after receiving the indicator, in a process of generating the AV, the HSS may set an Xth bit of an AMF parameter in the AUTN to 1, where 1≤X≤7. In this way, the communications network element may subsequently determine, by using the parameter, whether an authentication procedure of the UE includes identity-based key distribution. Certainly, in this step, the HSS may alternatively not perform the operation of setting a bit of the AMF parameter, that is, does not set a bit of the AMF parameter, but instead may send the indicator to the communications network element. In this way, the communications network element may still determine subsequently whether the received message includes the indicator, to determine whether the authentication procedure of the UE includes identity-based key distribution.

    [0084] If the message received by the HSS includes no indicator (indicator), it indicates that the authentication procedure of the UE includes no identity-based key distribution. In this case, the HSS performs authentication in a conventional AKA manner.

    [0085] As can be learned from steps 301 to 303, the communications network element may send the indicator to the HSS, the HSS may send the indicator to the communications network element when not performing a bit setting operation, and after performing a bit setting operation, the HSS may or may not send the indicator to the communications network element.

    [0086] 304: After the AV and the subscriber private key (SK_ID1) are generated, the HSS sends the AV and the subscriber private key (SK_ID1) to the communications network element by using a message, and optionally, may further send GPK to the communications network element.

    [0087] 305: After receiving the AV and the subscriber private key (SK_ID1) from the HSS, the communications network element sends the RAND and the AUTN to the UE.

    [0088] 306: The UE attempts to authenticate the AUTN after receiving the RAND and the AUTN, and after the AUTN is authenticated, calculates an RES as a response to the communications network element.

    [0089] 307: The UE sends the RES to the communications network element by using a message.

    [0090] 308: After receiving the RES, the communications network element authenticates whether the RES and an XRES in the AV are the same. If the RES and the XRES in the AV are the same, authentication succeeds; or if the RES and the XRES in the AV are different, an authentication failure is returned.

    [0091] 309: The communications network element sends SK_ID1 to the UE by using a message after authentication succeeds. In an optional manner, in this step, the communications network element may further send SK_ID1 and GPK to the UE, where GPK is a global public key.

    [0092] It should be noted herein that when the request sent by the UE to the communications network element carries only the IMSI and the indicator and the IMSI is not used as an identifier of an individual user, after the communications network element succeeds in authentication, the UE may send the user identifier to the communications network element. In this way, after receiving the user identifier, the communications network element may generate the subscriber private key (SK_ID1) based on the user identifier, and send SK_ID1 to the UE.

    [0093] 310: The UE sends a response to the communications network element. This step is an optional step. In this embodiment of the present invention, the UE may alternatively not send the response to the communications network element.

    [0094] In the key distribution method based on a KMS of an operator provided in this embodiment of the present invention, the UE sends the indicator to the communications network element, the communications network element can learn, based on the indicator, that an authentication procedure of the UE needs to include identity-based key distribution, and when authentication of the UE succeeds, the communications network element may distribute the private key to the UE. In addition, in the key distribution method based on a KMS of an operator, because the KMS is deployed in the HSS of the operator, after authentication of the UE succeeds, the private key may be distributed to the UE without further authentication by the operator, thereby reducing communication overheads.

    [0095] FIG. 4 is a flowchart of a key distribution method based on a KMS of an operator according to an embodiment of the present invention. In the key distribution method based on a KMS of an operator shown in FIG. 4, a KMS is deployed independent from a communications network element, but there is an interface between the KMS and the communications network element. The KMS generates a subscriber private key (SK_ID1), and after authentication of UE succeeds, the communications network element distributes the subscriber private key to the UE. In the embodiment shown in FIG. 4, after AKA authentication succeeds, the communications network element initiates, to the KMS, a request for obtaining the subscriber private key.

    [0096] Referring to FIG. 4, the key distribution method based on the operator KMS provided in this embodiment of the present invention may include:
    401: UE 1 initiates a request to a communications network element, where the request may carry an IMSI, a user identifier (ID1), and an indicator (indicator). Optionally, the request may carry only an IMSI and an indicator. In this embodiment of the present invention, the request may be specifically a user identity request (User Identity Request), or certainly may be various self-defined requests. A specific request name is not limited in this embodiment of the present invention, provided that the request carries the IMSI, the user identifier (ID1), and the indicator.

    [0097] For descriptions of the user identifier and the indicator, refer to content below step 201.

    [0098] 402: The communications network element receives the request sent by the UE, and sends, to an HSS, the IMSI from the UE by using a message. Optionally, the communications network element may further send the indicator to the HSS. After obtaining the request from the UE, the communications network element may learn, based on the indicator, that key distribution subsequently needs to be performed.

    [0099] 403: The HSS receives the IMSI, and performs the following operation of calculating an authentication vector (Authentication Vector, AV), where AV = (RAND, AUTN, XRES, Kasme), the RAND is an authentication random number, the XRES is a response value, an AUTN is an authentication value, and the Kasme is an authenticated shared key.

    [0100] If the communications network element sends the indicator to the HSS in step 402, the HSS may learn, based on the indicator, that a key needs to be distributed. Meanwhile, optionally, in a process of generating the AV, the HSS may set an Xth bit of an AMF parameter in the AUTN to 1, where 1≤X≤7. In this way, the communications network element may subsequently determine, by using the parameter, whether an authentication procedure of the UE includes identity-based key distribution. Certainly, in this step, the HSS may alternatively not perform the operation of setting a bit of the AMF parameter, that is, does not set a bit of the AMF parameter. In this way, the communications network element may still determine subsequently whether the received message includes the indicator in step 404, to determine whether the authentication procedure of the UE includes identity-based key distribution.

    [0101] If the message received by the HSS from the communications network element includes no indicator (indicator), the HSS does not set a bit of the AMF parameter.

    [0102] 404: After generating the AV, the HSS sends the AV to the communications network element by using a message. Optionally, the HSS may further send the indicator to the communications network element.

    [0103] As can be learned from steps 401 to 404, the communications network element may send the indicator to the HSS or may not send the indicator to the HSS. After receiving the indicator from the communications network element, the HSS may set a bit of the AMF parameter, and may choose to send the indicator to the communications network element or not to send the indicator to the communications network element.

    [0104] 405: After receiving the AV from the HSS, the communications network element sends the RAND and the AUTN to UE.

    [0105] 406: The UE attempts to authenticate the AUTN, and after the AUTN is authenticated, calculates an RES as a response to the communications network element.

    [0106] 407: The UE sends the RES to the communications network element by using a message.

    [0107] 408: After receiving the RES, the communications network element authenticates whether the RES and an XRES in the AV are the same. If the RES and the XRES in the AV are the same, authentication succeeds; or if the RES and the XRES in the AV are different, an authentication failure is returned.

    [0108] 409: When authentication succeeds, the communications network element sends a user identifier (ID1) to the KMS. The user identifier may be the user identifier in step 401, or may be a user identifier immediately sent by the UE after the UE learns that the communications network element succeeds in authentication.

    [0109] 410: The KMS generates a subscriber private key (SK_ID1) by using an identity-based algorithm.

    [0110] The KMS may calculate SK_ID1 by using the following several identifiers: (1) a user identifier (ID1); (2) an operator identifier||a user identifier, (ID||ID1), where the operator identifier may be a public land mobile network identifier (PLMN ID), a serving network identifier (serving network ID), a local operator network identifier, or the like; and (3) an operator identifier||a user identifier||a time (ID||ID1||time) or a user identifier||a time (ID1||time).

    [0111] 411: The KMS sends the subscriber private key (SK_ID1) to the communications network element. In an optional manner, in this step, the KMS may further send SK_ID1 and GPK to the communications network element, where GPK is a global public key.

    [0112] 412: After receiving the subscriber private key (SK_ID1), the communications network element sends the subscriber private key (SK_ID1) to the UE. Certainly, when receiving the subscriber private key (SK_ID1) and GPK, the communications network element sends the subscriber private key (SK_ID1) and GPK to the UE.

    [0113] 413: The UE sends a response to the communications network element after receiving the subscriber private key (SK_ID1) or the subscriber private key (SK_ID1) and GPK. This step is an optional step. In this embodiment of the present invention, the UE may alternatively not send the response to the communications network element.

    [0114] It should be noted herein that, in this embodiment of the present invention, optionally, in step 401, the request sent by the user to the communications network element may carry only the IMSI and the indicator (indicator). Correspondingly, after step 407, that is, after AKA authentication succeeds, the UE may send the user identifier to the communications network element, to request an identity-based subscriber private key.

    [0115] In the key distribution method based on a KMS of an operator provided in this embodiment of the present invention, the UE sends the indicator to the communications network element, the communications network element can learn, based on the indicator, that an authentication procedure of the UE needs to include identity-based key distribution, and when authentication of the UE succeeds, the communications network element may request the subscriber private key from the KMS, and distribute the subscriber private key to the UE after obtaining the subscriber private key generated by the KMS. In addition, in the key distribution method based on a KMS of an operator, because the KMS is deployed in the operator network, after authentication of the UE succeeds, the communications network element may directly distribute the subscriber private key to the UE without further authentication by the operator, thereby reducing communication overheads.

    [0116] FIG. 5 is a flowchart of a key distribution method based on a KMS of an operator according to an embodiment of the present invention. In the key distribution method based on a KMS of an operator shown in FIG. 5, a KMS is deployed independent from an HSS, but there is an interface between the KMS and the HSS. The KMS generates a subscriber private key, and a communications network element distributes the subscriber private key to UE.

    [0117] Referring to FIG. 5, the key distribution method based on the operator KMS provided in this embodiment of the present invention may include:
    501: UE initiates a request to a communications network element, where the request may carry an IMSI, a user identifier (ID1), and an indicator (indicator). In this embodiment of the present invention, the request may be specifically a user identity request (User Identity Request), or certainly may be various self-defined requests. A specific request name is not limited in this embodiment of the present invention, provided that the request carries the IMSI, the user identifier ID 1, and the indicator.

    [0118] For descriptions of the user identifier and the indicator, refer to corresponding content in step 201.

    [0119] 502: The communications network element receives the request sent by the UE, and sends the IMSI, the user identifier, and the indicator from the UE to an HSS by using a message.

    [0120] 503: The HSS receives the IMSI, the user identifier, and the indicator, and performs the following operation of calculating an authentication vector (Authentication Vector, AV), where AV = (RAND, AUTN, XRES, Kasme), the RAND is an authentication random number, the XRES is a response value, an AUTH is an authentication value, and the Kasme is an authenticated shared key.

    [0121] Optionally, after receiving the indicator, in a process of generating the AV, the HSS may set an Xth bit of an AMF parameter in the AUTN to 1, where 1≤X≤7. In this way, the communications network element may subsequently determine, by using the parameter, whether an authentication procedure of the UE includes identity-based key distribution. Certainly, in this step, the HSS may alternatively not perform the operation of setting a bit of the AMF parameter, that is, does not set a bit of the AMF parameter, but instead may send the indicator to the communications network element. In this way, the communications network element may still determine subsequently whether the received message includes the indicator, to determine whether the authentication procedure of the UE includes identity-based key distribution.

    [0122] If the message received by the HSS includes no indicator (indicator), it indicates that the authentication procedure of the UE includes no identity-based key distribution. In this case, the HSS performs authentication in a conventional AKA manner.

    [0123] 504: The HSS sends a user identifier (ID1) to the KMS by using a message.

    [0124] 505: After receiving the user identifier (ID1) from the HSS, the KMS generates a subscriber private key (SK_ID1) by using an identity-based algorithm. The KMS may calculate SK_ID1 by using the following several identifiers: (1) a user identifier (ID1); (2) an operator identifier||a user identifier, (ID||ID1), where the operator identifier may be a public land mobile network identifier (PLMN ID), a serving network identifier (serving network ID), a local operator network identifier, or the like; and (3) an operator identifier||a user identifier||a time (ID||ID1||time) or a user identifier||a time (ID1||time).

    [0125] 506: The KMS sends the subscriber private key (SK_ID1) to the HSS. Optionally, the KMS may send the subscriber private key (SK_ID1) and GPK.

    [0126] 507: After the AV and the subscriber private key (SK_ID1) are obtained, the HSS sends the AV and the subscriber private key (SK_ID1) to the communications network element by using a message, and optionally, may further send GPK to the communications network element.

    [0127] 508: After receiving the AV and the subscriber private key (SK_ID1) from the HSS, the communications network element sends the RAND and the AUTN to the UE.

    [0128] 509: The UE attempts to authenticate the AUTN after receiving the RAND and the AUTN, and after the AUTN is authenticated, calculates an RES as a response to the communications network element.

    [0129] 510: The UE sends the RES to the communications network element by using a message.

    [0130] 511: After receiving the RES, the communications network element authenticates whether the RES and an XRES in the AV are the same. If the RES and the XRES in the AV are the same, authentication succeeds; or if the RES and the XRES in the AV are different, an authentication failure is returned.

    [0131] 512: The communications network element sends SK_ID1 to the UE by using a message after authentication succeeds. In an optional manner, in this step, the communications network element may send SK_ID1 and GPK to the UE, where GPK is a global public key.

    [0132] 513: The UE sends a response to the communications network element. This step is an optional step. In this embodiment of the present invention, the UE may alternatively not send the response to the communications network element.

    [0133] It should be noted herein that in the embodiment shown in FIG. 5, the communications network element may send the indicator to the HSS, the HSS may send the indicator to the communications network element when not performing a bit setting operation, and after performing a bit setting operation, the HSS may or may not send the indicator to the communications network element.

    [0134] In the key distribution method based on a KMS of an operator provided in this embodiment of the present invention, the UE sends the indicator to the communications network element, the communications network element can learn, based on the indicator, that an authentication procedure of the UE needs to include identity-based key distribution, and the communications network element requests the subscriber private key from the KMS by using the HSS, and when authentication of the UE succeeds, distributes the subscriber private key to the UE after obtaining the subscriber private key generated by the KMS. In addition, in the key distribution method based on a KMS of an operator, because the KMS is deployed in the operator network, after authentication of the UE succeeds, the communications network element may directly distribute the subscriber private key to the UE without further authentication by the operator, thereby reducing communication overheads.

    [0135] The procedure in FIG. 2 to FIG. 5 may further include the following procedure. The UE sends a key request to the KMS in a conventional AKA manner or the like after setting up a security link with a core network, where the key request includes the user identifier. After obtaining the identifier, the KMS generates the key SK_ID1 in the foregoing manner and sends SK_ID1 to the UE.

    [0136] The following describes a key distribution method based on a KMS of a third party provided in an embodiment of the present invention. FIG. 6 is a flowchart of a key distribution method based on a KMS of a third party according to an embodiment of the present invention. In the key distribution method based on a KMS of a third party shown in FIG. 6, a KMS is deployed as an independent network element, and the KMS sends a message authentication code (Message Authentication Code, MAC) from UE to an operator network element for authentication, and after the operator network element succeeds in authentication, distributes a subscriber private key to the UE.

    [0137] Referring to FIG. 6, the key distribution method based on a KMS of a third party provided in this embodiment of the present invention may include:

    601: UE sends an IMSI to a communications network element.

    602: The communications network element sends the IMSI to an HSS.

    603: The HSS generates an authentication vector (AV), where the AV = (RAND, AUTN, XRES, Kasme). The RAND is an authentication random number, the XRES is a response value, the AUTH is an authentication value, and the Kasme is an authenticated shared key.

    604: After generating the AV, the HSS sends the AV to the communications network element.

    605: After receiving the AV from the HSS, the communications network element sends the RAND and the AUTN to UE.

    606: The UE attempts to authenticate the AUTN, and after the AUTN is authenticated, calculates an RES as a response to the communications network element.

    607: The UE sends the RES to the communications network element by using a message.

    608: After receiving the RES, the communications network element authenticates whether the RES and an XRES in the AV are the same. If the RES and the XRES in the AV are the same, authentication succeeds; or if the RES and the XRES in the AV are different, an authentication failure is returned.

    609: The UE calculates a message authentication code MAC 1 based on a shared key (including, but not limited to, at least one of Kasme, a CK, and an IK) obtained after AKA authentication, and calculates K based on the shared key (including, but not limited to, at least one of Kasme, a CK, and an IK), where K is a key encrypting key. A calculation formula is, for example, as follows: the MAC 1 = MAC ((at least one of Kasme, a CK, or an ID), (at least one of a user identifier and a parameter 1)), K = KDF((at least one of Kasme, a CK, or an ID), (at least one of user identifier and parameter 1), identifier of a KMS of a third party).



    [0138] For descriptions of the user identifier, refer to the corresponding content below step 201.

    [0139] The parameter 1 may be a random parameter, for example, a nonce, a sequence number (Sequence number, SQN), a connection identifier (connection ID), a fresh parameter (fresh parameter), a random number (random number), and the like.

    [0140] 610: UE 1 sends a user identifier, a MAC 1, and a parameter 1 to a KMS of a third party.

    [0141] 611: The third party KMS sends the user identifier, the MAC 1, and the parameter 1 to a key distribution center (Key Distribution Center, KDC).

    [0142] 612: The KDC sends the user identifier, the MAC 1, and the parameter 1 to the HSS or the communications network element.

    [0143] 613: The HSS or the communications network element attempts to authenticate the MAC 1, and after authentication succeeds, may randomly generate or derive K based on the shared key (including, but not limited to, at least one of Kasme, CK, and IK), for example, K = KDF((at least one of Kasme, CK, or IK), (at least one of identifier of a KMS of a third party, user identifier, and parameter 1)).

    [0144] If the HSS or the communications network element attempts to authenticate the MAC 1 by using the CK and/or the IK, the HSS or the communications network element needs to receive the CK and/or the IK in an AKA process.

    [0145] 614: The HSS/the communications network element sends K to the KDC.

    [0146] 615: The KDC sends K to the third party KMS.

    [0147] 616: The third party KMS generates a subscriber private key (SK_ID1) by using an identity-based algorithm, and encrypts SK_ID1 and GPK by using K.

    [0148] The KMS may calculate SK_ID1 by using the following several identifiers: (1) a user identifier (ID1); (2) an operator identifier||a user identifier, (ID||ID1), where the operator identifier may be a public land mobile network identifier (PLMN ID), a serving network identifier (serving network ID), a local operator network identifier, or the like; and (3) an operator identifier||a user identifier||a time (ID||ID1||time) or a user identifier||a time (ID1||time).

    [0149] 617: The third party KMS sends the encrypted SK_ID1 and GPK to the UE.

    [0150] 618: The UE performs decryption by using K, to obtain SK_ID1 and GPK.

    [0151] It should be noted herein that in the embodiment shown in FIG. 6, the KDC may alternatively not exist. In this way, the third party KMS may directly send the user identifier, the MAC 1, and the parameter 1 to the HSS/the communications network element. Meanwhile, optionally, the UE may not calculate K in step 609 but instead may calculate K after step 617.

    [0152] In the key distribution method based on the third party KMS provided in this embodiment of the present invention, the KMS is deployed as an independent network element, and the KMS sends the MAC from the UE to the operator network element for authentication, and after the operator network element succeeds in authentication, generates the subscriber private key and distributes the subscriber private key to the UE. In the key distribution method based on the third party KMS, after AKA authentication of the UE succeeds, an operator further needs to perform authentication, thereby improving communication security.

    [0153] FIG. 7 is a flowchart of a key distribution method based on a KMS of a third party according to an embodiment of the present invention. In the key distribution method based on a KMS of a third party shown in FIG. 7, a KMS is deployed as an independent network element, and the KMS sends a token (token) from UE to an operator network element for authentication, and after the operator network element succeeds in authentication, distributes a subscriber private key. In the embodiment shown in FIG. 7, an HSS and the third party KMS share a key K1.

    [0154] Referring to FIG. 7, the key distribution method based on a KMS of a third party provided in this embodiment of the present invention may include:
    701: UE initiates a request to a communications network element, where the request may carry an IMSI and an indicator (indicator). Optionally, the request may further carry a user identifier (ID1). In this embodiment of the present invention, the request may be specifically a user identity request (User Identity Request), or certainly may be various self-defined requests. A specific request name is not limited in this embodiment of the present invention, provided that the request carries corresponding content.

    [0155] For descriptions of the user identifier and the indicator, refer to corresponding content in step 201.

    [0156] 702: The communications network element receives the request sent by the UE, and sends the IMSI and the indicator from the UE to an HSS by using a message. Optionally, the communications network element may further send the user identifier to the HSS.

    [0157] 703: The HSS receives the IMSI and the indicator, and performs the following operation of calculating an authentication vector (Authentication Vector, the AV) and calculating a token (token) and K2. Optionally, the HSS may further receive the user identifier.

    [0158] The communications network element and the HSS may learn, based on the indicator, that a key subsequently needs to be distributed.

    [0159] K2 may be randomly generated or may be derived by using a subscriber root key, Kasme, CK, or IK. The AV = (RAND, AUTN, XRES, Kasme) and the token (token) = Enc (K1, MAC (K1, (at least one of ID1, identifier of a third party KMS, and network ID)), K2). To be specific, the token is encryption on the MAC (K1, (at least one of ID1, identifier of a third party KMS, and network identifier)) and K2 by using the key K1. The MAC (K1, (at least one of ID1, ID of a third party KMS, and network ID)) indicates that a MAC is used for authentication protection of ID1, the identifier of the third party KMS, and the network identifier by using the key K1, and may be used by the third party KMS to perform authentication on message correctness. K1 is a shared key between the HSS and the third party KMS. K2 is used to encrypt communication between the UE and the third party KMS, to ensure security. The RAND is an authentication random number, the XRES is a response value, the AUTN is an authentication value, and the Kasme is an authenticated shared key.

    [0160] Optionally, after receiving the indicator, in a process of generating the AV, the HSS may set an Xth bit of an AMF parameter in the AUTN to 1, where 1≤X≤7. In this way, the communications network element may subsequently determine, by using the parameter, whether an authentication procedure of the UE includes identity-based key distribution. Certainly, in this step, the HSS may alternatively not perform the operation of setting a bit of the AMF parameter, that is, does not set a bit of the AMF parameter, but instead may send the indicator to the communications network element. In this way, the communications network element may still determine subsequently whether the received message includes the indicator, to determine whether the authentication procedure of the UE includes identity-based key distribution.

    [0161] If the message received by the HSS includes no indicator (indicator), it indicates that the authentication procedure of the UE includes no identity-based key distribution. In this case, the HSS performs authentication in a conventional AKA manner.

    [0162] 704: After generating the AV, the token (token), and K2, the HSS sends the AV, the token (token), and K2 to the communications network element by using a message.

    [0163] As can be learned from steps 701 to 703, the communications network element may send the indicator to the HSS, the HSS may send the indicator to the communications network element when not performing a bit setting operation, and after performing a bit setting operation, the HSS may or may not send the indicator to the communications network element.

    [0164] 705: After receiving the AV, the token (token), and K2 from the HSS, the communications network element sends a RAND and an AUTN to the UE.

    [0165] 706: The UE attempts to authenticate the AUTN after receiving the RAND and the AUTN, and after the AUTN is authenticated, calculates an RES as a response to the communications network element.

    [0166] 707: The UE sends the RES to the communications network element by using a message.

    [0167] 708: After receiving the RES, the communications network element authenticates whether the RES and an XRES in the AV are the same. If the RES and the XRES in the AV are the same, authentication succeeds; or if the RES and the XRES in the AV are different, an authentication failure is returned.

    [0168] 709: After authentication succeeds, the communications network element sends the token (token) and K2 to the UE by using a message.

    [0169] 710: The UE sends a response to the communications network element. This step is an optional step. In this embodiment of the present invention, the UE may alternatively not send the response to the communications network element.

    [0170] 711: The UE initiates a request and sends the user identifier, an operator network identifier, and the token to a third party KMS.

    [0171] 712: The third party KMS performs search by using the operator network identifier, to obtain the shared key K1, and decrypts the token by using the shared key K1, to obtain the MAC (K1, ID1, ID of a third party KMS, network ID) and K2. Subsequently, an attempt to authenticate correctness of the MAC is performed by using K1.

    [0172] 713: When =the correctness of the MAC is authenticated, the third party KMS generates a subscriber private key (SK_ID1) by using an identity-based algorithm, and encrypts SK_ID1 and GPK by using K2.

    [0173] The KMS may calculate SK_ID1 by using the following several identifiers: (1) a user identifier (ID1); (2) an operator identifier||a user identifier, (ID||ID1), where the operator identifier may be a public land mobile network identifier (PLMN ID), a serving network identifier (serving network ID), a local operator network identifier, or the like; and (3) an operator ID||an ID1||a time or an ID1||a time.

    [0174] 714: The third party KMS sends the encrypted SK_ID1 and GPK to the UE.

    [0175] 715: The UE performs decryption by using K2, to obtain SK_ID1 and GPK.

    [0176] In the key distribution method based on the third party KMS provided in this embodiment of the present invention, the KMS is deployed as an independent network element, after AKA authentication succeeds, the UE sends the MAC to the third party KMS, and the KMS sends the MAC from the UE to the operator network element for authentication, and after the operator network element succeeds in authentication, generates the subscriber private key and distributes the subscriber private key to the UE. In the key distribution method based on the third party KMS, after AKA authentication of the UE succeeds, an operator further needs to perform authentication, thereby improving communication security.

    [0177] In all the foregoing embodiments, the message sent by the UE may carry no indicator, and the HSS may determine, based on a database of the HSS by using the IMSI or the user identifier, whether the UE requires identity-based key distribution. If determining that identity-based distribution is not required, the HSS performs a conventional AKA operation. If determining that identity-based key distribution is required, the HSS performs operations that are the same as those in all the foregoing embodiments. The operations include, but are not limited to: performing, by the HSS, a bit setting operation on the AMF parameter, and sending the AV only to the communications network element, so that the communications network element may determine, by using the bit setting operation, whether identity-based key distribution needs to be performed, or sending, by the HSS, an identifier 2 to the communications network element, to notify the communications network element that identity-based key distribution needs to be performed.

    [0178] The authentication method provided in this embodiment of the present invention may include a three-round authentication method and a two-round authentication method. Three-round and two-round identify a quantity of times of message transfer between communications devices. The three-round authentication method may include the following manner: completing mutual authentication based on a MAC, completing mutual authentication based on encryption, and completing mutual authentication based on a signature. The two-round authentication method may include the following manner: completing mutual authentication based on a MAC and completing mutual authentication based on a signature.

    [0179] The following first describes an authentication method based on a three-round authentication procedure provided in an embodiment of the present invention.

    [0180] In the following embodiments, a session identifier is used to identify a session, and may be randomly selected, or may be derived based on a previous session identifier, for example, may be obtained by adding one to the previous session identifier. A nonce 1 may be randomly selected to represent freshness. A service identifier is an identifier of a service between UE 1 and UE 2.

    [0181] In the following embodiments, the corresponding descriptions below step 201 may be applicable to both the first user identifier and the second user identifier.

    [0182] FIG. 8A is a flowchart of a three-round authentication method according to an embodiment of the present invention. Referring to FIG. 8 A, the three-round authentication method provided in this embodiment of the present invention may include:
    800: First user equipment sends a first random parameter to second user equipment.

    [0183] 900: The second user equipment obtains a first user identifier, a second user identifier, and a second random parameter, generates a second authentication feature based on the first user identifier, the second user identifier, the first random parameter, and the second random parameter, and sends the second authentication feature to the first user equipment.

    [0184] 1000: The first user equipment attempts to authenticate correctness of the second authentication feature, generates a first authentication feature, and sends the first authentication feature to the second user equipment.

    [0185] 1100: The second user equipment attempts to authenticate correctness of the first authentication feature.

    [0186] In the authentication method provided in this embodiment of the present invention, authentication is performed between two terminal devices by using a MAC, a ciphertext, or a digital signature, and in an authentication process, participation of an HSS is not required, so that an authentication flexibility requirement of a service can be satisfied.

    [0187] The following further describes the authentication method provided in this embodiment of the present invention with reference to FIG. 8B to FIG. 12. FIG. 11 and FIG. 12 are schematic diagrams of authentication methods based on a two-round authentication procedure.

    [0188] FIG. 8B is a flowchart of a third-round authentication method for mutual authentication based on a MAC according to an embodiment of the present invention. In the embodiment shown in FIG. 8B, the UE 1 may have a first user identifier (ID1), a first subscriber key (SK_ID1), and a global public key (GPK), and the UE 2 may have a second user identifier (ID2), a second subscriber key (SK_ID2), and a global public key (GPK).

    [0189] Referring to FIG. 8B, a three-round authentication method based on a three-round authentication procedure provided in an embodiment of the present invention may include:

    801: UE 1 sends a session identifier (session ID), a first random parameter (nonce 1), a first user identifier (ID1), and a service identifier (service ID) to UE 2, and may further send a second user identifier (ID2).

    802: The UE 2 calculates a communication shared key K_com based on GPK, ID2, SK_ID2, and ID1. GPK and SK_ID2 may be obtained in advance in a key distribution stage.



    [0190] There may be the following two calculation formulas:



    [0191] Specifically, if a user 1 and a user 2 want to perform secure communication, parameters are as follows: an identity of the user 1 is ID1, an identity-based private key of the user 1 is SK_ID1 = xH(ID1), an identity of the user 2 is ID2, and an identity-based private key of the user 2 is SK_ID2 = xH(ID2). The user 1 and the user 2 can calculate a unique shared key K_com = e(xH(ID1), H(ID2)) of the user 1 and the user 2 without exchanging a message.

    In this case, the key K is bound with the parameter 1. The parameter 1 may be at least one of a service identifier, a slice ID, a link ID, a connection identifier (connection ID), a session identifier (Session ID), a serving network identifier (serving network ID), a public land mobile network identifier (PLMN ID), ID 1, and ID2. The H() algorithm may be a Hash() algorithm or may be an HMAC() algorithm.

    [0192] 803: The UE 2 randomly selects a second random parameter (nonce 2), derives a session key K_session by using the communication shared key K_com, and calculates a second message authentication code (MAC 2) based on K_com or K_session.



    [0193] 804: The UE 2 sends the session identifier, the nonce 1, the nonce 2, and the MAC 2 to the UE 1. Optionally, the UE 2 may further send the service identifier and ID2 to the UE 1.

    [0194] 805: The UE 1 generates a shared key K_com based on GPK, ID1, SK_ID1, and ID2 by using a parameter input that is the same as that of the UE 2, and derives K_session by using a parameter input that is the same as that of the UE 2. The UE 1 attempts to authenticate correctness of the MAC 2 by using K_com or K_session; and if authentication succeeds, calculates a MAC 1, or if authentication does not succeed, does not calculate the MAC 1. Success of authentication indicates that the message is not tampered.



    [0195] A key used to attempt to authenticate correctness of the MAC 2 is the same as the key used to calculate the MAC 2 in step 803.

    [0196] 806: The UE 1 sends the MAC 1 to the UE 2.

    [0197] 807: The UE 2 attempts to authenticate correctness of the MAC 1 by using K_com or K_session. In the embodiment shown in FIG. 8, a MAC (including the MAC 1 and the MAC 2) may be calculated based on K com or K_session. In either manner, a same key needs to be used to calculate the MAC and perform authentication on the MAC.

    [0198] In the authentication method based on a three-round authentication procedure provided in this embodiment of the present invention, the UE 1 attempts to authenticate the MAC 2 from the UE 2 by using K_com or K_session, and subsequently the UE 2 attempts to authenticate a MAC from the UE 1 by using K_com or K_session. In this way, mutual authentication can be completed based on the MACs, and an authentication flexibility requirement of a service can be satisfied.

    [0199] FIG. 9 is a flowchart of a three-round authentication method for mutual authentication based on encryption according to an embodiment of the present invention. In the embodiment shown in FIG. 9, UE 1 may have a first user identifier (ID1), a first subscriber key(SK_ID1), and a global public key (GPK), and UE 2 may have a second user identifier (ID2), a second subscriber key(SK_ID2), and a global public key (GPK). In the embodiment shown in FIG. 9, the UE 1 and the UE 2 calculate ciphertexts of the UE 1 and the UE 2 to prove authenticity to the other party.

    [0200] Referring to FIG. 9, a three-round authentication method based on a three-round authentication procedure provided in an embodiment of the present invention may include:
    901: UE 1 sends a session identifier (session ID), a first user identifier (ID1), a service identifier (service ID), and En (ID2, nonce 1) to the UE 2, and may further send a second user identifier (ID2).

    [0201] The En(ID2, nonce 1) may be encrypted in two manners: encryption based on a shared key K, where the UE 1 first needs to generate a shared key K_com; and identity-based encryption, where the nonce 1 is encrypted by using ID2.

    [0202] 902: The UE 2 calculates a shared key K_com based on GPK, ID2, SK_ID2, and ID1. There may be the following two calculation formulas:



    [0203] Specifically, if a user 1 and a user 2 want to perform secure communication, parameters are as follows: an identity of the user 1 is ID1, an identity-based private key of the user 1 is SK_ID1 = xH(ID1), an identity of the user 2 is ID2, and an identity-based private key of the user 2 is SK_ID2 = xH(ID2). The user 1 and the user 2 can calculate a unique shared key K_com = e(xH(ID1), H(ID2)) of the user 1 and the user 2 without exchanging a message.

    where the key K is bound with the parameter 1, the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm may be a Hash() algorithm or may be an HMAC() algorithm.

    [0204] 903: The UE 2 obtains a nonce 1, randomly selects a nonce 2, and calculates a second ciphertext (ciphertext 2) based on the nonce 1 and the nonce 2. The ciphertext 2 = En(ID1, ID2, nonce 1, nonce 2).

    [0205] If the En(ID2, nonce 1) is encryption based on the shared key K_com, the UE 2 needs to first generate the shared key K_com, and then performs decryption to obtain the nonce 1. If the En(ID2, nonce 1) is encryption based on the identity ID2, the UE 2 performs decryption to obtain the nonce 1 by using SK_ID2.

    [0206] Optionally, in step 903, the UE 2 may further derive a session key K_session = KDF (K com, (at least one of session identifier, nonce 1, nonce 2, service identifier, ID1, and ID2)) by using the shared key K_com.

    [0207] The second ciphertext (ciphertext 2) may be obtained by encryption in the following manners: encrypting ID1, ID2, the nonce 1, and the nonce 2 based on the shared key K_com, to obtain the second ciphertext (ciphertext 2); performing identity-based encryption, and encrypting ID1, ID2, the nonce 1, and the nonce 2 by using ID1 to obtain the second ciphertext (ciphertext 2); and encrypting ID1, ID2, the nonce 1, and the nonce 2 based on the session key K_session to obtain the second ciphertext (ciphertext 2).

    [0208] 904: The UE 2 sends the first user identifier (ID1), the second user identifier (ID2), and the second ciphertext (ciphertext 2) to the UE 1.

    [0209] 905: After receiving ID1, ID2, and the second ciphertext (ciphertext 2), the UE 1 decrypts the second ciphertext (ciphertext 2) to obtain the nonce 1 and a second random parameter, and attempts to authenticate the nonce 1. When authentication succeeds, the UE 1 generates a first ciphertext (ciphertext 1), where ciphertext 1 = En(ID1, ID2, nonce 2).

    [0210] When the ciphertext 2 is decrypted, if the ciphertext 2 is encrypted based on the shared key K, the UE 1 first needs to generate the shared key K com, and then performs decryption to obtain the nonce 1 and the nonce 2. If the ciphertext 2 is encrypted based on an identity, the UE 1 performs decryption to obtain the nonce 1 and the nonce 2 by using SK_ID1. If the ciphertext 2 is encrypted based on the shared key K_session, the UE 1 first needs to generate the shared key K_com, then generates K_session, and performs decryption to obtain the nonce 1 and the nonce 2.

    [0211] After obtaining the nonce 1 and the nonce 2 by decryption, the UE 1 determines whether the nonce 1 and the encrypted nonce 1 in step 901 are the same. If the nonce 1 and the encrypted nonce 1 in step 901 are the same, authentication succeeds, and the first ciphertext (ciphertext 1) is generated. If the nonce 1 and the encrypted nonce 1 in step 901 are different, authentication fails, and the first ciphertext may not be generated.

    [0212] Optionally, the UE 1 may generate the shared key K_com based on GPK, ID1, SK_ID1, and ID2 by using a parameter input that is the same as that of the UE 2, and then derive K_session by using the parameter input that is the same as that of the UE 2.

    [0213] The ciphertext 1 may be obtained by encryption in the following manners: encrypting ID1, ID2, and the nonce 2 based on the shared key K_com, to obtain the first ciphertext (ciphertext 1); performing identity-based encryption, and encrypting ID1, ID2, and the nonce 2 by using ID2 to obtain the first ciphertext (ciphertext 1); and encrypting ID1, ID2, and the nonce 2 based on the session key K_session to obtain the first ciphertext (ciphertext 1).

    [0214] 906: The UE 1 sends the first ciphertext (ciphertext 1) to the UE 2.

    [0215] 907: The UE 2 decrypts the first ciphertext by using SK_ID2, K_com, or K_session, to obtain the nonce 2 by decryption, and determines whether the nonce 2 obtained by decryption and the encrypted nonce 2 in step 903 are the same. If the nonce 2 obtained by decryption and the encrypted nonce 2 in step 903 are the same, authentication of the UE 1 succeeds.

    [0216] It should be noted that in the embodiment shown in FIG. 9, the nonce 1 may not need to be encrypted in step 901, and the UE 1 directly sends the nonce 1 to the UE 2. Optionally, in step 906, the nonce 2 may alternatively not be encrypted and is directly sent by the UE 1 to the UE 2. In the authentication method based on a three-round authentication procedure provided in this embodiment of the present invention, the UE 1 attempts to authenticate the second ciphertext (ciphertext 2) from the UE 2 by using the shared key K_com or SK_ID1, and subsequently the UE 2 attempts to authenticate the first ciphertext (ciphertext 1) from the UE 1 by using SK_ID2 or the shared key K_com. In this way, mutual authentication can be completed based on encryption, and an authentication flexibility requirement of a service can be satisfied.

    [0217] FIG. 10 is a flowchart of a third-round authentication method for mutual authentication based on a signature according to an embodiment of the present invention. In the embodiment shown in FIG. 10, UE 1 may have a first user identifier (ID1), a first subscriber key(SK_ID1), and a global public key (GPK), and UE 2 may have a first user identifier (ID2), a second subscriber key(SK_ID2), and a global public key (GPK). In the embodiment shown in FIG. 10, UE 1 and the UE 2 prove authenticity to the other party by using digital signatures of the UE 1 and the UE 2.

    [0218] A difference between this embodiment and the embodiment shown in FIG. 8 lies in that in this embodiment, a digital signature is used to replace the MAC in the embodiment shown in FIG. 8. Referring to FIG. 10, a three-round authentication method based on a three-round authentication procedure provided in an embodiment of the present invention may include:
    1001: UE 1 sends a session identifier (session ID), a nonce 1, ID1, and a service identifier (service ID) to UE 2, and may further send a second user identifier (ID2).

    [0219] 1002: The UE 2 obtains the nonce 1 and randomly selects a nonce 2. The UE 2 may calculate K_com by using a same manner as that in the foregoing embodiment, and derive K_session = KDF ((at least one of K_com, nonce 1, and nonce 2), (at least one of session identifier, first user identifier, second user identifier, service identifier, slice identifier, link identifier, connection identifier, serving network identifier, and public land mobile network identifier)).

    [0220] 1003: The UE 2 calculates a second digital signature (signature 2) based on a second subscriber key (SK_ID2), where the signature 2 = Sign (SK_ID2, (at least one of nonce 1 and nonce 2), (at least one of session identifier, first user identifier, second user identifier, service identifier, slice identifier, link identifier, connection identifier, serving network identifier, and public land mobile network identifier)).

    [0221] 1004: The UE 2 sends the nonce 1, the nonce 2, and the second digital signature (signature 2) to the UE 1, and may further send at least one of ID1 and ID2.

    [0222] 1005: The UE 1 attempts to authenticate correctness of the second digital signature (signature 2) based on the second user identifier (ID2). When the correctness of the second digital signature is authenticated, the UE calculates a first digital signature (signature 1) based on a first subscriber key (SK_ID1). The signature 1 = Sign (SK_ID1, (at least one of nonce 1 and nonce 2), (at least one of session identifier, first user identifier, second user identifier, service identifier, slice identifier, link identifier, connection identifier, serving network identifier, and public land mobile network identifier)). If the second digital signature fails to be authenticated, the first digital signature may not be calculated.

    [0223] Meanwhile, the UE 1 may calculate K_com and K_session in the same manner.

    [0224] 1006: The UE 1 sends the first digital signature (signature 1) to the UE 2.

    [0225] 1007: The UE 2 attempts to authenticate correctness of the first digital signature (signature 1) based on the first user identifier (ID1). After authentication succeeds, the UE 1 and the UE 2 share K_session. In addition, a communication session between the UE 1 and the UE 2 may be encrypted by using K_session, to ensure security.

    [0226] In the authentication method based on a three-round authentication procedure provided in this embodiment of the present invention, the UE 1 attempts to authenticate correctness of the second digital signature (signature 2) based on ID2, and the UE 2 attempts to authenticate correctness of the first digital signature (signature 1) based on ID1. In this way, mutual authentication can be completed based on the digital signatures, and an authentication flexibility requirement of a service is satisfied.

    [0227] The following describes an authentication method based on a two-round authentication procedure provided in an embodiment of the present invention.

    [0228] FIG. 11 is a flowchart of a two-round authentication method for mutual authentication based on a MAC according to an embodiment of the present invention. In the embodiment shown in FIG. 11, UE 1 may have a first user identifier (ID1), a first subscriber key (SK_ID1), and a global public key (GPK), and UE 2 may have a second user identifier (ID2), a second subscriber key (SK_ID2), and a global public key (GPK).

    [0229] The authentication procedure in the embodiment shown in FIG. 11 is approximately similar to that in the embodiment shown in FIG. 8. A difference lies in that after receiving a first message from the UE 1, the UE 2 may perform authentication on legality of the UE 1. In the three-round authentication shown in FIG. 8, the UE 2 attempts to authenticate legality of the UE 1 only after receiving a second message from the UE 1.

    [0230] Referring to FIG. 11, the authentication method based on the two-round authentication procedure provided in an embodiment of the present invention may include:
    1101: UE 1 generates a shared key K_com.

    [0231] There may be the following two calculation formulas:



    [0232] Specifically, if a user 1 and a user 2 want to perform secure communication, parameters are as follows: an identity of the user 1 is ID1, an identity-based private key of the user 1 is SK_ID1 = sH(ID1), an identity of the user 2 is ID2, and an identity-based private key of the user 2 is SK_ID2 = sH(ID2). The user 1 and the user 2 can calculate a unique shared key K = e(xH(ID1), H(ID2)) of the user 1 and the user 2 without exchanging a message.

    where the key K is bound with the parameter 1, the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm may be a Hash() algorithm or may be an HMAC() algorithm.

    [0233] 1102: The UE 1 randomly selects a nonce 1 and calculates a MAC 1 by using K_com.



    [0234] 1103: The UE 1 sends a session identifier, the nonce 1, a first user identifier, a second user identifier, and the MAC 1 to UE 2.

    [0235] 1104: The UE 2 generates K_com.

    [0236] There may be the following two calculation formulas:



    [0237] Specifically, if a user 1 and a user 2 want to perform secure communication, parameters are as follows: an identity of the user 1 is ID1, an identity-based private key of the user 1 is SK_ID1 = sH(ID1), an identity of the user 2 is ID2, and an identity-based private key of the user 2 is SK_ID2 = sH(ID2). The user 1 and the user 2 can calculate a unique shared key K = e(xH(ID1), H(ID2)) of the user 1 and the user 2 without exchanging a message.

    where the key K is bound with the parameter 1, the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm may be a Hash() algorithm or may be an HMAC() algorithm.

    [0238] 1105: The UE 2 attempts to authenticate correctness of the MAC 1, and when the correctness of the MAC 1 is authenticated, calculates a MAC 2 based on a randomly selected nonce 2 and K com.



    [0239] 1106: The UE 2 sends the nonce 1, the nonce 2, the first user identifier, the second user identifier, and the MAC 2 to the UE 1.

    [0240] 1107: The UE 1 attempts to authenticate correctness of the MAC 2, and derives a session key



    [0241] 1108: The UE 2 derives a session key K_session = KDF (K_com, (at least one of session identifier, nonce 1, nonce 2, service identifier, ID1, and ID2)).

    [0242] Optionally, a sequence of performing step 1108 may be adjusted, and step 1108 may be performed in any step after step 1104.

    [0243] Optionally, in step 1101 or step 1102, the UE 1 may further calculate K_session. In this case, the parameter of the nonce 2 is not included when K_session is derived, and the UE 1 may subsequently calculate the MAC 1 based on K_session. Correspondingly, the UE 2 calculates K_com and K_session, attempts to authenticate correctness of the MAC 1 by using K_session, and after authentication succeeds, calculates the MAC 2 based on K_session and sends the MAC 2 to the UE 1, so that the UE 1 attempts to authenticate authenticity of the MAC 2, to complete mutual authentication.

    [0244] In the authentication method based on a two-round authentication procedure provided in this embodiment of the present invention, the UE 2 attempts to authenticate a MAC from the UE 1 by using K_com or K_session, and subsequently the UE 1 attempts to authenticate the MAC 2 from the UE 2 by using K_com or K_session. In this way, mutual authentication can be completed based on the MAC, and an authentication flexibility requirement of a service can be satisfied.

    [0245] FIG. 12 is a flowchart of a two-round authentication method for mutual authentication based on a signature according to an embodiment of the present invention. In the embodiment shown in FIG. 12, the UE 1 may have a first user identifier (ID1), a first subscriber key (SK_ID1), and a global public key (GPK), and the UE 2 may have a second user identifier (ID2), a second subscriber key (SK_ID2), and a global public key (GPK).

    [0246] The authentication procedure in the embodiment shown in FIG. 12 is approximately similar to that in the embodiment shown in FIG. 11. A difference lies in that in the embodiment, a digital signature is used to replace the MAC in the embodiment shown in FIG. 11.

    [0247] Referring to FIG. 12, a three-round authentication method based on a two-round authentication procedure provided in an embodiment of the present invention may include:

    1201: UE 1 generates K_com in the same manner as that in the foregoing embodiment.

    1202: The UE 1 randomly selects a nonce 1, and calculates a first digital signature (signature 1) by using SK_ID1. The signature 1 = Sign (SK_ID1, (at least one of nonce 1, session identifier, ID1, ID2, service identifier, slice ID, link ID, connection identifier, session identifier, serving network identifier, and PLMN ID)).

    1203: The UE 1 sends the session identifier, the nonce 1, ID1, ID2, and the first digital signature (signature 1) to UE 2.

    1204: The UE 2 generates K_com in the same manner.

    1205: The UE 2 attempts to authenticate correctness of the first digital signature (signature 1) by using ID1, and after authentication succeeds, calculates a second digital signature (signature 2) by using SK_ID2. The signature 2 = Sign (SK_ID2, (at least one of nonce 1 and nonce 2), (at least one of session identifier, ID1, ID2, service identifier, slice ID, link ID, connection identifier, serving network identifier, and PLMN ID)).

    1206: The UE 2 sends the nonce 1, the nonce 2, the first user identifier, the second user identifier, and the second digital signature (signature 2) to the UE 1.

    1207: The UE 1 attempts to authenticate correctness of the second digital signature (signature 2), and derives a session key K_session = KDF (K_com, (at least one of session identifier, nonce 1, nonce 2, service identifier, ID1, and ID2)).

    1208: The UE 2 derives a session key K_session = KDF (K_com, (at least one of session identifier, nonce 1, nonce 2, service identifier, ID1, and ID2)).



    [0248] Optionally, step 1208 of deriving the session key K_session may be performed in any step after step 1204.

    [0249] Optionally, in step 1201 or step 1202, the UE 1 may further calculate K_session. In this case, the parameter of the nonce 2 is not included when K_session is derived. Correspondingly, the UE 2 calculates K_com, and calculates K_session in the same manner as that of the UE 1.

    [0250] In the authentication method based on a two-round authentication procedure provided in this embodiment of the present invention, the UE 2 attempts to authenticate correctness of the first digital signature (signature 1) based on ID1, and the UE 1 attempts to authenticate correctness of the second digital signature (signature 2) based on ID2. In this way, mutual authentication can be completed based on the digital signature, and an authentication flexibility requirement of a service is satisfied.

    [0251] It should be noted that the foregoing embodiments are all based on a session. A session identifier (session ID) is added to a sent message, and a parameter of a session identifier is also added in key deriving and authentication. The foregoing manner also supports a slice, flow (flow), and bearer mode. To be specific, a slice ID, a flow identifier, or a bearer ID is added to a sent message, and the parameter of the slice ID, the flow identifier, or the bearer ID is also added in key deriving and authentication.

    [0252] FIG. 13 is a structural block diagram of an authentication apparatus according to an embodiment of the present invention. Referring to FIG. 13, the authentication apparatus 1300 includes a sending module 1301, a receiving module 1302, and a processing module 1303.

    [0253] The sending module 1301 is configured to send a first random parameter to second user equipment.

    [0254] The receiving module 1302 is configured to receive a second authentication feature from the second user equipment.

    [0255] The processing module 1303 is configured to: attempt to authenticate correctness of the second authentication feature, and generate a first authentication feature.

    [0256] The sending module 1301 is further configured to send the first authentication feature to the second user equipment.

    [0257] In a case, the authentication feature is a message authentication code. In this case, before the first authentication feature is generated, the receiving module 1302 is further configured to: receive the first random parameter and the second random parameter from the second user equipment. The processing module 1303 is specifically configured to: obtain the first user identifier and the second user identifier, generate a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier, and generate a first MAC based on the communication shared key K_com or the session key K_session, the first random parameter, and the second random parameter, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    where
    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the first user equipment in advance or received from the first user equipment.

    [0258] In a case, the authentication feature is a ciphertext. In this case, the processing module 1303 is specifically configured to:
    decrypt a second ciphertext by using a first subscriber key, a communication shared key K_com, or a session key K_session, to obtain a first random parameter and a second random parameter, and determining whether the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, where if the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, authentication succeeds, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and



    [0259] When the authentication feature is a ciphertext, the processing module 1303 is specifically configured to:
    obtain the first user identifier and the second user identifier, and encrypt the first user identifier, the second user identifier, and the second random parameter by using the first user identifier, the communication shared key K_com, or the session key K_session, to generate a first ciphertext.

    [0260] In a case, the authentication feature is a digital signature. In this case, the receiving module 1302 is further configured to: receive the first random parameter and the second random parameter from the second user equipment.

    [0261] The processing module 1303 is specifically configured to calculate a first digital signature based on the first random parameter, the second random parameter, and a first subscriber key, where

    where
    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance or received from the first user equipment.

    [0262] In the authentication apparatus provided in this embodiment of the present invention, authentication is performed between two terminal devices by using a MAC, a ciphertext, or a digital signature, and in an authentication process, participation of an HSS is not required, so that an authentication flexibility requirement of a service can be satisfied.

    [0263] FIG. 14 is a structural block diagram of an authentication apparatus according to an embodiment of the present invention. Referring to FIG. 14, the authentication apparatus 1400 includes a sending module 1401, a receiving module 1402, and a processing module 1403.

    [0264] The receiving module 1402 is configured to receive a first random parameter from first user equipment.

    [0265] The processing module 1403 is configured to: obtain a first user identifier, a second user identifier, and a second random parameter, generate a second authentication feature based on the first user identifier, the second user identifier, the first random parameter, and the second random parameter, and send the second authentication feature to the first user equipment.

    [0266] The receiving module 1402 is further configured to receive a first authentication feature from the first user equipment.

    [0267] The processing module 1403 is further configured to attempt to authenticate correctness of the first authentication feature.

    [0268] In a case, the authentication feature is a message authentication code, and the sending module 1401 is configured to:
    after the processing module 1403 generates a second MAC, send the first random parameter and the second random parameter to the first user equipment.

    [0269] When the authentication feature is a message authentication code, the processing module 1403 is specifically configured to:

    generate a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier; and

    generate the second MAC based on the communication shared key K_com or the session key K_session, the first random parameter, and the second random parameter, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance or received from the first user equipment.



    [0270] In a case, the authentication feature is a ciphertext, and the processing module 1403 is specifically configured to:

    encrypt the first user identifier, the second user identifier, the first random parameter, and the second random parameter by using the first user identifier, the communication shared key K_com, or the session key K_session, to generate a second ciphertext; and

    the attempting to authenticate correctness of the first authentication feature includes:
    decrypt the first ciphertext by using the first subscriber key, the communication shared key K_com, or the session key K_session, to obtain a second random parameter, and determining whether the second random parameter obtained by decryption is the same as the previously encrypted second random parameter, where if the second random parameter obtained by decryption is the same as the previously encrypted second random parameter, authentication succeeds, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and



    [0271] In a case, the authentication feature is a digital signature;
    the processing module 1403 is specifically configured to: generate a second digital signature in the following manner:

    and
    after the processing module 1403 generates the second digital signature, the sending module 1401 is configured to: send the first random parameter and the second random parameter to the first user equipment.

    [0272] In the authentication apparatus provided in this embodiment of the present invention, authentication is performed between two terminal devices by using a MAC, a ciphertext, or a digital signature, and in an authentication process, participation of an HSS is not required, so that an authentication flexibility requirement of a service can be satisfied.

    [0273] FIG. 15 is a schematic structural diagram of a terminal device according to an embodiment of the present invention. Referring to FIG. 15, the terminal 1500 provided in this embodiment of the present invention may include: at least one processor 1501, a memory 1502, a communications interface 1503, and a bus. The processor 1501, the memory 1502, and the communications interface 1503 are connected to and communicate with each other by using the bus. The bus may be an industry standard architecture (Industry Standard Architecture, ISA for short) bus, a peripheral component interconnect (Peripheral Component, PCI for short) bus, an extended industry standard architecture (Extended Industry Standard Architecture, EISA for short) bus, or the like. The bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used to represent the bus in FIG. 15, but this does not mean that there is only one bus or only one type of bus.

    [0274] The memory 1502 is configured to store executable program code, where the program code includes a computer operation instruction. The memory 1502 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory. The processor 1501 reads the executable program code stored by the memory 1502, to run a program corresponding to the executable program code to:

    send a first random parameter to second user equipment;

    receive a second authentication feature from the second user equipment; and

    attempt to authenticate correctness of the second authentication feature, generate a first authentication feature, and send the first authentication feature to the second user equipment.



    [0275] In a case, the authentication feature is a message authentication code MAC, and the processor 1501 reads the executable program code stored by the memory 1502, to run a program corresponding to the executable program code to:

    before the first authentication feature is generated, receive the first random parameter and the second random parameter from the second user equipment; and

    obtain the first user identifier and the second user identifier, and generate a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier; and

    generate a first MAC based on the communication shared key K_com or the session key K_session, the first random parameter, and the second random parameter, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the first user equipment in advance or received from the second user equipment.



    [0276] In another case, the authentication feature is a ciphertext, and the processor 1501 reads the executable program code stored by the memory 1502, to run a program corresponding to the executable program code to:
    decrypt a second ciphertext by using a first subscriber key, a communication shared key K_com, or a session key K_session, to obtain a first random parameter and a second random parameter, and determining whether the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, where if the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, authentication succeeds, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and



    [0277] When the authentication feature is a ciphertext, the processor 1501 reads the executable program code to: obtain the first user identifier and the second user identifier, and encrypt the first user identifier, the second user identifier, and the second random parameter by using the first user identifier, the communication shared key K_com, or the session key K_session, to generate a first ciphertext.

    [0278] In another case, the authentication feature is a digital signature, and the processor 1501 reads the executable program code stored by the memory 1502, to run a program corresponding to the executable program code to: before the first authentication feature is generated, receive the first random parameter and the second random parameter from the second user equipment; and

    calculate a first digital signature based on the first random parameter, the second random parameter, and a first subscriber key, where

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance or received from the first user equipment.



    [0279] In the terminal provided in this embodiment of the present invention, authentication is performed between two terminal devices by using a MAC, a ciphertext, or a digital signature, and in an authentication process, participation of an HSS is not required, so that an authentication flexibility requirement of a service can be satisfied.

    [0280] FIG. 16 is a schematic structural diagram of a terminal device according to an embodiment of the present invention. Referring to FIG. 16, the terminal 1600 provided in this embodiment of the present invention may include: at least one processor 1601, a memory 1602, a communications interface 1603, and a bus. The processor 1601, the memory 1602, and the communications interface 1603 are connected to and communicate with each other by using the bus. The bus may be an industry standard architecture (Industry Standard Architecture, ISA for short) bus, a peripheral component interconnect (Peripheral Component, PCI for short) bus, an extended industry standard architecture (Extended Industry Standard Architecture, EISA for short) bus, or the like. The bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used to represent the bus in FIG. 16, but this does not mean that there is only one bus or only one type of bus.

    [0281] The memory 1602 is configured to store executable program code, where the program code includes a computer operation instruction. The memory 1602 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory. The processor 1601 reads the executable program code stored by the memory 1602 to run a program corresponding to the executable program code to:

    receive a first random parameter from first user equipment;

    obtain a first user identifier, a second user identifier, and a second random parameter, generate a second authentication feature based on the first user identifier, the second user identifier, the first random parameter, and the second random parameter, and send the second authentication feature to the first user equipment;

    receive a first authentication feature from the first user equipment; and

    attempt to authenticate correctness of the first authentication feature.



    [0282] In a case, the authentication feature is a message authentication code (MAC), and the processor 1601 reads the executable program code stored by the memory 1602 to run a program corresponding to the executable program code to:

    generate a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier; and

    generate the second MAC based on the communication shared key K com or the session key K_session, the first random parameter, and the second random parameter, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    where

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance or received from the first user equipment.



    [0283] After the second MAC is generated, the first random parameter and the second random parameter may be sent to the first user equipment.

    [0284] In another case, the authentication feature is a ciphertext, and the processor 1601 reads the executable program code stored by the memory 1602 to run a program corresponding to the executable program code to:

    encrypt the first user identifier, the second user identifier, the first random parameter, and the second random parameter by using the first user identifier, a communication shared key K_com, or a session key K_session, to generate a second ciphertext; and

    decrypt a first ciphertext by using a first subscriber key, the communication shared key K_com, or the session key K_session, to obtain a second random parameter, and determining whether the second random parameter obtained by decryption is the same as the previously encrypted second random parameter, where if the second random parameter obtained by decryption is the same as the previously encrypted second random parameter, authentication succeeds, where

    where the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and



    [0285] In another case, the authentication feature is a digital signature, and the processor 1601 reads the executable program code stored by the memory 1602 to run a program corresponding to the executable program code to:

    and after the second digital signature is generated, send the first random parameter and the second random parameter to the first user equipment.

    [0286] In the terminal provided in this embodiment of the present invention, authentication is performed between two terminal devices by using a MAC, a ciphertext, or a digital signature, and in an authentication process, participation of an HSS is not required, so that an authentication flexibility requirement of a service can be satisfied.

    [0287] It should be noted that an authentication system provided in the embodiments of the present invention may include the terminal shown in FIG. 15 and the terminal shown in FIG. 16. The terminals shown in FIG. 15 and FIG. 16 may be the user equipments described in the foregoing. For related content of the embodiment of the terminal and the embodiment of the authentication method, refer to each other.

    [0288] It should be noted that an example in which the authentication apparatus provided in the foregoing embodiment includes only the foregoing modules is used for description. In an actual application, one or more modules may be added or reduced based on a requirement, to perform some or all functions described above. In addition, the embodiments of the authentication apparatus and the authentication method provided in the foregoing embodiments belong to a same idea, and for specific implementation processes thereof, refer to the method embodiment. Details are not described herein again.

    [0289] It should be noted that the embodiments in this specification are all described in a progressive manner, each embodiment focuses on a difference from other embodiments, and for same or similar parts in the embodiments, reference may be made to these embodiments. An apparatus embodiment is basically similar to a method embodiment, and therefore is described briefly. For related parts, reference may be made to partial descriptions in the method embodiment.

    [0290] It should be noted that, in this specification, the terms "include", "comprise", or their any other variant is intended to cover a non-exclusive inclusion, so that a process, a method, an article, or an apparatus that includes a list of elements not only includes those elements but also includes other elements which are not expressly listed, or further includes elements inherent to such process, method, article, or apparatus. An element preceded by "includes a..." does not, without more constraints, preclude the presence of additional identical elements in the process, method, article, or device that includes the element.

    [0291] A person of ordinary skill in the art may understand that all or some of the steps of the embodiments may be implemented by hardware or a program instructing related hardware. The program may be stored in a computer-readable storage medium. The storage medium may include: a read-only memory, a magnetic disk, or an optical disc.

    [0292] The foregoing descriptions are merely example embodiments of the present invention, but are not intended to limit the present invention. Any modification, equivalent replacement, and improvement made without departing from the principle of the present invention shall fall within the protection scope of the present invention.


    Claims

    1. An authentication method, wherein the method comprises:

    sending, by first user equipment, a first random parameter to second user equipment;

    obtaining, by the second user equipment, a first user identifier, a second user identifier, and a second random parameter, generating a second authentication feature based on the first user identifier, the second user identifier, the first random parameter, and the second random parameter, and sending the second authentication feature to the first user equipment;

    attempting to authenticate, by the first user equipment, correctness of the second authentication feature, generating a first authentication feature, and sending the first authentication feature to the second user equipment; and

    attempting to authenticate, by the second user equipment, correctness of the first authentication feature, wherein the authentication feature is a message authentication code, MAC, and after a second MAC is generated, the method further comprises:

    sending, by the second user equipment, the first random parameter and the second random parameter to the first user equipment; and

    the generating, by the first user equipment, a first authentication feature comprises: generating, by the first user equipment, the first MAC based on the first random parameter and the second random parameter, wherein the generating a second MAC comprises:

    generating a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier; and

    generating the second MAC based on the communication shared key K_com or the session key K_session, the first random parameter, and the second random parameter.


     
    2. The authentication method according to claim 1, wherein the obtaining, by the second user equipment, a first user identifier, a second user identifier, and a second random parameter comprises:
    receiving, by the second user equipment, the first user identifier and the second user identifier from the first user equipment, and randomly generating the second random parameter.
     
    3. An authentication method, wherein the method comprises:

    sending, by first user equipment, a first random parameter to second user equipment;

    receiving, by the first user equipment, a second authentication feature from the second user equipment; and

    attempting to authenticate, by the first user equipment, correctness of the second authentication feature, generating a first authentication feature, and sending the first authentication feature to the second user equipment, wherein the authentication feature is a message authentication code MAC, and before the generating a first authentication feature, the method further comprises:

    receiving, by the first user equipment, the first random parameter and a second random parameter from the second user equipment; and

    the generating a first authentication feature comprises:

    obtaining, by the first user equipment, the first user identifier and the second user identifier, and generating a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier; and

    generating, by the first user equipment, a first MAC based on the communication shared key K_com or the session key K_session, the first random parameter, and the second random parameter, wherein

    wherein the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    wherein

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the first user equipment in advance or received from the second user equipment.


     
    4. The authentication method according to claim 3, wherein the authentication feature is a ciphertext, and the attempting to authenticate, by the first user equipment, correctness of the second authentication feature comprises:
    decrypting, by the first user equipment, a second ciphertext by using a first subscriber key, a communication shared key K_com, or a session key K_session, to obtain a first random parameter and a second random parameter, and determining whether the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, wherein if the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, authentication succeeds, wherein

    wherein the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and


     
    5. The authentication method according to claim 4, wherein the generating a first authentication feature comprises:
    obtaining, by the first user equipment, the first user identifier and the second user identifier, and encrypting the first user identifier, the second user identifier, and the second random parameter by using the first user identifier, the communication shared key K_com, or the session key K_session, to generate a first ciphertext.
     
    6. An authentication method, wherein the method comprises:

    receiving, by second user equipment, a first random parameter from first user equipment;

    obtaining, by the second user equipment, a first user identifier, a second user identifier, and a second random parameter, generating a second authentication feature based on the first user identifier, the second user identifier, the first random parameter, and the second random parameter, and sending the second authentication feature to the first user equipment;

    receiving, by the second user equipment, a first authentication feature from the first user equipment; and

    attempting to authenticate, by the second user equipment, correctness of the first authentication feature, wherein the authentication feature is a message authentication code MAC, and after a second MAC is generated, the method further comprises:
    sending, by the second user equipment, the first random parameter and the second random parameter to the first user equipment, wherein the generating a second MAC comprises:

    generating a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier; and

    generating the second MAC based on the communication shared key K_com or the session key K_session, the first random parameter, and the second random parameter, wherein

    wherein the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    wherein

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance or received from the first user equipment.


     
    7. An authentication apparatus, wherein the authentication apparatus comprises:

    a sending module, configured to send a first random parameter to second user equipment;

    a receiving module, configured to receive a second authentication feature from the second user equipment; and

    a processing module, configured to: attempt to authenticate correctness of the second authentication feature, and generate a first authentication feature, wherein

    the sending module is further configured to send the first authentication feature to the second user equipment, wherein the authentication feature is a message authentication code MAC, and before the first authentication feature is generated, the receiving module is further configured to receive the first random parameter and a second random parameter from the second user equipment; and

    the processing module is specifically configured to: obtain the first user identifier and the second user identifier, generate a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier, and generate a first MAC based on the communication shared key K_com or the session key K_session, the first random parameter, and the second random parameter, wherein

    wherein the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    wherein

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the first user equipment in advance or received from the first user equipment.


     
    8. The authentication apparatus according to claim 7, wherein the authentication feature is a ciphertext, and the processing module is specifically configured to:
    decrypt a second ciphertext by using a first subscriber key, a communication shared key K_com, or a session key K_session, to obtain a first random parameter and a second random parameter, and determining whether the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, wherein if the first random parameter obtained by decryption is the same as the first random parameter previously sent to the second user equipment, authentication succeeds, wherein

    wherein the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm; and


     
    9. An authentication apparatus, wherein the authentication apparatus comprises:

    a receiving module, configured to receive a first random parameter from first user equipment; and

    a processing module, configured to: obtain a first user identifier, a second user identifier, and a second random parameter, generate a second authentication feature based on the first user identifier, the second user identifier, the first random parameter, and the second random parameter, and send the second authentication feature to the first user equipment, wherein

    the receiving module is further configured to receive a first authentication feature from the first user equipment; and

    the processing module is further configured to attempt to authenticate correctness of the first authentication feature, wherein the authentication feature is a message authentication code MAC, and the authentication apparatus further comprises a sending module, configured to:
    after the processing module generates a second MAC, send the first random parameter and the second random parameter to the first user equipment, wherein the processing module is specifically configured to:

    generate a communication shared key K_com and/or a session key K_session based on the first user identifier and the second user identifier; and

    generate the second MAC based on the communication shared key K_com or the session key K_session, the first random parameter, and the second random parameter, wherein

    wherein the parameter 1 may be at least one of a service identifier, a slice identifier, a link identifier, a connection identifier, a session identifier, a serving network identifier, a public land mobile network identifier, the first user identifier, and the second user identifier, and the H() algorithm is a Hash() algorithm or an HMAC() algorithm;

    and

    wherein

    the session identifier, the service identifier, the slice identifier, the link identifier, the connection identifier, the serving network identifier, and the public land mobile network identifier are obtained by the second user equipment in advance or received from the first user equipment.


     


    Ansprüche

    1. Authentifizierungsverfahren, wobei das Verfahren Folgendes umfasst:

    Senden eines ersten Zufallsparameters durch ein erstes Benutzergerät an ein zweites Benutzergerät;

    Erlangen einer ersten Benutzerkennung, einer zweiten Benutzerkennung und eines zweiten Zufallsparameters durch das zweite Benutzergerät, Erzeugen eines zweiten Authentifizierungsmerkmals auf Grundlage der ersten Benutzerkennung, der zweiten Benutzerkennung, des ersten Zufallsparameters und des zweiten Zufallsparameters und Senden des zweiten Authentifizierungsmerkmals an das erste Benutzergerät;

    Versuchen der Authentifizierung der Richtigkeit des zweiten Authentifizierungsmerkmals durch das erste Benutzergerät, Erzeugen eines ersten Authentifizierungsmerkmals und Senden des ersten Authentifizierungsmerkmals an das zweite Benutzergerät; und

    Versuchen der Authentifizierung der Richtigkeit des ersten Authentifizierungsmerkmals durch das zweite Benutzergerät, wobei das Authentifizierungsmerkmal ein Nachrichtenauthentifizierungscode (Message Authentication Code - MAC) ist, und nachdem ein zweiter MAC erzeugt wurde, das Verfahren ferner Folgendes umfasst:

    Senden des ersten Zufallsparameters und des zweiten Zufallsparameters durch das zweite Benutzergerät an das erste Benutzergerät; und

    das Erzeugen eines ersten Authentifizierungsmerkmals durch das erste Benutzergerät Folgendes umfasst: Erzeugen des ersten MAC durch das erste Benutzergerät auf Grundlage des ersten Zufallsparameters und des zweiten Zufallsparameters, wobei das Erzeugen eines zweiten MAC Folgendes umfasst:

    Erzeugen eines gemeinsamen Kommunikationsschlüssels K_com und/oder eines Sitzungsschlüssels K_session auf Grundlage der ersten Benutzerkennung und der zweiten Benutzerkennung; und

    Erzeugen des zweiten MAC auf Grundlage des gemeinsamen Kommunikationsschlüssels K_com oder des Sitzungsschlüssels K_session, des ersten Zufallsparameters und des zweiten Zufallsparameters.


     
    2. Authentifizierungsverfahren nach Anspruch 1, wobei das Erlangen einer ersten Benutzerkennung, einer zweiten Benutzerkennung und eines zweiten Zufallsparameters durch das zweite Benutzergerät Folgendes umfasst:
    Empfangen der ersten Benutzerkennung und der zweiten Benutzerkennung durch das zweite Benutzergerät von dem ersten Benutzergerät und zufälliges Erzeugen des zweiten Zufallsparameters.
     
    3. Authentifizierungsverfahren, wobei das Verfahren Folgendes umfasst:

    Senden eines ersten Zufallsparameters durch ein erstes Benutzergerät an ein zweites Benutzergerät;

    Empfangen eines zweiten Authentifizierungsmerkmals durch das erste Benutzergerät von dem zweiten Benutzergerät; und

    Versuchen der Authentifizierung der Richtigkeit des zweiten Authentifizierungsmerkmals durch das erste Benutzergerät, Erzeugen eines ersten Authentifizierungsmerkmals und Senden des ersten Authentifizierungsmerkmals an das zweite Benutzergerät, wobei das Authentifizierungsmerkmal ein Nachrichtenauthentifizierungscode MAC ist, und das Verfahren vor dem Erzeugen eines ersten Authentifizierungsmerkmals ferner Folgendes umfasst:

    Empfangen des ersten Zufallsparameters und eines zweiten Zufallsparameters durch das erste Benutzergerät von dem zweiten Benutzergerät; und

    das Erzeugen eines ersten Authentifizierungsmerkmals Folgendes umfasst:

    Erlangen der ersten Benutzerkennung und der zweiten Benutzerkennung durch das erste Benutzergerät und Erzeugen eines gemeinsamen Kommunikationsschlüssels K_com und/oder eines Sitzungsschlüssels K_session auf Grundlage der ersten Benutzerkennung und der zweiten Benutzerkennung; und

    Erzeugen eines ersten MAC durch das erste Benutzergerät auf Grundlage des gemeinsamen Kommunikationsschlüssels K_com oder des Sitzungsschlüssels K_session, des ersten Zufallsparameters und des zweiten Zufallsparameters, wobei

    wobei der Parameter 1 zumindest eine von einer Dienstkennung, einer Segmentkennung, einer Link-Kennung, einer Verbindungskennung, einer Sitzungskennung, einer Kennung eines bedienenden Netzes, einer Kennung eines öffentlichen Landmobilfunknetzes, der ersten Benutzerkennung und der zweiten Benutzerkennung sein kann und der H()-Algorithmus ein Hash()-Algorithmus oder ein HMAC()-Algorithmus ist;

    und

    wobei

    die Sitzungskennung, die Dienstkennung, die Segmentkennung, die Link-Kennung, die Verbindungskennung, die Kennung des bedienenden Netzes und die Kennung des öffentlichen Landmobilfunknetzes durch das erste Benutzergerät im Voraus erlangt oder von dem zweiten Benutzergerät empfangen werden.


     
    4. Authentifizierungsverfahren nach Anspruch 3, wobei das Authentifizierungsmerkmal ein verschlüsselter Text ist und das Versuchen der Authentifizierung der Richtigkeit des zweiten Authentifizierungsmerkmals durch das erste Benutzergerät Folgendes umfasst:
    Entschlüsseln eines zweiten verschlüsselten Texts durch das erste Benutzergerät durch Verwendung eines ersten Teilnehmerschlüssels, eines gemeinsamen Kommunikationsschlüssels K_com oder eines Sitzungsschlüssels K_session, um einen ersten Zufallsparameter und einen zweiten Zufallsparameter zu erlangen, und Bestimmen, ob der erste durch Entschlüsselung erlangte Zufallsparameter identisch mit dem zuvor an das zweite Benutzergerät gesendeten ersten Zufallsparameter ist, wobei, wenn der erste Zufallsparameter, der durch Entschlüsselung erlangt wurde, identisch mit dem zuvor an das zweite Benutzergerät gesendeten ersten Zufallsparameter ist, die Authentifizierung erfolgreich ist, wobei

    oder

    wobei der Parameter 1 zumindest eine von einer Dienstkennung, einer Segmentkennung, einer Link-Kennung, einer Verbindungskennung, einer Sitzungskennung, einer Kennung eines bedienenden Netzes, einer Kennung eines öffentlichen Landmobilfunknetzes, der ersten Benutzerkennung und der zweiten Benutzerkennung sein kann und der H()-Algorithmus ein Hash()-Algorithmus oder ein HMAC()-Algorithmus ist; und


     
    5. Authentifizierungsverfahren nach Anspruch 4, wobei das Erzeugen eines ersten Authentifizierungsmerkmals Folgendes umfasst:
    Erlangen der ersten Benutzerkennung und der zweiten Benutzerkennung durch das erste Benutzergerät und Verschlüsseln der ersten Benutzerkennung, der zweiten Benutzerkennung und des zweiten Zufallsparameters durch Verwendung der ersten Benutzerkennung, des gemeinsamen Kommunikationsschlüssels K_com oder des Sitzungsschlüssels K_session, um einen ersten verschlüsselten Text zu erzeugen.
     
    6. Authentifizierungsverfahren, wobei das Verfahren Folgendes umfasst:

    Empfangen eines ersten Zufallsparameters durch ein zweites Benutzergerät von einem ersten Benutzergerät;

    Erlangen einer ersten Benutzerkennung, einer zweiten Benutzerkennung und eines zweiten Zufallsparameters durch das zweite Benutzergerät, Erzeugen eines zweiten Authentifizierungsmerkmals auf Grundlage der ersten Benutzerkennung, der zweiten Benutzerkennung, des ersten Zufallsparameters und des zweiten Zufallsparameters und Senden des zweiten Authentifizierungsmerkmals an das erste Benutzergerät;

    Empfangen eines ersten Authentifizierungsmerkmals durch das zweite Benutzergerät von dem ersten Benutzergerät; und

    Versuchen der Authentifizierung der Richtigkeit des ersten Authentifizierungsmerkmals durch das zweite Benutzergerät, wobei das Authentifizierungsmerkmal ein Nachrichtenauthentifizierungscode MAC ist, und nachdem ein zweiter MAC erzeugt wurde, das Verfahren ferner Folgendes umfasst:
    Senden des ersten Zufallsparameters und des zweiten Zufallsparameters durch das zweite Benutzergerät an das erste Benutzergerät; wobei das Erzeugen eines zweiten MAC Folgendes umfasst:

    Erzeugen eines gemeinsamen Kommunikationsschlüssels K_com und/oder eines Sitzungsschlüssels K_session auf Grundlage der ersten Benutzerkennung und der zweiten Benutzerkennung; und

    Erzeugen des zweiten MAC auf Grundlage des gemeinsamen Kommunikationsschlüssels K_com oder des Sitzungsschlüssels K_session, des ersten Zufallsparameters und des zweiten Zufallsparameters, wobei

    wobei der Parameter 1 zumindest eine von einer Dienstkennung, einer Segmentkennung, einer Link-Kennung, einer Verbindungskennung, einer Sitzungskennung, einer Kennung eines bedienenden Netzes, einer Kennung eines öffentlichen Landmobilfunknetzes, der ersten Benutzerkennung und der zweiten Benutzerkennung sein kann und der H()-Algorithmus ein Hash()-Algorithmus oder ein HMAC()-Algorithmus ist;

    und

    wobei

    die Sitzungskennung, die Dienstkennung, die Segmentkennung, die Link-Kennung, die Verbindungskennung, die Kennung des bedienenden Netzes und die Kennung des öffentlichen Landmobilfunknetzes durch das zweite Benutzergerät im Voraus erlangt oder von dem ersten Benutzergerät empfangen werden.


     
    7. Authentifizierungsvorrichtung, wobei die Authentifizierungsvorrichtung Folgendes umfasst:

    ein Sendemodul, das dazu ausgelegt ist, einen ersten Zufallsparameter an ein zweites Benutzergerät zu senden;

    ein Empfangsmodul, das dazu ausgelegt ist, ein zweites Authentifizierungsmerkmal von dem zweiten Benutzergerät zu empfangen; und

    ein Verarbeitungsmodul, das zu Folgendem ausgelegt ist:

    Versuchen der Authentifizierung der Richtigkeit des zweiten Authentifizierungsmerkmals und Erzeugen eines ersten Authentifizierungsmerkmals, wobei

    das Sendemodul ferner dazu ausgelegt ist, das erste Authentifizierungsmerkmal an das zweite Benutzergerät zu senden, wobei das Authentifizierungsmerkmal ein Nachrichtenauthentifizierungscode MAC ist, und bevor das Authentifizierungsmerkmal erzeugt wird, ist das Empfangsmodul ferner dazu ausgelegt, den ersten Zufallsparameter und einen zweiten Zufallsparameter von dem zweiten Benutzergerät zu empfangen; und

    das Verarbeitungsmodul insbesondere zu Folgendem ausgelegt ist: Erlangen der ersten Benutzerkennung und der zweiten Benutzerkennung, Erzeugen eines gemeinsamen Kommunikationsschlüssels K_com und/oder eines Sitzungsschlüssels K_session auf Grundlage der ersten Benutzerkennung und der zweiten Benutzerkennung und Erzeugen eines ersten MAC auf Grundlage des gemeinsamen Kommunikationsschlüssels K_com oder des Sitzungsschlüssels K_session, des ersten Zufallsparameters und des zweiten Zufallsparameters, wobei

    wobei der Parameter 1 zumindest eine von einer Dienstkennung, einer Segmentkennung, einer Link-Kennung, einer Verbindungskennung, einer Sitzungskennung, einer Kennung eines bedienenden Netzes, einer Kennung eines öffentlichen Landmobilfunknetzes, der ersten Benutzerkennung und der zweiten Benutzerkennung sein kann und der H()-Algorithmus ein Hash()-Algorithmus oder ein HMAC()-Algorithmus ist;

    und

    wobei

    die Sitzungskennung, die Dienstkennung, die Segmentkennung, die Link-Kennung, die Verbindungskennung, die Kennung des bedienenden Netzes und die Kennung des öffentlichen Landmobilfunknetzes durch das erste Benutzergerät im Voraus erlangt oder von dem ersten Benutzergerät empfangen werden.


     
    8. Authentifizierungsvorrichtung nach Anspruch 7, wobei das Authentifizierungsmerkmal ein verschlüsselter Text ist und das Verarbeitungsmodul insbesondere zu Folgendem ausgelegt ist:
    Entschlüsseln eines zweiten verschlüsselten Texts durch Verwendung eines ersten Teilnehmerschlüssels, eines gemeinsamen Kommunikationsschlüssels K_com oder eines Sitzungsschlüssels K_session, um einen ersten Zufallsparameter und einen zweiten Zufallsparameter zu erlangen, und Bestimmen, ob der erste durch Entschlüsselung erlangte Zufallsparameter identisch mit dem zuvor an das zweite Benutzergerät gesendeten ersten Zufallsparameter ist, wobei, wenn der erste Zufallsparameter, der durch Entschlüsselung erlangt wurde, identisch mit dem zuvor an das zweite Benutzergerät gesendeten ersten Zufallsparameter ist, die Authentifizierung erfolgreich ist, wobei

    oder

    wobei der Parameter 1 zumindest eine von einer Dienstkennung, einer Segmentkennung, einer Link-Kennung, einer Verbindungskennung, einer Sitzungskennung, einer Kennung eines bedienenden Netzes, einer Kennung eines öffentlichen Landmobilfunknetzes, der ersten Benutzerkennung und der zweiten Benutzerkennung sein kann und der H()-Algorithmus ein Hash()-Algorithmus oder ein HMAC()-Algorithmus ist; und


     
    9. Authentifizierungsvorrichtung, wobei die Authentifizierungsvorrichtung Folgendes umfasst:

    ein Empfangsmodul, das dazu ausgelegt ist, einen ersten Zufallsparameter von einem ersten Benutzergerät zu empfangen; und

    ein Verarbeitungsmodul, das zu Folgendem ausgelegt ist: Erlangen einer ersten Benutzerkennung, einer zweiten Benutzerkennung und eines zweiten Zufallsparameters, Erzeugen eines zweiten Authentifizierungsmerkmals auf Grundlage der ersten Benutzerkennung, der zweiten Benutzerkennung, des ersten Zufallsparameters und des zweiten Zufallsparameters und Senden des zweiten Authentifizierungsmerkmals an das erste Benutzergerät; wobei

    das Empfangsmodul ferner dazu ausgelegt ist, ein erstes Authentifizierungsmerkmal von dem ersten Benutzergerät zu empfangen; und

    das Verarbeitungsmodul ferner dazu ausgelegt ist zu versuchen, die Richtigkeit des ersten Authentifizierungsmerkmals zu authentifizieren, wobei das Authentifizierungsmerkmal ein Nachrichtenauthentifizierungscode MAC ist, und die Authentifizierungsvorrichtung ferner ein Sendemodul umfasst, das zu Folgendem ausgelegt ist:
    nachdem das Verarbeitungsmodul einen zweiten MAC erzeugt hat, Senden des ersten Zufallsparameters und des zweiten Zufallsparameters an das erste Benutzergerät, wobei das Verarbeitungsmodul insbesondere zu Folgendem ausgelegt ist:

    Erzeugen eines gemeinsamen Kommunikationsschlüssels K_com und/oder eines Sitzungsschlüssels K_session auf Grundlage der ersten Benutzerkennung und der zweiten Benutzerkennung; und

    Erzeugen des zweiten MAC auf Grundlage des gemeinsamen Kommunikationsschlüssels K_com oder des Sitzungsschlüssels K_session, des ersten Zufallsparameters und des zweiten Zufallsparameters, wobei

    wobei der Parameter 1 zumindest eine von einer Dienstkennung, einer Segmentkennung, einer Link-Kennung, einer Verbindungskennung, einer Sitzungskennung, einer Kennung eines bedienenden Netzes, einer Kennung eines öffentlichen Landmobilfunknetzes, der ersten Benutzerkennung und der zweiten Benutzerkennung sein kann und der H()-Algorithmus ein Hash()-Algorithmus oder ein HMAC()-Algorithmus ist;

    und

    wobei

    die Sitzungskennung, die Dienstkennung, die Segmentkennung, die Link-Kennung, die Verbindungskennung, die Kennung des bedienenden Netzes und die Kennung des öffentlichen Landmobilfunknetzes durch das zweite Benutzergerät im Voraus erlangt oder von dem ersten Benutzergerät empfangen werden.


     


    Revendications

    1. Procédé d'authentification, le procédé comprenant :

    l'envoi, par un premier équipement utilisateur, d'un premier paramètre aléatoire à un second équipement utilisateur ;

    l'obtention, par le second équipement utilisateur, d'un premier identifiant utilisateur, d'un second identifiant utilisateur, et d'un second paramètre aléatoire, la génération d'un second attribut d'authentification d'après le premier identifiant utilisateur, le second identifiant utilisateur, le premier paramètre aléatoire et le second paramètre aléatoire, et l'envoi du second attribut d'authentification au premier équipement utilisateur ;

    la tentative d'authentification, par le premier équipement utilisateur, d'une exactitude du second attribut d'authentification, la génération d'un premier attribut d'authentification, et l'envoi du premier attribut d'authentification au second équipement utilisateur ; et

    la tentative d'authentification, par le second équipement utilisateur, d'une exactitude du premier attribut d'authentification, dans lequel l'attribut d'authentification est un code d'authentification de message, MAC, et après génération d'un second MAC, le procédé comprenant en outre :

    l'envoi, par le second équipement utilisateur, du premier paramètre aléatoire et du second paramètre aléatoire au premier équipement utilisateur ; et

    la génération, par le premier équipement utilisateur, d'un premier attribut d'authentification comprend : la génération, par le premier équipement utilisateur, du premier MAC d'après le premier paramètre aléatoire et le second paramètre aléatoire, dans lequel la génération d'un second MAC comprend :

    la génération d'une clé partagée en communication K_com et/ou d'une clé de session K_session d'après le premier identifiant utilisateur et le second identifiant utilisateur ; et

    la génération du second MAC d'après la clé partagée en communication K_com ou la clé de session K_session, le premier paramètre aléatoire et le second paramètre aléatoire.


     
    2. Procédé d'authentification selon la revendication 1, dans lequel l'obtention, par le second équipement utilisateur, d'un premier identifiant utilisateur, d'un second identifiant utilisateur et d'un second paramètre aléatoire comprend :
    la réception, par le second équipement utilisateur, du premier identifiant utilisateur et du second identifiant utilisateur depuis le premier équipement utilisateur, et la génération aléatoire du second paramètre aléatoire.
     
    3. Procédé d'authentification, le procédé comprenant :

    l'envoi, par un premier équipement utilisateur, d'un premier paramètre aléatoire à un second équipement utilisateur ;

    la réception, par le premier équipement utilisateur, d'un second attribut d'authentification depuis le second équipement utilisateur ; et

    la tentative d'authentification, par le premier équipement utilisateur, d'une exactitude du second attribut d'authentification, la génération d'un premier attribut d'authentification, et l'envoi du premier attribut d'authentification au second équipement utilisateur, dans lequel l'attribut d'authentification est un code d'authentification de message MAC, et avant la génération d'un premier attribut d'authentification, le procédé comprenant en outre :

    la réception, par le premier équipement utilisateur, du premier paramètre aléatoire et d'un second paramètre aléatoire depuis le second équipement utilisateur ; et

    la génération d'un premier attribut d'authentification comprend :

    l'obtention, par le premier équipement utilisateur, du premier identifiant utilisateur et du second identifiant utilisateur, et la génération d'une clé partagée en communication K_com et/ou d'une clé de session K_session d'après le premier identifiant utilisateur et le second identifiant utilisateur ; et

    la génération, par le premier équipement utilisateur, d'un premier MAC d'après la clé partagée en communication K_com et/ou la clé de session K_session, le premier paramètre aléatoire, et le second paramètre aléatoire, dans lequel

    dans lequel le paramètre 1 peut être au moins l'un d'un identifiant de service, d'un identifiant de tranche, d'un identifiant de liaison, d'un identifiant de connexion, d'un identifiant de session, d'un identifiant de réseau de desserte, d'un identifiant de réseau mobile terrestre publique, du premier identifiant utilisateur et du second identifiant utilisateur, et l'algorithme H() est un algorithme de hachage() ou un algorithme HMAC() ;

    et

    dans lequel l'identifiant de session, l'identifiant de service, l'identifiant de tranche, l'identifiant de liaison, l'identifiant de connexion, l'identifiant de réseau de desserte et l'identifiant de réseau mobile terrestre publique sont obtenus à l'avance par le premier équipement utilisateur ou reçus depuis le second équipement utilisateur.


     
    4. Procédé d'authentification selon la revendication 3, dans lequel l'attribut d'authentification est un texte chiffré, et la tentative d'authentification, par le premier équipement utilisateur, d'une exactitude du second attribut d'authentification comprend :

    le déchiffrement, par le premier équipement utilisateur, d'un second texte chiffré en utilisant une première clé d'abonné, une clé partagée en communication K_com, ou une clé de session K_session, pour obtenir un premier paramètre aléatoire et un second paramètre aléatoire, et la détermination permettant de savoir si le premier paramètre aléatoire obtenu par déchiffrement est le même que le premier paramètre aléatoire précédemment envoyé au second équipement utilisateur, dans lequel si le premier paramètre aléatoire obtenu par déchiffrement est le même que le premier paramètre aléatoire précédemment envoyé au second équipement utilisateur, l'authentification réussit, dans lequel

    ou

    dans lequel le paramètre 1 peut être au moins l'un d'un identifiant de service, d'un identifiant de tranche, d'un identifiant de liaison, d'un identifiant de connexion, d'un identifiant de session, d'un identifiant de réseau de desserte, d'un identifiant de réseau mobile terrestre publique, du premier identifiant utilisateur et du second identifiant utilisateur, et l'algorithme H() est un algorithme de hachage() ou un algorithme HMAC() ; et


     
    5. Procédé d'authentification selon la revendication 4, dans lequel la génération d'un premier attribut d'authentification comprend :
    l'obtention, par le premier équipement utilisateur, du premier identifiant utilisateur et du second identifiant utilisateur, et le chiffrement du premier identifiant utilisateur, du second identifiant utilisateur, et du second paramètre aléatoire en utilisant le premier identifiant utilisateur, la clé partagée en communication K_com, ou la clé de session K_session, pour générer un premier texte chiffré.
     
    6. Procédé d'authentification, le procédé comprenant :

    la réception, par un second équipement utilisateur, d'un premier paramètre aléatoire depuis un premier équipement utilisateur ;

    l'obtention, par le second équipement utilisateur, d'un premier identifiant utilisateur, d'un second identifiant utilisateur et d'un second paramètre aléatoire, la génération d'un second attribut d'authentification d'après le premier identifiant utilisateur, le second identifiant utilisateur, le premier paramètre aléatoire et le second paramètre aléatoire, et l'envoi du second attribut d'authentification au premier équipement utilisateur ;

    la réception, par le second équipement utilisateur, d'un premier attribut d'authentification depuis le premier équipement utilisateur ; et

    la tentative d'authentification, par le second équipement utilisateur, d'une exactitude du premier attribut d'authentification, dans lequel l'attribut d'authentification est un code d'authentification de message MAC, et après génération d'un second MAC, le procédé comprenant en outre :
    l'envoi, par le second équipement utilisateur, du premier paramètre aléatoire et du second paramètre aléatoire au premier équipement utilisateur, dans lequel la génération d'un second MAC comprend :

    la génération d'une clé partagée en communication K_com et/ou d'une clé de session K_session d'après le premier identifiant utilisateur et le second identifiant utilisateur ; et

    la génération du second MAC d'après la clé partagée en communication K_com ou la clé de session K_session, le premier paramètre aléatoire et le second paramètre aléatoire, dans lequel

    dans lequel le paramètre 1 peut être au moins l'un d'un identifiant de service, d'un identifiant de tranche, d'un identifiant de liaison, d'un identifiant de connexion, d'un identifiant de session, d'un identifiant de réseau de desserte, d'un identifiant de réseau mobile terrestre publique, du premier identifiant utilisateur et du second identifiant utilisateur, et l'algorithme H() est un algorithme de hachage() ou un algorithme HMAC() ;

    et

    dans lequel l'identifiant de session, l'identifiant de service, l'identifiant de tranche, l'identifiant de liaison, l'identifiant de connexion, l'identifiant de réseau de desserte et l'identifiant de réseau mobile terrestre publique sont obtenus à l'avance par le second équipement utilisateur ou reçus depuis le premier équipement utilisateur.


     
    7. Appareil d'authentification, l'appareil d'authentification comprenant :

    un module d'envoi, conçu pour envoyer un premier paramètre aléatoire à un second équipement utilisateur ;

    un module de réception, conçu pour recevoir un second attribut d'authentification depuis le second équipement utilisateur ; et

    un module de traitement, conçu pour : tenter d'authentifier une exactitude du second attribut d'authentification, et générer un premier attribut d'authentification, dans lequel

    le module d'envoi est en outre conçu pour envoyer le premier attribut d'authentification au second équipement utilisateur, dans lequel l'attribut d'authentification est un code d'authentification de message, MAC, et avant génération du premier attribut d'authentification, le module de réception est en outre conçu pour recevoir le premier paramètre aléatoire et un second paramètre aléatoire depuis le second équipement utilisateur ; et

    le module de traitement est spécifiquement conçu pour : obtenir le premier identifiant utilisateur et le second identifiant utilisateur, générer une clé partagée en communication K_com et/ou une clé de session K_session d'après le premier identifiant utilisateur et le second identifiant utilisateur, et générer un premier MAC d'après la clé partagée en communication K_com ou la clé de session K_session, le premier paramètre aléatoire et le second paramètre aléatoire, dans lequel

    dans lequel le paramètre 1 peut être au moins l'un d'un identifiant de service, d'un identifiant de tranche, d'un identifiant de liaison, d'un identifiant de connexion, d'un identifiant de session, d'un identifiant de réseau de desserte, d'un identifiant de réseau mobile terrestre publique, du premier identifiant utilisateur et du second identifiant utilisateur, et l'algorithme H() est un algorithme de hachage() ou un algorithme HMAC() ;

    et

    dans lequel l'identifiant de session, l'identifiant de service, l'identifiant de tranche, l'identifiant de liaison, l'identifiant de connexion, l'identifiant de réseau de desserte et l'identifiant de réseau mobile terrestre publique sont obtenus à l'avance par le premier équipement utilisateur ou reçus depuis le premier équipement utilisateur.


     
    8. Appareil d'authentification selon la revendication 7, dans lequel l'attribut d'authentification est un texte chiffré, et le module de traitement est spécifiquement conçu pour :
    déchiffrer un second texte chiffré en utilisant une première clé d'abonné, une clé partagée en communication K_com, ou une clé de session K_session, pour obtenir un premier paramètre aléatoire et un second paramètre aléatoire, et déterminer si le premier paramètre aléatoire obtenu par déchiffrement est le même que le premier paramètre aléatoire précédemment envoyé au second équipement utilisateur, dans lequel si le premier paramètre aléatoire obtenu par déchiffrement est le même que le premier paramètre aléatoire précédemment envoyé au second équipement utilisateur, l'authentification réussit, dans lequel


    ou

    dans lequel le paramètre 1 peut être au moins l'un d'un identifiant de service, d'un identifiant de tranche, d'un identifiant de liaison, d'un identifiant de connexion, d'un identifiant de session, d'un identifiant de réseau de desserte, d'un identifiant de réseau mobile terrestre publique, du premier identifiant utilisateur et du second identifiant utilisateur, et l'algorithme H() est un algorithme de hachage() ou un algorithme HMAC() ; et


     
    9. Appareil d'authentification, l'appareil d'authentification comprenant :

    un module de réception, conçu pour recevoir un premier paramètre aléatoire depuis un premier équipement utilisateur ; et

    un module de traitement, conçu pour : obtenir un premier identifiant utilisateur, un second identifiant utilisateur et un second paramètre aléatoire, générer un second attribut d'authentification d'après le premier identifiant utilisateur, le second identifiant utilisateur, le premier paramètre aléatoire et le second paramètre aléatoire, et envoyer le second attribut d'authentification au premier équipement utilisateur, dans lequel

    le module de réception est en outre conçu pour recevoir un premier attribut d'authentification depuis le premier équipement utilisateur ; et

    le module de traitement est en outre conçu pour tenter d'authentifier une exactitude du premier attribut d'authentification, dans lequel l'attribut d'authentification est un code d'authentification de message MAC, et l'appareil d'authentification comprenant en outre un module d'envoi, conçu pour :
    après génération par le module de traitement d'un second MAC, envoyer le premier paramètre aléatoire et le second paramètre aléatoire au premier équipement utilisateur, dans lequel le module de traitement est spécifiquement conçu pour :

    générer une clé partagée en communication K_com et/ou une clé de session K_session d'après le premier identifiant utilisateur et le second identifiant utilisateur ; et

    générer le second MAC d'après la clé partagée en communication K_com ou la clé de session K_session, le premier paramètre aléatoire et le second paramètre aléatoire, dans lequel

    dans lequel le paramètre 1 peut être au moins l'un d'un identifiant de service, d'un identifiant de tranche, d'un identifiant de liaison, d'un identifiant de connexion, d'un identifiant de session, d'un identifiant de réseau de desserte, d'un identifiant de réseau mobile terrestre publique, du premier identifiant utilisateur et du second identifiant utilisateur, et l'algorithme H() est un algorithme de hachage() ou un algorithme HMAC() ;

    et

    dans lequel l'identifiant de session, l'identifiant de service, l'identifiant de tranche, l'identifiant de liaison, l'identifiant de connexion, l'identifiant de réseau de desserte et l'identifiant de réseau mobile terrestre publique sont obtenus à l'avance par le second équipement utilisateur ou reçus depuis le premier équipement utilisateur.


     




    Drawing


















































    Cited references

    REFERENCES CITED IN THE DESCRIPTION



    This list of references cited by the applicant is for the reader's convenience only. It does not form part of the European patent document. Even though great care has been taken in compiling the references, errors or omissions cannot be excluded and the EPO disclaims all liability in this regard.

    Patent documents cited in the description