Network authentication method and device, terminal and network-side equipment

By using the root key of the current session to generate encryption and integrity keys to encrypt authentication response messages in 5G network authentication, the problem of correlation attacks when the first authentication fails is solved, thus improving the security of network authentication and the efficiency of devices.

CN116347432BActive Publication Date: 2026-05-15CHINA MOBILE COMM LTD RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111577437.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2026-05-15
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

Existing 5G network authentication protocols may be vulnerable to correlated attacks when the first authentication fails. Existing solutions fail to effectively encrypt error messages, allowing attackers to obtain information about authentication failures.

Method used

If the authentication response message indicates that network authentication has failed, the authentication response message is encrypted using an encryption key and an integrity key generated from the root key of the current session to ensure that the message content is not obtained by attackers.

Benefits of technology

By encrypting the authentication response message, correlation attacks are prevented, improving the security and reliability of network authentication and reducing device computational requirements and power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116347432B_ABST
    Figure CN116347432B_ABST
Patent Text Reader

Abstract

The application provides a network authentication method, device, terminal and network side equipment. The method comprises the following steps: receiving a first authentication parameter sent by the network side equipment; generating an authentication response message and a root key of a current session according to the first authentication parameter; in the case that the authentication response message indicates that the network authentication fails, performing encryption processing on the authentication response message by using an encryption key and an integrity key, wherein the authentication response message comprises an error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained according to the root key of the current session; and sending the authentication response message after the encryption processing to the network side equipment. In the embodiment of the application, the terminal derives the encryption key and the integrity key by using the root key of the current session known by the network side equipment, and performs encryption on the authentication response message by using a symmetric encryption algorithm, so that the attack of an attacker can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a network authentication method, apparatus, terminal, and network-side equipment. Background Technology

[0002] 5G will permeate all aspects of future society, playing a crucial role in building a user-centric, comprehensive information ecosystem. Security architecture is essential for the normal operation of 5G networks, and authentication protocols are the cornerstone of this architecture. Currently, two authentication protocols are defined for authentication between user equipment (UE) and the network: 5G-AKA (5G Authentication and Key Agreement) and EAP-AKA (Extensible Authentication Protocol AKA). 5G-AKA is developed based on the Long Term Evolution (LTE) authentication protocol EPS-AKA, while EAP-AKA is an authentication protocol defined by the Internet Engineering Task Force (IETF).

[0003] The AKA protocol is vulnerable to correlation attacks. Current solutions to mitigate these attacks involve the UE sending only a message encrypted with the network's public key to indicate the error message type when UE authentication fails. Alternatively, the UE can encrypt this message using a stored root key derived from the encryption and integrity keys from the previous successful UE-network authentication. However, in these solutions, the error message is not encrypted upon initial authentication failure, leaving the UE still susceptible to correlation attacks. Summary of the Invention

[0004] The purpose of this invention is to provide a network authentication method, apparatus, terminal, and network-side device, which solves the problem of associated attack risks that may be encountered when the first authentication fails in the prior art.

[0005] To achieve the above objectives, embodiments of the present invention provide a network authentication method, comprising:

[0006] Receive the first authentication parameters sent by the network-side device;

[0007] Generate an authentication response message and the root key of the current session based on the first authentication parameters;

[0008] If the authentication response message indicates that network authentication has failed, the authentication response message is encrypted using an encryption key and an integrity key, wherein the authentication response message includes the error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session.

[0009] Send the encrypted authentication response message to the network-side device.

[0010] Optionally, the first authentication parameters include: a first random number and an authentication token.

[0011] Optionally, the method further includes:

[0012] The encryption key and integrity key are determined based on the first authentication parameters and the root key of the current session.

[0013] Optionally, the authentication response message includes at least one of the following parameters:

[0014] The reasons for network authentication failure, including the error type;

[0015] Second random number;

[0016] User Permanent Identifier (SUPI);

[0017] Response data.

[0018] Optionally, the error types include:

[0019] Medium Access Control (MAC) error; or, Synchronization (SYNC) error.

[0020] Optionally, in the case where the authentication response message indicates network authentication failure, encrypting the authentication response message using an encryption key and an integrity key includes:

[0021] The authentication response message is encrypted using the encryption key, and MAC information for integrity protection is generated using the integrity key.

[0022] To achieve the above objectives, embodiments of the present invention provide a network authentication method applied to a network-side device, comprising:

[0023] Generate an authentication message, which includes: the root key of the current session and the first authentication parameter;

[0024] Send the first authentication parameter to the terminal;

[0025] Receive an authentication response message sent by the terminal, the authentication response message being generated based on the first authentication parameters;

[0026] Based on the root key of the current session, the authentication response message is decrypted to obtain the error type corresponding to the network authentication failure.

[0027] Optionally, the first authentication parameters include: a first random number and an authentication token.

[0028] Optionally, the authentication response message includes at least one of the following parameters:

[0029] The reasons for network authentication failure, including the error type;

[0030] Second random number;

[0031] User permanent identifier SUPI;

[0032] Response data.

[0033] Optionally, generating the authentication message includes:

[0034] The authentication message is generated by the Unified Data Management (UDM) entity or the Authentication Credential Repository and Processing Function (ARPF) of the network-side device.

[0035] Optionally, sending the first authentication parameter to the terminal includes:

[0036] The authentication message is sent to the Authentication Server Function (AUSF) via the UDM or ARPF of the network-side device;

[0037] The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF;

[0038] The first authentication parameter is sent to the terminal via the SEAF.

[0039] Optionally, receiving the authentication response message sent by the terminal includes:

[0040] The authentication response message sent by the terminal is received through the UDM or ARPF of the network-side device;

[0041] The authentication response message is sent by the terminal to SEAF, forwarded by SEAF to AUSF, and then sent by AUSF to UDM or ARPF.

[0042] Optionally, the step of decrypting the authentication response message based on the root key of the current session to obtain the error type corresponding to the network authentication failure includes:

[0043] Determine the encryption key and integrity key based on the root key of the current session;

[0044] The authentication response message is verified using the integrity key via AUSF;

[0045] If the verification is successful, the authentication response message is decrypted using the encryption key to obtain the error type corresponding to the network authentication failure.

[0046] Optionally, the method further includes:

[0047] In the case of a SYNC error, the UDM or ARPF of the network-side device receives the second authentication parameter sent by the AUSF;

[0048] The UDM or ARPF synchronizes the Sequence Number (SQN) of the network-side device with the SQN of the terminal based on the second authentication parameter.

[0049] Optionally, the method further includes:

[0050] The error type and the terminal's SUPI are sent to the SEAF via the AUSF.

[0051] To achieve the above objectives, embodiments of the present invention provide a network authentication device, comprising:

[0052] The first receiving module is used to receive the first authentication parameters sent by the network-side device;

