Identity authentication and key distribution method and system based on white-box cryptographic algorithm

By pre-loading baseline code and white-box libraries, generating session key distribution tokens using the key management center, and randomly selecting white-box code to update white-box passwords, the problem of excessive resource consumption caused by frequent key updates in white-box attack environments is solved, thereby improving the security and manageability of the system.

CN117201076BActive Publication Date: 2026-05-29CHINA TELECOM QUANTUM TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM QUANTUM TECH CO LTD
Filing Date
2023-08-01
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In a white-box attack environment, existing technologies suffer from excessive resource consumption and system performance impact due to frequent key updates, and excessive memory and processor usage due to switching between multiple sets of program code.

Method used

By pre-loading baseline code, white-box code, and white-box library, session key distribution tokens are generated using the key management center. White-box passwords are updated by randomly selecting white-box code and round function dynamic libraries, thereby reducing resource consumption and improving security.

Benefits of technology

While ensuring security, it reduces the resource consumption of white-box code transmission and switching, and improves the manageability and resistance to attacks of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117201076B_ABST
    Figure CN117201076B_ABST
Patent Text Reader

Abstract

The application discloses an identity authentication and key distribution method and system based on a white-box cryptographic algorithm, and the method comprises the following steps: a communication initiator generates an identity authentication token by using randomly selected white-box code and sends the token to a key management center; a session key distribution token sent by the key management center is received, the session key distribution token is generated by the key management center after the identity authentication token is verified to be correct, and the session key distribution token comprises a target round function generated based on a randomly selected session key; the communication initiator refreshes the reference code stored locally by using the target round function and the white-box code stored locally, and generates a communication session white-box cryptographic algorithm; the communication initiator sends the communication session white-box cryptographic algorithm and the session key distribution token to a communication responder for encrypted communication; and the application reduces the resource consumption of white-box code transmission and switching in the whole identity authentication and key distribution process while ensuring security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cryptographic application technology, specifically to an identity authentication and key distribution method and system based on white-box cryptographic algorithms. Background Technology

[0002] In a white-box attack context, the execution of software is completely visible to attackers. Without special protection for the key, attackers can easily obtain the key information by observing or executing the software. White-box cryptography addresses this situation by protecting the key within the execution process of the cryptographic software, preventing attackers from extracting it. Different keys require different algorithm execution code, meaning key distribution occurs through the distribution of executable programs. Updates to the key trigger updates to the entire executable program. This operational model presents the following problems:

[0003] (1) The space occupied by the executable code of the cryptographic algorithm is much larger than that of a symmetric key, at least by K bytes and bytes. Updating the key causes the entire executable program of the algorithm to be updated and distributed, which will occupy a lot of network transmission resources or storage resources. The more frequently the key is updated, the more resources are occupied.

[0004] (2) During the execution of the executable program of the algorithm implementation, the resource and time consumption of reloading the entire executable program of the algorithm implementation, as well as the impact on the system's operating status and performance, are far greater than the cost of reading a symmetric key. The more frequently the key is updated, the greater the pressure on the system.

[0005] (3) Identity authentication based on symmetric cryptography requires the use of multiple pre-shared keys to improve security. This can lead to excessive memory and processor usage when using white-box cryptography due to the switching of multiple program codes.

[0006] In related technologies, patent application CN113132087A proposes using security chips and white-box cryptography for authentication based on the varying security requirements of IoT terminal devices. Patent application CN114448624A proposes a transparent IoT secure transmission scheme based on white-box cryptography services. However, neither proposal details the implementation method of the white-box cryptography algorithm or the method of white-box key distribution. Summary of the Invention

[0007] The technical problem to be solved by this invention is how to reduce the resource consumption of white-box code transmission and switching during the entire identity authentication and key distribution process while ensuring security.

[0008] The present invention solves the above-mentioned technical problems through the following technical means:

[0009] In a first aspect, this invention proposes an authentication and key distribution method based on a white-box cryptographic algorithm, characterized in that both parties involved in the communication are pre-loaded with baseline code, white-box code, and a white-box library, wherein the white-box library includes a round function dynamic library with the same number of round functions corresponding to the master key, and the method includes:

[0010] The initiator of the communication generates an authentication token using randomly selected white-box code and sends it to the key management center;

[0011] The communication initiator receives a session key distribution token sent by the key management center. The session key distribution token is generated by the key management center after verifying the identity authentication token. The session key distribution token includes a target round function generated based on a randomly selected session key.

[0012] The communication initiator uses the locally stored white-box code and the target round function to refresh the locally stored base code to generate a white-box cipher for the communication session;

[0013] The communication initiator sends the white-box password of the communication session and the session key distribution token to the communication responder for encrypted communication.

[0014] Furthermore, the reference code is generated by using the SM4 white-box algorithm to process the reference key at the white-box code generation point;

[0015] Each of the white-box codes is generated by using the SM4 white-box algorithm to operate on each of the master keys at the white-box code generation point;

[0016] Each round function operation code of the white-box code is stored in each dynamic link library in the corresponding round function dynamic library, and the round function dynamic library corresponding to each master key is stored in the white-box library.

[0017] Furthermore, each of the dynamic link libraries is encrypted and protected by protection code. The protection code is generated by the white-box code generation point using the SM4 white-box algorithm to calculate the random numbers generated in real time, and both parties involved in the communication are pre-filled with the protection code.

