A security authentication method, device and equipment of an eSIM and a storage medium
By using two-way authentication between the terminal device and the user identification card and shared key encryption, the problem of communication network security being affected after the eSIM card is disassembled is solved, and the secure binding between the terminal device and the user identification card is realized, thereby improving the security of accessing the mobile network.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING CEC HUADA ELECTRONIC DESIGN CO LTD
- Filing Date
- 2025-12-02
- Publication Date
- 2026-07-07
AI Technical Summary
In terminal devices equipped with eSIM cards, the eSIM card can be removed and inserted into other devices, affecting the security of the terminal device accessing the communication network via the eSIM card.
By establishing two-way authentication between the terminal device and the user identification card, a shared key is generated, and the device identifier is encrypted using the shared key to ensure information security and complete the binding between the terminal device and the user identification card.
It improves the security and reliability of terminal devices accessing mobile networks through embedded user identification cards, prevents information theft and tampering, and ensures that the binding results are stored on the user identification card.
Smart Images

Figure CN121692167B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication equipment technology, and specifically to an eSIM security authentication method, apparatus, and storage medium. Background Technology
[0002] eSIM (Embedded-SIM) is a type of SIM card that embeds the functions of a traditional SIM card directly into the device's chip in an electronic form. It eliminates the need for a physical card slot, and users can switch and manage operator networks remotely through configuration.
[0003] In terminal devices equipped with eSIM cards, users can make calls and access the internet via the eSIM card module. Even though the eSIM is embedded in the device's chip, once the eSIM card is disassembled, it can still be inserted into other devices to access the mobile network, thus affecting the security of the terminal device accessing the communication network via the eSIM card.
[0004] Therefore, there is an urgent need for a technical solution to bind eSIM cards to mobile terminals. Summary of the Invention
[0005] In view of this, this application provides an eSIM security authentication method, apparatus, device, and storage medium, which improves the security and reliability of terminal hardware when accessing mobile networks through an embedded user identification card. The technical solution is as follows.
[0006] Firstly, an eSIM security authentication method is provided, the method being used in a terminal device, the terminal device having an embedded user identification card, the method comprising:
[0007] When the terminal device is powered on and it detects that it is not bound to the user identification card, it generates a first public key and a first private key.
[0008] The first information is sent to the user identification card; the first information includes the first public key and a first signature generated by a preset private key.
[0009] The system receives second information sent by a user identification card and verifies the second signature in the second information using the second public key in the second information; the second signature is generated using the second private key; the second public key and the second private key are generated after the user identification card successfully identifies the first information using a preset public key.
[0010] If the verification of the second signature passes, a second shared key is generated based on the first private key and the second public key;
[0011] The device identifier is encrypted with a MAC address using the second shared key to obtain the third information;
[0012] The third information is sent to the user identification card, so that the user identification card stores the device identifier after successfully decrypting the third information using the first shared key, thereby completing the binding between the user identification card and the terminal device; the first shared key is generated by the user identification card based on the first public key and the second private key.
[0013] In one optional implementation, the first information further includes a first random number; the first signature is obtained by signing the first random number using the first private key;
[0014] The second information also includes a second random number; the second signature is obtained by signing the second random number using the second private key.
[0015] In one optional implementation, verifying the second signature in the second information using the second public key in the second information includes:
[0016] The second signature in the second information is parsed using the second public key to obtain the second parsing result;
[0017] Determine whether the second parsing result matches the first random number; if they match, the verification passes.
[0018] If there is a mismatch, the terminal device returns the first error code.
[0019] In one optional implementation, the step of encrypting the device identifier with a MAC address using a second shared key to obtain the third information includes:
[0020] The device identifier and the second random number are encrypted with the second shared key and then MAC-added to obtain the third information.
[0021] In one optional implementation, the method further includes:
[0022] The system receives and decrypts the fourth information using the second shared key; the fourth information is generated after the user identification card storage device is identified; the fourth information is obtained by encrypting and adding a MAC address using the first shared key.
[0023] If the parsing result of the fourth information is the first random number and the binding success identifier, the second random number and the binding confirmation identifier are encrypted with MAC using the second shared key to generate the fifth information;
[0024] Send the fifth information to the user identification card;
[0025] The system receives a sixth message sent by the user identification card, which indicates that the user identification card has successfully bound itself to the terminal. The sixth message is generated by the user identification card after decrypting, deMAC-checking, and verifying the fifth message using the first shared key.
[0026] In one optional implementation, the method further includes:
[0027] When the terminal device is powered on, it detects that it is bound to the user identification card and receives the seventh information;
[0028] The seventh information is parsed using the second shared key. If the parsing result matches the second random number, the device identifier and the second random number are encrypted using the second shared key to obtain the eighth information.
[0029] Send the eighth information to the user identification card;
[0030] The system receives the verification result sent by the user identification card; the verification result is generated by the user identification card after verifying the parsing result of the eighth information.
[0031] In one optional implementation, the second information further includes the electronic identity identifier of the user identification card;
[0032] The seventh information is parsed using the second shared key. If the parsing result matches the second random number, the device identifier and the second random number are encrypted using the second shared key to obtain the eighth information, including:
[0033] The seventh information is parsed using the second shared key. If the parsing result matches the second random number and the electronic identity, the device identifier and the second random number are encrypted using the second shared key to obtain the eighth information.
[0034] Secondly, a security authentication method for eSIM is provided, the method being used for a user identification card; the user identification card is embedded in a terminal device; the method includes:
[0035] If, when the terminal device is powered on, it is detected that the user identification card is not bound to the terminal device, the first information is received; the first information includes a first public key and a first signature generated by a preset private key; the first public key and the first private key are generated after the terminal device is powered on and it is detected that the user identification card is not bound to the user identification card.
[0036] If the first signature is successfully verified using the preset public key, a second public key and a second private key are generated.
[0037] A first shared key is generated based on the second private key and the first public key;
[0038] Send second information to the terminal device; the first information includes the second public key and a second signature generated by the second private key;
[0039] Receive third information; the third information is obtained by encrypting the device identifier with a MAC using a second shared key; the second shared key is generated by the terminal device based on the second public key and the first private key after the terminal device successfully verifies the second signature using the second public key.
[0040] If the third information is successfully parsed using the first shared key, the device identifier is stored to complete the binding of the user identification card and the terminal device.
[0041] In one optional implementation, the first information further includes a first random number; the first signature is obtained by signing the first random number using the first private key;
[0042] The second information also includes a second random number; the second signature is obtained by signing the second random number using the second private key.
[0043] In one optional implementation, the method further includes:
[0044] The first signature is parsed using a pre-set public key to obtain the first parsing result;
[0045] If the first parsing result is returned to the terminal device, and the first parsing result indicates parsing failure, then the terminal device is instructed to return a first error code.
[0046] In one optional implementation, the third information is obtained by the terminal device encrypting the device identifier and the second random number using the second shared key and then adding a MAC.
[0047] The method further includes:
[0048] The third information is parsed using the first shared key to obtain the third parsing result;
[0049] If the third parsing result matches the second random number, then the third information is successfully parsed.
[0050] If there is a mismatch, a third error code is returned to the terminal device.
[0051] In one optional implementation, storing the device identifier to complete the binding of the user identification card to the terminal device includes:
[0052] If the user identification card stores the device identifier, it generates fourth information based on the first random number and the successful binding identifier. The fourth information is obtained by encrypting the first shared key and adding a MAC.
[0053] Send the fourth message to the terminal device;
[0054] The terminal device receives a fifth message; the fifth message is generated by the terminal device after decrypting and de-MACing the fourth message using the second shared key and passing the verification.
[0055] The fifth information is decrypted using the first shared key. If the result of the decryption and MAC decryption of the fifth information matches the second random number and the binding confirmation identifier, then the sixth information is sent to the terminal device to indicate that the user identification card has successfully bound to the terminal.
[0056] In one optional implementation, the method further includes:
[0057] If a binding with the terminal device is detected when the terminal device is powered on, the seventh piece of information is generated based on the second random number;
[0058] Send the seventh message to the terminal device;
[0059] The terminal device receives an eighth message; the eighth message is generated by the terminal device after parsing the seventh message with the second shared key and matching it with the second random number.
[0060] The eighth piece of information is parsed, and a verification result is sent to the terminal device based on the parsing result of the eighth piece of information.
[0061] In one optional implementation, if the parsing result of the eighth information matches the device identifier and the second random number, the terminal device identifier is successfully verified, and the verification result is returned to the terminal to allow the terminal device to perform network access authentication.
[0062] In one optional implementation, the method further includes:
[0063] If the parsing result of the eighth information does not match at least one of the device identifier and the second random number, the seventh information is regenerated based on the second random number.
[0064] In one optional implementation, if the parsing result of the eighth information does not match at least one of the device identifier and the second random number, then regenerating the seventh information based on the second random number includes:
[0065] If the parsing result of the eighth information does not match at least one of the device identifier and the second random number, and the number of times the seventh information is generated is less than the number threshold, then the seventh information is regenerated according to the second random number.
[0066] If the parsing result of the eighth information does not match at least one of the device identifier and the second random number, and the number of times the seventh information is generated is greater than or equal to the number threshold, then the fourth error code is used as the verification result.
[0067] In one optional implementation, the second information further includes the electronic identity identifier of the user identification card;
[0068] The generation of the seventh information based on the second random number includes:
[0069] The seventh information is obtained by encrypting the second random number and the electronic identity using the first shared key and adding a MAC.
[0070] Thirdly, a security authentication device for eSIM is provided, the device being disposed in a terminal device, the terminal device having an embedded user identification card, the device comprising:
[0071] The first key generation module is used to generate a preset public key and a first private key when the terminal device is powered on and it is detected that it is not bound to the user identification card.
[0072] A first generation module is configured to send first information to the user identification card; the first information includes the first public key and a first signature generated by the first private key;
[0073] The first receiving module is used to receive the second information sent by the user identification card, and to verify the second signature in the second information using the second public key in the second information; the second signature is generated by the second private key; the second public key and the second private key are generated after the user identification card successfully identifies the first information using the preset public key.
[0074] The first key generation module is also used to generate a second shared key based on the first private key and the second public key if the verification of the second signature passes.
[0075] The first encryption module is used to encrypt the device identifier with a MAC address using the second shared key to obtain the third information;
[0076] The first sending module is used to send the third information to the user identification card, so that the user identification card stores the device identifier after successfully decrypting the third information through the first shared key, thereby completing the binding between the user identification card and the terminal device; the first shared key is generated by the user identification card based on the first public key and the second private key.
[0077] Fourthly, an eSIM security authentication device is provided, the device being disposed on a user identification card, the user identification card being embedded in a terminal device; the device includes:
[0078] The second receiving module is configured to receive first information if it detects that the terminal device is not bound to the terminal device when the terminal device is powered on; the first information includes a first public key and a first signature generated by a preset private key; the first public key and the first private key are generated after the terminal device is powered on and it is detected that it is not bound to the user identification card.
[0079] The second key generation module is used to generate a second public key and a second private key if the first signature is successfully verified according to the preset public key.
[0080] The second key generation module is further configured to generate a first shared key based on the second private key and the first public key;
[0081] The second sending module is used to send second information to the terminal device; the first information includes the second public key and a second signature generated by the second private key.
[0082] The second receiving module is further configured to receive third information; the third information is obtained by encrypting the device identifier with a MAC address using a second shared key; the second shared key is generated by the terminal device based on the second public key and the first private key after the terminal device successfully verifies the second signature using the second public key.
[0083] The storage module is used to store the device identifier if the third information is successfully parsed using the first shared key, so as to complete the binding of the user identification card and the terminal device.
[0084] Fifthly, an electronic device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to implement the above-described eSIM security authentication method.
[0085] In a sixth aspect, a computer-readable storage medium is provided, wherein at least one instruction is stored therein, the at least one instruction being loaded and executed by a processor to implement the above-described eSIM security authentication method.
[0086] The technical solution provided in this application may include the following beneficial effects:
[0087] In this solution, if a terminal device embedded with a user identification card is detected as not being bound to a user identification card, the terminal device and the user identification card sign each other using their respective private keys, thereby transmitting the public key to the other party to complete two-way authentication between the terminal and the user identification card. After authentication, a shared key is generated through public key exchange. The shared key is used to protect the device identifier and the user identification card's identity identifier to ensure that the information is not stolen or tampered with. Finally, the binding result is stored in the user identification card, which improves the security and reliability of the terminal hardware when accessing the mobile network through the embedded user identification card. Attached Figure Description
[0088] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0089] Figure 1 This is a flowchart illustrating a secure authentication method for eSIM according to an exemplary embodiment.
[0090] Figure 2 This is a flowchart illustrating a secure authentication method for eSIM according to an exemplary embodiment.
[0091] Figure 3 This is a flowchart illustrating a secure authentication method for eSIM according to an exemplary embodiment.
[0092] Figure 4 A complete flowchart of a binding process according to an embodiment of this application is shown.
[0093] Figure 5 A logic diagram of a verification logic for a terminal device and a user identification card according to an embodiment of this application is shown.
[0094] Figure 6 A complete flowchart of a verification process according to an embodiment of this application is shown.
[0095] Figure 7 A complete flowchart of another binding process involved in an embodiment of this application is shown.
[0096] Figure 8 A complete flowchart of another process involving the terminal device and user identification card according to an embodiment of this application is shown.
[0097] Figure 9 This is a schematic diagram of the structure of an eSIM security authentication device provided in an embodiment of this application.
[0098] Figure 10 This is a schematic diagram of the structure of an eSIM security authentication device provided in an embodiment of this application.
[0099] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an optional embodiment of the present invention. Detailed Implementation
[0100] 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 with reference to the accompanying drawings. 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.
[0101] In the description of the embodiments of this application, the term "correspondence" may indicate that there is a direct or indirect correspondence between two things, or that there is an association between two things, or that there is a relationship of instruction and being instructed, configuration and being configured, etc.
[0102] In terminal devices equipped with a user identification card (in this application embodiment, the user identification card is an eSIM card), users can make calls and access the internet via the eSIM card module. Even though the eSIM is embedded in the device's chip, it can still be inserted into other devices to access the mobile network after being disassembled, thus affecting the security of the terminal device accessing the communication network via the eSIM card. To avoid this situation, it is now necessary to bind the terminal device to the eSIM card, so that before the terminal device accesses the mobile network via the eSIM card, the eSIM card can determine whether there is a risk of the eSIM card being stolen based on the binding relationship.
[0103] To achieve the above objectives, this application provides an eSIM security authentication method, please refer to... Figure 1 , Figure 1 This is a flowchart illustrating a secure authentication method for an eSIM according to an exemplary embodiment. The method is used in a terminal device that has a user identification card embedded therein. The method includes:
[0104] Step 101: When the terminal device is powered on, if it is detected that it is not bound to the user identification card, a first public key and a first private key are generated.
[0105] When the terminal device is powered on, it first checks the binding status between itself and the user identification card. If it detects that the terminal device has not yet established a binding relationship with the user identification card, the terminal device enters the binding process. In this binding process, the terminal device generates a temporary key pair, which includes a first public key and a first private key. The first public key is used to disclose the key to the user identification card, and the first private key is used for subsequent key negotiation.
[0106] Step 102: Send the first information to the user identification card; the first information includes the first public key and the first signature generated by the preset private key.
[0107] The terminal device uses a pre-set private key to digitally sign the data contained in the first information to generate a first signature, which is used to ensure the integrity and source credibility of the first information.
[0108] In this embodiment, before the binding process between the terminal device and the user identification card, the terminal device needs to store a pair of pre-set public and private keys. These public and private keys are controlled and stored within the device by the terminal, and the eSIM needs to store the pre-set public key. Through these pre-set public and private keys, a one-to-one correspondence exists between the terminal device and the eSIM card before the initial binding. Theoretically, the terminal device can only be bound to a pre-set eSIM (usually soldered into the terminal device).
[0109] Step 103: Receive the second information sent by the user identification card, and verify the second signature in the second information using the second public key in the second information.
[0110] The second signature is generated using the second private key; the second public key and the second private key are generated after the user identification card's preset public key successfully recognizes the first information. In other words, after the user identification card successfully verifies the first signature using the preset public key (representing successful recognition of the first information), it generates a second public-private key pair, uses the second private key to sign the relevant information to form the second signature, and then returns the second information containing the second public key and the second signature to the terminal device.
[0111] After receiving the second information, the terminal device extracts the second public key and the second signature, and uses the second public key to verify the second signature. If the verification is successful, it indicates that the second information has not been tampered with and was indeed generated by the user identification card; if the verification fails, the terminal device can terminate the binding process or initiate a new binding request.
[0112] Step 104: If the verification of the second signature passes, then generate a second shared key based on the first private key and the second public key.
[0113] If the second signature verification in step 103 passes, the terminal device generates a second shared key based on its own first private key and the second public key provided by the user identification card.
[0114] Specifically, the terminal device can use a key negotiation algorithm (such as the Elliptic Curve Diffie-Hellman Key Exchange Algorithm ECDH) to calculate a second shared key using a first private key and a second public key. This shared key is a key that can only be derived by the terminal and the user identification card, and cannot be recovered by a third party by eavesdropping on the public key.
[0115] Step 105: Encrypt the device identifier with MAC using the second shared key to obtain the third information.
[0116] The terminal device uses the aforementioned second shared key to perform symmetric encryption on the device identifier to be bound, in order to generate the third information. The device identifier can be a terminal ID (TID), a device serial number, a hardware identifier, or other information used to uniquely identify the terminal.
[0117] Step 106: Send the third information to the user identification card, so that the user identification card can store the device identifier after successfully decrypting the third information with the first shared key, thereby completing the binding between the user identification card and the terminal device.
[0118] In this embodiment of the application, the first shared key is generated by the user identification card based on the first public key and the second private key, that is, it uses the same key negotiation algorithm as the second shared key to generate the second shared key through the first public key and the second private key.
[0119] Although the first private key is usually asymmetrical with the first public key, and the second private key is also asymmetrical with the second public key, a negotiation algorithm can be used to make the first shared key the same as the second shared key. Therefore, the first shared key and the second shared key can encrypt and decrypt each other.
[0120] The terminal device sends the third information to the user identification card. After receiving the third information, the user identification card uses the first shared key generated by the second private key and the first public key to decrypt the third information and recover the terminal device identifier.
[0121] If decryption is successful and a valid device identifier is obtained, the user identification card stores the device identifier in its internal secure storage area to complete the binding relationship between the user identification card and the current terminal device.
[0122] Subsequently, before authentication by the communication network, the binding relationship between the user identification card and the current terminal device is determined to confirm whether to join the network, thereby improving communication security.
[0123] In summary, this solution, when a terminal device embedded with a user identification card is detected to be unbound to the user identification card, enables the terminal device and the user identification card to sign using their respective private keys, thereby transmitting the public key to each other to complete two-way authentication between the terminal and the user identification card. After authentication, a shared key is generated through public key exchange, and the device identifier is encrypted using the shared key to ensure that the information is not stolen or tampered with. Finally, the binding result is stored in the user identification card, improving the security and reliability when the terminal hardware is changed.
[0124] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating a secure authentication method for an eSIM according to an exemplary embodiment. The method is used for a user identification card embedded in a terminal device, and includes:
[0125] Step 201: If, when the terminal device is powered on, it is detected that the device is not bound to the user identification card, first information is received; the first information includes a first public key and a first signature generated by a preset private key; the first public key and the first private key are generated after the terminal device is powered on and it is detected that the device is not bound to the user identification card.
[0126] Step 202: If the first signature is successfully verified using the preset public key, then a second public key and a second private key are generated.
[0127] Step 203: Generate a first shared key based on the second private key and the first public key;
[0128] Step 204: Send the second information to the terminal device; the first information includes the second public key and the second signature generated by the second private key;
[0129] Step 205, receive third information; the third information is obtained by encrypting the device identifier with a MAC using the second shared key; the second shared key is generated by the terminal device after successfully verifying the second signature with the second public key, based on the second public key and the first public key;
[0130] Step 206: If the third information is successfully parsed using the first shared key, the device identifier is stored to complete the binding of the user identification card and the terminal device.
[0131] because Figure 2 The illustrated embodiments and Figure 1 The embodiments shown represent the two ends of the interaction process. Therefore, the execution principle of steps 201-206 is similar to that of steps 101-206, and will not be repeated here.
[0132] In summary, this solution, when a terminal device embedded with a user identification card is detected to be unbound to the user identification card, enables the terminal device and the user identification card to sign using their respective private keys, thereby transmitting the public key to each other to complete two-way authentication between the terminal and the user identification card. After authentication, a shared key is generated through public key exchange, and the device identifier is encrypted using the shared key to ensure that the information is not stolen or tampered with. Finally, the binding result is stored in the user identification card, improving the security and reliability when the terminal hardware is changed.
[0133] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating a secure authentication method for an eSIM according to an exemplary embodiment. The method is jointly performed by a terminal device and a user identification card embedded in the terminal device, and includes:
[0134] S301: When the terminal device is powered on, if it is detected that it is not bound to the user identification card, the terminal device generates a first public key and a first private key.
[0135] S302, the terminal device sends the first information to the user identification card; the first information includes the first public key and the first signature generated by the preset private key; correspondingly, the user identification card receives the first information.
[0136] In one possible implementation, the first information also includes a first random number; the first signature is obtained by signing the first random number using a preset private key.
[0137] S303, the user identification card verifies the first signature based on the preset public key.
[0138] Optionally, if the first information also includes a first random number, then after the user identification card verifies the first signature according to the preset public key, it can theoretically recover a random number. If the obtained random number is the first random number, it means that the first information has not been tampered with, the first public key in the first information is secure, and subsequent operations can be performed.
[0139] S304 If the first signature is successfully verified, the user identification card generates a second public key and a second private key.
[0140] In another possible implementation, the user identification card parses the first signature according to a preset public key to obtain a first parsing result; the first parsing result is returned to the terminal device, and if the first parsing result indicates parsing failure, the terminal device is instructed to return a first error code.
[0141] In other words, after the user identification card obtains the first signature, it first parses the first signature according to the preset public key to obtain the first parsing result. If the first parsing result is a parsing failure, the terminal device needs to return the first error code at this time.
[0142] S305, the user identification card generates a first shared key based on the second private key and the first public key.
[0143] S306, the user identification card sends the second information to the terminal device; correspondingly, the terminal device receives the second information.
[0144] Steps 304 to 306 above and Figure 1 The content of the illustrated embodiment is similar and will not be repeated here.
[0145] S307, the terminal device verifies the second signature in the second information using the second public key in the second information; the second signature is generated using the second private key.
[0146] In one possible implementation, the second information also includes a second random number; the second signature is obtained by signing the second random number with a second private key.
[0147] In one possible implementation, the terminal device parses the second signature in the second information using the second public key to obtain the second parsing result; it then determines whether the second parsing result matches the first random number. If they match, the verification passes; otherwise, the terminal device terminates the subsequent process and returns the first error code.
[0148] If the second information also includes a second random number, then the terminal device can theoretically recover a random number after verifying the second signature using the second public key. If the obtained random number is the second random number, it means that the second information has not been tampered with, the second public key in the second information is secure, and subsequent operations can be performed.
[0149] S308, if the verification of the second signature passes, the terminal device generates a second shared key based on the first private key and the second public key.
[0150] S309, the terminal device encrypts the device identifier with a MAC address using the second shared key to obtain the third information.
[0151] In one possible implementation, the terminal device can obtain the third information by encrypting the device identifier and the second random number with a second shared key and adding a MAC.
[0152] S310, the terminal device sends the third information to the user identification card, and the corresponding user identification card receives the third information.
[0153] In one possible implementation, the third information is obtained by the terminal device encrypting the device identifier and the second random number using the second shared key and adding a MAC address; at this time, the user identification card parses the third information using the first shared key to obtain a third parsing result; if the third parsing result matches the second random number, it is determined that the third information has been successfully parsed; if they do not match, a third error code is returned to the terminal device.
[0154] In this embodiment of the application, after receiving the third information, the user identification card can decrypt the third information using its own stored first shared key to obtain a random number. If the random number matches the second random number, it means that the third information has not been tampered with, and the device identifier obtained by decrypting the third information can be trusted. If they do not match, a third error code needs to be returned to the terminal device to inform the terminal device that there is a risk at this time.
[0155] S311 After the user identification card successfully decrypts the third information using the first shared key, it stores the device identifier to complete the binding between the user identification card and the terminal device.
[0156] In one alternative implementation, after the user identification card is identified by the storage device, it needs to inform the terminal device to confirm the binding between the two parties. Therefore, the following process also needs to be performed:
[0157] S312, if the user identification card stores the device identifier, generate the fourth information based on the first random number and the binding success identifier.
[0158] At this point, the user identification card has successfully decrypted the third information and completed the binding (storage device identifier). However, the terminal device does not know whether the card has actually written the information successfully, so the card needs to inform it of the result. The fourth information sent by the user identification card at this time includes: a first random number and a binding success identifier (e.g., code=0x01 indicates success). In this embodiment, the fourth information is obtained by encrypting and adding a MAC address to the first shared key.
[0159] S313, send the fourth information to the terminal device; correspondingly, the terminal device receives the fourth information and decrypts and deMACs it using the second shared key.
[0160] S314, if the parsing result of the fourth information is the first random number and the binding success identifier, the terminal device encrypts the second random number and the binding confirmation identifier with the second shared key and adds a MAC to generate the fifth information.
[0161] When the terminal device receives the fourth information, it will decrypt and deMAC the fourth information using the second shared key. Then, it will verify the result of the decryption and deMAC of the fourth information. The verification includes: whether the random number in the fourth information is the first random number; and whether the identifier is the binding success identifier.
[0162] Once the verification is successful, the corresponding fifth piece of information is generated, which includes a second random number and a binding confirmation identifier (e.g., code=0x01 indicates success), and is sent to the user's identification card.
[0163] S315, the terminal device sends the fifth information to the user identification card; correspondingly, the user identification card receives the fifth information and decrypts and deMACs it using the first shared key.
[0164] S316, if the result of decrypting the MAC address of the fifth information matches the second random number and the binding confirmation identifier, then the user identification card sends the sixth information to the terminal device to indicate that the user identification card has successfully bound to the terminal device. Correspondingly, the terminal device receives the sixth information sent by the user identification card and confirms that the user identification card has successfully bound to the terminal device.
[0165] At this point, the user identification card verifies the fifth piece of information. The verification content may include: the random number must be a second random number generated by the user itself; and the identifier must be a binding confirmation identifier issued by the device.
[0166] After successful verification, the user identification card sends a sixth message (final confirmation message). Upon receiving the sixth message, both parties confirm that the binding process has successfully concluded.
[0167] All of the above processes can be completed through Figure 4 To represent it intuitively, Figure 4 A complete flowchart of a binding process according to an embodiment of this application is shown. Figure 4 As shown, the process includes the following steps:
[0168] Step 1: The device (i.e., the terminal device) is powered on or the eSIM is detected to be powered on. The binding status is checked. If it is not bound, the binding process is executed; if it is already bound, the verification process is executed.
[0169] Steps 2-5: After entering the binding process, the eSIM verification terminal is started. The terminal generates a temporary public-private key pair (i.e., the first public key tPK.DEVICE and the first private key tSK.DEVICE). The terminal uses the terminal's preset private key SK.DEVICE pair (the terminal's random number (i.e., the first random number RAND.DEVICE) and the terminal's temporary public key) to sign and send it to the eSIM. The eSIM uses the preset public key PK.DEVICE generated by the terminal to verify the signature information (i.e., the first signature) and sends the verification result back to the terminal.
[0170] Step 6: eSIM generates a temporary public-private key pair (i.e., the second public key tPK.ESIM and the second private key tSK.ESIM) and a random number (i.e., the second random number RAND.ESIM). It uses its own temporary private key (the second private key) and the other party's temporary public key (the first public key) to complete the shared key negotiation and store it. Then, it signs the temporary private key pair (the terminal's random number, the eSIM's random number, and the eSIM's temporary public key) and sends it to the terminal.
[0171] Steps 7-9 are for terminal verification of eSIM. The terminal obtains the eSIM temporary public key and the terminal random number. The temporary public key is used for signature verification. The terminal random number is compared with the one generated in the terminal. After the terminal verification is completed, the terminal negotiates and stores the shared key SessinKEY (hereinafter referred to as S-KEY) with the temporary public key of the other party and its own temporary private key.
[0172] Device Identifier Binding:
[0173] Steps 10-13: The terminal uses the shared key S-KEY to protect the unique device identifier (i.e., the device ID mentioned above) and the random number of the eSIM with a symmetric key and then sends it to the eSIM. After receiving the protection information, the eSIM uses the shared key to decrypt the deMAC device identifier and stores it, thus completing the terminal information binding.
[0174] If the above authentication process is successful, the subsequent data binding process can continue; if it fails, the binding will be terminated. The above authentication process can be implemented using proactive or APDU commands, depending on the terminal's capabilities.
[0175] After completing the binding process between the terminal device and the SIM card, the terminal device can securely access the mobile network via the SIM card. Furthermore, if the terminal device is powered off and then powered on again, since the SIM card already stores the device identifier, the terminal device does not need to repeat the binding process. However, to ensure that the SIM card has not been disassembled and combined with other terminal devices during power outages, it needs to undergo security verification with the terminal device. Therefore, in... Figure 3 Based on the proposed solution, Figure 5 A logic diagram illustrating a verification logic for a terminal device and a user identification card according to an embodiment of this application is shown. Figure 5 As shown, the verification logic includes the following:
[0176] S501, when the terminal device is powered on, it detects that it is bound to the user identification card, and the user identification card generates the seventh information based on the second random number.
[0177] When the terminal device is powered on, it is detected that it is already bound to the user identification card. The user identification card reads the device identifier stored inside and further uses the second shared key to protect the second random number generated in the binding process to generate the seventh information.
[0178] In one possible implementation, the seventh information includes a second random number encrypted with a second shared key, used to instruct the user identification card to initiate a verification of the current binding relationship.
[0179] S502, the user identification card sends the seventh information to the terminal device, and the corresponding terminal device receives the seventh information.
[0180] The user identification card sends the generated seventh information to the terminal device; correspondingly, the terminal device receives the seventh information and waits to parse it.
[0181] S503, the terminal device parses the seventh information using the second shared key. If the parsing result matches the second random number, it encrypts the device identifier and the second random number using the second shared key and adds a MAC to obtain the eighth information.
[0182] After receiving the seventh message, the terminal device parses the seventh message using the second shared key to obtain the second random number carried in the seventh message.
[0183] If the parsed random number matches the second random number generated by the user identification card during the binding period, the terminal device confirms that the user identification card has not been replaced, and then encrypts the device identifier and the second random number with MAC according to the second shared key to generate the eighth information.
[0184] In one possible implementation, the device identifier is concatenated with a second random number to form verification data, which is then protected by a second shared key to form the eighth piece of information.
[0185] If the parsing is inconsistent, the terminal device can generate an error code and abort the subsequent process.
[0186] S504, the terminal device sends the eighth information to the user identification card; correspondingly, the user identification card receives the eighth information sent by the terminal device.
[0187] S505, the user identification card parses the eighth piece of information.
[0188] The user identification card decrypts and parses the eighth information using the first shared key or the second shared key (depending on the specific encryption relationship) to obtain the device identifier and the second random number carried in the eighth information.
[0189] The SIM card compares the device identifier in the parsed result with the device identifier stored internally to confirm whether the terminal device maintains a consistent binding relationship with the current SIM card. Simultaneously, the SIM card can also check whether the second random number matches the value recorded during the binding period to further verify message integrity.
[0190] S506, the user identification card sends a verification result to the terminal device based on the parsing result of the eighth information, and the terminal device receives the verification result sent by the user identification card.
[0191] In the above verification process, the terminal device and the user's identification card exchange information through multiple rounds to complete the basic binding relationship confirmation. However, in order to ensure the security of the verification results and handle abnormal situations, this application embodiment also specifies the processing logic of the terminal device when the verification fails.
[0192] In this embodiment of the application, if the parsing result of the eighth information matches the device identifier and the second random number, the terminal device identifier is successfully verified, and the verification result is returned to the terminal to allow the terminal device to perform network access authentication.
[0193] At this point, after parsing the eighth piece of information, if the device identifier and the value of the second random number match the expected values (indicating that the binding relationship has not been tampered with), the terminal device considers the user identification card verification successful. In other words, the terminal device can only execute the network access process after the binding relationship verification is successful, ensuring that only legitimate devices can access the mobile network through the user identification card, thus preventing counterfeit or stolen user identification cards from accessing the network.
[0194] Optionally, if the parsing result of the eighth information does not match at least one of the device identifier and the second random number, the seventh information is regenerated based on the second random number.
[0195] If the device identifier in the parsed result of the eighth information does not match the expected value, or if the second random number does not match, it indicates an abnormality in the binding relationship, which may be due to the device identifier being tampered with or data loss during communication. In this case, the terminal device can perform a re-verification to rule out errors in the eighth information caused by other accidental factors.
[0196] Furthermore, if the parsing result of the eighth information does not match at least one of the device identifier and the second random number, and the number of times the seventh information is generated is less than the number of times threshold, then the seventh information is regenerated according to the second random number.
[0197] If the parsing result of the eighth information does not match at least one of the device identifier and the second random number, and the number of times the seventh information is generated is greater than or equal to the number threshold, then the fourth error code will be used as the verification result.
[0198] When the verification fails, the system will not terminate immediately, but will retry a limited number of times according to the preset number of times (such as the maximum number of retries). When the number of times the seventh information is generated reaches the threshold, if the verification still fails, the system will stop further attempts and return an error code, indicating that the binding verification cannot be completed successfully.
[0199] The above verification process can be achieved through Figure 6 To represent it intuitively, Figure 6 A complete flowchart of a verification process according to an embodiment of this application is shown. Figure 6 As shown, the process includes the following steps:
[0200] Step 1: The device (terminal device) is powered on or the eSIM is detected to be powered on. The binding status is checked. If it is not bound, the binding process is executed; if it is already bound, the verification process is executed.
[0201] Steps 2-3: After entering the verification process, eSIM requests the device identifier from the terminal and generates a random number protected by the shared key S-KEY, which is then transmitted to the terminal.
[0202] Steps 4-5: The terminal uses the shared key to decrypt and verify the eSIM random number, and uses the shared key S-KEY to encrypt the device identifier and the eSIM random number with MAC to generate protection information, which is then sent to the eSIM.
[0203] Steps 6-7 verify the device identifier and eSIM random number in the eSIM verification protection information. If successful, the device and SIM card verification is successful, and the subsequent network access process can continue. If unsuccessful, try 3 times. If all 3 attempts fail, the terminal device returns an error code and network access is prohibited.
[0204] The above verification process can be implemented using either active methods or APDU commands, depending on the terminal's capabilities.
[0205] Furthermore, in Figure 5 Building upon the steps shown, this embodiment of the application can further enhance the binding security of the terminal through EID. Specifically, in this embodiment of the application, the electronic identity identifier (EID) of the user identification card can be set in the second information.
[0206] At this point, S501 can be replaced by the following process:
[0207] The seventh piece of information is obtained by encrypting the second random number and the electronic identity using the first shared key and adding a MAC.
[0208] The seventh message at this point includes a second random number and an electronic identity identifier. The second random number is used to prevent replay attacks and ensure randomness in each round of interaction; the electronic identity identifier is used to uniquely identify the user's identification card entity. Both are encrypted with a MAC address using the first shared key to ensure that only legitimate devices (i.e., terminal devices storing the second shared key) can correctly encrypt or decrypt the seventh message.
[0209] At this point, S503 can be replaced by the following process:
[0210] The seventh information is parsed using the second shared key. If the parsing result matches the second random number and the electronic identity, the device identifier and the second random number are encrypted with a MAC using the second shared key to obtain the eighth information.
[0211] In other words, after parsing the seventh information using the second shared key, the parsing result must simultaneously ensure that the second random number is consistent with the second random number sent by the terminal and that the electronic identity (EID) is consistent with the EID obtained by the terminal device during the binding process. Only then can it be said that the seventh information has not been tampered with and its source is trustworthy.
[0212] In this case, Figure 7 A complete flowchart of another binding process involved in an embodiment of this application is shown. Figure 7 As shown, the process includes:
[0213] Public key authentication and key negotiation:
[0214] Step 1: The device is powered on or the eSIM is detected to be powered on. The binding status is checked. If it is not bound, the binding process is executed; if it is already bound, the verification process is executed.
[0215] Steps 2-5: After entering the binding process, start the eSIM verification terminal. The terminal generates a temporary public-private key pair. The terminal uses the preset private key to generate a random number and the terminal's temporary public key to sign and send it to the eSIM. The eSIM uses the preset public key generated by the terminal to verify the signature information and sends the verification result back to the terminal.
[0216] Step 6: eSIM generates a temporary public-private key pair and a random number. It uses its own temporary private key and the other party's temporary public key to complete the shared key negotiation and store it. Then, it signs the temporary private key pair (terminal random number, eSIM terminal random number, eSIM temporary public key, EID) and sends it to the terminal.
[0217] Steps 7-9 are for terminal verification of eSIM. The terminal obtains eSIM signature source data, which uses a temporary public key for signature verification. The terminal's random number is compared with the one generated in the terminal. After the terminal completes the verification, it negotiates and stores the shared key S-KEY using the other party's temporary public key and its own temporary private key, and stores the EID in the terminal. Subsequently, the terminal uses the shared key S-KEY to protect the device identifier and the eSIM random number and sends it to the eSIM.
[0218] Steps 10-11: eSIM completes random number verification and stores the device identifier in eSIM, while organizing the eSIM to return confirmation data to the terminal;
[0219] Steps 12-15: The terminal confirms the correctness of the eSIM binding data and sends the terminal confirmation data to the eSIM. After the eSIM confirms the terminal information, it informs the terminal of the result.
[0220] If the above authentication process is successful, the subsequent data binding process can continue; if it fails, the binding will be terminated. The above authentication process can be implemented using proactive or APDU commands, depending on the terminal's capabilities.
[0221] Specifically, Figure 7 The process is as follows: Figure 4 Based on the illustrated process, the transmission and storage of EID content have been added.
[0222] Correspondingly, Figure 8 A complete flowchart illustrating another process of the terminal device and user identification card involved in an embodiment of this application is shown. Figure 8 As shown, the process includes:
[0223] Step 1: The device is powered on or the eSIM is detected to be powered on. The binding status is checked. If it is not bound, the binding process is executed; if it is already bound, the verification process is executed.
[0224] Steps 2-3: After entering the verification process, eSIM requests the device identifier from the terminal and generates a random number and EID protected by the shared key S-KEY, which are then transmitted to the terminal.
[0225] Steps 4-5: The terminal uses the shared key to verify the random number and EID, and uses the shared key S-KEY to protect the device identifier and eSIM random number, and sends them to the eSIM;
[0226] Steps 6-7 involve verifying the eSIM device identifier and random number. If successful, the SIM card verification is complete, and the subsequent network access process can continue. If unsuccessful, network access will be prohibited.
[0227] The above verification process can be implemented using either active methods or APDU commands, depending on the terminal's capabilities.
[0228] Specifically, Figure 8 The process is as follows: Figure 6 Based on the illustrated process, the content of verification via EID has been added.
[0229] In summary, this solution, when a terminal device embedded with a user identification card is detected to be unbound to the user identification card, enables the terminal device and the user identification card to self-sign using their respective private keys, thereby transmitting the public key to the other party to complete two-way authentication between the terminal and the user identification card. After authentication, a shared key is generated through public-private key interaction, and the device identifier is encrypted using the shared key to ensure that the information is not stolen or tampered with. Finally, the binding result is stored in the user identification card, improving the security and reliability when the terminal hardware is changed.
[0230] This application also provides an eSIM security authentication device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0231] This application provides an eSIM security authentication device. Figure 9 This is a schematic diagram of the structure of an eSIM security authentication device provided in an embodiment of this application. The device is disposed in a terminal device, and the terminal device embeds a user identification card. The device includes:
[0232] The first key generation module 901 is used to generate a first public key and a first private key when the terminal device is powered on and it is detected that it is not bound to the user identification card.
[0233] The first generation module 902 is used to send first information to the user identification card; the first information includes the first public key and a first signature generated by a preset private key;
[0234] The first receiving module 903 is used to receive second information sent by the user identification card and verify the second signature in the second information using the second public key in the second information; the second signature is generated by the second private key; the second public key and the second private key are generated after the user identification card successfully recognizes the first information.
[0235] The first key generation module is further configured to generate a second shared key based on the first private key and the second public key if the verification of the second signature passes.
[0236] The first encryption module 904 is used to encrypt the device identifier with MAC using the second shared key to obtain the third information;
[0237] The first sending module 902 is further configured to send the third information to the user identification card, so that the user identification card stores the device identifier after successfully decrypting the third information through the first shared key, thereby completing the binding of the user identification card and the terminal device; the first shared key is generated by the user identification card based on the first public key and the second private key.
[0238] This application also provides another eSIM security authentication device. Figure 10 This is a schematic diagram of the structure of an eSIM security authentication device provided in an embodiment of this application. The device is disposed on a user identification card, and the user identification card is embedded in a terminal device. The device includes:
[0239] The second receiving module 1001 is configured to receive first information if it detects that the terminal device is not bound to the terminal device when the terminal device is powered on; the first information includes a first public key and a first signature generated by a preset private key; the first public key and the first private key are generated after the terminal device is powered on and it is detected that it is not bound to the user identification card.
[0240] The second key generation module 1002 is used to generate a second public key and a second private key if the first signature is successfully verified according to the preset public key.
[0241] The second key generation module is further configured to generate a first shared key based on the second private key and the first public key;
[0242] The second sending module 1003 is used to send second information to the terminal device; the first information includes the second public key and a second signature generated by the second private key.
[0243] The second receiving module is further configured to receive third information; the third information is obtained by encrypting the device identifier with a MAC address using a second shared key; the second shared key is generated by the terminal device based on the second public key and the first public key after the terminal device successfully verifies the second signature using the second public key.
[0244] The storage module 1004 is used to store the device identifier if the third information is successfully parsed using the first shared key, so as to complete the binding of the user identification card and the terminal device.
[0245] In summary, this solution, when a terminal device embedded with a user identification card is detected to be unbound to the user identification card, enables the terminal device and the user identification card to sign using their respective private keys, thereby transmitting the public key to the other party to complete two-way authentication between the terminal and the user identification card. After authentication, a shared key is generated through public-private key interaction, and the device identifier is encrypted using the shared key to ensure that the information is not stolen or tampered with. Finally, the binding result is stored in the user identification card, improving the security and reliability when the terminal hardware is changed.
[0246] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0247] The device in this embodiment is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0248] Please see Figure 11 , Figure 11 This is a schematic diagram of the structure of an electronic device provided in an optional embodiment of the present invention. This electronic device can be implemented as a terminal device or an embedded user identification card, as described above. Figure 7 As shown, the electronic device includes one or more processors 10, a memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processor can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces).
[0249] The processor 10 may further include a hardware chip. This hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0250] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0251] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the use of the electronic device based on the display of a mini-program landing page. Furthermore, the memory 20 may include high-speed random access memory (RAM), and may also include non-transient memory, such as at least one disk storage device, flash memory device, or other non-transient solid-state storage device. The memory 20 may include volatile memory, such as RAM; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid-state drive; the memory 20 may also include combinations of the above types of memory.
[0252] The electronic device also includes a communication interface 30 for communicating with other devices or communication networks.
[0253] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0254] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A secure authentication method for eSIM, characterized in that, The method is used in a terminal device, wherein a user identification card is embedded in the terminal device, and the method includes: When the terminal device is powered on and it detects that it is not bound to the user identification card, it generates a first public key and a first private key. The first information is sent to the user identification card; the first information includes the first public key and a first signature generated by a preset private key. The system receives second information sent by a user identification card and verifies the second signature in the second information using the second public key in the second information; the second signature is generated using the second private key; the second public key and the second private key are generated after the user identification card successfully identifies the first information using a preset public key. If the verification of the second signature passes, a second shared key is generated based on the first private key and the second public key; The device identifier is encrypted with a MAC address using the second shared key to obtain the third information; The third information is sent to the user identification card, so that the user identification card stores the device identifier after successfully decrypting the third information using the first shared key, thereby completing the binding between the user identification card and the terminal device; the first shared key is generated by the user identification card based on the first public key and the second private key.
2. The method according to claim 1, characterized in that, The first information also includes a first random number; the first signature is obtained by signing the first random number using the first private key; The second information also includes a second random number; the second signature is obtained by signing the second random number using the second private key.
3. The method according to claim 2, characterized in that, The step of verifying the second signature in the second information using the second public key in the second information includes: The second signature in the second information is parsed using the second public key to obtain the second parsing result; Determine whether the second parsing result matches the first random number; if they match, the verification passes. If there is a mismatch, the terminal device returns the first error code.
4. The method according to claim 2, characterized in that, The process of encrypting the device identifier with a MAC address using the second shared key to obtain the third information includes: The device identifier and the second random number are encrypted with the second shared key and then MAC-added to obtain the third information.
5. The method according to claim 2, characterized in that, The method further includes: The system receives and decrypts the fourth information using the second shared key; the fourth information is generated after the user identification card storage device is identified; the fourth information is obtained by encrypting and adding a MAC address using the first shared key. If the parsing result of the fourth information is the first random number and the binding success identifier, the second random number and the binding confirmation identifier are encrypted with MAC using the second shared key to generate the fifth information; Send the fifth information to the user identification card; The system receives a sixth message sent by the user identification card, which indicates that the user identification card has successfully bound itself to the terminal. The sixth message is generated by the user identification card after decrypting, deMAC-checking, and verifying the fifth message using the first shared key.
6. The method according to any one of claims 2 to 5, characterized in that, The method further includes: When the terminal device is powered on, it detects that it is bound to the user identification card and receives the seventh information; The seventh information is parsed using the second shared key. If the parsing result matches the second random number, the device identifier and the second random number are encrypted using the second shared key to obtain the eighth information. Send the eighth information to the user identification card; The system receives the verification result sent by the user identification card; the verification result is generated by the user identification card after verifying the parsing result of the eighth information.
7. The method according to claim 6, characterized in that, The second information also includes the electronic identity identifier of the user identification card; The seventh information is parsed using the second shared key. If the parsing result matches the second random number, the device identifier and the second random number are encrypted using the second shared key to obtain the eighth information, including: The seventh information is parsed using the second shared key. If the parsing result matches the second random number and the electronic identity, the device identifier and the second random number are encrypted with a MAC address using the second shared key to obtain the eighth information.
8. A secure authentication method for eSIM, characterized in that, The method is used for user identification cards; The user identification card is embedded in the terminal device; the method includes: If, when the terminal device is powered on, it is detected that the user identification card is not bound to the terminal device, the first information is received; the first information includes a first public key and a first signature generated by a preset private key; the first public key and the first private key are generated after the terminal device is powered on and it is detected that the user identification card is not bound to the user identification card. If the first signature is successfully verified using the preset public key, a second public key and a second private key are generated. A first shared key is generated based on the second private key and the first public key; Send second information to the terminal device; the first information includes the second public key and a second signature generated by the second private key; Receive third information; the third information is obtained by encrypting the device identifier with a MAC using a second shared key; the second shared key is generated by the terminal device based on the second public key and the first private key after the terminal device successfully verifies the second signature using the second public key. If the third information is successfully parsed using the first shared key, the device identifier is stored to complete the binding of the user identification card and the terminal device.
9. The method according to claim 8, characterized in that, The first information also includes a first random number; the first signature is obtained by signing the first random number using the preset private key; The second information also includes a second random number; the second signature is obtained by signing the second random number using the second private key.
10. The method according to claim 9, characterized in that, The method further includes: The first signature is parsed using a pre-set public key to obtain the first parsing result; If the first parsing result is returned to the terminal device, and the first parsing result indicates parsing failure, then the terminal device is instructed to return a first error code.
11. The method according to claim 9, characterized in that, The third information is obtained by the terminal device encrypting the device identifier and the second random number using the second shared key and adding a MAC. The method further includes: The third information is parsed using the first shared key to obtain the third parsing result; If the third parsing result matches the second random number, then the third information is successfully parsed. If there is a mismatch, a third error code is returned to the terminal device.
12. The method according to claim 9, characterized in that, The step of storing the device identifier to complete the binding of the user identification card and the terminal device includes: If the user identification card stores the device identifier, it generates fourth information based on the first random number and the successful binding identifier. The fourth information is obtained by encrypting the first shared key and adding a MAC. Send the fourth message to the terminal device; The terminal device receives a fifth message; the fifth message is generated by the terminal device after decrypting and de-MACing the fourth message using the second shared key and passing the verification. The fifth information is decrypted using the first shared key. If the result of the decryption and MAC decryption of the fifth information matches the second random number and the binding confirmation identifier, then the sixth information is sent to the terminal device to indicate that the user identification card has successfully bound to the terminal.
13. The method according to any one of claims 9 to 12, characterized in that, The method further includes: If a binding with the terminal device is detected when the terminal device is powered on, the seventh piece of information is generated based on the second random number; Send the seventh message to the terminal device; The terminal device receives an eighth message; the eighth message is generated by the terminal device after parsing the seventh message with the second shared key and matching it with the second random number. The eighth piece of information is parsed, and a verification result is sent to the terminal device based on the parsing result of the eighth piece of information.
14. The method according to claim 13, characterized in that, If the parsing result of the eighth information matches the device identifier and the second random number, the terminal device identifier is successfully verified, and the verification result is returned to the terminal to allow the terminal device to perform network access authentication.
15. The method according to claim 14, characterized in that, The method further includes: If the parsing result of the eighth information does not match at least one of the device identifier and the second random number, the seventh information is regenerated based on the second random number.
16. The method according to claim 15, characterized in that, If the parsing result of the eighth information does not match at least one of the device identifier and the second random number, then the seventh information is regenerated based on the second random number, including: If the parsing result of the eighth information does not match at least one of the device identifier and the second random number, and the number of times the seventh information is generated is less than the number threshold, then the seventh information is regenerated according to the second random number. If the parsing result of the eighth information does not match at least one of the device identifier and the second random number, and the number of times the seventh information is generated is greater than or equal to the number threshold, then the fourth error code is used as the verification result.
17. The method according to claim 13, characterized in that, The second information also includes the electronic identity identifier of the user identification card; The generation of the seventh information based on the second random number includes: The seventh information is obtained by encrypting the second random number and the electronic identity using the first shared key and adding a MAC.
18. A secure authentication device for eSIM, characterized in that, The device is installed in a terminal device, the terminal device having an embedded user identification card, and the device includes: The first key generation module is used to generate a first public key and a first private key when the terminal device is powered on and it is detected that it is not bound to the user identification card. A first sending module is used to send first information to the user identification card; the first information includes the first public key and a first signature generated by a preset private key; The first receiving module is used to receive the second information sent by the user identification card, and to verify the second signature in the second information using the second public key in the second information; the second signature is generated by the second private key; the second public key and the second private key are generated after the user identification card successfully identifies the first information using the preset public key. The first key generation module is also used to generate a second shared key based on the first private key and the second public key if the verification of the second signature passes. The first encryption module is used to encrypt the device identifier with a MAC address using the second shared key to obtain the third information; The first sending module is used to send the third information to the user identification card, so that the user identification card stores the device identifier after successfully decrypting the third information through the first shared key, thereby completing the binding between the user identification card and the terminal device; the first shared key is generated by the user identification card based on the first public key and the second private key.
19. A security authentication device for eSIM, characterized in that, The device is disposed on a user identification card, and the user identification card is embedded in a terminal device; the device includes: The second receiving module is configured to receive first information if it detects that the terminal device is not bound to the user identification card when the terminal device is powered on; the first information includes a first public key and a first signature generated by a preset private key; the first public key and the first private key are generated after the terminal device is powered on and it is detected that it is not bound to the user identification card. The second key generation module is used to generate a second public key and a second private key if the first signature is successfully verified according to the preset public key. The second key generation module is further configured to generate a first shared key based on the second private key and the first public key; The second sending module is used to send second information to the terminal device; the second information includes the second public key and a second signature generated by the second private key. The second receiving module is further configured to receive third information; the third information is obtained by encrypting the device identifier with a MAC address using a second shared key; the second shared key is generated by the terminal device based on the second public key and the first private key after the terminal device successfully verifies the second signature using the second public key. The storage module is used to store the device identifier if the third information is successfully parsed using the first shared key, so as to complete the binding of the user identification card and the terminal device.
20. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the eSIM security authentication method according to any one of claims 1 to 17.
21. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the eSIM security authentication method according to any one of claims 1 to 17.