[0053] The first generation module is used to generate an authentication response message and the root key of the current session based on the first authentication parameters.

[0054] A first processing module is configured to encrypt the authentication response message using an encryption key and an integrity key when the authentication response message indicates network authentication failure, wherein the authentication response message includes an error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session;

[0055] The first sending module is used to send the encrypted authentication response message to the network-side device.

[0056] Optionally, the first authentication parameters include: a first random number and an authentication token.

[0057] Optionally, the device further includes:

[0058] The first determining module is used to determine the encryption key and the integrity key based on the first authentication parameters and the root key of the current session.

[0059] Optionally, the authentication response message includes at least one of the following parameters:

[0060] The reasons for network authentication failure, including the error type;

[0061] Second random number;

[0062] User permanent identifier SUPI;

[0063] Response data.

[0064] Optionally, the error types include:

[0065] Media access control MAC error; or, synchronization SYNC error.

[0066] Optionally, the first processing module is specifically used to: encrypt the authentication response message using the encryption key, and generate MAC information for integrity protection using the integrity key.

[0067] To achieve the above objectives, embodiments of the present invention provide a network authentication device, comprising:

[0068] The second generation module is used to generate an authentication message, which includes: the root key of the current session and the first authentication parameter;

[0069] The second sending module is used to send the first authentication parameters to the terminal;

[0070] The second receiving module is used to receive the authentication response message sent by the terminal, the authentication response message being generated based on the first authentication parameters;

[0071] The second processing module is used to decrypt the authentication response message based on the root key of the current session to obtain the error type corresponding to the network authentication failure.

[0072] Optionally, the first authentication parameters include: a first random number and an authentication token.

[0073] Optionally, the authentication response message includes at least one of the following parameters:

[0074] The reasons for network authentication failure, including the error type;

[0075] Second random number;

[0076] User permanent identifier SUPI;

[0077] Response data.

[0078] Optionally, the second generation module is specifically used for: the unified data management entity (UDM) or the authentication credential storage and processing function (ARPF) of the network-side device to generate the authentication message.

[0079] Optionally, the second sending module is specifically used for:

[0080] The authentication message is sent to the authentication service function AUSF via the UDM or ARPF of the network-side device;

[0081] The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF;

[0082] The first authentication parameter is sent to the terminal via the SEAF.

[0083] Optionally, the second receiving module is specifically used to: receive the authentication response message sent by the terminal through the UDM or ARPF of the network-side device;

[0084] The authentication response message is sent by the terminal to SEAF, forwarded by SEAF to AUSF, and then sent by AUSF to UDM or ARPF.

[0085] Optionally, the second processing module is specifically used for:

[0086] The second determining module is used to determine the encryption key and the integrity key based on the root key of the current session;

[0087] The verification unit is used to verify the authentication response message using an integrity key via AUSF;

[0088] The decryption unit is used to decrypt the authentication response message using the encryption key when the verification is successful, so as to obtain the error type corresponding to the network authentication failure.

[0089] Optionally, the device further includes:

[0090] The third receiving module is used to receive the second authentication parameter sent by the AUSF from the UDM or ARPF of the network-side device when the error type is SYNC error.

[0091] A synchronization processing module is used by the UDM or ARPF to synchronize the serial number SQN of the network-side device with the SQN of the terminal according to the second authentication parameters.

[0092] Optionally, the device further includes:

[0093] The third sending module is used to send the error type and the terminal's SUPI to the SEAF via the AUSF.

[0094] To achieve the above objectives, embodiments of the present invention provide a terminal, including: a transceiver and a processor;

[0095] The transceiver is used to: receive the first authentication parameters sent by the network-side device;

[0096] The processor is configured to: generate an authentication response message and the root key of the current session based on the first authentication parameters;

[0097] If the authentication response message indicates that network authentication has failed, the authentication response message is encrypted using an encryption key and an integrity key, wherein the authentication response message includes the error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session.

[0098] The transceiver is also used to send the encrypted authentication response message to the network-side device.

[0099] Optionally, the first authentication parameters include: a first random number and an authentication token.

[0100] Optionally, the processor is further configured to: determine the encryption key and the integrity key based on the first authentication parameters and the root key of the current session.

[0101] Optionally, the authentication response message includes at least one of the following parameters:

[0102] The reasons for network authentication failure, including the error type;

[0103] Second random number;

[0104] User permanent identifier SUPI;

[0105] Response data.

[0106] Optionally, the error types include:

[0107] Media access control MAC error; or, synchronization SYNC error.

[0108] Optionally, if the authentication response message indicates that network authentication has failed, the processor encrypts the authentication response message using an encryption key and an integrity key, including:

[0109] The authentication response message is encrypted using the encryption key, and MAC information for integrity protection is generated using the integrity key.

[0110] To achieve the above objectives, embodiments of the present invention provide a network-side device, including: a transceiver and a processor;

[0111] The processor is configured to: generate an authentication message, the authentication message including: the root key of the current session and a first authentication parameter;

[0112] The transceiver is configured to: send the first authentication parameters to the terminal; and receive an authentication response message sent by the terminal, wherein the authentication response message is generated based on the first authentication parameters;

[0113] The processor is further configured to: decrypt the authentication response message based on the root key of the current session to obtain the error type corresponding to the network authentication failure.

[0114] Optionally, the first authentication parameters include: a first random number and an authentication token.

[0115] Optionally, the authentication response message includes at least one of the following parameters:

[0116] The reasons for network authentication failure, including the error type;

[0117] Second random number;

[0118] User permanent identifier SUPI;

[0119] Response data.

[0120] Optionally, the processor generates an authentication message, including:

[0121] The authentication message is generated by the Unified Data Management Entity (UDM) or the Authentication Credential Storage and Processing Function (ARPF) of the network-side device.

[0122] Optionally, the transceiver sends the first authentication parameter to the terminal, including:

[0123] The authentication message is sent to the authentication service function AUSF via the UDM or ARPF of the network-side device;

[0124] The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF;

[0125] The first authentication parameter is sent to the terminal via the SEAF.

[0126] Optionally, the transceiver receives an authentication response message sent by the terminal, including:

[0127] The authentication response message sent by the terminal is received through the UDM or ARPF of the network-side device;

[0128] The authentication response message is sent by the terminal to SEAF, forwarded by SEAF to AUSF, and then sent by AUSF to UDM or ARPF.

[0129] Optionally, the processor decrypts the authentication response message based on the root key of the current session to obtain the error type corresponding to the network authentication failure, including:

[0130] Determine the encryption key and integrity key based on the root key of the current session;

[0131] The authentication response message is verified using the integrity key via AUSF;

[0132] If the verification is successful, the authentication response message is decrypted using the encryption key to obtain the error type corresponding to the network authentication failure.

[0133] Optionally, the transceiver is further configured to: in the case of a SYNC error, the UDM or ARPF of the network-side device receive the second authentication parameters sent by the AUSF;