[0018] Furthermore, the communication initiator generates an authentication token using randomly selected white-box code and sends it to the key management center, including:

[0019] The communication initiator uses the randomly selected white-box code to encrypt a random number randomly selected by the communication initiator, the identity identifiers of both parties involved in the communication, and the sequence number of the white-box code pre-shared between the communication initiator and the key management center, to generate the identity authentication token and send it to the key management center.

[0020] Furthermore, the session key distribution token includes token A and token B. Token A carries information including a dynamic link library Lib_Ns generated based on the session key and selected based on a random integer Ns, integers Nk and Nf used to locate the round functions in the white-box library, and the sequence number SN_A of the white-box code pre-shared between the communication initiator and the key management center.

[0021] The token TokenB carries information including a dynamic link library Lib_Ns generated based on the session key and selected based on a random integer Ns, integers Nk and Nf used to locate the round functions in the white-box library, and a sequence number SN_B of the white-box code pre-shared between the communication responder and the key management center.

[0022] Furthermore, the communication initiator uses locally stored white-box code and the target round function to refresh the locally stored baseline code to generate a white-box cipher for the communication session, including:

[0023] The communication initiator calls the corresponding white-box code in its local machine to decrypt and verify the token TokenA according to the serial number SN_A;

[0024] After successful verification, the corresponding dynamic link library is selected from the local white-box library as the shared dynamic link library based on the integers Nk and Nf.

[0025] Based on the shared link library and the dynamic link library Lib_Ns, the round functions corresponding to integers Nf and Ns in the base code are replaced to generate the white-box cipher for the communication session.

[0026] Further, after the verification is passed, a corresponding dynamic link library is selected from the local white-box library as a shared dynamic link library based on the integers Nk and Nf, including:

[0027] After selecting the corresponding dynamic link library from the local white-box library based on integers Nk and Nf, the shared dynamic link library is obtained by calling the protection code to decrypt the dynamic link library.

[0028] Furthermore, the communication initiator sends the white-box cryptography of the communication session and the session key distribution token to the communication responder for encrypted communication, including:

[0029] The communication initiator uses the communication session password to encrypt the random number Nv generated in real time by the communication initiator to generate a token TokenS.

[0030] Send the tokens TokenS and TokenB to the communication responder.

[0031] Furthermore, the method also includes:

[0032] The communication responder calls the corresponding white-box code in its local machine to decrypt and verify the token TokenB based on the serial number SN_B in the token TokenB.

[0033] After successful verification, the corresponding dynamic link library is selected from the local white-box library as the shared dynamic link library based on the integers Nk and Nf.

[0034] Based on the shared link library and the dynamic link library Lib_Ns, the round functions corresponding to integers Nf` and Ns in the base code are replaced to generate the white-box cipher for the communication session. The round functions located by integer Nf` are the reverse of the round functions located by integer Nf.

[0035] The token is verified using the white-box cryptography of the communication session. After successful verification, both parties involved in the communication use the white-box cryptography of the communication session for encrypted communication.

[0036] Secondly, this invention proposes a communication terminal based on a white-box cryptographic algorithm. The communication terminal is pre-loaded with baseline code, white-box code, and a white-box library. The white-box library includes a round function dynamic library with the same number of rounds as the master key. The communication terminal includes:

[0037] The identity authentication initiation module is used to generate an identity authentication token using randomly selected white-box code and send it to the key management center;

[0038] The token acquisition module is used to receive a session key distribution token sent by the key management center. The session key distribution token is generated by the key management center after verifying the identity authentication token. The session key distribution token includes a target round function generated based on a randomly selected session key.

[0039] The refresh module is used to refresh the base code stored locally using the white-box code stored locally and the target round function to generate a white-box password for the communication session.

[0040] An encrypted communication module is used to send the white-box password of the communication session and the session key distribution token to the communication responder for encrypted communication.

[0041] Thirdly, the present invention proposes an identity authentication and key distribution system based on white-box cryptography algorithm. The system includes: a communication initiator, a communication responder, a key management center, and a quantum key distribution network. The communication initiator and the communication responder are both connected to the key management center. The communication initiator, the communication responder, and the key management center are all connected to corresponding white-box code generation points. Each of the white-box code generation points is connected to each quantum network node in the quantum key distribution network.

[0042] The quantum key distribution network is used to inject a base key and several master keys into each of the white-box code generation points;

[0043] The white-box code generation point is used to perform calculations on the base key and the master key using the SM4 white-box algorithm to generate base code and white-box code corresponding to the master key, and to store each round function operation code of the white-box code into each dynamic link library in the corresponding round function dynamic library, and the round function dynamic library is stored in the white-box library.

[0044] The communication initiator is used to generate an identity authentication token using randomly selected white-box code and send it to the key management center for identity authentication, and to receive a session key distribution token returned by the key management center, wherein the session key distribution token carries a target round function generated based on the session key;

[0045] The communication initiator generates a white-box cipher for encrypted communication with the communication responder based on the target round function generated by the session key and the locally stored baseline code and white-box library.

[0046] The advantages of this invention are:

