Authentication method, device, equipment and storage medium
Encrypting and decrypting identity information through symmetric algorithms solves the problem of long identity authentication cycles caused by public key algorithms and achieves an efficient and secure identity authentication process.
Patent Information
- Application Number
- CN202210505397.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-05-10
AI Technical Summary
In the existing technology, when the public key algorithm is used for identity authentication between devices, the encryption process is complicated, resulting in a long authentication cycle and low efficiency.
Random numbers are used to dynamically generate identity information, and encryption and decryption are performed through symmetric algorithms, which reduces the time required for identity authentication, improves efficiency, and prevents replay attacks.
It effectively shortens the identity authentication time, improves the efficiency of identity authentication, and enhances business security.
Smart Images

Figure CN114710282B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an identity authentication method, device, equipment and storage medium. Background Art
[0002] When a first device needs to perform service transmission with a second device, the first device and the second device need to authenticate the identities of the devices first.
[0003] In the related art, identity authentication between devices is achieved through public key algorithms. Since public key algorithms are asymmetric algorithms, the encryption process is complex and takes a long time, resulting in a long authentication cycle. Summary of the invention
[0004] The embodiments of the present application provide an identity authentication method, apparatus, device and storage medium, which reduce the time required for identity authentication.
[0005] In a first aspect, an embodiment of the present application provides an identity authentication method, including:
[0006] receiving an identity authentication request from a first device;
[0007] generating a first random number according to the identity authentication request;
[0008] Acquire first identity information of the first device according to the first random number, where the first identity information is obtained by the first device encrypting the first random number using a first key;
[0009] The first device is authenticated according to the first random number, the first key, and the first identity information to obtain an identity authentication result of the first device.
[0010] The embodiment of the present application utilizes random numbers to dynamically generate the first identity information, and the first identity information can only be maintained once during the service life cycle, thereby avoiding replay attacks and ensuring the security of the service.
[0011] In a possible implementation, performing identity authentication on the first device according to the first random number, the first key, and the first identity information to obtain an identity authentication result of the first device includes:
[0012] Decrypting the first identity information using the first key to obtain a second random number; the algorithm used for decryption is a symmetric algorithm;
[0013] The first device is authenticated according to the first random number and the second random number to obtain an authentication result of the first device.
[0014] The embodiment of the present application uses a symmetric algorithm to encrypt and decrypt the first identity information, which reduces the time required for identity authentication and improves the efficiency of identity authentication.
[0015] In a possible implementation, performing identity authentication on the first device according to the first random number and the second random number to obtain an identity authentication result of the first device includes:
[0016] Determine whether the first random number and the second random number are the same;
[0017] If yes, determining that the identity authentication result is that the identity authentication of the first device is passed;
[0018] If not, it is determined that the identity authentication result is that the identity authentication of the first device fails.
[0019] In a possible implementation manner, after determining that the identity authentication result is that the identity authentication of the first device is passed, the method further includes:
[0020] Delete the first random number and the second random number.
[0021] In a possible implementation, acquiring the first identity information of the first device according to the first random number includes:
[0022] Sending the first random number to the first device;
[0023] Receive the first identity information sent by the first device.
[0024] In a possible implementation, the encryption algorithm is a symmetric algorithm.
[0025] In a possible implementation manner, receiving the first identity information sent by the first device includes:
[0026] A service instruction sent by the first device is received, where the service instruction includes the first identity information.
[0027] In a possible implementation manner, after receiving the service instruction sent by the first device, the method further includes:
[0028] If it is determined that the identity authentication result is that the identity authentication of the first device is passed, the service is processed according to the service instruction.
[0029] In a possible implementation manner, before obtaining the identity authentication request of the first device, the method further includes:
[0030] Receiving a second identity information and a ciphertext of the first key; the second identity information is obtained by the first device encrypting the first one-time valid key through a shared key;
[0031] Performing authority verification on the first device according to the first one-time valid key, the shared key and the second identity information;
[0032] If the authority verification is passed, the ciphertext of the first key is decrypted by the shared key to obtain the first key;
[0033] The first key is written into a one-time programmable area of the chip.
[0034] The content in the one-time programmable area cannot be changed once written. In the second device, only the algorithm acceleration engine can access the area, and other software or hardware have no access rights. The embodiment of the present application writes the first key into the one-time programmable area to prevent key leakage.
[0035] In a possible implementation, performing authority verification on the first device according to the first one-time valid key, the shared key, and the second identity information includes:
[0036] Decrypting the second identity information using the shared key to obtain a second one-time valid key;
[0037] Determining whether the first one-time key and the second one-time key are the same;
[0038] If yes, the permission verification is passed;
[0039] If not, the permission verification fails.
[0040] In a possible implementation, writing the first key into a one-time programmable area of a chip includes:
[0041] Obtaining a first cyclic redundancy code of the first key;
[0042] determining a second cyclic redundancy code of the first key;
[0043] Whether the first key is valid is determined according to the first cyclic redundancy code and the second cyclic redundancy code, and when it is determined that the first key is valid, the first key is written into a one-time programmable area of the chip.
[0044] In a second aspect, an embodiment of the present application provides an identity authentication device, including a receiving module, a generating module, an acquiring module and an identity authentication module, wherein:
[0045] The receiving module is used to receive an identity authentication request from a first device;
[0046] The generating module is used to generate a first random number according to the identity authentication request;
[0047] The acquisition module is used to acquire first identity information of the first device according to the first random number, where the first identity information is obtained by the first device encrypting the first random number using a first key;
[0048] The identity authentication module is used to authenticate the first device according to the first random number, the first key and the first identity information to obtain an identity authentication result of the first device.
[0049] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory;
[0050] The memory stores computer-executable instructions;
[0051] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the identity authentication method as described in any one of the first aspects.
[0052] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the identity authentication method described in any one of the first aspects.
[0053] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it can implement the identity authentication method described in any one of the first aspects.
[0054] The embodiment of the present application provides an identity authentication method, apparatus, device and storage medium, which obtains an identity authentication request of a first device; generates a first random number according to the identity authentication request; obtains first identity information of the first device according to the first random number, and the first identity information is obtained by encrypting the first random number by the first device using a first key; authenticates the first device according to the first random number, the first key and the first identity information, and obtains the identity authentication result of the first device. The time required for identity authentication is reduced, and the security of the authentication process is guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0056] Figure 2 A flowchart of an identity authentication method provided in an embodiment of the present application;
[0057] Figure 3A flowchart of another identity authentication method provided in an embodiment of the present application;
[0058] Figure 4 A schematic diagram of a process of deploying a first key on a second device provided in an embodiment of the present application;
[0059] Figure 5 A schematic diagram of another process of deploying a first key on a second device provided in an embodiment of the present application;
[0060] Figure 6 A flowchart of another identity authentication method provided in an embodiment of the present application;
[0061] Figure 7 A schematic diagram of the structure of an identity verification device provided in an embodiment of the present application;
[0062] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in combination with the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0064] It should be understood that the terms "first", "second", etc. involved in the embodiments of the present application are used to distinguish different objects rather than to describe a specific order.
[0065] For ease of understanding, the following Figure 1 , the application scenarios to which the embodiments of the present application are applicable are described.
[0066] Figure 1 This is a schematic diagram of an application scenario provided by the embodiment of this application. Figure 1 The communication system in the application scenario includes a first device 101 and a second device 102. The first device 101 and the second device 102 can perform service data transmission.
[0067] The first device may be a server or a hardware encryption device; the second device may be a terminal device.
[0068] A hardware encryption device is an external encryption device that has special security algorithm functions, such as the U-shield used by banks and the tax disk configured by tax authorities.
[0069] A terminal device is a device with wireless transceiver function. It can be deployed on land, including indoors or outdoors, handheld, wearable or vehicle-mounted; it can also be deployed on the water (such as ships, etc.); it can also be deployed in the air (such as airplanes, balloons and satellites, etc.). The terminal device can be a mobile phone, a tablet computer (pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a vehicle-mounted terminal device, a wireless terminal in self-driving, a wireless terminal device in remote medical, a wireless terminal device in smart grid, a wireless terminal device in transportation safety, a wireless terminal device in smart city, a wireless terminal device in smart home, a wearable terminal device, etc. The terminal equipment involved in the embodiments of the present application may also be referred to as a terminal, user equipment (UE), access terminal equipment, vehicle-mounted terminal, industrial control terminal, UE unit, UE station, mobile station, mobile station, remote station, remote user equipment, mobile device, wireless communication equipment, UE agent or UE device, etc. The terminal equipment may be fixed or mobile.
[0070] Before the first device and the second device perform service transmission, the identities of the two devices need to be authenticated to ensure the security of service transmission. In the related art, the identity authentication between devices is realized through the public key algorithm. Since the public key algorithm is an asymmetric algorithm, the encryption process is complicated and takes a long time, resulting in a long authentication cycle.
[0071] In view of this, an embodiment of the present application provides a new identity authentication method, which uses random numbers to dynamically generate first identity information. The first identity information can only be maintained once in the business life cycle, which can prevent replay attacks and improve the security of identity authentication. At the same time, the method used in the embodiment of the present application to encrypt and decrypt the first identity information is a symmetric algorithm, and the calculation process is simpler than that of an asymmetric algorithm, thereby reducing the time required for identity authentication and improving the efficiency of identity authentication.
[0072] The technical solution shown in the present application is described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or displayed content will not be repeatedly described in different embodiments.
[0073] Figure 2A flowchart of an identity authentication method provided in an embodiment of the present application. Figure 2 , the method comprising:
[0074] S201. The second device receives an identity authentication request from the first device.
[0075] The execution subject of the embodiment of the present application may be the second device, or may be an identity verification device disposed in the second device. The identity verification device may be implemented by software, or may be implemented by a combination of software and hardware.
[0076] The second device may receive the identity authentication request when the first device issues a service instruction.
[0077] The authentication request may be a random number acquisition command.
[0078] S202. The second device generates a first random number according to the identity authentication request.
[0079] The second device may generate the first random number using a random number generator.
[0080] The first random number may be 64 bytes.
[0081] After the second device generates the first random number, the first random number may be temporarily stored in a specific area.
[0082] S203: The second device obtains first identity information of the first device according to the first random number, where the first identity information is obtained by the first device encrypting the first random number using a first key.
[0083] The first key may be a key configured in advance by the first device and the second device and used for identity authentication.
[0084] The first key may be a device group key (Device Group Key, DGK).
[0085] There is only one first key in the second device; multiple second devices can use one first key, or each second device can use a first key separately. Correspondingly, the first device has the ability to manage multiple first keys and identify different first keys.
[0086] The encryption algorithm can be a symmetric algorithm, which must have both encryption and integrity verification functions.
[0087] The symmetric algorithm may be an Advanced Encryption Standard (AES)-Galois / Counter Mode (GCM) encryption algorithm or an SM4-GCM encryption algorithm, wherein SM4 is a symmetric block cipher algorithm in GB / T 32907-2016.
[0088] GCM symmetric encryption uses a counter mode with a Galois Message Authentication Code (GMAC).
[0089] After the second device generates the first random number, it can send the first random number to the first device. The first device can encrypt the first random number using the first key to obtain the first identity information, and send the first identity information to the second device for identity authentication.
[0090] S204: The second device authenticates the first device according to the first random number, the first key, and the first identity information to obtain an identity authentication result of the first device.
[0091] The second device can decrypt the first identity information according to the first key to obtain a second random number. By determining whether the first random number and the second random number are the same, the identity of the first device can be verified.
[0092] The result of the authentication can be either authentication passed or authentication failed.
[0093] exist Figure 2 In the illustrated embodiment, the second device receives an identity authentication request from the first device; generates a first random number according to the identity authentication request; obtains first identity information of the first device according to the first random number, the first identity information being obtained by the first device encrypting the first random number using a first key; authenticates the first device according to the first random number, the first key, and the first identity information, and obtains an identity authentication result of the first device. By using the random number and the first key to authenticate the identity of the first device, the time required for identity authentication is reduced.
[0094] exist Figure 2 Based on the embodiment shown below, combined with Figure 3 The above authentication methods are explained in detail.
[0095] Figure 3 This is a flowchart of another identity authentication method provided in the embodiment of the present application. Figure 3 , the method comprising:
[0096] S301: The second device receives an identity authentication request from the first device.
[0097] It should be noted that the execution process of S301 can refer to the execution process of S201, which will not be described in detail here.
[0098] S302: The second device generates a first random number according to the identity authentication request.
[0099] The first random number can only maintain a limited life cycle, such as the cycle of a business interaction. If new business transactions are to be carried out, a new random number needs to be regenerated.
[0100] S303: The second device sends a first random number to the first device.
[0101] After receiving the first random number sent by the second device, the first device may use the first key to encrypt the first random number to obtain the first identity information; the encryption algorithm may be a symmetric algorithm.
[0102] S304: The second device receives a service instruction sent by the first device, where the service instruction includes the first identity information.
[0103] The service instruction may be generated before the identity authentication request is sent, and the first device may send the identity authentication request to the second device according to the service instruction.
[0104] Including the first identity information in the business instruction means that the first identity information can be used as a verification parameter to encapsulate the business instruction.
[0105] The service instruction may be an instruction to obtain data.
[0106] S305. The second device uses the first key to decrypt the first identity information to obtain a second random number; the algorithm used for decryption is a symmetric algorithm.
[0107] The second random number may be the same as or different from the first random number. If the first random number changes during the transmission process, the second random number is different from the first random number.
[0108] S306: The second device determines whether the first random number and the second random number are the same.
[0109] If yes, execute S307.
[0110] If not, execute S309.
[0111] S307: Determine that the identity authentication result is that the identity authentication of the first device is passed.
[0112] After the identity authentication of the first device is passed, the second device can process the service according to the service instruction.
[0113] S308: Delete the first random number and the second random number, and process the service according to the service instruction.
[0114] Deleting the first random number and the second random number can prevent replay attacks.
[0115] S309: Determine that the identity authentication result is that the identity authentication of the first device fails.
[0116] When the identity authentication of the first device fails, the second device will not execute the service according to the service instruction.
[0117] exist Figure 3 In the illustrated embodiment, the second device obtains an identity authentication request from the first device; generates a first random number according to the identity authentication request; sends the first random number to the first device; receives a business instruction sent by the first device, the business instruction including the first identity information; uses the first key to decrypt the first identity information to obtain the second random number; the algorithm used for decryption is a symmetric algorithm; determines whether the first random number and the second random number are the same; if so, determines that the identity authentication result is that the identity authentication of the first device is passed, deletes the first random number and the second random number, and processes the business according to the business instruction; if not, determines that the identity authentication result is that the identity authentication of the first device is not passed. Since the calculation process of the symmetric algorithm is relatively simple, encryption and decryption of the identity information of the first device based on the symmetric algorithm can reduce the time of identity authentication; at the same time, the identity information generated based on the random number and the first key in the embodiment of the present application can only maintain one business life cycle, prevents replay attacks, and improves the security of identity authentication and business processing.
[0118] Figure 2-Figure 3 The embodiment shown illustrates the identity authentication process between devices. At the beginning of the identity authentication, the first key needs to be deployed in the second device. After the second device has deployed the first key, the first key can be used multiple times for identity authentication. Figure 4 , the deployment process of the first key is described in detail.
[0119] Figure 4 For a flow chart of a second device deploying a first key provided in an embodiment of the present application, see Figure 4 , the method comprising:
[0120] S401. The second device receives the ciphertext of the second identity information and the first key; the second identity information is obtained by the first device encrypting the first one-time valid key through the shared key.
[0121] In order to ensure the security of the first key during the transmission process, the first device may encrypt the first key, the key used for encryption may be a shared key, and the algorithm used for encryption may be a symmetric algorithm.
[0122] The first one-time valid key is a one-time key, which becomes invalid after being used once.
[0123] The algorithm used by the shared key to encrypt the first one-time key may be a symmetric algorithm.
[0124] The shared key may be a key obtained by negotiation between the first device and the second device using a public key algorithm; the first one-time key is preset in a read-only memory (ROM) through a code.
[0125] S402: The second device performs authority verification on the first device according to the first one-time valid key, the shared key and the second identity information.
[0126] The permission verification of the first device can be performed based on the first one-time valid key, the shared key and the second identity information in the following manner: use the shared key to decrypt the second identity information to obtain the second one-time valid key; determine whether the first one-time valid key and the second one-time valid key are the same; if so, the permission verification passes; if not, the permission verification fails.
[0127] The algorithm used for decryption may be a symmetric algorithm.
[0128] S403: If the authority verification is passed, the second device decrypts the ciphertext of the first key using the shared key to obtain the first key.
[0129] The algorithm used for decryption may be a symmetric algorithm.
[0130] S404: The second device writes the first key into the one-time programmable area of the chip.
[0131] The content in the One Time Programmable (OTP) area cannot be changed once written. In the second device, only the algorithm acceleration engine can access this area, and other software or hardware have no access rights, thereby preventing key leakage.
[0132] The first key can be written into the one-time programmable area of the chip in the following manner: obtain a first cyclic redundancy code of the first key; determine a second cyclic redundancy code of the first key; determine whether the first key is valid based on the first cyclic redundancy code and the second cyclic redundancy code, and write the first key into the one-time programmable area of the chip when it is determined that the first key is valid.
[0133] The first cyclic code and the second cyclic code can be the same or different; when the first cyclic code and the second cyclic code are the same, it means that the first key has not been modified during the transmission process, that is, the first key is valid; when the first cyclic code and the second cyclic code are different, it means that the first key has been modified during the transmission process, that is, the first key is invalid and a new key needs to be deployed. The security of identity authentication can be improved by judging the validity of the first key.
[0134] exist Figure 4 In the illustrated embodiment, the second device receives the second identity information and the ciphertext of the first key; the second identity information is obtained by the first device encrypting the first one-time valid key through the shared key; the first device is authenticated according to the first one-time valid key, the shared key and the second identity information; if the authentication passes, the ciphertext of the first key is decrypted through the shared key to obtain the first key; the first key is written into the one-time programmable area of the chip. In the process of deploying the first key, the first key is first encrypted, and the ciphertext of the first key is decrypted after the first device is authenticated through the second identity information, thereby improving the security of the first key during transmission. At the same time, writing the first key into the OTP can effectively prevent key leakage and improve the security of the first key deployment.
[0135] Based on any of the above embodiments, Figure 5 The deployment process of the first key is explained with examples. Figure 6 Give examples of identity verification methods.
[0136] Example 1
[0137] Figure 5 A schematic diagram of another process of deploying a first key on a second device provided in an embodiment of the present application. Figure 5 , including the following steps:
[0138] 1. The security server calculates the cyclic redundancy check (CRC) of the DGK to obtain CRC1; encrypts the DGK using the shared key to obtain the DGK ciphertext; encrypts the first one-time valid key using the shared key to obtain the identity token (second identity information). The shared key can be a key obtained by negotiation between the first device and the second device using a public key algorithm; the first one-time key is preset in the ROM through code.
[0139] 2. The security server sends CRC1, DGK ciphertext and identity token to the terminal device.
[0140] 3. The terminal device uses the shared key to decrypt the identity token to obtain a second one-time key; and uses the first one-time key and the second one-time key to verify the authority of the security server.
[0141] 4. If the first one-time valid key is the same as the second one-time valid key, it is determined that the authority authentication of the security server is passed; the terminal device uses the shared key to decrypt the DGK ciphertext to obtain the DGK.
[0142] 5. The terminal device calculates the CRC of DGK and obtains CRC2; the validity of DGK is determined based on CRC2 and CRC1.
[0143] 6. If CRC2 and CRC1 are the same, it proves that the DGK key is valid; write the DGK into the chip OTP area and set the chip status to DGK deployed.
[0144] 7. The terminal device returns the deployment status to the security server.
[0145] In the process of deploying DGK, DGK is first encrypted, and the DGK ciphertext is decrypted after the security server is authenticated through the identity token, which improves the security of DGK transmission. At the same time, writing DGK into OTP can prevent DGK leakage and improve the security of DGK deployment.
[0146] Example 2
[0147] After the terminal device deploys the DGK, both the terminal device and the server have the DGK, and the identity authentication process between devices can be started.
[0148] Figure 6 A flowchart of another identity authentication method provided in the embodiment of the present application. Figure 6 , including the following steps:
[0149] 1. The user who requests the business function first logs in to the security server using his account and password.
[0150] 2. The security server determines whether the user has the authority to access the DGK based on the user type (eg, advanced user, ordinary user, etc.); for example, advanced users have the authority to access the DGK.
[0151] 3. If the user has the authority to access DGK, the security server obtains the business instruction and sends a random number collection command to the terminal device to obtain the random number R1 from the terminal device.
[0152] 4. The terminal device generates a 64-byte random number R1 through a random number generator and saves it to a specific area.
[0153] 5. The terminal device sends a random number R1 to the security server.
[0154] 6. After the security server receives the random number R1, it encrypts the random number R1 using DGK based on the AES-GCM algorithm to generate an identity token (first identity information).
[0155] 7. Use the identity token as a verification parameter to encapsulate business instructions.
[0156] 8. The security server sends the encapsulated business instructions to the terminal device.
[0157] 9. The terminal device uses DGK to decrypt the identity token based on the AES-GCM algorithm to obtain the random number R2.
[0158] 10. Determine whether the random number R1 and the random number R2 are the same; if they are different, execute step 11; if they are the same, execute step 12;
[0159] 11. The terminal device terminates this service.
[0160] 12. The terminal device authenticates the security server, deletes the random number R1 and the random number R2, and processes the business according to the business instructions.
[0161] 13. The terminal device returns the business processing results to the security server.
[0162] The symmetric algorithm is used to encrypt and decrypt identity tokens between terminal devices and security servers or hardware encryption devices, which reduces the time required for identity authentication and improves the efficiency of identity authentication. At the same time, a random number generator is used to dynamically generate identity tokens, which only last once during the business life cycle, ensuring the security of identity authentication and business processing.
[0163] In Example 1-2, the security server may be replaced by a hardware encryption device, and the AES-GCM algorithm may be replaced by the SM4-GCM algorithm.
[0164] Figure 7 This is a schematic diagram of the structure of an identity verification device provided in an embodiment of the present application. Figure 7 The identity verification device 10 includes: a receiving module 11, a generating module 12, an acquiring module 13 and an identity verification module 14, wherein:
[0165] The receiving module 11 is used to receive an identity authentication request from a first device;
[0166] The generating module 12 is used to generate a first random number according to the identity authentication request;
[0167] The acquisition module 13 is used to acquire first identity information of the first device according to the first random number, where the first identity information is obtained by the first device encrypting the first random number using a first key;
[0168] The identity authentication module 14 is used to authenticate the first device according to the first random number, the first key and the first identity information to obtain an identity authentication result of the first device.
[0169] In a possible implementation, the identity authentication module 14 is specifically used for:
[0170] Decrypting the first identity information using the first key to obtain a second random number; the algorithm used for decryption is a symmetric algorithm;
[0171] The first device is authenticated according to the first random number and the second random number to obtain an authentication result of the first device.
[0172] In a possible implementation, the identity authentication module 14 is specifically used for:
[0173] Determine whether the first random number and the second random number are the same;
[0174] If yes, determining that the identity authentication result is that the identity authentication of the first device is passed;
[0175] If not, it is determined that the identity authentication result is that the identity authentication of the first device fails.
[0176] In a possible implementation manner, after the identity verification module 14, a deletion module is further included, and the deletion module is used to:
[0177] Delete the first random number and the second random number.
[0178] In a possible implementation manner, the acquisition module 13 is specifically used to:
[0179] Sending the first random number to the first device;
[0180] Receive the first identity information sent by the first device.
[0181] In a possible implementation, the encryption algorithm is a symmetric algorithm.
[0182] In a possible implementation manner, the acquisition module 13 is specifically used to:
[0183] A service instruction sent by the first device is received, where the service instruction includes the first identity information.
[0184] In a possible implementation manner, after the acquisition module 13, a service processing module is further included, and the service processing module is used to:
[0185] If it is determined that the identity authentication result is that the identity authentication of the first device is passed, the service is processed according to the service instruction.
[0186] In a possible implementation manner, before the receiving module 11, a deployment module is further included, and the deployment module is used to:
[0187] Receiving a second identity information and a ciphertext of the first key; the second identity information is obtained by the first device encrypting the first one-time valid key through a shared key;
[0188] Performing authority verification on the first device according to the first one-time valid key, the shared key and the second identity information;
[0189] If the authority verification is passed, the ciphertext of the first key is decrypted by the shared key to obtain the first key;
[0190] The first key is written into a one-time programmable area of the chip.
[0191] In a possible implementation, the deployment module is specifically used to:
[0192] Decrypting the second identity information using the shared key to obtain a second one-time valid key;
[0193] Determining whether the first one-time key and the second one-time key are the same;
[0194] If yes, the permission verification is passed;
[0195] If not, the permission verification fails.
[0196] In a possible implementation, the deployment module is specifically used to:
[0197] Obtaining a first cyclic redundancy code of the first key;
[0198] determining a second cyclic redundancy code of the first key;
[0199] Whether the first key is valid is determined according to the first cyclic redundancy code and the second cyclic redundancy code, and when it is determined that the first key is valid, the first key is written into a one-time programmable area of the chip.
[0200] The identity authentication device 10 provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0201] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8The electronic device 20 may include a memory 21 and a processor 22. Exemplarily, the memory 21 and the processor 22 are interconnected via a bus 23.
[0202] The memory 21 is used to store program instructions;
[0203] The processor 22 is used to execute the program instructions stored in the memory, so as to enable the electronic device 20 to perform the above-mentioned identity authentication method.
[0204] The electronic device may be a chip, a module, an integrated development environment (IDE), etc.
[0205] Figure 8 The electronic device shown in the embodiment can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0206] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above-mentioned identity authentication method.
[0207] The embodiment of the present application may also provide a computer program product, including a computer program, which, when executed by a processor, can implement the above-mentioned identity authentication method.
[0208] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
[0209] In addition, although each operation is described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or to be performed in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the application. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0210] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. An identity authentication method, characterized in that: Applied to the second device, comprising: receiving an identity authentication request from a first device; generating a first random number according to the identity authentication request; Acquire first identity information of the first device according to the first random number, where the first identity information is obtained by the first device encrypting the first random number using a first key; Performing identity authentication on the first device according to the first random number, the first key, and the first identity information to obtain an identity authentication result of the first device; Before obtaining the authentication request of the first device, the method further includes: Receiving a second identity information and a ciphertext of the first key; the second identity information is obtained by the first device encrypting the first one-time valid key through a shared key; Performing authority verification on the first device according to the first one-time valid key, the shared key and the second identity information; If the authority verification is passed, the ciphertext of the first key is decrypted by the shared key to obtain the first key; Obtaining a first cyclic redundancy code of the first key; determining a second cyclic redundancy code of the first key; Whether the first key is valid is determined according to the first cyclic redundancy code and the second cyclic redundancy code, and when it is determined that the first key is valid, the first key is written into a one-time programmable area of the chip.
2. The method according to claim 1, characterized in that: Performing identity authentication on the first device according to the first random number, the first key, and the first identity information to obtain an identity authentication result of the first device, including: Decrypting the first identity information using the first key to obtain a second random number; the algorithm used for decryption is a symmetric algorithm; The first device is authenticated according to the first random number and the second random number to obtain an authentication result of the first device.
3. The method according to claim 2, characterized in that Performing identity authentication on the first device according to the first random number and the second random number to obtain an identity authentication result of the first device, including: Determine whether the first random number and the second random number are the same; If yes, determining that the identity authentication result is that the identity authentication of the first device is passed; If not, it is determined that the identity authentication result is that the identity authentication of the first device fails.
4. The method according to claim 3, characterized in that: After determining that the identity authentication result is that the identity authentication of the first device is passed, the method further includes: Delete the first random number and the second random number.
5. The method according to any one of claims 1 to 4, characterized in that: Acquiring first identity information of the first device according to the first random number includes: Sending the first random number to the first device; Receive the first identity information sent by the first device.
6. The method according to claim 5, characterized in that The encryption algorithm used is a symmetric algorithm.
7. The method according to claim 5, characterized in that Receiving the first identity information sent by the first device includes: A service instruction sent by the first device is received, where the service instruction includes the first identity information.
8. The method according to claim 7, characterized in that After receiving the service instruction sent by the first device, the method further includes: If it is determined that the identity authentication result is that the identity authentication of the first device is passed, the service is processed according to the service instruction.
9. The method according to claim 1, characterized in that: Performing authority verification on the first device according to the first one-time valid key, the shared key, and the second identity information includes: Decrypting the second identity information using the shared key to obtain a second one-time valid key; Determining whether the first one-time key and the second one-time key are the same; If yes, the permission verification is passed; If not, the permission verification fails.
10. An identity verification device, characterized in that: It includes a receiving module, a generating module, an acquiring module and an identity verification module, wherein: The receiving module is used to receive an identity authentication request from a first device; The generating module is used to generate a first random number according to the identity authentication request; The acquisition module is used to acquire first identity information of the first device according to the first random number, where the first identity information is obtained by the first device encrypting the first random number using a first key; The identity authentication module is used to authenticate the first device according to the first random number, the first key and the first identity information to obtain an identity authentication result of the first device; A deployment module, configured to receive a second identity information and a ciphertext of the first key; the second identity information is obtained by encrypting the first one-time valid key by the first device through a shared key; Performing authority verification on the first device according to the first one-time valid key, the shared key and the second identity information; If the authority verification is passed, the ciphertext of the first key is decrypted by the shared key to obtain the first key; Writing the first key into a one-time programmable area of the chip; The deployment module is specifically used to obtain a first cyclic redundancy code of the first key; determining a second cyclic redundancy code of the first key; Whether the first key is valid is determined according to the first cyclic redundancy code and the second cyclic redundancy code, and when it is determined that the first key is valid, the first key is written into a one-time programmable area of the chip.
11. An electronic device, characterized in that: include: Memory, processor; The memory is used to store computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the identity authentication method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the identity authentication method described in any one of claims 1 to 9.
13. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, can implement the identity authentication method described in any one of claims 1 to 9.