[0134] The processor is further configured to: synchronize the serial number SQN of the network-side device with the SQN of the terminal according to the second authentication parameter.

[0135] Optionally, the transceiver is further configured to: send the error type and the terminal's SUPI to the SEAF via the AUSF.

[0136] To achieve the above objectives, embodiments of the present invention provide an electronic device, including: a transceiver, a processor, a memory, and a program or instructions stored in the memory and executable on the processor; the processor implements the above-described network authentication method when executing the program or instructions.

[0137] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, which, when executed by a processor, implement the steps of the network authentication method described above.

[0138] The beneficial effects of the above-described technical solution of the present invention are as follows:

[0139] In embodiments of the present invention, during the authentication process between the terminal and the network-side device, both the network-side device and the terminal generate root keys for the current session. When the UE fails to authenticate with the network, the UE sends only one message to the network-side device to indicate the error type corresponding to the network authentication failure. The UE derives the encryption key and integrity key using the root key of the current session, which is known to both the UE and the network-side device, and encrypts the authentication response message using a symmetric encryption algorithm. Since the authentication response message is encrypted at this time, attackers cannot obtain the content of this message, thus preventing attackers from launching related attacks. Attached Figure Description

[0140] Figure 1 This is one of the flowcharts illustrating the network authentication method according to an embodiment of the present invention;

[0141] Figure 2 This is a second schematic flowchart of the network authentication method according to an embodiment of the present invention;

[0142] Figure 3 This is the third flowchart illustrating the network authentication method according to an embodiment of the present invention;

[0143] Figure 4 This is one of the structural schematic diagrams of a network authentication device according to an embodiment of the present invention;

[0144] Figure 5 This is a second schematic diagram of the network authentication device according to an embodiment of the present invention;

[0145] Figure 6 This is one of the structural schematic diagrams of the terminal according to an embodiment of the present invention;

[0146] Figure 7 This is one of the structural schematic diagrams of the network-side device according to an embodiment of the present invention;

[0147] Figure 8 This is a second schematic diagram of the terminal structure according to an embodiment of the present invention;

[0148] Figure 9 This is a second schematic diagram of the network-side device according to an embodiment of the present invention. Detailed Implementation

[0149] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0150] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0151] In various embodiments of the present invention, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0152] In addition, the terms "system" and "network" are often used interchangeably in this article.

[0153] In the embodiments provided in this application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.

[0154] like Figure 1 As shown, this embodiment of the invention provides a network authentication method applied to a terminal, including:

[0155] Step 11: Receive the first authentication parameters sent by the network-side device.

[0156] Optionally, the first authentication parameter includes: a first random number (RAND) and an authentication token (AUTN).

[0157] Step 12: Generate an authentication response message and the root key of the current session based on the first authentication parameters.

[0158] After receiving the first authentication parameter, the terminal calculates the authentication response based on RAND and AUTN, obtains the authentication response message, and simultaneously generates the root key K for the current session based on the RAND and AUTN. AUSF The current session refers to the session between the network-side device and the terminal during this authentication process. It should be noted that a root key for the current session needs to be generated each time the network-side device and the terminal conduct a network session.

[0159] Step 13: If the authentication response message indicates that network authentication has failed, encrypt the authentication response message using an encryption key and an integrity key, wherein the authentication response message includes the error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session.

[0160] Step 14: Send the encrypted authentication response message to the network-side device.

[0161] The terminal verifies the network based on the first authentication parameters. If the verification fails, the terminal generates the authentication response message, which includes the error type corresponding to the network authentication failure.

[0162] Optionally, the terminal determines the encryption key and integrity key based on the first authentication parameters and the root key of the current session. The terminal encrypts the authentication response message using the encryption key and protects the integrity of the authentication response message using the integrity key. The terminal then sends the processed authentication response message to the network-side device.

[0163] The authentication response message may include at least one of the following parameters:

[0164] (1) The reason for network authentication failure (FAIL_CAUS), wherein the reason for failure includes the error type; the error type may include: Media Access Control (MAC) error (MAC_FAIL); or, Synchronization (SYNC) error (SYNC_FAIL). The MAC_FAIL error message indicates that the terminal failed to verify the MAC information in the first authentication parameter; the SYNC_FAIL error message indicates that the terminal failed to verify the SQN.

[0165] (2) Second random number; can be represented by Nonce. Nonce is a one-time random number that can make the ciphertext of the authentication response message different each time, so as to prevent attackers in correlation attacks from guessing the actual value of FAIL_CAUSE.

[0166] (3) User Permanent Identifier (SUPI); The UE's SUPI can be sent to the network-side device in this message to prevent the network-side device's SEAF from initiating an authentication request message to the UE. That is, regardless of whether it is MAC_FAIL or SYNC_FAIL, the SEAF will only send an authentication request message to the UE, thereby avoiding the related attacks caused by attackers based on the different response messages that the SEAF responds to after receiving the authentication response message.

[0167] (4) Response data (RES_DATA).

[0168] In this embodiment, if the value of FAIL_CAUSE is SYNC_FAIL, then RES_DATA is AUTS, which can be used to indicate synchronization failure. The AUTS can be used to restore SQN synchronization between the UE and the network testing device. If the value of FAIL_CAUSE is MAC_FAIL, then RES_DATA can be a random number, and the length of RES_DATA can be the same as the length of the generated AUTS.

[0169] As an optional embodiment, when the authentication response message indicates that network authentication has failed, encrypting the authentication response message using an encryption key and an integrity key includes: encrypting the authentication response message using the encryption key and generating MAC information for integrity protection using the integrity key.

[0170] In this embodiment, the terminal can generate the root key of the current session based on the RAND and AUTN, and derive the encryption key K using the root key of the current session. E and the integrity key K M The authentication response message is encrypted using the encryption key, and the integrity key K is used to encrypt the encryption key. M Generate MAC information for integrity protection.

[0171] Optionally, the encryption key K can be derived using the root key of the current session by calculating the key derivation function KDF. E and the integrity key K M The algorithm is as follows:

[0172] K E =KDF(K AUSF (RAND || Length of RAND || "Encryption Key" || Length of "Encryption Key")

[0173] K M =KDF(K AUSF (RAND || Length of RAND || "MAC Key" || Length of "MAC Key")

[0174] Among them, K AUSF K is the root key for the current session. EThe encryption key is represented by KDF, which stands for key derivation function, and RAND for random number. "‖" indicates string concatenation. "Encryption Key" can be a key known beforehand from the terminal and the network-side device, corresponding to KDF. E The string; "MAC Key" represents the integrity key, and "MAC Key" can be a pre-known key corresponding to K in the terminal and the network-side device. M The string.

[0175] In the embodiments of this application, the encryption key K E and the integrity key K M It uses the root key K of the current session. AUSF The derivation is as follows: Since a root key K corresponding to each session is generated, the key K is obtained through derivation. AUSF Therefore, the encryption key and integrity key obtained in each authentication process may be different. The encryption key and integrity key are obtained by deriving the encryption key and integrity key using the root key of the current session. The authentication response message is encrypted using the encryption key and integrity key, which can ensure that the attacker cannot obtain the content of the message, thereby preventing the attacker from launching a related attack.

[0176] As an optional embodiment, the terminal receives a first authentication parameter sent by the network-side device. This first authentication parameter can be generated by the network-side device's UDM or ARPF. The first authentication parameter can be sent by the UDM or ARPF to the network-side device's AUSF, and then by the AUSF to the SEAF, which in turn sends it to the terminal. Taking the network-side device as an example, which includes UDM or ARPF, AUSF, and SEAF, the implementation process of the terminal receiving the first authentication parameter sent by the network-side device and the implementation process of the terminal performing network authentication are explained below.

[0177] like Figure 2 As shown, it specifically includes:

[0178] Step 1: The network-side device generates an authentication message, such as an authentication vector (5G HE AV), which may include RAND, AUTN, and expected user response (XRES*). The authentication message may also include the root key of the current session.

[0179] Step 2: The UDM / ARPF sends the authentication message to the AUSF. For example, the UDM / ARPF sends the 5G HE AV to the AUSF through the authentication response message (Nudm_UE Authentication_Get response); optionally, the UDM / ARPF can also send the SUPI of the UE that needs to be authenticated to the AUSF.

[0180] Step 3: The AUSF sends the first authentication parameter to the SEAF. For example, the AUSF sends the 5G SE AV to the SEAF via an authentication response message (Nausf_UE Authentication_Authenticate Response). The 5G SE AV is generated based on the 5G HE AV. The 5G SE AV may include RAND and AUTN, and may also include HXRES*. RAND and AUTN are copied from the 5G HE AV, and HXRES* is derived from XRES* in the 5G HE AV.

[0181] Step 4: The SEAF sends the first authentication parameters to the terminal. For example, the SEAF sends RAND and AUTN to the UE through an Authentication Request message.

[0182] Step 5: The UE calculates the authentication response message based on the received first authentication parameters (RAND and AUTN), and simultaneously generates the root key K for the current session. AUSF .

[0183] Step 6: The UE verifies the network. If the verification fails, it generates an authentication response message, which may include: FAIL_CAUSE, Nonce, SUPI, and RES_DATA.

[0184] The value of FAIL_CAUSE can be either MAC_FAIL or SYNC_FAIL. The nonce is a one-time random number that ensures the ciphertext of the authentication response message is different each time, preventing attackers from guessing the actual value of FAIL_CAUSE. The UE's SUPI can optionally be sent to the network-side device in this message to prevent SEAF from initiating an authentication request message to the UE. Regardless of whether the value of FAIL_CAUSE is MAC_FAIL or SYNC_FAIL, SEAF will only send an authentication request message to the UE, thus avoiding related attacks that could arise from different SEAF responses after receiving the authentication response message.

[0185] The authentication response message is encrypted and protected using an encryption key and an integrity key generated based on the root key of the current session. The UE then sends the processed authentication response message to the SEAF.

[0186] Step 7: SEAF forwards the authentication response message to AUSF.

[0187] Step 8: AUSF verifies the MAC using the stored integrity key. If verification is successful, it uses the stored encryption key K. E Decrypt the message and perform subsequent operations based on the error type.

[0188] Step 9: If FAIL_CAUSE is SYNC_FAIL, AUSF sends an authentication request (Nudm_UEAuthentication_Get) message to UDM along with the following parameters: RAND and AUTS. UDM then synchronizes the network-side device's SQN with the UE's SQN based on AUTS and RAND.

[0189] Step 10: AUSF sends FAIL_CAUSE and the UE's SUPI to SEAF, for example, by sending the above parameters using an authentication response message (Nausf_UEAuthentication_Authenticate Response).

[0190] In embodiments of the present invention, during the authentication process between the terminal and the network-side device, both the network-side device and the terminal generate root keys for the current session. When the UE fails to authenticate with the network, the UE sends only one message to the network indicating the error type (MAC_FAIL or SYNC_FAIL) corresponding to the authentication failure. The UE derives the encryption key and integrity key using the root key of the current session, which is known to both the UE and the network-side device, and encrypts the authentication response message using a symmetric encryption algorithm. Because this authentication response message is encrypted, attackers cannot obtain the content of this message, thus preventing them from launching related attacks. This embodiment only uses a symmetric key algorithm (key derivation algorithm), which places lower computational demands on the device and consequently consumes less power.

[0191] In the embodiments of this application, compared to deriving encryption and integrity keys using session root keys stored by the terminal and network-side devices, the stored session root keys are those stored by each UE during the last successful mutual authentication between the UE and the network-side device. In this embodiment, the current session root key is generated during the authentication process; it only replaces the stored session root key upon successful authentication. Therefore, the system can distinguish between the current session root key and the stored session root key. Furthermore, when the first authentication fails, the failure response uses the current session root key to obtain the encryption and integrity keys, effectively preventing association attacks.

[0192] like Figure 3 As shown, this embodiment of the invention provides a network authentication method applied to a network-side device, comprising:

[0193] Step 31: Generate an authentication message, which includes the root key of the current session and the first authentication parameter.

[0194] The authentication message, such as the authentication vector (5G HE AV), may include a first authentication parameter, which may include a first random number (RAND), an authentication token (AUTN), and may also include XRES*. The authentication message may also include the root key of the current session.

[0195] Step 32: Send the first authentication parameter to the terminal.

[0196] Step 33: Receive the authentication response message sent by the terminal, the authentication response message being generated based on the first authentication parameters.

[0197] The network-side device sends the first authentication parameters to the terminal. After receiving the first authentication parameters, the terminal calculates the authentication response based on RAND and AUTN to obtain the authentication response message. Simultaneously, the terminal generates the root key for the current session based on the RAND and AUTN. The current session refers to the session between the network-side device and the terminal during this authentication process. It should be noted that a root key for the current session needs to be generated each time the network-side device and the terminal conduct a network session.

[0198] The terminal determines the encryption key and integrity key based on the first authentication parameters and the root key of the current session. In the event of network authentication failure, the terminal encrypts the authentication response message using the encryption key and integrity key, and the authentication response message includes the error type corresponding to the network authentication failure.

[0199] Optionally, the authentication response message includes at least one of the following parameters:

[0200] (1) The reason for network authentication failure, wherein the reason for failure includes the error type; the error type may include: MAC_FAIL or SYNC_FAIL. The MAC_FAIL error message indicates that the terminal failed to verify the MAC information in the first authentication parameter; the SYNC_FAIL error message indicates that the terminal failed to verify the SQN.

[0201] (2) Second random number; can be represented by Nonce. Nonce is a one-time random number that can make the ciphertext of the authentication response message different each time, so as to prevent attackers in association attacks from guessing the actual value of FAIL_CAUSE.

[0202] (3) User Permanent Identifier (SUPI); The UE's SUPI can be sent to the network-side device in this message to prevent the network-side device's SEAF from initiating an authentication request message to the UE. That is, regardless of whether it is MAC_FAIL or SYNC_FAIL, the SEAF will only send an authentication request message to the UE, thereby avoiding the related attacks caused by attackers based on the different response messages that the SEAF responds to after receiving the authentication response message.

[0203] (4) Response data (RES_DATA).

[0204] If the value of FAIL_CAUSE is SYNC_FAIL, then RES_DATA is AUTS, which can be used to indicate synchronization failure. The AUTS can be used to restore SQN synchronization between the UE and the network testing device. If the value of FAIL_CAUSE is MAC_FAIL, then RES_DATA can be a random number, and the length of RES_DATA can be the same as the length of the generated AUTS.

[0205] Step 34: Decrypt the authentication response message based on the root key of the current session to obtain the error type corresponding to the network authentication failure.

[0206] After receiving the authentication response message, the network-side device can deduce the encryption key and integrity key based on the root key of the current session, and use the encryption key and integrity key to decrypt the authentication response message to obtain the error type corresponding to the network authentication failure.

[0207] Optionally, generating the authentication message includes: the network-side device generating the authentication message using a Unified Data Management Entity (UDM) or an Authentication Credential Storage and Processing Function (ARPF).

[0208] Optionally, sending the first authentication parameter to the terminal includes:

[0209] The authentication message is sent to the authentication service function AUSF via the UDM or ARPF of the network-side device;

[0210] The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF;

[0211] The first authentication parameter is sent to the terminal via the SEAF.

[0212] In this embodiment, the UDM / ARPF of the network-side device generates an authentication message, the UDM / ARPF sends the authentication message to the AUSF, the AUSF sends the first authentication parameter to the SEAF, and the SEAF sends the first authentication parameter to the terminal.

[0213] Optionally, receiving the authentication response message sent by the terminal includes: receiving the authentication response message sent by the terminal through the UDM or ARPF of the network-side device; wherein the authentication response message is sent by the terminal to the SEAF, forwarded by the SEAF to the AUSF, and sent by the AUSF to the UDM or ARPF.

[0214] In this embodiment, the UE calculates an authentication response message based on the received first authentication parameters and simultaneously generates the root key for the current session. The UE verifies the network; if verification fails, it generates an authentication response message, which may include: FAIL_CAUSE, Nonce, SUPI, and RES_DATA. The UE sends the encrypted authentication response message to the SEAF; the SEAF forwards the authentication response message to the AUSF.

[0215] Optionally, the step of decrypting the authentication response message based on the root key of the current session to obtain the error type corresponding to the network authentication failure includes: determining an encryption key and an integrity key based on the root key of the current session; verifying the authentication response message using the integrity key via AUSF; and, if the verification is successful, decrypting the authentication response message using the encryption key to obtain the error type corresponding to the network authentication failure. The encryption key and the integrity key are obtained based on the root key of the current session, and the encryption key K is derived from the root key of the current session. E and the integrity key K M The calculation can be performed using the key derivation function KDF, which will not be elaborated here.

[0216] Optionally, the method further includes: when the error type is a SYNC error, the UDM or ARPF of the network-side device receives the second authentication parameter sent by the AUSF; the UDM or ARPF synchronizes the serial number SQN of the network-side device with the SQN of the terminal according to the second authentication parameter. Optionally, the method further includes: sending the error type and the SUPI of the terminal to the SEAF through the AUSF.

[0217] In this embodiment, the AUSF uses the stored integrity key to verify the MAC. If the verification is successful, it decrypts the message using the stored encryption key to obtain the error type corresponding to the network authentication failure, and performs subsequent operations based on the error type. Specifically, if FAIL_CAUSE is SYNC_FAIL, the AUSF sends an authentication request message to the UDM along with the following parameters: RAND and AUTS. The UDM then synchronizes the network-side device's SQN with the UE's SQN based on AUTS and RAND.

[0218] AUSF sends FAIL_CAUSE and the UE's SUPI to SEAF, for example, by sending the above parameters using an authentication response message.

[0219] In the embodiments of this application, compared to deriving encryption and integrity keys using session root keys stored by the terminal and network-side devices, the stored session root keys are those stored by each UE during the last successful mutual authentication between the UE and the network-side device. In this embodiment, the root key for the current session is generated during the authentication process; it only replaces the stored session root key upon successful authentication. Therefore, the system can distinguish between the current session root key and the stored session root key. Furthermore, when the first authentication fails, the failure response uses the root key of the current session to obtain the encryption and integrity keys, effectively preventing association attacks. This embodiment only uses a symmetric key algorithm (key derivation algorithm), which places lower computational demands on the device and thus consumes less power.

[0220] In embodiments of the present invention, during the authentication process between the terminal and the network-side device, both the network-side device and the terminal generate root keys for the current session. When the UE fails to authenticate with the network, the UE sends only one message to the network-side device to indicate the error type corresponding to the network authentication failure. The UE derives the encryption key and integrity key using the root key of the current session, which is known to both the UE and the network-side device, and encrypts the authentication response message using a symmetric encryption algorithm. Since the authentication response message is encrypted at this time, attackers cannot obtain the content of this message, thus preventing attackers from launching related attacks.

[0221] It should be noted that the embodiments of this application can implement all the steps implemented by the network-side device in the above-described method embodiments applied to the terminal, and can achieve the corresponding technical effects, which will not be elaborated here.

[0222] like Figure 4 As shown, this embodiment of the invention also provides a network authentication device 400, applied to a terminal, comprising:

[0223] The first receiving module 410 is used to receive the first authentication parameters sent by the network-side device;

[0224] The first generation module 420 is used to generate an authentication response message and the root key of the current session based on the first authentication parameters.

[0225] The first processing module 430 is configured to encrypt the authentication response message using an encryption key and an integrity key when the authentication response message indicates that network authentication has failed, wherein the authentication response message includes an error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session;

[0226] The first sending module 440 is used to send the encrypted authentication response message to the network-side device.

[0227] Optionally, the first authentication parameters include: a first random number and an authentication token.

[0228] Optionally, the device further includes:

[0229] The first determining module is used to determine the encryption key and the integrity key based on the first authentication parameters and the root key of the current session.

[0230] Optionally, the authentication response message includes at least one of the following parameters:

[0231] The reasons for network authentication failure, including the error type;

[0232] Second random number;

[0233] User permanent identifier SUPI;

[0234] Response data.

[0235] Optionally, the error types include:

[0236] Media access control MAC error; or, synchronization SYNC error.

[0237] Optionally, the first processing module is specifically used to: encrypt the authentication response message using the encryption key, and generate MAC information for integrity protection using the integrity key.

[0238] In embodiments of the present invention, during the authentication process between the terminal and the network-side device, both the network-side device and the terminal generate root keys for the current session. When the UE fails to authenticate with the network, the UE sends only one message to the network-side device to indicate the error type corresponding to the network authentication failure. The UE derives the encryption key and integrity key using the root key of the current session, which is known to both the UE and the network-side device, and encrypts the authentication response message using a symmetric encryption algorithm. Since the authentication response message is encrypted at this time, attackers cannot obtain the content of this message, thus preventing attackers from launching related attacks.

[0239] It should be noted that the network authentication device provided in this embodiment of the invention can implement all the method steps implemented in the network authentication method embodiment applied to the terminal, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.

[0240] To achieve the above objectives, such as Figure 5 As shown, an embodiment of the present invention provides a network authentication device 500, applied to a network-side device, comprising:

[0241] The second generation module 510 is used to generate an authentication message, which includes: the root key of the current session and the first authentication parameter;

[0242] The second sending module 520 is used to send the first authentication parameters to the terminal;

[0243] The second receiving module 530 is used to receive an authentication response message sent by the terminal, wherein the authentication response message is generated based on the first authentication parameters;

[0244] The second processing module 540 is used to decrypt the authentication response message according to the root key of the current session to obtain the error type corresponding to the network authentication failure.

[0245] Optionally, the first authentication parameters include: a first random number and an authentication token.

[0246] Optionally, the authentication response message includes at least one of the following parameters:

[0247] The reasons for network authentication failure, including the error type;

[0248] Second random number;

[0249] User permanent identifier SUPI;

[0250] Response data.

[0251] Optionally, the second generation module is specifically used for: the unified data management entity (UDM) or the authentication credential storage and processing function (ARPF) of the network-side device to generate the authentication message.

[0252] Optionally, the second sending module is specifically used for:

[0253] The authentication message is sent to the authentication service function AUSF via the UDM or ARPF of the network-side device;

[0254] The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF;

[0255] The first authentication parameter is sent to the terminal via the SEAF.

[0256] Optionally, the second receiving module is specifically used to: receive the authentication response message sent by the terminal through the UDM or ARPF of the network-side device;

[0257] The authentication response message is sent by the terminal to SEAF, forwarded by SEAF to AUSF, and then sent by AUSF to UDM or ARPF.

[0258] Optionally, the second processing module is specifically used for:

[0259] The second determining module is used to determine the encryption key and the integrity key based on the root key of the current session;

[0260] The verification unit is used to verify the authentication response message using an integrity key via AUSF;

[0261] The decryption unit is used to decrypt the authentication response message using the encryption key when the verification is successful, so as to obtain the error type corresponding to the network authentication failure.

[0262] Optionally, the device further includes:

[0263] The third receiving module is used to receive the second authentication parameter sent by the AUSF from the UDM or ARPF of the network-side device when the error type is SYNC error.

[0264] A synchronization processing module is used by the UDM or ARPF to synchronize the serial number SQN of the network-side device with the SQN of the terminal according to the second authentication parameters.

[0265] Optionally, the device further includes:

[0266] The third sending module is used to send the error type and the terminal's SUPI to the SEAF via the AUSF.

[0267] In embodiments of the present invention, during the authentication process between the terminal and the network-side device, both the network-side device and the terminal generate root keys for the current session. When the UE fails to authenticate with the network, the UE sends only one message to the network-side device to indicate the error type corresponding to the network authentication failure. The UE derives the encryption key and integrity key using the root key of the current session, which is known to both the UE and the network-side device, and encrypts the authentication response message using a symmetric encryption algorithm. Since the authentication response message is encrypted at this time, attackers cannot obtain the content of this message, thus preventing attackers from launching related attacks.

[0268] It should be noted that the network authentication device provided in this embodiment of the invention can implement all the method steps implemented in the network authentication method embodiment applied to network side devices, and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.

[0269] like Figure 6 As shown, a terminal 600 according to an embodiment of the present invention includes: a transceiver 620 and a processor 610; wherein,

[0270] The transceiver 620 is used to: receive the first authentication parameters sent by the network-side device;

[0271] The processor 610 is configured to: generate an authentication response message and the root key of the current session based on the first authentication parameters;

[0272] If the authentication response message indicates that network authentication has failed, the authentication response message is encrypted using an encryption key and an integrity key, wherein the authentication response message includes the error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session.

[0273] The transceiver 620 is also used to send the encrypted authentication response message to the network-side device.

[0274] Optionally, the first authentication parameters include: a first random number and an authentication token.

[0275] Optionally, the processor is further configured to: determine the encryption key and the integrity key based on the first authentication parameters and the root key of the current session.

[0276] Optionally, the authentication response message includes at least one of the following parameters:

[0277] The reasons for network authentication failure, including the error type;

[0278] Second random number;

[0279] User permanent identifier SUPI;

[0280] Response data.

[0281] Optionally, the error types include:

[0282] Media access control MAC error; or, synchronization SYNC error.

[0283] Optionally, if the authentication response message indicates that network authentication has failed, the processor encrypts the authentication response message using an encryption key and an integrity key, including:

[0284] The authentication response message is encrypted using the encryption key, and MAC information for integrity protection is generated using the integrity key.

[0285] In embodiments of the present invention, during the authentication process between the terminal and the network-side device, both the network-side device and the terminal generate root keys for the current session. When the UE fails to authenticate with the network, the UE sends only one message to the network-side device to indicate the error type corresponding to the network authentication failure. The UE derives the encryption key and integrity key using the root key of the current session, which is known to both the UE and the network-side device, and encrypts the authentication response message using a symmetric encryption algorithm. Since the authentication response message is encrypted at this time, attackers cannot obtain the content of this message, thus preventing attackers from launching related attacks.

[0286] It should be noted that the terminal provided in the embodiments of the present invention can implement all the method steps implemented in the network authentication method embodiments applied to the terminal, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail.

[0287] like Figure 7 As shown, a network-side device 700 according to an embodiment of the present invention includes: a transceiver 720 and a processor 710; wherein,

[0288] The processor 710 is configured to: generate an authentication message, the authentication message including: the root key of the current session and a first authentication parameter;

[0289] The transceiver 720 is configured to: send the first authentication parameters to the terminal; and receive an authentication response message sent by the terminal, wherein the authentication response message is generated based on the first authentication parameters;

[0290] The processor 710 is further configured to: decrypt the authentication response message according to the root key of the current session to obtain the error type corresponding to the network authentication failure.

[0291] Optionally, the first authentication parameters include: a first random number and an authentication token.

[0292] Optionally, the authentication response message includes at least one of the following parameters:

[0293] The reasons for network authentication failure, including the error type;

[0294] Second random number;

[0295] User permanent identifier SUPI;

[0296] Response data.

[0297] Optionally, the processor generates an authentication message, including:

[0298] The authentication message is generated by the Unified Data Management Entity (UDM) or the Authentication Credential Storage and Processing Function (ARPF) of the network-side device.

[0299] Optionally, the transceiver sends the first authentication parameter to the terminal, including:

[0300] The authentication message is sent to the authentication service function AUSF via the UDM or ARPF of the network-side device;

[0301] The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF;

[0302] The first authentication parameter is sent to the terminal via the SEAF.

[0303] Optionally, the transceiver receives an authentication response message sent by the terminal, including:

[0304] The authentication response message sent by the terminal is received through the UDM or ARPF of the network-side device;

[0305] The authentication response message is sent by the terminal to SEAF, forwarded by SEAF to AUSF, and then sent by AUSF to UDM or ARPF.

[0306] Optionally, the processor decrypts the authentication response message based on the root key of the current session to obtain the error type corresponding to the network authentication failure, including:

[0307] Determine the encryption key and integrity key based on the root key of the current session;

[0308] The authentication response message is verified using the integrity key via AUSF;

[0309] If the verification is successful, the authentication response message is decrypted using the encryption key to obtain the error type corresponding to the network authentication failure.

[0310] Optionally, the transceiver is further configured to: in the case of a SYNC error, the UDM or ARPF of the network-side device receive the second authentication parameters sent by the AUSF;

[0311] The processor is further configured to: synchronize the serial number SQN of the network-side device with the SQN of the terminal according to the second authentication parameter.

[0312] Optionally, the transceiver is further configured to: send the error type and the terminal's SUPI to the SEAF via the AUSF.

[0313] In embodiments of the present invention, during the authentication process between the terminal and the network-side device, both the network-side device and the terminal generate root keys for the current session. When the UE fails to authenticate with the network, the UE sends only one message to the network-side device to indicate the error type corresponding to the network authentication failure. The UE derives the encryption key and integrity key using the root key of the current session, which is known to both the UE and the network-side device, and encrypts the authentication response message using a symmetric encryption algorithm. Since the authentication response message is encrypted at this time, attackers cannot obtain the content of this message, thus preventing attackers from launching related attacks.

[0314] It should be noted that the network-side device provided in the embodiments of the present invention can implement all the method steps implemented in the network authentication method embodiments applied to network-side devices, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail.

[0315] Another embodiment of the present invention includes a terminal, such as Figure 8 As shown, it includes a transceiver 810, a processor 800, a memory 820, and a program or instructions stored in the memory 820 and executable on the processor 800; when the processor 800 executes the program or instructions, it implements the network authentication method applied to the terminal described above.

[0316] The transceiver 810 is used to receive and send data under the control of the processor 800.

[0317] Among them, Figure 8In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 800 and memory represented by memory 820 together. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. Transceiver 810 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. For different user equipment, user interface 830 can also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.

[0318] The processor 800 is responsible for managing the bus architecture and general processing, while the memory 820 can store the data used by the processor 800 during operation.

[0319] Another embodiment of the network-side device of the present invention, such as Figure 9 As shown, it includes a transceiver 910, a processor 900, a memory 920, and a program or instructions stored in the memory 920 and executable on the processor 900; when the processor 900 executes the program or instructions, it implements the network authentication method applied to network-side devices described above.

[0320] The transceiver 910 is used to receive and send data under the control of the processor 900.

[0321] Among them, Figure 9 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 900) and memory (memory 920). The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 910 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. The processor 900 is responsible for managing the bus architecture and general processing, and the memory 920 can store data used by the processor 900 during operation.

[0322] An embodiment of the present invention provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the steps in the network authentication method described above and achieve the same technical effect. To avoid repetition, further details are omitted here.

[0323] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0324] It should be further noted that the electronic devices described in this specification include, but are not limited to, smartphones, tablets, etc., and many of the described functional components are referred to as modules in order to more specifically emphasize the independence of their implementation.