[0047] (1) In this invention, the two parties involved in the communication are pre-loaded with base code, white-box code and white-box library. In the subsequent identity authentication process, the identity and key identifiers are used to distinguish the white-box encryption program code based on different identities and different keys for identity authentication. When updating and distributing the session key, a round function of the white-box code generated by the key management center based on the fresh session key is randomly selected and some dynamic link libraries in the white-box library are randomly reloaded to update some round functions in the base code. This reduces the resource consumption of white-box code transmission and switching in the entire identity authentication and key distribution process while ensuring security.

[0048] (2) The white-box cryptography corresponding to the session key is uniformly generated and distributed by the key management center. Combined with the round function of the local white-box library, it reduces data transmission consumption and improves security to a certain extent, thereby enhancing the manageability of the entire system.

[0049] (3) Different participants and the key management center perform identity authentication and key distribution based on different pre-shared white-box codes, which improves security and resistance to attacks.

[0050] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0051] Figure 1 This is a flowchart illustrating an identity authentication and key distribution method based on a white-box cryptographic algorithm proposed in an embodiment of the present invention.

[0052] Figure 2 This is a schematic diagram of the structure of a communication terminal based on a white-box cryptographic algorithm according to an embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram of the structure of an identity authentication and key distribution system based on a white-box cryptographic algorithm proposed in an embodiment of the present invention;

[0054] Figure 4 This is a flowchart of an identity authentication and key distribution system based on a white-box cryptographic algorithm proposed in an embodiment of the present invention. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0056] like Figure 1 As shown, the first embodiment of the present invention proposes an authentication and key distribution method based on a white-box cryptographic algorithm. Both parties involved in the communication are pre-loaded with baseline code, white-box code, and a white-box library. The white-box library includes a dynamic library of round functions with the same number as the master key. The method includes the following steps:

[0057] S10. The communication initiator generates an identity authentication token using a randomly selected white-box code and sends it to the key management center.

[0058] S20. The communication initiator receives a session key distribution token sent by the key management center. The session key distribution token is generated by the key management center after verifying the identity authentication token. The session key distribution token includes a target round function generated based on a randomly selected session key.

[0059] S30. The communication initiator uses the locally stored white-box code and the target round function to refresh the locally stored base code to generate a communication session white-box password.

[0060] S40. The communication initiator sends the white-box password of the communication session and the session key distribution token to the communication responder for encrypted communication.

[0061] In this embodiment, during the identity authentication process, the communication participants use identity and key identifiers to distinguish white-box encryption program code based on different identities and different keys for identity authentication. Furthermore, when updating and distributing session keys, a round function of the white-box code generated by the key management center based on the fresh session key is randomly selected, and some dynamic libraries in the white-box library are randomly reloaded to update some round functions in the base code. This reduces the resource consumption of white-box code transmission and switching during the entire identity authentication and key distribution process while ensuring security.

[0062] In one embodiment, the base code is generated by using the SM4 white-box algorithm to operate on the base key;

[0063] Each of the white-box codes is generated by using the SM4 white-box algorithm to operate on each of the master keys at the white-box code generation point;

[0064] Each round function operation code of the white-box code is stored in each dynamic link library in the corresponding round function dynamic library, and the round function dynamic library corresponding to each master key is stored in the white-box library.

[0065] In one embodiment, the dynamic link library is protected by a protection code. The protection code is generated by the white-box code generation point using the SM4 white-box algorithm to calculate random numbers generated in real time, and both parties involved in the communication are pre-filled with the protection code.

[0066] Specifically, a reference key is synchronized across the entire domain through a quantum key distribution network (QKD) and transmitted to white-box code generation points. The white-box code generation points generate a reference code based on the reference key. The reference code is then loaded into the communication participants using secure storage media such as secure SIM cards, secure TF cards, or secure U-shields. The key management center obtains and runs the reference code from the corresponding white-box code generation point. At the same time, each white-box code generation point generates random numbers in real time and generates protection codes based on these random numbers, which are then injected into the secure storage media.

[0067] A quantum key distribution network (QKD) generates and distributes several pre-shared master keys between each communication participant and the key management center. These pre-shared master keys are then passed to corresponding white-box code generation points. Each white-box code generation point generates a white-box SM4 algorithm program code based on each master key; this is called pre-shared white-box code. These white-box codes are then ordered, identified, and compressed. The code generation points for each communication participant use high-capacity storage media to store these pre-shared white-box codes generated from the pre-shared master keys between the participant and the key management center. The code generation points for the key management center then transmit these pre-shared white-box codes to the key management center.

[0068] A quantum key distribution network (QKD) generates and distributes a large number of shared master keys across the entire domain for all communication participants. These master keys are then passed to white-box code generation points. Each white-box code generation point generates a white-box SM4 algorithm program based on its master key, and places the 32 round function operations of this code into 32 dynamic link libraries. After compression and encryption using a protection code, the code is stored in the code generation point's white-box library and indexed using the master key identifier (a 32-bit integer) plus a round identifier (values ​​1-32). A large-capacity storage medium is used to fill the white-box library for the corresponding communication participants. By dividing the white-box algorithm code into 32 dynamic libraries, different identities and keys correspond to different combinations of dynamic libraries, thus achieving identity authentication and key distribution services.

[0069] In one embodiment, step S10: The communication initiator generates an authentication token using randomly selected white-box code and sends it to the key management center, including:

