Communication data decryption method, device, electronic device and storage medium
By storing user decryption parameters and key generation functions, and combining preset protection algorithms and count values to decrypt communication data multiple attempts, the problem of low decryption efficiency of communication data in the prior art is solved, and efficient acquisition of decryption parameter sets is achieved, reducing the number of interactions, and improving the decryption efficiency of communication data.
Patent Information
- Application Number
- CN202411757824.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2044-12-03
AI Technical Summary
The existing communication data decryption methods are inefficient and it is difficult to efficiently obtain the decryption parameter sets of both parties in the communication.
By storing user decryption parameters for authentication, the communication data is attempted multiple times by using the key generation function and preset protection algorithm, initial count value and historical bearer identifier to obtain the key set of both parties in the communication, and reduce the number of interactions with the sender of the communication.
Improve the efficiency of obtaining decryption parameter sets, reduce the number of communication interactions with the communication sender, and improve the efficiency of decryption of communication data.
Smart Images

Figure CN119255229B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wireless communication networks, and in particular to a method, device, electronic device and storage medium for decrypting communication data. Background Art
[0002] Currently, the Long Term Evolution (LTE) mobile communication system has the largest number of users and is the most widely used. LTE mobile communication air interface transmission requires two-way authentication between the network and the end user. Summary of the Invention
[0003] The present invention provides a communication data decryption method, device, electronic device and storage medium, which are used to solve the defect of low efficiency of the communication data decryption method in the prior art and improve the efficiency of the existing communication data decryption method.
[0004] The present invention provides a method for decrypting communication data, comprising: authenticating an authentication request message of a communication sender based on a stored user decryption parameter of at least one user; when the authentication request message passes the authentication, acquiring a key set of the communication sender based on the matching user decryption parameter of the authentication request message, the authentication request message and a key generation function, the key set including a key of a non-access layer NAS message, a key of a radio resource control RRC message and a key of a user plane message; when the NAS message of the communication data of the communication sender and the RRC message of the communication data are decrypted for the first time, decrypting the key set of the communication data of the communication sender based on a plurality of preset protection algorithms, a plurality of initial count values, a plurality of history values and the like. The bearer identifier bearerid and key set are used to attempt to decrypt the NAS message and the RRC message at least once. When the decryption of the NAS message and the RRC message is successful, the decryption parameter set of the communication data is saved, and the user plane message of the communication data is decrypted based on the decryption parameter set and the key set; the decryption parameter set includes at least a protection algorithm, a count value and bearerid, and the count value represents the round of the communication data; when the NAS message and the RRC message are not decrypted for the first time, the decryption parameter set is obtained according to the saved result of the decryption parameter set, and the NAS message, the RRC message and the user plane message are decrypted based on the decryption parameter set and the key set.
[0005] According to the communication data decryption method provided by the present invention, the user decryption parameters include at least a key identifier KI and an operator configuration parameter OPC, and the authentication request message of the communication sender is authenticated based on the user decryption parameters of at least one user that have been stored, including: obtaining the authentication token AUTN and a random value of the authentication request message; obtaining an authentication parameter set based on AUTN, the random value, the target user's KI and the target user's OPC, where the target user is any user; generating a message authentication code MAC of the authentication request message based on the authentication parameter set; when the MAC of the authentication request message is equal to the extended message authentication code of the authentication request message, the authentication parameter set is generated; and when the MAC of the authentication request message is equal to the extended message authentication code of the authentication request message, the authentication parameter set is generated. When the MAC of the authentication request message is equal to the XMAC of the authentication request message, it is determined that the authentication request message has passed the authentication; when the MAC of the authentication request message is not equal to the XMAC of the authentication request message, traverse the users in sequence to update the target user, update the authentication parameter set based on the updated target user, and update the MAC of the authentication request message based on the updated authentication parameter set. When the MAC of the updated authentication request message is equal to the XMAC of the authentication request message, it is determined that the authentication request message has passed the authentication; when all users have been traversed and the MAC of the updated authentication request message is still not equal to the XMAC of the authentication request message, it is determined that the authentication request message has failed the authentication.
[0006] According to the communication data decryption method provided by the present invention, before attempting to decrypt a NAS message and an RRC message at least once based on multiple preset protection algorithms, multiple initial count values, multiple historical bearer identifiers bearerids, and key sets, the method further includes: if a security mode message from the communication sender is received, obtaining a protection algorithm based on the security mode message; if no security mode message is received, determining a preset protection algorithm based on a no encryption algorithm, an Advanced Encryption Standard AES algorithm, a SNOW3G sequence number stream cipher algorithm, and a Zu Chongzhi ZUC algorithm.
[0007] According to the decryption method of communication data provided by the present invention, the initial count value is obtained based on the following steps: when receiving an authentication request message, determining that the current count value is 0, and during the communication process, obtaining the current sequence number of the current air interface packet data convergence protocol PDCP message of the communication sender; if the current sequence number is less than the previous sequence number, increasing the current count value by one to obtain the initial count value; the previous sequence number is the sequence number of the previous air interface PDCP message of the communication sender.
[0008] According to the communication data decryption method provided by the present invention, the key of the NAS message includes the encryption key of the NAS message and the integrity key of the NAS message. Based on multiple preset protection algorithms, multiple initial count values, multiple historical bearerids, and key sets, at least one decryption attempt is made on the NAS message, including: obtaining at least one initial decryption parameter set based on at least one combination result of the multiple preset protection algorithms, multiple initial count values, and multiple historical bearerids; decrypting the NAS message at least once based on the encryption key of the NAS message, the integrity key of the NAS message, and the at least one initial decryption parameter set, obtaining the MAC of the NAS message, until the MAC of the NAS message is equal to the XMAC of the NAS message, thereby determining that the NAS message decryption is successful.
[0009] According to the decryption method for communication data provided by the present invention, the key of the RRC message includes the encryption key of the RRC message and the integrity key of the RRC message. Based on multiple preset protection algorithms, multiple initial count values, multiple historical bearerids and key sets, the RRC message is attempted to be decrypted at least once, including: obtaining at least one initial decryption parameter set based on at least one combination result of multiple preset protection algorithms, multiple initial count values and multiple historical bearerids; decrypting the RRC message at least once based on the encryption key of the RRC message, the integrity key of the RRC message and at least one initial decryption parameter set, obtaining the MAC of the RRC message, until the MAC of the RRC message is equal to the XMAC of the RRC message, and determining that the RRC message decryption is successful.
[0010] According to the communication data decryption method provided by the present invention, the user plane message of the communication data is decrypted based on the decryption parameter set and the key set, including: decrypting the user plane message based on the key and decryption parameter set of the user plane message to obtain the decryption result of the user plane message; when the decryption result of the user plane message meets the IP packet characteristics or the robust header compression packet ROHC characteristics, it is determined that the user plane message decryption is successful.
[0011] The present invention also provides a communication data decryption device, comprising: an authentication module, for authenticating an authentication request message of a communication sender based on a stored user decryption parameter of at least one user; a key set determination module, for obtaining a key set of the communication sender based on the matching user decryption parameter of the authentication request message, the authentication request message and a key generation function when the authentication request message passes the authentication, wherein the key set includes a key of a non-access layer NAS message, a key of a radio resource control RRC message and a key of a user plane message; a first decryption module, for decrypting the NAS message of the communication data of the communication sender and the RRC message of the communication data for the first time based on multiple preset protection algorithms, multiple An initial count value, multiple historical bearer identifiers (BearerIDs) and a key set are used to attempt to decrypt a NAS message and an RRC message at least once. When the NAS message and the RRC message are successfully decrypted, a decryption parameter set of the communication data is saved, and the user plane message of the communication data is decrypted based on the decryption parameter set and the key set. The decryption parameter set includes at least a protection algorithm, a count value and BearerIDs, and the count value represents the round of the communication data. A second decryption module is used to obtain a decryption parameter set according to the saved result of the decryption parameter set when the NAS message and the RRC message are not decrypted for the first time, and decrypt the NAS message, the RRC message and the user plane message based on the decryption parameter set and the key set.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any of the above-mentioned communication data decryption methods is implemented.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements any of the above-mentioned communication data decryption methods when executed by a processor.
[0014] The communication data decryption method, device, electronic device, and storage medium provided by the present invention attempt to authenticate a received authentication request message using multiple stored user decryption parameters, thereby avoiding communication interaction with the communication sender, obtaining the communication user identity, and obtaining the key set for the current communication between the two communicating parties based on matching user decryption parameters, the authentication request message, and the key generation function. Multiple decryption attempts are made on NAS messages and RRC messages based on a preset integrity protection algorithm, an initial count value, and bearerid, achieving the acquisition of the decryption parameter set used by both parties in communication without communication interaction with the communication sender, thereby improving the efficiency of obtaining the decryption parameter set. The present invention greatly reduces the number of communication interactions with the communication sender during both the authentication and decryption processes, thereby improving the efficiency of decrypting communication data. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0016] Figure 1 This is one of the flow charts of the communication data decryption method provided by the present invention.
[0017] Figure 2 This is the second flow chart of the communication data decryption method provided by the present invention.
[0018] Figure 3 This is the third flow chart of the communication data decryption method provided by the present invention.
[0019] Figure 4 It is a structural diagram of the communication data decryption device provided by the present invention.
[0020] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0021] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0022] The following combination Figure 1-Figure 5 The present invention describes a method, device and electronic device for decrypting communication data.
[0023] Figure 1 This is one of the flow charts of the communication data decryption method provided by the present invention, such as Figure 1 As shown, the method for decrypting communication data includes S100 to S400, and each step is specifically as follows.
[0024] S100: Authenticating an authentication request message of a communication sender based on a stored user decryption parameter of at least one user.
[0025] The execution subject of this application may be the communication recipient.
[0026] like Figure 2As shown, the user decryption parameters of at least one user are pre-stored. When an authentication request message is received from a communication sender, the user decryption parameters of each stored user are traversed to authenticate the authentication request message until the authentication request message is authenticated. If the authentication request message fails after traversing the user decryption parameters of all users, it means that the communication sender does not match any of the pre-stored users and authentication fails.
[0027] S200: When the authentication request message passes the authentication, the key set of the communication sender is obtained based on the matching user decryption parameters of the authentication request message, the authentication request message and the key generation function.
[0028] The key set includes keys for non-access stratum (NAS) messages, keys for radio resource control (RRC) messages, and keys for user plane messages.
[0029] Matching user decryption parameters includes matching the Key Identifier (KI), matching the Operator Configuration Parameter (OPC), and other user decryption parameters. Obtain the Authentication Token (AUTN) and random value from the authentication request message. Input the matching KI, matching OPC, AUTN, and random value into the key generation function to obtain the sender's key set.
[0030] S300: When the NAS message of the communication data and the RRC message of the communication data of the communication sender are decrypted for the first time, based on multiple preset protection algorithms, multiple initial count values, multiple historical bearer identifiers bearerid and key sets, at least one attempt is made to decrypt the NAS message and the RRC message. When the NAS message and the RRC message are decrypted successfully, the decryption parameter set of the communication data is saved, and the user plane message of the communication data is decrypted based on the decryption parameter set and the key set.
[0031] The decryption parameter set includes at least a protection algorithm, a count value, and bearerid, where the count value represents the round of communication data.
[0032] Based on multiple preset protection algorithms, multiple initial count values, multiple historical bearer identifiers (BearerIDs) and key sets, before attempting to decrypt a NAS message and an RRC message at least once, the method further includes: if a security mode message from the communication sender is received, obtaining a protection algorithm based on the security mode message; if no security mode message is received, determining a preset protection algorithm based on the no encryption algorithm, the Advanced Encryption Standard (AES) algorithm, the SNOW3G algorithm, and the Zu Chongzhi (ZUC) algorithm.
[0033] Protection algorithms include encryption and decryption, as well as integrity protection algorithms, used to decrypt and verify the integrity of communication data (including NAS messages, RRC messages, and user plane messages). The count value represents the round in which the sender sends communication data, for example, the first round of communication data, the second round of communication data, etc. Each round of communication data includes multiple pieces of communication data; for example, a round includes 1024 pieces of communication data. The historical bearer identifier (BearerID) is a typical bearer identifier, for example, 0-7.
[0034] When receiving communication data from the communication sender, if the Non-Access Stratum (NAS) message of the communication data or the Radio Resource Control (RRC) message of the communication data is decrypted for the first time, it is necessary to attempt to decrypt the NAS message and the RRC message.
[0035] like Figure 3 As shown in the figure, if a security mode message is received from the communication sender, the algorithm configured in the security mode message is directly used as the security protection algorithm. If no security mode message is received, the algorithm attempts to decrypt the NAS message and RRC message by traversing the no encryption algorithm, the Advanced Encryption Standard (AES) algorithm, the Sequence Number Stream Cipher (SNOW3G) algorithm, and the Zu Chongzhi (ZUC) algorithm until the decryption attempt is successful.
[0036] The present invention obtains the protection algorithm based on the security mode message, thereby improving the accuracy of determining the protection algorithm. By traversing multiple preset protection algorithms, the protection algorithm is obtained, avoiding the need to obtain the protection algorithm from the communication sender and reducing the number of interactions with the communication sender.
[0037] When the NAS message and RRC message decryption attempt is successful, the preset protection algorithm corresponding to the successful decryption attempt is used as the protection algorithm of the communication data, the initial count value corresponding to the successful decryption attempt is used as the count value of the communication data, and the historical bearer identifier (bearerid) corresponding to the successful decryption attempt is used as the bearerid of the communication data. Figure 3 As shown, further, the uplink and downlink directions of the communication data and the length of the communication data are obtained. A decryption parameter set is determined based on the protection algorithm, the count value, the bearerid, the uplink and downlink directions of the message, and the length of the communication data. The decryption parameter set is saved, and the user plane message of the communication data is decrypted based on the decryption parameter set.
[0038] S400: When the NAS message and the RRC message are not decrypted for the first time, the decryption parameter set is obtained according to the saved result of the decryption parameter set, and the NAS message, the RRC message and the user plane message are decrypted based on the decryption parameter set and the key set.
[0039] like Figure 2 As shown, if the NAS message and RRC message are not decrypted for the first time, the decryption parameter set is directly obtained based on the saved result of the decryption parameter set. The NAS message, RRC message and user plane message are decrypted in sequence based on the decryption parameter set.
[0040] (1) Decrypt the NAS message using the NAS message key (the encryption key for the NAS message). If the NAS message decryption is successful, the subsequent RRC message decryption is performed. If the NAS message decryption is unsuccessful, indicating that the decryption parameter set has changed, the decryption parameter set is updated according to S300, and the NAS message is decrypted using the updated decryption parameter set.
[0041] (2) Decrypt the RRC message using the RRC message key (the encryption key of the RRC message). If the RRC message decryption is successful, the subsequent user plane message decryption is performed. If the RRC message decryption is unsuccessful, it indicates that the decryption parameter set has changed. The decryption parameter set is updated according to S300, and the RRC message is decrypted based on the updated decryption parameter set.
[0042] (3) Decrypt the user plane message according to the user plane message key.
[0043] The communication data decryption method provided by the present invention performs an authentication attempt on a received authentication request message using multiple stored user decryption parameters, avoiding communication interactions with the communication sender, obtaining the communication user identity, and obtaining the key set for the current communication between the two communicating parties by matching the user decryption parameters, the authentication request message, and the key generation function. Multiple decryption attempts are made on NAS messages and RRC messages based on a preset integrity protection algorithm (preset protection algorithm), an initial count value, and bearerid. This achieves the acquisition of the decryption parameter set used by both parties in communication without any communication interactions with the communication sender, thereby improving the efficiency of obtaining the decryption parameter set. This method significantly reduces the number of communication interactions with the communication sender during both the authentication and decryption processes, thereby improving the efficiency of decrypting communication data.
[0044] Based on the above embodiment, the user decryption parameters include at least the key identifier KI and the operator configuration parameter OPC. Based on the stored user decryption parameters of at least one user, the authentication request message of the communication sender is authenticated, including S110 to S160. The details of each step are as follows.
[0045] S110: Obtain the authentication token AUTN and random value of the authentication request message.
[0046] S120: Based on AUTN, the random value, the target user's KI and the target user's OPC, an authentication parameter set is obtained, where the target user is any user.
[0047] S130: Generate a message authentication code MAC for the authentication request message based on the authentication parameter set.
[0048] S140: When the MAC of the authentication request message is equal to the extended message authentication code XMAC of the authentication request message, it is determined that the authentication request message passes the authentication.
[0049] S150: When the MAC of the authentication request message is not equal to the XMAC of the authentication request message, traverse the users in sequence to update the target user, update the authentication parameter set based on the updated target user, and update the MAC of the authentication request message based on the updated authentication parameter set. When the MAC of the updated authentication request message is equal to the XMAC of the authentication request message, it is determined that the authentication request message has passed the authentication.
[0050] S160: When the user has traversed all the authentication requests and the MAC of the updated authentication request message is still not equal to the XMAC of the authentication request message, it is determined that the authentication request message fails the authentication.
[0051] Attempt to authenticate the authentication request message based on the target user's user decryption parameters. Obtain the authentication parameter set. Generate a message authentication code (MAC) for the authentication request message based on each authentication parameter set.
[0052] The Extended Message Authentication Code (XMAC) of the authentication request message can be directly obtained from the authentication request message. The XMAC of the authentication request message is used to verify the integrity of the authentication request message and ensure that the authentication request message has not been tampered with during transmission.
[0053] When the MAC of the authentication request message equals the XMAC of the authentication request message, the authentication request message is determined to have been successfully authenticated (passed authentication). Otherwise, the authentication request message is determined to have failed authentication (failed authentication). If the authentication request message fails authentication, the authentication parameter set is updated with another user as the target user. The updated MAC of the authentication request message is calculated based on the updated authentication parameter set. If the MAC of the updated authentication request message equals the XMAC of the authentication request message, the authentication request message is determined to have been successfully authenticated. If the authentication request message still fails authentication after traversing the user decryption parameters of all users, it indicates that the communication sender does not match any of the pre-stored users, and authentication is terminated.
[0054] The present invention automatically authenticates the authentication request message according to the user decryption parameter, reduces the number of communication interactions with the communication inventor, and improves the efficiency of authenticating the authentication request message.
[0055] The initial count value is obtained based on the following steps.
[0056] S310: When receiving the authentication request message, determine that the current count value is 0. During the communication process, obtain the current sequence number of the current air interface packet data convergence protocol (PDCP) message of the communication sender; if the current sequence number is less than the previous sequence number, increase the current count value by one to obtain the initial count value; the previous sequence number is the sequence number of the previous air interface PDCP message of the communication sender.
[0057] Upon receiving the current Packet Data Convergence Protocol (PDCP) message from the sender, the current PDCP sequence number is obtained. If the current sequence number is less than the previous sequence number, it indicates that the PDCP sequence number has rolled over and the current count value needs to be updated.
[0058] In a round of communication data, the air interface PDCP sequence number increases sequentially, for example, from 0 to a maximum value. When the sequence number reaches the maximum value, the count value is incremented by 1, and the next round of communication data is sent. The air interface PDCP sequence number increases sequentially from 0 until it reaches the maximum value, at which point the count value is incremented by 1 again, and the above process repeats.
[0059] If the current sequence number is less than the previous sequence number, it means that a cross-round reception of communication data has occurred, and the current count value needs to be increased by 1 to update the current count value.
[0060] Furthermore, cross-round communication data reception typically spans one round, or at most two rounds. Therefore, the set tolerances for the current count value are ±1 and ±2. The initial count value is obtained by adding the set tolerances to the current count value. For example, if the current count value is 3 and the set tolerances include ±1 and ±2, then the initial count values include 1, 2, 4, and 5.
[0061] The present invention automatically corrects the current count value according to the set error, thereby improving the accuracy of determining the initial count value and being beneficial to improving the accuracy of determining the count value.
[0062] Based on the above embodiment, the key of the NAS message includes the encryption key of the NAS message and the integrity key of the NAS message. Based on multiple preset protection algorithms, multiple initial count values, multiple historical bearerids, and key sets, at least one decryption attempt is made on the NAS message, including S320 to S330. The details of each step are as follows.
[0063] S320: Obtain at least one initial decryption parameter set based on at least one combination result of multiple preset protection algorithms, multiple initial count values, and multiple historical bearerids.
[0064] S330: Based on the encryption key of the NAS message, the integrity key of the NAS message and at least one initial decryption parameter set, decrypt the NAS message at least once to obtain the MAC of the NAS message until the MAC of the NAS message is equal to the XMAC of the NAS message, and determine that the NAS message decryption is successful.
[0065] If a NAS message is received from a communication sender and this is the first decryption of the NAS message, multiple initial decryption parameter sets are obtained based on multiple combinations of multiple preset protection algorithms, multiple initial count values, and multiple historical bearerids. One initial decryption parameter set is obtained based on one preset protection algorithm, one initial count value, and one historical bearerid.
[0066] Furthermore, the initial decryption parameter set also includes the uplink and downlink directions of the communication data and the length of the communication data.
[0067] Determine whether the NAS message integrity key and NAS message encryption key exist. If not, exit immediately, confirming that the NAS message cannot be decrypted. If the NAS message integrity key and NAS message encryption key exist, decrypt the NAS message using the NAS message encryption key and an initial decryption parameter set. Obtain the NAS message MAC based on the decryption result, the initial decryption parameter set, and the NAS message integrity key. Obtain the NAS message XMAC directly from the NAS message. Iterate through each initial decryption parameter set and decrypt the NAS message until the NAS message MAC equals the NAS message XMAC. Decryption is successful; otherwise, decryption fails. If decryption is successful, save the corresponding initial decryption parameter set as the decryption parameter set for the NAS message. Also save the NAS message encryption key and NAS message integrity key corresponding to the successful decryption. For example, the NAS message encryption key is the non-access stratum encryption key (Knasenc), and the NAS message integrity key is the non-access stratum integrity key (Knasinc).
[0068] If the NAS message cannot be decrypted successfully after traversing all initial decryption parameter sets, decryption of the NAS message is stopped and it is determined that the NAS message cannot be decrypted.
[0069] like Figure 2As shown, if a NAS message is received and this is not the first time the NAS message is decrypted, the decryption parameter set corresponding to the NAS message is directly obtained. The NAS message is decrypted using the decryption parameter set and the encryption key of the NAS message. If the NAS message decryption is successful, subsequent RRC messages are decrypted. If the NAS message decryption is unsuccessful, indicating that the decryption parameter set may have changed, the NAS message is decrypted again using the initial decryption parameter set to update the decryption parameter set.
[0070] The present invention attempts to decrypt a NAS message based on at least one initial decryption parameter set, an encryption key of the NAS message, and an integrity key of the NAS message, thereby achieving automatic decryption of the NAS message in the absence of the context of communication data and improving the efficiency of NAS message decryption.
[0071] Based on the above embodiment, the key of the RRC message includes the encryption key of the RRC message and the integrity key of the RRC message. Based on multiple preset protection algorithms, multiple initial count values, multiple historical bearerids and key sets, the RRC message is attempted to be decrypted at least once, including S350 to S360. The details of each step are as follows.
[0072] S350: Obtain at least one initial decryption parameter set based on at least one combination result of multiple preset protection algorithms, multiple initial count values, and multiple historical bearerids.
[0073] S360: Based on the encryption key of the RRC message, the integrity key of the RRC message and at least one initial decryption parameter set, decrypt the RRC message at least once and obtain the MAC of the RRC message until the MAC of the RRC message is equal to the XMAC of the RRC message, and determine that the RRC message decryption is successful.
[0074] If an RRC message is received from a communication sender and this is the first decryption of the RRC message, multiple initial decryption parameter sets are obtained based on multiple combinations of multiple preset protection algorithms, multiple initial count values, and multiple historical bearerids. Furthermore, the initial decryption parameter sets also include the uplink and downlink directions of the communication data and the length of the communication data.
[0075] Determine whether the RRC message integrity key and encryption key exist. If not, exit immediately, declaring the RRC message undecryptable. If present, decrypt the RRC message using the RRC message encryption key and an initial decryption parameter set. Obtain the RRC message MAC based on the decryption result, the initial decryption parameter set, and the RRC message integrity key. Obtain the RRC message XMAC directly from the RRC message. Iterate through each initial decryption parameter set and decrypt the RRC message until the RRC message MAC equals the RRC message XMAC. Decryption is successful; otherwise, decryption fails. If decryption is successful, the corresponding initial decryption parameter set is used as the decryption parameter set for the RRC message and saved. In the same round of communication data transmission, the RRC message and NAS message share the same decryption parameter set. Save the RRC message encryption key and RRC message integrity key corresponding to the successfully decrypted RRC message. For example, the RRC message encryption key is the Radio Resource Control encryption key (Krrcenc), and the RRC message integrity key is the Radio Resource Control integrity key (Krrcinc).
[0076] If the RRC message cannot be decrypted successfully after traversing all initial decryption parameter sets, decryption of the RRC message is stopped, and it is determined that the RRC message cannot be decrypted.
[0077] like Figure 2 As shown, further, if an RRC message is received and this is not the first decryption of the RRC message, the decryption parameter set corresponding to the RRC message is directly obtained. The RRC message is decrypted based on the decryption parameter set and the encryption key of the RRC message. If the RRC message decryption is successful, subsequent user plane messages are decrypted. If the RRC message decryption is unsuccessful, indicating that the decryption parameter set may have changed, the RRC message is re-decrypted based on the initial decryption parameter set to update the decryption parameter set.
[0078] The present invention attempts to decrypt the RRC message based on at least one initial decryption parameter set, the encryption key of the RRC message and the integrity key of the RRC message, thereby realizing automatic decryption of the RRC message in the absence of the context of communication data and improving the efficiency of decrypting the RRC message.
[0079] Based on the above embodiment, decrypting the user plane message of the communication data based on the decryption parameter set and the key set includes S370 to S380, and each step is specifically as follows.
[0080] S370: Decrypt the user plane message based on the key and decryption parameter set of the user plane message to obtain a decryption result of the user plane message.
[0081] S380: When the decryption result of the user plane message meets the IP packet feature or the robust header compression packet ROHC feature, it is determined that the user plane message decryption is successful.
[0082] If a user plane message is received from the sender, the system determines whether the user plane message key exists. If not, the system exits decryption and determines that the user plane message cannot be decrypted. If the user plane message key exists, the system decrypts the user plane message based on the user plane message key and the decryption parameter set, obtaining a decryption result. The user plane message key includes the user plane encryption key (Kupenc).
[0083] When the decryption result of the user plane message meets the IP packet characteristics or the robust header (ROHC) compression packet characteristics, it is determined that the user plane message decryption is successful.
[0084] The present invention directly decrypts the user plane message according to the key of the user plane message, thereby improving the efficiency of decrypting the user plane message.
[0085] The communication data decryption device provided by the present invention is described below. The communication data decryption device described below and the communication data decryption method described above can be referenced to each other.
[0086] like Figure 4 As shown, a communication data decryption device includes: an authentication module 401, which is used to authenticate the authentication request message of the communication sender based on the stored user decryption parameters of at least one user.
[0087] The key set determination module 402 is used to obtain the key set of the communication sender based on the matching user decryption parameters of the authentication request message, the authentication request message and the key generation function when the authentication request message passes the authentication. The key set includes the key of the non-access stratum NAS message, the key of the radio resource control RRC message and the key of the user plane message.
[0088] The first decryption module 403 is configured to, when the NAS message of the communication data and the RRC message of the communication data of the communication sender are decrypted for the first time, attempt to decrypt the NAS message and the RRC message at least once based on multiple preset protection algorithms, multiple initial count values, multiple historical bearer identifiers (bearerids), and key sets; when the NAS message and the RRC message are decrypted successfully, save the decryption parameter set of the communication data, and decrypt the user plane message of the communication data based on the decryption parameter set and the key set; the decryption parameter set includes at least a protection algorithm, a count value, and a bearerid, and the count value represents the round of the communication data.
[0089] The second decryption module 404 is used to obtain the decryption parameter set according to the saved result of the decryption parameter set when the NAS message and the RRC message are not decrypted for the first time, and decrypt the NAS message, the RRC message and the user plane message based on the decryption parameter set and the key set.
[0090] The communication data decryption device provided by the present invention performs an authentication attempt on a received authentication request message using multiple stored user decryption parameters, avoiding communication interaction with the communication sender, obtaining the communication user identity, and obtaining the key set for the current communication between the two communicating parties based on matching user decryption parameters, the authentication request message, and the key generation function. Multiple decryption attempts are made on NAS messages and RRC messages based on a preset integrity protection algorithm, an initial count value, and bearerid, achieving the acquisition of the decryption parameter set used by both parties in communication without communication interaction with the communication sender, thereby improving the efficiency of obtaining the decryption parameter set. The present invention significantly reduces the number of communication interactions with the communication sender during both the authentication and decryption processes, thereby improving the efficiency of decrypting communication data.
[0091] In one embodiment, the user decryption parameters include at least a key identifier KI and an operator configuration parameter OPC. The authentication module 401 is configured to: obtain an authentication token AUTN and a random value from the authentication request message; obtain an authentication parameter set based on the AUTN, the random value, the target user's KI, and the target user's OPC, where the target user is any user; generate a message authentication code MAC for the authentication request message based on the authentication parameter set; when the MAC of the authentication request message is equal to the extended message authentication code XMAC of the authentication request message, determine that the authentication request message has passed authentication; when the MAC of the authentication request message is not equal to the XMAC of the authentication request message, traverse the users in sequence to update the target user, update the authentication parameter set based on the updated target user, and update the MAC of the authentication request message based on the updated authentication parameter set; when the MAC of the updated authentication request message is equal to the XMAC of the authentication request message, determine that the authentication request message has passed authentication; when all users have been traversed and the MAC of the updated authentication request message is still not equal to the XMAC of the authentication request message, determine that the authentication request message has failed authentication.
[0092] In one embodiment, the first decryption module 403 is also used to: if a security mode message is received from the communication sender, obtain a protection algorithm based on the security mode message; if no security mode message is received, determine a preset protection algorithm based on the no encryption algorithm, the Advanced Encryption Standard AES algorithm, the serial number stream cipher SNOW3G algorithm and the Zu Chongzhi ZUC algorithm.
[0093] In one embodiment, the first decryption module 403 is used to: when receiving an authentication request message, determine that the current count value is 0, and during the communication process, obtain the current sequence number of the current air interface packet data convergence protocol PDCP message of the communication sender; if the current sequence number is less than the previous sequence number, increase the current count value by one to obtain the initial count value; the previous sequence number is the sequence number of the previous air interface PDCP message of the communication sender.
[0094] In one embodiment, the key of the NAS message includes an encryption key and an integrity key of the NAS message. The first decryption module 403 is configured to: obtain at least one initial decryption parameter set based on at least one combination result of multiple preset protection algorithms, multiple initial count values, and multiple historical bearerids; decrypt the NAS message at least once based on the encryption key of the NAS message, the integrity key of the NAS message, and the at least one initial decryption parameter set, and obtain a MAC of the NAS message, until the MAC of the NAS message is equal to the XMAC of the NAS message, thereby determining that the NAS message decryption is successful.
[0095] In one embodiment, the key of the RRC message includes the encryption key of the RRC message and the integrity key of the RRC message. The first decryption module 403 is used to: obtain at least one initial decryption parameter set based on at least one combination result of multiple preset protection algorithms, multiple initial count values and multiple historical bearerids; decrypt the RRC message at least once based on the encryption key of the RRC message, the integrity key of the RRC message and at least one initial decryption parameter set, obtain the MAC of the RRC message, until the MAC of the RRC message is equal to the XMAC of the RRC message, and determine that the RRC message decryption is successful.
[0096] In one embodiment, the first decryption module 403 is used to: decrypt the user plane message based on the key and decryption parameter set of the user plane message to obtain the decryption result of the user plane message; when the decryption result of the user plane message meets the IP packet characteristics or the robust header compression packet ROHC characteristics, it is determined that the user plane message decryption is successful.
[0097] Figure 5 An example of a physical structure diagram of an electronic device is shown below. Figure 5As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communications interface 520 and the memory 530 communicate with each other via the communications bus 540. The processor 510 may call the logic instructions in the memory 530 to execute a method for decrypting communication data, the method comprising: authenticating the authentication request message of the communication sender based on the user decryption parameters of at least one stored user; when the authentication request message passes the authentication, obtaining the key set of the communication sender based on the matching user decryption parameters of the authentication request message, the authentication request message and the key generation function, the key set including the key of the non-access layer NAS message, the key of the radio resource control RRC message and the key of the user plane message; when the NAS message of the communication data of the communication sender and the RRC message of the communication data are decrypted for the first time, based on multiple preset protection algorithms, Multiple initial count values, multiple historical bearer identifiers (BearerIDs) and key sets are used to attempt to decrypt NAS messages and RRC messages at least once. When the NAS messages and RRC messages are successfully decrypted, a decryption parameter set of the communication data is saved, and the user plane message of the communication data is decrypted based on the decryption parameter set and the key set. The decryption parameter set includes at least a protection algorithm, a count value and BearerIDs, and the count value represents the round of the communication data. When the NAS message and RRC message are not decrypted for the first time, the decryption parameter set is obtained according to the saved result of the decryption parameter set, and the NAS message, RRC message and user plane message are decrypted based on the decryption parameter set and the key set.
[0098] Furthermore, the logic instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0099] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented by a processor to execute the communication data decryption method provided by the above methods, the method comprising: authenticating the authentication request message of the communication sender based on the user decryption parameters of at least one user that have been stored; when the authentication request message passes the authentication, obtaining the key set of the communication sender based on the matching user decryption parameters of the authentication request message, the authentication request message and the key generation function, the key set including the key of the non-access layer NAS message, the key of the radio resource control RRC message and the key of the user plane message; when the NAS message of the communication data of the communication sender and the RRC message of the communication data are During the first decryption, at least one attempt is made to decrypt the NAS message and the RRC message based on multiple preset protection algorithms, multiple initial count values, multiple historical bearer identifiers bearerid and key sets. When the decryption of the NAS message and the RRC message is successful, the decryption parameter set of the communication data is saved, and the user plane message of the communication data is decrypted based on the decryption parameter set and the key set; the decryption parameter set includes at least a protection algorithm, a count value and bearerid, and the count value represents the round of the communication data; when the NAS message and the RRC message are not decrypted for the first time, the decryption parameter set is obtained according to the saved result of the decryption parameter set, and the NAS message, the RRC message and the user plane message are decrypted based on the decryption parameter set and the key set.
[0100] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0101] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for decrypting communication data, characterized in that: include: authenticating the authentication request message of the communication sender based on the stored user decryption parameter of at least one user; When the authentication request message passes authentication, obtaining a key set of the communication sender based on the matching user decryption parameter of the authentication request message, the authentication request message, and a key generation function, the key set including a key for a non-access stratum (NAS) message, a key for a radio resource control (RRC) message, and a key for a user plane message; When a NAS message of the communication data of the communication sender and an RRC message of the communication data are decrypted for the first time, obtaining at least one initial decryption parameter set based on at least one combination result of multiple preset protection algorithms, multiple initial count values, and multiple historical bearer identifiers (bearerid); attempting to decrypt the NAS message and the RRC message at least once based on the key set and the at least one initial decryption parameter set; when the decryption of the NAS message and the RRC message is successful, saving the decryption parameter set of the communication data, and decrypting the user plane message of the communication data based on the decryption parameter set and the key set; The decryption parameter set includes at least a protection algorithm, a count value, bearerid, uplink and downlink directions of the communication data, and the length of the communication data, wherein the count value represents the round of the communication data; When the NAS message and the RRC message are not decrypted for the first time, the decryption parameter set is obtained according to the saved result of the decryption parameter set, and the NAS message, the RRC message and the user plane message are decrypted based on the decryption parameter set and the key set.
2. The method for decrypting communication data according to claim 1, wherein: The user decryption parameters include at least a key identifier KI and an operator configuration parameter OPC, and the authentication request message of the communication sender is authenticated based on the stored user decryption parameters of at least one user, including: Obtain the authentication token AUTN and random value of the authentication request message; Acquire an authentication parameter set based on the AUTN, the random value, the target user's KI, and the target user's OPC, where the target user is any of the users; Generate a message authentication code MAC for the authentication request message based on the authentication parameter set; When the MAC of the authentication request message is equal to the extended message authentication code XMAC of the authentication request message, determining that the authentication request message passes the authentication; When the MAC of the authentication request message is not equal to the XMAC of the authentication request message, traversing the users in sequence to update the target user, updating the authentication parameter set based on the updated target user, and updating the MAC of the authentication request message based on the updated authentication parameter set; when the MAC of the updated authentication request message is equal to the XMAC of the authentication request message, determining that the authentication request message has passed authentication; When all the users have been traversed and the MAC of the updated authentication request message is still not equal to the XMAC of the authentication request message, it is determined that the authentication request message fails the authentication.
3. The method for decrypting communication data according to claim 1, wherein: Before attempting to decrypt the NAS message and the RRC message at least once based on the multiple preset protection algorithms, the multiple initial count values, the multiple historical bearer identifiers (bearerids), and the key set, the method further includes: If a security mode message is received from the communication sender, obtaining the protection algorithm based on the security mode message; If the security mode message is not received, the preset protection algorithm is determined based on the no encryption algorithm, the Advanced Encryption Standard AES algorithm, the serial number stream cipher SNOW3G algorithm and the Zu Chongzhi ZUC algorithm.
4. The method for decrypting communication data according to claim 1, wherein: The initial count value is obtained based on the following steps: When the authentication request message is received, the current count value is determined to be 0. During the communication process, the current sequence number of the current air interface packet data convergence protocol PDCP message of the communication sender is obtained; if the current sequence number is less than the previous sequence number, the current count value is increased by one to obtain the initial count value; the previous sequence number is the sequence number of the previous air interface PDCP message of the communication sender.
5. The method for decrypting communication data according to claim 1, wherein: The key of the NAS message includes an encryption key and an integrity key of the NAS message, and performing at least one decryption attempt on the NAS message based on the key set and the at least one initial decryption parameter set, comprising: Based on the encryption key of the NAS message, the integrity key of the NAS message, and at least one of the initial decryption parameter sets, decrypt the NAS message at least once to obtain a MAC of the NAS message, until the MAC of the NAS message is equal to the XMAC of the NAS message, and determine that the NAS message decryption is successful.
6. The method for decrypting communication data according to claim 1, wherein: The key of the RRC message includes an encryption key of the RRC message and an integrity key of the RRC message, and based on the key set and the at least one initial decryption parameter set, attempting to decrypt the RRC message at least once, comprising: Based on the encryption key of the RRC message, the integrity key of the RRC message and at least one of the initial decryption parameter sets, the RRC message is decrypted at least once to obtain the MAC of the RRC message until the MAC of the RRC message is equal to the XMAC of the RRC message, and it is determined that the RRC message is decrypted successfully.
7. The method for decrypting communication data according to claim 1, wherein: The decrypting the user plane message of the communication data based on the decryption parameter set and the key set includes: Decrypting the user plane message based on the key of the user plane message and the decryption parameter set to obtain a decryption result of the user plane message; When the decryption result of the user plane message meets the IP packet feature or the Robust Header Compression (ROHC) packet feature, it is determined that the decryption of the user plane message is successful.
8. A communication data decryption device, characterized in that: include: an authentication module, configured to authenticate an authentication request message from a communication sender based on a stored user decryption parameter of at least one user; a key set determining module, configured to, when the authentication request message passes authentication, obtain the key set of the communication sender based on the matching user decryption parameters of the authentication request message, the authentication request message, and a key generation function, wherein the key set includes a key for a non-access stratum (NAS) message, a key for a radio resource control (RRC) message, and a key for a user plane message; A first decryption module is configured to, when a NAS message of the communication data of the communication sender and an RRC message of the communication data are decrypted for the first time, obtain at least one initial decryption parameter set based on at least one combination result of multiple preset protection algorithms, multiple initial count values, and multiple historical bearer identifiers bearerid; perform at least one decryption attempt on the NAS message and the RRC message based on the key set and the at least one initial decryption parameter set, and when the decryption of the NAS message and the RRC message is successful, save the decryption parameter set of the communication data, and decrypt the user plane message of the communication data based on the decryption parameter set and the key set; The decryption parameter set includes at least a protection algorithm, a count value, bearerid, uplink and downlink directions of the communication data, and the length of the communication data, wherein the count value represents the round of the communication data; A second decryption module is configured to obtain the decryption parameter set according to the saved result of the decryption parameter set when the NAS message and the RRC message are not decrypted for the first time, and decrypt the NAS message, the RRC message, and the user plane message based on the decryption parameter set and the key set.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the communication data decryption method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for decrypting communication data according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Data processing method and device based on downlink signaling and storage medium
CN114040396A
Key matching method and device, equipment and storage medium
CN114697037A