[0325] In this embodiment of the invention, the module can be implemented in software so that it can be executed by various types of processors. For example, an identified executable code module may include one or more physical or logical blocks of computer instructions, which may be constructed as objects, procedures, or functions. Nevertheless, the executable code of the identified module does not need to be physically located together, but may include different instructions stored in different bits, which, when logically combined, constitute the module and achieve the module's intended purpose.

[0326] In practice, an executable code module can be a single instruction or many instructions, and can even be distributed across multiple different code segments, different programs, and across multiple memory devices. Similarly, operational data can be identified within the module and can be implemented in any suitable form and organized within any suitable type of data structure. This operational data can be collected as a single dataset or distributed across different locations (including different storage devices), and can exist, at least in part, solely as electronic signals within the system or network.

[0327] When a module can be implemented using software, considering the current level of hardware technology, modules that can be implemented in software can be implemented using hardware circuits by those skilled in the art to achieve the corresponding functions, without considering cost. These hardware circuits include conventional very-large-scale integrated circuits (VLSI) or gate arrays, as well as existing semiconductors such as logic chips and transistors, or other discrete components. Modules can also be implemented using programmable hardware devices, such as field-programmable gate arrays, programmable array logic, and programmable logic devices.

[0328] The exemplary embodiments described above are with reference to the accompanying drawings. Many different forms and embodiments are feasible without departing from the spirit and teachings of the invention. Therefore, the invention should not be construed as limiting the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention complete and convey the scope of the invention to those skilled in the art. In these drawings, component dimensions and relative dimensions may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. As used herein, unless clearly indicated otherwise, the singular forms “a,” “an,” and “the” are intended to include all such forms. It will be further understood that the terms “comprising” and / or “including”, when used in this specification, indicate the presence of the stated features, integers, steps, operations, components, and / or elements, but do not exclude the presence or addition of one or more other features, integers, steps, operations, components, and / or groups thereof. Unless otherwise indicated, when stated, a range of values ​​includes the upper and lower limits of the range and any subranges in between.