[0070] The communication initiator uses the randomly selected white-box code to encrypt a random number randomly selected by the communication initiator, the identity identifiers of both parties involved in the communication, and the sequence number of the white-box code pre-shared between the communication initiator and the key management center, to generate the identity authentication token and send it to the key management center.

[0071] Specifically, the identity authentication token is represented as follows:

[0072] Token=ID_A||ID_B||Na||SN_A||Text1||EncA(ID_A||ID_B||Na||SN_A||Text2)

[0073] Wherein, ID_A is the identity identifier of the communication initiator, ID_B is the identity identifier of the communication responder, Na is a random number generated in real time, SN_A is the sequence number of the pre-shared white-box code between the communication initiator and the key management center, Text1 and Text2 are readable strings, and EncA represents encryption using the pre-shared white-box SM4 algorithm code between the communication initiator and the key management center.

[0074] In one embodiment, the session key distribution token includes token A and token B. Token A carries information including a dynamic link library Lib_Ns generated based on the session key and selected based on a random integer Ns, integers Nk and Nf used to locate the round functions in the white-box library, and the sequence number SN_A of the white-box code pre-shared between the communication initiator and the key management center.

[0075] The token TokenB carries information including a dynamic link library Lib_Ns generated based on the session key and selected based on a random integer Ns, integers Nk and Nf used to locate the round functions in the white-box library, and a sequence number SN_B of the white-box code pre-shared between the communication responder and the key management center.

[0076] Specifically, the process of generating the session key distribution token is as follows:

[0077] The key management center uses the ID_A and SN_A in the authentication token to call the corresponding pre-shared white-box code to decrypt and verify the authentication token of the communication initiator. After successful verification, a random number is generated in real time as the session key, and based on this session key, white-box SM4 algorithm code is generated through the code generation point. The 32 round function operation codes of this code are placed into 32 dynamic link libraries respectively, generating a random integer Ns less than or equal to 32, and a round function dynamic library Lib_Ns is selected based on this integer Ns.

[0078] The key management center generates two 32-bit integers, Nk and Nf, which are used by the communication initiator and the communication responder to locate the round functions in the white-box library. Nk is used as the master key identifier to locate the dynamic link library of the round function corresponding to the master key in the white-box library, and Nf is used as a bitmap to locate several round functions in the dynamic link library of the 32 round functions corresponding to the master key in the white-box library (the number corresponding to the bit set to 1 in the 32-bit bitmap is the selected round function. For example, bitmap 0x000000FF corresponds to round functions 1-8).

[0079] The key management center randomly selects SN_B to use as the pre-shared white-box code between the selection and communication responder ID_B. Based on the above information, a session key (white-box code) is formed and a distribution token is sent to the communication initiator.

[0080] Token = TokenA || TokenB

[0081] TokenA=Text3||EncA(ID_A||ID_B||Na||SN_A||Text4||Nk||Nf||Ns||Lib_Ns)

[0082] TokenB=ID_A||ID_B||Nb||SN_B||Text5||EncB(ID_A||ID_B||Nb||SN_b||Text6||Nf||Ns||Lib_Ns)

[0083] In this context, EncB represents encryption using pre-shared white-box SM4 algorithm code between the communication responder and the key management center, and Text3 to Text6 are readable strings.

[0084] It should be noted that the white-box cryptography corresponding to the session key is uniformly generated and distributed by the key management center. Combined with the round function of the local white-box library, it reduces data transmission consumption and improves security to a certain extent, thereby enhancing the manageability of the entire system. Furthermore, different communication participants and the key management center perform identity authentication and key distribution based on different pre-shared white-box codes, which improves security and resistance to attacks.

[0085] In one embodiment, step S30: The communication initiator refreshes the locally stored base code using the locally stored white-box code and the target round function to generate a white-box cipher for the communication session, including the following steps:

[0086] S31. The communication initiator calls the corresponding white-box code in the local machine to decrypt and verify the token TokenA according to the serial number SN_A;

[0087] S32. After verification, select the corresponding dynamic link library from the local white-box library as the shared dynamic link library based on the integers Nk and Nf.

[0088] S33. Based on the shared link library and the dynamic link library Lib_Ns, replace the round functions corresponding to integers Nf and Ns in the base code to generate the white-box cipher for the communication session.

[0089] In one embodiment, step S32: after successful verification, selecting a corresponding dynamic link library from the local white-box library as a shared dynamic link library based on integers Nk and Nf, includes:

[0090] After selecting the corresponding dynamic link library from the local white-box library based on integers Nk and Nf, the shared dynamic link library is obtained by calling the protection code to decrypt the dynamic link library.

[0091] In one embodiment, step S40: The communication initiator sends the white-box cipher of the communication session and the session key distribution token to the communication responder for encrypted communication, including:

[0092] The communication initiator uses the communication session password to encrypt the random number Nv generated in real time by the communication initiator to generate a token TokenS.

[0093] Send the tokens TokenS and TokenB to the communication responder.

[0094] Specifically, the communication initiator selects the corresponding round function dynamic library from the white-box library based on the integers Nk and Nf. The white-box code execution container runs the program decoder, calls the protection code to decompress the round function dynamic library, and replaces or adds the round function dynamic library corresponding to Ns with Lib_Ns. Then, the corresponding round functions of the baseline white-box SM4 algorithm code for Nf and Ns are replaced to form and run the white-box cryptographic algorithm code for the communication session. This code is used to encrypt the real-time random number Nv to form TokenS, which is sent to the communication responder along with TokenB.