[0329] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A network authentication method applied to a terminal, characterized in that, include: Receive the first authentication parameters sent by the network-side device; Generate an authentication response message and the root key of the current session based on the first authentication parameters; If the authentication response message indicates network authentication failure, the authentication response message is encrypted using an encryption key and an integrity key, wherein the authentication response message includes the error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session; wherein a root key corresponding to each session is generated; Send the encrypted authentication response message to the network-side device; The first authentication parameter is sent by the network-side device in the following manner: The authentication message is sent to the authentication service function AUSF via the UDM or ARPF of the network-side device; The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF; The first authentication parameter is sent to the terminal via the SEAF.

2. The method according to claim 1, characterized in that, The first authentication parameters include: a first random number and an authentication token.

3. The method according to claim 1, characterized in that, The method further includes: The encryption key and integrity key are determined based on the first authentication parameters and the root key of the current session.

4. The method according to claim 1, characterized in that, The authentication response message includes at least one of the following parameters: The reasons for network authentication failure, including the error type; Second random number; User permanent identifier SUPI; Response data.

5. The method according to claim 1 or 4, characterized in that, The error types include: Media access control MAC error; or, synchronization SYNC error.

6. The method according to claim 1, characterized in that, In the event that the authentication response message indicates network authentication failure, the method of encrypting the authentication response message using an encryption key and an integrity key includes: The authentication response message is encrypted using the encryption key, and MAC information for integrity protection is generated using the integrity key.