[0095] TokenS=ID_A||ID_B||Ns||Text7||EncS(ID_A||ID_B||Ns||Text8)

[0096] Text7 and Text8 are readable strings.

[0097] In one embodiment, after the communication responder receives the token, the method further includes the following steps:

[0098] The communication responder calls the corresponding white-box code in its local machine to decrypt and verify the token TokenB based on the serial number SN_B in the token TokenB.

[0099] After successful verification, the corresponding dynamic link library is selected from the local white-box library as the shared dynamic link library based on the integers Nk and Nf.

[0100] Based on the shared link library and the dynamic link library Lib_Ns, the round functions corresponding to integers Nf` and Ns in the base code are replaced to generate the white-box cipher for the communication session. The round functions located by integer Nf` are the reverse of the round functions located by integer Nf.

[0101] The token is verified using the white-box cryptography of the communication session. After successful verification, both parties involved in the communication use the white-box cryptography of the communication session for encrypted communication.

[0102] Specifically, the responding party, based on SN_B in TokenB, invokes the corresponding pre-shared white-box code to decrypt and verify TokenB. Upon successful verification, it refreshes its local base code to form and run the same white-box cryptography for the communication session as the initiating party, using this code to verify TokenS. After successful verification, both parties then use the aforementioned white-box cryptographic algorithm code for encrypted communication.

[0103] Furthermore, since the round keys used for encryption and decryption are in reverse order, the round function number that is replaced during decryption should be 32 - "the number corresponding to setting the bitmap to 1" + 1. For example, when decrypting bitmap 0x000000FF, it corresponds to round functions 24-32.

[0104] During the authentication process, the 32 round functions of the white-box cryptography are dynamically and randomly loaded according to key changes, which improves security. Furthermore, when the key is changed, a portion of the 32 round functions of the white-box SM4 cryptography are randomly updated, reducing the resource consumption of white-box code transmission and switching. Different participants and the key management center perform authentication and key distribution based on different pre-shared white-box codes, which enhances security and resistance to attacks.

[0105] like Figure 2 As shown, the second embodiment of the present invention proposes a communication terminal based on a white-box cryptographic algorithm. The communication terminal is pre-loaded with base code, white-box code, and a white-box library. The white-box library includes a round function dynamic library with the same number of round functions as the master key. The communication terminal includes:

[0106] The identity authentication initiation module 10 is used to generate an identity authentication token using randomly selected white-box code and send it to the key management center.

[0107] The token acquisition module 20 is used to receive a session key distribution token sent by the key management center. The session key distribution token is generated by the key management center after verifying the identity authentication token. The session key distribution token includes a target round function generated based on a randomly selected session key.

[0108] The refresh module 30 is used to refresh the base code stored locally using the white-box code stored locally and the target round function to generate a white-box password for the communication session.

[0109] The encrypted communication module 40 is used to send the white-box password of the communication session and the session key distribution token to the communication responder for encrypted communication.

[0110] In one embodiment, the base code is generated by using the SM4 white-box algorithm to operate on the base key;

[0111] Each of the white-box codes is generated by using the SM4 white-box algorithm to operate on each of the master keys at the white-box code generation point;

[0112] Each round function operation code of the white-box code is stored in each dynamic link library in the corresponding round function dynamic library, and the round function dynamic library corresponding to each master key is stored in the white-box library.

[0113] In one embodiment, the dynamic link library is protected by protection code encryption. The protection code is generated by the white-box code generation point using the SM4 white-box algorithm to calculate random numbers generated in real time, and both parties involved in the communication are pre-filled with the protection code.

[0114] In one embodiment, the identity authentication initiation module 10 is specifically used for:

[0115] The communication initiator uses the randomly selected white-box code to encrypt a random number randomly selected by the communication initiator, the identity identifiers of both parties involved in the communication, and the sequence number of the white-box code pre-shared between the communication initiator and the key management center, to generate the identity authentication token and send it to the key management center.

[0116] In one embodiment, the session key distribution token includes token A and token B. Token A carries information including a dynamic link library Lib_Ns generated based on the session key and selected based on a random integer Ns, integers Nk and Nf used to locate the round functions in the white-box library, and the sequence number SN_A of the white-box code pre-shared between the communication initiator and the key management center.

[0117] The token TokenB carries information including a dynamic link library Lib_Ns generated based on the session key and selected based on a random integer Ns, integers Nk and Nf used to locate the round functions in the white-box library, and a sequence number SN_B of the white-box code pre-shared between the communication responder and the key management center.

[0118] In one embodiment, the refresh module 30 includes:

[0119] The decryption unit is used by the communication initiator to call the corresponding white-box code in the local machine to decrypt and verify the token TokenA according to the serial number SN_A;

[0120] The refresh unit is used to select the corresponding dynamic link library from the local white-box library as the shared dynamic link library after the verification is passed, based on the integers Nk and Nf.

[0121] The communication session white-box cipher generation unit is used to replace the round functions corresponding to integers Nf and Ns in the base code based on the shared link library and the dynamic link library Lib_Ns, thereby generating the communication session white-box cipher.

[0122] In one embodiment, the refresh unit is configured to select the corresponding dynamic link library from the local white-box library based on integers Nk and Nf, and then call protection code to decrypt the dynamic link library to obtain the shared dynamic link library.

[0123] In one embodiment, the communication session white-box cryptography generation unit is specifically used for:

[0124] The communication session password is used to encrypt the random number Nv generated in real time by the communication initiator to generate a token TokenS.

[0125] Send the tokens TokenS and TokenB to the communication responder.

[0126] In one embodiment, when the communication terminal acts as a communication responder, it is further configured to:

[0127] Based on the serial number SN_B in the token B, the corresponding white-box code in the local machine is called to decrypt and verify the token B;

[0128] After successful verification, the corresponding dynamic link library is selected from the local white-box library as the shared dynamic link library based on the integers Nk and Nf.

[0129] Based on the shared link library and the dynamic link library Lib_Ns, the round functions corresponding to integers Nf` and Ns in the base code are replaced to generate the white-box cipher for the communication session. The round functions located by integer Nf` are the reverse of the round functions located by integer Nf.

[0130] The token is verified using the white-box cryptography of the communication session. After successful verification, both parties involved in the communication use the white-box cryptography of the communication session for encrypted communication.

[0131] It should be noted that other embodiments or implementation methods of the communication terminal based on the white-box cryptographic algorithm described in this invention can refer to the above-described method embodiments, and will not be repeated here.

[0132] like Figure 3As shown, the third embodiment of the present invention proposes an identity authentication and key distribution system based on a white-box cryptographic algorithm. The system includes: a communication initiator 1, a communication responder 2, a key management center 3, and a quantum key distribution network 4. The communication initiator 1 and the communication responder 2 are both connected to the key management center 3. The communication initiator 1, the communication responder 2, and the key management center 3 are all connected to corresponding white-box code generation points 5. Each of the white-box code generation points 5 is connected to each quantum network node in the quantum key distribution network 4.

[0133] The quantum key distribution network 4 is used to inject a base key and several master keys into each of the white-box code generation points;

[0134] The white-box code generation point 5 is used to perform calculations on the base key and the master key using the SM4 white-box algorithm to generate base code and white-box code corresponding to the master key, and to store each round function operation code of the white-box code into each dynamic link library in the corresponding round function dynamic library, and the round function dynamic library is stored in the white-box library.

[0135] The communication initiator 1 is used to generate an identity authentication token using randomly selected white-box code and send it to the key management center 3 for identity authentication, and to receive a session key distribution token returned by the key management center 3, wherein the session key distribution token carries a round function generated based on the session key;

[0136] The communication initiator 2 generates a white-box cipher for encrypted communication with the communication responder based on the round function generated by the session key and the locally stored baseline code and white-box library.

[0137] Specifically, the communication participants are hardware and software nodes that use white-box cryptographic algorithms for encrypted communication. They use a pre-shared white-box SM4 cryptographic algorithm to authenticate themselves with the key management center and obtain the white-box SM4 cryptographic algorithm code generated by the key management center based on the real-time session key for encrypted communication. The process consists of a white-box code execution container, a dynamic library loader, and a program decoder. The white-box code execution container runs the fixed parts of the cryptographic algorithm, calls the dynamic library loader to load different white-box SM4 algorithm round function dynamic libraries, and the program decoder decrypts and decompresses the compressed and encrypted algorithm dynamic library ciphertext.

[0138] White-box code generation point: Used to generate different white-box cryptographic programs based on different keys, and to inject or distribute white-box code to the participants in the communication.

[0139] Key proxy: Used to provide proxy functions for key injection and key distribution when communication participants cannot directly perform key injection and key distribution at nodes of the quantum key distribution network.

[0140] Key Management Center: Used to generate session keys in real time, generate white-box cryptographic program code based on the key, divide the generated white-box cryptography into 32 dynamic libraries according to 32 rounds of round function cryptographic operations, randomly select round function dynamic libraries, compress and encrypt them, and then distribute them online to communication participants who have passed identity verification.

[0141] The quantum key distribution network comprises quantum network nodes and a quantum network link control center, providing services such as quantum key generation and distribution, quantum key relay, and quantum key provision. Among them, the quantum network nodes store the generated quantum keys, receive key requests from key agents, and provide keys to key agents or directly provide key filling and key distribution services. The quantum network link control center can establish quantum key distribution and relay links between nodes according to the quantum network node ID.

[0142] like Figure 4 As shown, the workflow of the identity authentication and key distribution system based on white-box cryptography algorithm proposed in this embodiment includes:

[0143] (1) A reference key is synchronized across the entire domain through the quantum key distribution network (QKD) and transmitted to the white-box code generation point. The white-box code generation point generates a white-box SM4 algorithm program reference code based on the reference key. The white-box SM4 reference code is filled into the communication participants using secure storage media such as secure SIM cards, secure TF cards or secure U-shields. The key management center obtains and runs the reference code from the corresponding code point. At the same time, each white-box code generation point generates random numbers in real time and generates white-box protection code based on the random numbers and injects it into the secure storage medium.