7. A network authentication method, applied to network-side devices, characterized in that, include: Generate an authentication message, which includes: the root key of the current session and the first authentication parameter; Send the first authentication parameter to the terminal; The system receives an authentication response message sent by the terminal, the authentication response message being generated based on the first authentication parameters; wherein, in the case where the authentication response message indicates network authentication failure, the authentication response message is obtained by encrypting it using an encryption key and an integrity key, the authentication response message including the error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session; The authentication response message is decrypted based on the root key of the current session to obtain the error type corresponding to the network authentication failure; wherein, a root key corresponding to each session is generated. Sending the first authentication parameter to the terminal includes: The authentication message is sent to the authentication service function AUSF via the UDM or ARPF of the network-side device; The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF; The first authentication parameter is sent to the terminal via the SEAF.

8. The method according to claim 7, characterized in that, The first authentication parameters include: a first random number and an authentication token.

9. The method according to claim 7, characterized in that, The authentication response message includes at least one of the following parameters: The reasons for network authentication failure, including the error type; Second random number; User permanent identifier SUPI; Response data.

10. The method according to claim 7, characterized in that, The generated authentication message includes: The authentication message is generated by the Unified Data Management Entity (UDM) or the Authentication Credential Storage and Processing Function (ARPF) of the network-side device.