[0144] (2) A number of pre-shared master keys are generated and distributed between each communication participant and the key management center through a quantum key distribution network (QKD). These pre-shared master keys are then passed to the corresponding white-box code generation points. Each white-box code generation point generates a white-box SM4 algorithm program code based on each master key, which is called pre-shared white-box code. These white-box codes are then identified and compressed in an orderly manner. The code generation points corresponding to the communication participants use high-capacity storage media to fill the corresponding communication participants with these pre-shared white-box codes generated based on the pre-shared master keys between the communication participants and the key management center. The code generation points corresponding to the key management center then transmit the pre-shared white-box codes generated based on these pre-shared master keys to the key management center.

[0145] (3) A large number of shared master keys are generated and distributed to all communication participants in the domain through the quantum key distribution network (QKD). These master keys are then passed to the white-box code generation point. The white-box code generation point generates a white-box SM4 algorithm program code based on each master key and puts the 32 round function operation codes of the code into 32 dynamic link libraries respectively. After compression, the code is encrypted and protected by the white-box SM4 protection code in S1. After compression and encryption protection by the white-box SM4 protection code in S1, the code generation point stores the white-box library and indexes it using the master key identifier (32-bit integer) plus the round identifier (value 1-32). A large-capacity storage medium is used to fill the white-box library for the corresponding communication participants.

[0146] (4) The communication participants first use a secure storage medium to import white-box protection code and white-box baseline code, and then use a high-capacity storage medium to import multiple sets of pre-shared white-box code and white-box library.

[0147] (5) The communication participants start the white-box code execution container, run the program decoder, call the white-box SM4 protection code to decrypt and decompress and run the white-box SM4 baseline algorithm code.

[0148] (6) The communication initiator randomly selects and runs a set of pre-shared white-box code to generate random numbers and uses the code to encrypt the random numbers and the communication initiator's identity identifier and code number to form an identity authentication token, which is then sent to the key management center for identity authentication.

[0149] (7) The Key Management Center, based on ID_A and SN_A, calls the corresponding pre-shared white-box code to decrypt and verify the identity authentication token of the communication initiator. After successful verification, a random number is generated in real time as the session key, and white-box code is generated through the code generation point based on the session key. The 32 round function operation codes of this code are placed into 32 dynamic link libraries respectively, generating a random integer Ns less than or equal to 32, and selecting a round function dynamic library Lib_Ns based on this integer. The Key Management Center generates two 32-bit integers Nk and Nf, which are used by the communication initiator and the communication responder to locate the round functions in the white-box library. Nk is used as the master key identifier to locate the round function dynamic link library corresponding to the master key in the white-box library, and Nf is used as a bitmap to locate several round functions in the 32 round function dynamic link libraries corresponding to the master key in the white-box library. The Key Management Center randomly selects SN_B to select the pre-shared white-box code between the communication responder ID_B, and forms a session key (white-box code) distribution token based on the above information and sends it to the communication initiator.

[0150] (8) The communication initiator calls the corresponding pre-shared white-box code to decrypt and verify TokenA based on SN_A. After successful verification, as described in S7, the corresponding round function dynamic library is selected from the white-box library based on Nk and Nf. The white-box code execution container runs the program decoder, calls the white-box SM4 protection code to decrypt and decompress the round function dynamic library, and replaces or adds the round function dynamic library corresponding to Ns with Lib_Ns. Then, the round functions corresponding to Nf and Ns in the baseline white-box SM4 algorithm code are replaced to form and run the white-box cryptographic algorithm code for the communication session. The code is used to encrypt the real-time random number Nv to form TokenS, which is sent to the communication responder along with TokenB.

[0151] (9) The responding party calls the corresponding pre-shared white-box code to decrypt and verify TokenB based on SN_B in TokenB. After successful verification, the base code is refreshed to form and run the same white-box cryptographic algorithm code for the communication session as the initiating party. This code is used to verify TokenS. After successful verification, both parties use the white-box cryptographic algorithm code for the communication session formed above for encrypted communication.

[0152] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0153] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0154] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for identity authentication and key distribution based on white-box cryptography algorithms, characterized in that, Both parties involved in the communication are pre-loaded with baseline code, white-box code, and a white-box library. The white-box library includes a round function dynamic library with the same number of round functions as the master key. The method includes: The initiator of the communication generates an authentication token using randomly selected white-box code and sends it to the key management center; The communication initiator receives a session key distribution token sent by the key management center. The session key distribution token is generated by the key management center after verifying the identity authentication token. The session key distribution token includes a target round function generated based on a randomly selected session key. The communication initiator uses the locally stored white-box code and the target round function to refresh the locally stored base code to generate a white-box cipher for the communication session; The communication initiator sends the white-box cryptography of the communication session and the session key distribution token to the communication responder for encrypted communication; The session key distribution tokens include token A and token B. Token A carries information including a dynamic link library Lib_Ns generated based on the session key and selected based on a random integer Ns, integers Nk and Nf used to locate the round functions in the white-box library, and the sequence number SN_A of the white-box code pre-shared between the communication initiator and the key management center. Token B carries information including a dynamic link library Lib_Ns generated based on the session key and selected based on a random integer Ns, integers Nk and Nf used to locate the round functions in the white-box library, and the sequence number SN_B of the white-box code pre-shared between the communication responder and the key management center. The communication initiator refreshes the locally stored baseline code using the locally stored white-box code and the target round function to generate a communication session white-box cipher, including: the communication initiator calls the corresponding locally stored white-box code to decrypt and verify the token TokenA according to the sequence number SN_A; after successful verification, the initiator selects the corresponding dynamic link library from the locally stored white-box library as a shared dynamic link library according to the integers Nk and Nf; based on the shared link library and the dynamic link library Lib_Ns, the round function corresponding to the integers Nf and Ns in the baseline code is replaced to generate the communication session white-box cipher.