11. The method according to claim 7, characterized in that, The step of receiving the authentication response message sent by the terminal includes: The authentication response message sent by the terminal is received through the UDM or ARPF of the network-side device; The authentication response message is sent by the terminal to SEAF, forwarded by SEAF to AUSF, and then sent by AUSF to UDM or ARPF.

12. The method according to claim 11, characterized in that, The step of decrypting the authentication response message based on the root key of the current session to obtain the error type corresponding to the network authentication failure includes: Determine the encryption key and integrity key based on the root key of the current session; The authentication response message is verified using the integrity key via AUSF; If the verification is successful, the authentication response message is decrypted using the encryption key to obtain the error type corresponding to the network authentication failure.

13. The method according to claim 12, characterized in that, The method further includes: In the case of a SYNC error, the UDM or ARPF of the network-side device receives the second authentication parameter sent by the AUSF; The UDM or ARPF synchronizes the serial number SQN of the network-side device with the SQN of the terminal based on the second authentication parameter.

14. The method according to claim 12, characterized in that, The method further includes: The error type and the terminal's SUPI are sent to the SEAF via the AUSF.

15. A network authentication device, characterized in that, include: The first receiving module is used to receive the first authentication parameters sent by the network-side device; The first generation module is used to generate an authentication response message and the root key of the current session based on the first authentication parameters. The first processing module is configured to encrypt the authentication response message using an encryption key and an integrity key when the authentication response message indicates that network authentication has failed, wherein the authentication response message includes an error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session; wherein a root key corresponding to each session is generated; The first sending module is used to send the encrypted authentication response message to the network-side device; The first authentication parameter is sent by the network-side device in the following manner: The authentication message is sent to the authentication service function AUSF via the UDM or ARPF of the network-side device; The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF; The first authentication parameter is sent to the terminal via the SEAF.

16. A network authentication device, characterized in that, include: The second generation module is used to generate an authentication message, which includes: the root key of the current session and the first authentication parameter; The second sending module is used to send the first authentication parameters to the terminal; The second receiving module is configured to receive an authentication response message sent by the terminal, the authentication response message being generated based on the first authentication parameters; wherein, in the case where the authentication response message indicates network authentication failure, the authentication response message is obtained by encrypting it using an encryption key and an integrity key, and the authentication response message includes the error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session; The second processing module is used to decrypt the authentication response message based on the root key of the current session to obtain the error type corresponding to the network authentication failure; wherein, a root key corresponding to the current session is generated for each session; Sending the first authentication parameter to the terminal includes: The authentication message is sent to the authentication service function AUSF via the UDM or ARPF of the network-side device; The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF; The first authentication parameter is sent to the terminal via the SEAF.

17. A terminal, characterized in that, include: Transceiver and processor; The transceiver is used to: receive the first authentication parameters sent by the network-side device; The processor is configured to: generate an authentication response message and the root key of the current session based on the first authentication parameters; If the authentication response message indicates network authentication failure, the authentication response message is encrypted using an encryption key and an integrity key, wherein the authentication response message includes the error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session; wherein a root key corresponding to each session is generated; The transceiver is also used to: send the encrypted authentication response message to the network-side device; The first authentication parameter is sent by the network-side device in the following manner: The authentication message is sent to the authentication service function AUSF via the UDM or ARPF of the network-side device; The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF; The first authentication parameter is sent to the terminal via the SEAF.

18. A network-side device, characterized in that, include: Transceiver and processor; The processor is configured to: generate an authentication message, the authentication message including: the root key of the current session and a first authentication parameter; The transceiver is configured to: send the first authentication parameters to the terminal; receive an authentication response message sent by the terminal, the authentication response message being generated based on the first authentication parameters; wherein, in the case where the authentication response message indicates network authentication failure, the authentication response message is obtained by encrypting it using an encryption key and an integrity key, the authentication response message including the error type corresponding to the network authentication failure; the encryption key and the integrity key are obtained based on the root key of the current session; The processor is further configured to: decrypt the authentication response message according to the root key of the current session to obtain the error type corresponding to the network authentication failure; wherein, a root key corresponding to the current session is generated for each session; Sending the first authentication parameter to the terminal includes: The authentication message is sent to the authentication service function AUSF via the UDM or ARPF of the network-side device; The first authentication parameter is sent to the Security Anchor Function (SEAF) via the AUSF; The first authentication parameter is sent to the terminal via the SEAF.

19. An electronic device comprising: A transceiver, a processor, a memory, and a program or instructions stored in the memory and executable on the processor; characterized in that, when the processor executes the program or instructions, it implements the network authentication method as described in any one of claims 1-6, or implements the network authentication method as described in any one of claims 7-14.

20. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the steps of the network authentication method as described in any one of claims 1-6, or implement the steps of the network authentication method as described in any one of claims 7-14.