2. The authentication and key distribution method based on white-box cryptography algorithm as described in claim 1, characterized in that, The baseline code is generated by using the SM4 white-box algorithm to calculate the baseline key from the white-box code generation point. Each of the white-box codes is generated by using the SM4 white-box algorithm to operate on each of the master keys at the white-box code generation point; Each round function operation code of the white-box code is stored in each dynamic link library in the corresponding round function dynamic library, and the round function dynamic library corresponding to each master key is stored in the white-box library.

3. The authentication and key distribution method based on white-box cryptography algorithm as described in claim 2, characterized in that, The dynamic link library is protected by encryption with protection code. The protection code is generated by the white-box code generation point using the SM4 white-box algorithm to calculate the random numbers generated in real time, and both parties involved in the communication have pre-filled the protection code.

4. The authentication and key distribution method based on white-box cryptography algorithm as described in claim 1, characterized in that, The communication initiator generates an authentication token using randomly selected white-box code and sends it to the key management center, including: The communication initiator uses the randomly selected white-box code to encrypt a random number randomly selected by the communication initiator, the identity identifiers of both parties involved in the communication, and the sequence number of the white-box code pre-shared between the communication initiator and the key management center, to generate the identity authentication token and send it to the key management center.

5. The authentication and key distribution method based on white-box cryptography algorithm as described in claim 1, characterized in that, After the verification is passed, a corresponding dynamic link library is selected from the local white-box library as a shared dynamic link library based on integers Nk and Nf, including: After selecting the corresponding dynamic link library from the local white-box library based on integers Nk and Nf, the shared dynamic link library is obtained by calling the protection code to decrypt the dynamic link library.

6. The authentication and key distribution method based on white-box cryptography algorithm as described in claim 1, characterized in that, The communication initiator sends the white-box cryptography of the communication session and the session key distribution token to the communication responder for encrypted communication, including: The communication initiator uses the white-box cryptography of the communication session to encrypt the random number Nv generated in real time by the communication initiator to generate a token TokenS. Send the tokens TokenS and TokenB to the communication responder.

7. The authentication and key distribution method based on white-box cryptography algorithm as described in claim 6, characterized in that, The method further includes: The communication responder calls the corresponding white-box code in its local machine to decrypt and verify the token TokenB based on the serial number SN_B in the token TokenB. After successful verification, the corresponding dynamic link library is selected from the local white-box library as the shared dynamic link library based on the integers Nk and Nf. Based on the shared link library and the dynamic link library Lib_Ns, the round functions corresponding to integers Nf` and Ns in the base code are replaced to generate the white-box cipher for the communication session. The round functions located by integer Nf` are the reverse of the round functions located by integer Nf. The token is verified using the white-box cryptography of the communication session. After successful verification, both parties involved in the communication use the white-box cryptography of the communication session for encrypted communication.

8. A communication terminal based on a white-box cryptographic algorithm, characterized in that, The communication terminal is pre-loaded with baseline code, white-box code, and a white-box library. The white-box library includes a dynamic library of round functions corresponding to the number of master keys. The communication terminal is used to execute the authentication and key distribution method based on white-box cryptographic algorithms as described in any one of claims 1-7, including: The identity authentication initiation module is used to generate an identity authentication token using randomly selected white-box code and send it to the key management center; The token acquisition module is used to receive a session key distribution token sent by the key management center. The session key distribution token is generated by the key management center after verifying the identity authentication token. The session key distribution token includes a target round function generated based on a randomly selected session key. The refresh module is used to refresh the base code stored locally using the white-box code stored locally and the target round function to generate a white-box password for the communication session. An encrypted communication module is used to send the white-box password of the communication session and the session key distribution token to the communication responder for encrypted communication.

9. An authentication and key distribution system based on white-box cryptography algorithms, characterized in that, The system includes: a communication initiator, a communication responder, a key management center, and a quantum key distribution network. The communication initiator and the communication responder are both connected to the key management center. The communication initiator, the communication responder, and the key management center are all connected to corresponding white-box code generation points. Each of the white-box code generation points is connected to each quantum network node in the quantum key distribution network. The quantum key distribution network is used to inject a base key and several master keys into each of the white-box code generation points; The white-box code generation point is used to perform calculations on the base key and the master key using the SM4 white-box algorithm to generate base code and white-box code corresponding to the master key, and to store each round function operation code of the white-box code into each dynamic link library in the corresponding round function dynamic library, and the round function dynamic library is stored in the white-box library. The communication initiator is used to generate an identity authentication token using randomly selected white-box code and send it to the key management center for identity authentication, and to receive a session key distribution token returned by the key management center, wherein the session key distribution token carries a round function generated based on the session key; The communication initiator generates a white-box cryptography for encrypted communication with the communication responder based on the round function generated by the session key and the locally stored baseline code and white-box library. The communication initiator is used to execute the authentication and key distribution method based on the white-box cryptography algorithm as described in any one of claims 1-7.