Human-computer control interaction method, interaction system, computer equipment and storage medium
The IBC-PKI method based on the national secret algorithm solves the problem of insufficient network access security and command security in IoT devices, realizes device identity authentication and secure transmission of command data, and ensures the authenticity and effectiveness of the command. Enhanced trust between device and user.
Patent Information
- Application Number
- CN202011263161.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-12
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-11-12
Smart Images

Figure CN112422280B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of equipment security authentication and instruction security protection, and in particular relates to a human-computer control interaction method, an interaction system, a computer device and a storage medium. Background Art
[0002] At present, the Internet era brings intelligence to control systems, but also brings network security risks. When an IoT device is hacked, the original stability of the system is maliciously destroyed. In this case, it is not enough to rely solely on the system's own control technology. IT security and OT security protection are also required, among which IT security protection targets information systems, while OT security protection targets malicious operations.
[0003] OT security: Operational security mainly focuses on the control of physical devices. It adds protection against illegal control attacks on the basis of control security.
[0004] Control security: refers to the security issues in the process of controlling physical equipment, emphasizing stability, real-time, robustness, and controllability.
[0005] IoT OT security is the security issue of converting information into physical activities. Its security protection goals are different from traditional information security protection, although there are many similar technologies in terms of implementation technology. IT security and OT security have different characteristics. These characteristics include the interaction and mutual influence of IT technology and OT technology in the IoT. The differences between commonly used IT security and OT security protection are mainly reflected in:
[0006] 1. OT security emphasizes that the IoT system needs to protect information security, and also needs to protect operational behaviors. This type of technology is called OT security technology;
[0007] 2. Traditional IT security mainly protects information, and pays relatively little attention to data timeliness and freshness, which are particularly important in the IoT environment;
[0008] 3. Due to the limited resources of IoT devices, the security protection technology that can be supported also needs to be specially customized. Simply put, lightweight information security protection technology is needed, especially lightweight security authentication technology.
[0009] In the Internet of Things, we often encounter the process of sending instructions from one device to another, for example, sending a recharge instruction from a POS to an IC. Since the POS is a professional security device customized by a bank, in the traditional processing process, the security of the business data content is emphasized, and the security requirements of the recharge instruction itself are ignored. In the Internet of Things, instructions are the center of business data. Instructions should be distinguished from data, and different protections should be provided for each:
[0010] 1) Transaction data, such as A paying 100 yuan to B, reflects the transaction relationship between people. Its security protection features are the identity authentication of people and the inalterability of transaction content.
[0011] 2) Instruction data. For example, A issues a data instruction to his mobile phone to "generate a payment of 100 yuan to B". What A issues is the instruction, and the result generated by the mobile phone based on the instruction is the transaction data.
[0012] The legitimacy of control instructions is the core of OT security, which is mainly reflected in:
[0013] 1) It is necessary to ensure that the impact of control instructions on the controlled object is within a safe range, that is, the controlled object only processes instruction data but does not accept and process code;
[0014] 2) The authenticity of control instructions looks very similar to the authentication of information security, but in the IoT environment, the authenticity of control instructions is not completely consistent with traditional authentication technology.
[0015] 3) Due to the limited resources of IoT devices, the security protection technology that can be supported also needs to be specially customized. Simply put, lightweight information security protection technology is needed, especially lightweight security authentication technology.
[0016] It is very important to ensure the authenticity of instruction data, protect instruction data from illegal tampering, and protect the timeliness of instruction data. Therefore, the security protection of instruction data should include the authenticity of data source, data integrity protection, and data freshness protection.
[0017] Through the above analysis, the problems and defects of the prior art are as follows:
[0018] (1) In the prior art, the security of device access to the network, the security of instructions between people, the anti-attack ability of instructions, and the security protection of transmission between devices A and B are poor during data transmission.
[0019] (2) The instructions were not strictly controlled for confidentiality, the format of secure communication instructions was not limited, and the validity of the control instructions was not considered. There were risks such as confusing instruction formats, easy tampering, and replay.
[0020] (3) Due to the limited computing resources of IoT devices, most devices do not consider security and the lightweight encryption and decryption algorithms.
[0021] The difficulty of solving the above problems and defects is as follows: The difficulty of solving the above problems lies mainly in the high degree of fragmentation of IoT devices, the lack of unified industry standards, and the failure to form unified industry norms. At the same time, due to the limited computing resources of IoT devices, most industry users only consider the continuity of business and tolerate or ignore the security of the device itself.
[0022] The significance of solving the above problems and defects is: by building a human-computer interaction method based on IBC+PKI, the control instruction format is defined, and the security of the device itself is effectively improved, including but not limited to device network security authentication, device identification key issuance, and device instruction security transmission, which improves the safety of device operation. At the same time, the lightweight encryption technology combining IBC+PKI is used to achieve security protection of sensitive information such as keys and operation instructions. Summary of the invention
[0023] In view of the problems existing in the prior art, the present invention provides a human-computer control interaction method, an interaction system, a computer device and a storage medium.
[0024] The present invention is implemented as follows: an IBC-PKI human-machine control interaction method based on a national secret algorithm, the IBC-PKI human-machine control interaction method based on a national secret algorithm comprises:
[0025] Step 1: Initialize the IoT device, including pre-making the initial master key IMK (Initialmaster key), device root key and management center public key Pubc in the device security module;
[0026] Step 2: Device network authentication and related parameter and key acquisition. The device generates a unique fingerprint based on relevant attributes using algorithms such as SM3, and uses a password-protected secure interaction method to complete identity authentication at the center, and securely obtain identification keys, IBC parameters, and device public keys from the center.
[0027] Step 3: Device A uses a cryptographic algorithm to protect the operation instructions sent to device B.
[0028] Step 4: Device B decrypts the command and displays the command content to User B. User B confirms and authorizes Device B to respond.
[0029] Furthermore, in step 1, before user A authorizes device A, the following steps are also included:
[0030] (1) The IoT management center initializes the symmetric key in the security device and sets an initial master key IMK, device root key and management center public key Pubc in the device security module before the device joins the network;
[0031] (2) The device is powered on, and according to the characteristics of the device, the device's software and hardware information is collected, and the collected hardware information is used as the device's characteristic information. The device security module calculates the device fingerprint based on the device characteristic information;
[0032] (3) Verify device access to the network, issue SM9 public parameters, and update device authentication keys.
[0033] Further, in step (3), the device network access verification includes:
[0034] First, the security module generates a random number R1; the security module generates the public and private key pair of the device owner,
[0035] Secondly, assemble the data request data NA_Req_data = device feature information || device fingerprint || holder public key || holder personal information;
[0036] Then, using R1 as the key, SM4 algorithm is used for encryption to obtain the ciphertext M1 = SM4 encryption (R1, NA_Req_data)
[0037] Furthermore, the ciphertext M2 is calculated as SM2 encrypted (Pubc, R1); MAC is calculated as SM4_MAC (IMK, M2||M1);
[0038] Finally, M = M2||M1||MAC; M is sent to the center. The process is as follows Figure 5 .
[0039] Further, in step (3), the sending of SM9 public parameters includes:
[0040] 1) The center receives the information M, verifies MAC using IMK, MAC1=SM4 decryption (IMK, M2||M1), compares MAC with MAC1, if they are not equal, reports an error and exits, if they are equal, confirms that the device is a legitimate device;
[0041] 2) Decrypt R1 using the central private key, R1 = SM2 decryption (central private key, M2);
[0042] 3) Decrypt NA_Req_data using R1, NA_Req_data = SM4 decryption (R1, M1);
[0043] 4) Read the device fingerprint from NA_Req_data. If the device fingerprint does not exist in the device library, continue to register the device. If the device already exists in the library, repeated network access is not allowed.
[0044] 5) The center issues a user public key certificate PubCert_user to the holder; the center generates a unique device identification ID for this device using the SM9 algorithm;
[0045] 6) The center extracts the SM9 parameter ciphertext = SM4 encryption (shareKey, SM9 parameter); the center generates a random number R2 and calculates Rkey = R1^R2;
[0046] 7) Calculate M1 = SM4 decryption (Rkey, shareKey); load M1 into 16-level register Q (the primitive polynomial is X 16 +X 5 +X 3 +X 2 +1);
[0047] 8) Order Where X i is the i-th byte of the device fingerprint from left to right;
[0048] 9) Shift register Q cyclically moves N times to obtain the confidentiality parameter
[0049] 10) The center calculates the device master key MK=SM4 encryption (device root key, device ID) and uses the device root key as the key to encrypt the device unique ID; wherein the device root key is generated in advance by the management center and stored in the security device;
[0050] 11) The center calculates MK ciphertext = SM4 encryption (Rkey, device ID||MK) and encrypts device ID||MK using Rkey as the key;
[0051] 12) The center calculates MR2=SM4 encryption (R1, R2) and uses R1 as the key to encrypt R2; the center organizes the sending of the message P=MR2||MK ciphertext||confidentiality parameter X||SM9 parameter ciphertext||PubCert_use;
[0052] 13) Calculate MAC = SM4_MAC (IMK, P); 18) Transmit P||MAC to the terminal.
[0053] Further, in step (3), updating the device authentication key includes:
[0054] Step 1: Use IMK to verify MAC; use R1 to decrypt R2; calculate Rkey = R1^R2; use Rkey to decrypt device ID and MK;
[0055] The second step is to extract device features, calculate device fingerprints, and calculate the N value; And load it into the shift register Q, run it in reverse N beats, and get M1;
[0056] Step 3: Calculate shareKey = SM4 encryption (Rkey, M1); calculate SM9 parameters = SM4 decryption (shareKey, SM9 parameter ciphertext);
[0057] Step 4: Calculate Z1 = SM4 encryption (MK, R2); Calculate Z2 = SM2 signature (Pri_use, Z1); Send Z1||Z2, the center uses MK to decrypt Z1 to obtain R2 and compares it with the center's R2. If the comparison passes, it is determined that the confirmation information is correct, and if the comparison fails, it is determined that the confirmation information is wrong; verify the correctness of Z2 signature through the user's public key. If both verifications pass, the verification passes, and the network access process ends successfully. If one verification fails, the verification fails, and the network access process ends in failure.
[0058] Further, in step 3, the user A authorizes the generation of instructions including:
[0059] (1.1) User A enters the PIN to unlock the user's private key in the device security module and the use rights of the device SM9.
[0060] (1.2) User A obtains the certificate and device ID of user B. User A can obtain the certificate and device ID of user B from the management center; or directly obtain the certificate and device ID of user B from user B through NFC or QR code.
[0061] (1.3) Obtain random number Rd from user B; user A generates instruction content information M;
[0062] (1.4) Calculate keyAB=ECDH(CertB,PriA); Calculate working key workKey=SM4 encryption(keyAB, instruction generation time TB);
[0063] (1.5) Calculate MC = SM4 encryption (workKey, Rd||M); Calculate signature = SM2 signature (user A private key, MC);
[0064] (1.6) Construct instruction content = MC||SM2 signature||A certificate.
[0065] Further, in step 3, the device A performs transmission protection on the instruction including:
[0066] (2.1) Generate a random number R and use the SM9 private key of device A to sign the construction instruction content;
[0067] (2.2) Encrypt R using device B’s ID to obtain MR; let commandHeader = sender A device ID || receiver B device ID || generation time TB || expiration time TD
[0068] (2.3) Calculate command ciphertext = SM4 encryption (R, commandHeader); construct command = MR || command ciphertext || command content;
[0069] (2.4) Use the SM9 private key of device A to sign the instruction; send the instruction||instruction signature to B.
[0070] Further, in step 4, the device B interprets the instruction including:
[0071] (3.1) Verify the SM9 signature using the ID of device A;
[0072] (3.2) Use device B’s ID to decrypt MR and get commandHeader;
[0073] (3.3) Calculate keyAB = ECDH (CertA, PriB);
[0074] (3.4) Calculate the working key workKey = SM4 encryption (keyAB, instruction generation time TB);
[0075] (3.5) Verify SM2 signature using user A’s certificate;
[0076] (3.6) Calculate M = SM4 decryption (workKey, MC);
[0077] (3.7) Display M to user B. After obtaining user B’s authorization, device B responds.
[0078] Another object of the present invention is to provide an IBC-PKI human-machine control interaction system based on a national secret algorithm for implementing the IBC-PKI human-machine control interaction method based on a national secret algorithm, wherein the IBC-PKI human-machine control interaction system based on a national secret algorithm comprises:
[0079] IoT management center, users and devices;
[0080] User, used to generate instructions and authorize device execution;
[0081] The IoT management center is used to manage the correspondence between all users and their devices, generate and issue each user's SM2 certificate and confidentiality parameters, and distribute SM9 co-opening parameters to each device;
[0082] The device is provided with a security module; the security module is used to store and calculate device keys; generate and store user SM2 private keys and public key certificates; store SM9 public parameters and provide encryption and decryption algorithms based on device ID; and store other types of keys.
[0083] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the human-computer control interaction method.
[0084] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the human-computer control interaction method.
[0085] Combining all the above technical solutions, the advantages and positive effects of the present invention are as follows: the present invention provides data source authenticity verification through IBC+PKI cryptographic technology, combines password authentication with key management, and uses the keys under such management to perform data integrity protection and data freshness protection, providing the information security protection required for instruction data. If the instruction data requires confidentiality protection, the management of the keys required for data confidentiality protection is added during the authentication and key management phase, and the plaintext data is replaced with ciphertext data during the data transmission phase to achieve the purpose of security protection.
[0086] The advantages of the present invention also include:
[0087] 1. Equipment network security
[0088] By verifying the MAC of the network access request information, the management center can be sure that the current network access device meets the predetermined requirements. By presetting the center certificate, the device management center certificate can be prevented from being replaced. The device random number R1 is encrypted and sent by the management center public key, and the management center random number R2 is encrypted and sent by R1. Therefore, Rkey has security and confidentiality characteristics.
[0089] SM9 shared parameters are encrypted only once with shareKey, and shareKey is the same for all devices. The generation of shareKey is the inverse process of the key dispersion algorithm, that is, any Rkey can find a dispersion parameter so that shareKey = SM4 encryption (Rkey, dispersion parameter) holds, therefore, dispersion parameter = SM4 decryption (Rkey, shareKey).
[0090] Based on the principle of primitive polynomials over finite fields, any register state can reach another specific state after a certain number of steps. Therefore, the dispersion parameter is regarded as a state, and a specific step length is calculated according to the characteristics of the fingerprint. The state after the mover rotates this step length is used as a confidentiality parameter. In this way, different devices have different confidentiality parameters. After moving a specific step length in reverse, the dispersion parameter of the same value can be obtained. The security of the confidentiality parameter has two points: one is to bind it with the device ID to prevent incorrect matching; the other is to be encrypted and sent, and this encryption is one-time one-key.
[0091] The confidentiality of the distributed parameters depends on the step length and the confidentiality parameters. The step length information is calculated and not reflected in the message. The calculation of the step length depends on the device fingerprint. This information is transmitted to the center using the digital envelope technology of the center's public key. Other security is effectively guaranteed. When the terminal processes, the step length is calculated in the security module. Therefore, the security of the step length is guaranteed to a certain extent.
[0092] 2. Security of instructions between people
[0093] Strong directivity: The present invention adopts SM2 ECDH algorithm to negotiate the master key of both parties AB, and disperses the working key to achieve the characteristic of one-time one-key. Only the recipient who has the private key can decrypt the instruction and execute it.
[0094] Strong credibility: A cannot deny having sent this instruction.
[0095] Non-replayability: After decryption, B verifies R2 and the validity period of the instruction, and deletes Rd after execution. If the instruction is executed repeatedly, the dual factors of Rd and the validity period will prevent the instruction from being executed again.
[0096] Uninterceptability: Since the instruction content is encrypted, anyone who intercepts the instruction cannot decrypt and execute it, and cannot extract a single piece of data from the ciphertext to reconstruct a new instruction.
[0097] 3. Anti-attack capability of instructions
[0098] 1) The instruction transmission between user A and user B uses the ECDH algorithm to ensure that both parties have a symmetric key keyAB that is closely related to their identities, ensuring that only user B who holds the private key can decrypt the instruction. Therefore, the reception of the instruction has exclusive credibility and can resist man-in-the-middle attacks. Other third parties cannot synthesize the correct keyAB with the certificate of A.
[0099] 2) When the instruction is transmitted, user B can verify the signature of user A of the instruction to ensure that the source of the instruction cannot be forged or tampered with.
[0100] 3) The working key is calculated through a decentralized algorithm that complies with financial standards to ensure that the instruction is transmitted once and for all.
[0101] 4) After each instruction is executed, device B will return a random number RD to device A. Device A will encrypt RD and send it to device B along with the instruction. In this way, device B will authenticate the identity of device A before executing the instruction. After the execution is completed, RD will be updated and overwritten. In this way, only device B can receive instructions from device A, which can effectively prevent attackers from replaying instructions.
[0102] 4) Since the data transmitted by the Internet of Things is not necessarily completely reliable, wrong data may appear. Random numbers RA, RB, and RD also play a role in testing the correctness of current data in each stage of the process to prevent data loss.
[0103] 5) The time factor is used in the protocol to disperse the working key, which plays the role of one-time key.
[0104] 6) By establishing the expiration time, the B device can be required to forcibly update the RD, thereby ensuring that repeated replay of instructions is an invalid behavior.
[0105] 4. Security of transmission between devices A and B
[0106] The IBC device ID-based delivery method is used to enhance the transaction experience, which is more inclined to friendly instruction interaction. The delivery protection based on the SM9 algorithm ensures that the source of the confirmed data is credible. The digital envelope mechanism based on SM9 ensures that device A is sure that only device B can receive and decrypt the instruction header to obtain the generation time and complete the source of the instruction. Otherwise, any intermediate device cannot complete the decryption to obtain the generation time. BRIEF DESCRIPTION OF THE DRAWINGS
[0107] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0108] Figure 1 It is a schematic diagram of the IBC-PKI human-machine control interaction method based on the national secret algorithm provided in an embodiment of the present invention.
[0109] Figure 2 It is a flow chart of the IBC-PKI human-machine control interaction method based on the national encryption algorithm provided in an embodiment of the present invention.
[0110] Figure 3 This is an architecture diagram of the IBC-PKI human-machine control interaction system based on the national secret algorithm provided in an embodiment of the present invention.
[0111] Figure 4 It is a schematic diagram of the structure of an IBC-PKI human-machine control interaction system based on a national secret algorithm provided by an embodiment of the present invention;
[0112] In the figure: 1. IoT management center; 2. Devices; 3. Users.
[0113] Figure 5 It is a schematic diagram of the process of sending M to the center provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0114] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0115] In view of the problems existing in the prior art, the present invention provides an IBC-PKI human-machine control interaction method based on the national secret algorithm. The present invention is described in detail below in conjunction with the accompanying drawings.
[0116] like Figure 1-Figure 2 As shown, the IBC-PKI human-machine control interaction method based on the national secret algorithm provided in the embodiment of the present invention includes the following steps:
[0117] S101, user A authorizes device A and obtains user B's random number and device ID; user A authorizes and generates instructions;
[0118] S102, device A performs transmission protection on the instruction;
[0119] S103, device B interprets the instruction; device B displays the interpreted content to user B, user B checks the interpreted content, and authorizes device B to respond.
[0120] Before user A authorizes device A according to an embodiment of the present invention, the following steps are also included:
[0121] (1) The IoT management center initializes the symmetric key in the security device and sets an initial master key IMK, device root key and management center public key Pubc in the device security module before the device joins the network;
[0122] (2) The device is powered on, and according to the characteristics of the device, the device's software and hardware information is collected, and the collected hardware information is used as the device's characteristic information. The device security module calculates the device fingerprint based on the device characteristic information;
[0123] (3) Verify device access to the network, issue SM9 public parameters, and update device authentication keys.
[0124] In step (3), the device network access verification provided by the embodiment of the present invention includes:
[0125] First, the security module generates a random number R1; the security module generates the public and private key pair of the device owner,
[0126] Secondly, assemble the data request data NA_Req_data = device feature information || device fingerprint || holder public key || holder personal information;
[0127] Then, using R1 as the key, SM4 algorithm is used for encryption to obtain the ciphertext M1 = SM4 encryption (R1, NA_Req_data)
[0128] Furthermore, calculate the ciphertext M2 = SM2 Encryption (Pubc, R1); calculate MAC = SM4 MAC (IMK, M2||M1);
[0129] Finally, M=M2||M1||MAC; send M to the center.
[0130] In step (3), the SM9 public parameters provided by the embodiment of the present invention include:
[0131] 1) Receive information M, use IMK to verify MAC, MAC1 = SM4 decryption (IMK, M2||M1), compare RMAC and MAC1, if they are not equal, report an error and exit;
[0132] 2) Decrypt R1 using the central private key, R1 = SM2 decryption (central private key, M2);
[0133] 3) Decrypt NA_Req_data using R1, NA_Req_data = SM4 decryption (R1, M1);
[0134] 4) Read the device fingerprint from NA_Req_data. If the device fingerprint does not exist in the device library, continue to register the device. If the device already exists in the library, repeated network access is not allowed.
[0135] 5) The center issues a user public key certificate PubCert_user to the holder; the center generates a unique identification ID for this device;
[0136] 6) The center extracts the SM9 parameter ciphertext = SM4 encryption (shareKey, SM9 parameter); the center generates a random number R2 and calculates Rkey = R1^R2;
[0137] 7) Calculate M1 = SM4 decryption (Rkey, shareKey); load M1 into 16-level register Q (the primitive polynomial is X 16 +X 5 +X 3 +X 2 +1);
[0138] 8) Order Where X i is the i-th byte of the device fingerprint from left to right;
[0139] 9) Shift register Q cyclically moves N times to obtain the confidentiality parameter
[0140] 10) The center calculates the device master key MK=SM4 encryption (device root key, device ID) and uses the device root key as the key to encrypt the device unique ID; wherein the device root key is generated in advance by the management and stored in the security device;
[0141] 11) The center calculates MK ciphertext = SM4 encryption (Rkey, device ID||MK) and encrypts device ID||MK using Rkey as the key;
[0142] 12) The center calculates MR2=SM4 encryption (R1, R2) and uses R1 as the key to encrypt R2; the center organizes the sending of the message P=MR2||MK ciphertext||confidentiality parameter X||SM9 parameter ciphertext||PubCert_use;
[0143] 13) Calculate MAC = SM4_MAC (IMK, P); 14) Transmit P||MAC to the terminal.
[0144] In step (3), the updating device authentication key provided by the embodiment of the present invention includes:
[0145] Step 1: Use IMK to verify MAC; use R1 to decrypt R2; calculate Rkey = R1^R2; use Rkey to decrypt device ID and MK;
[0146] The second step is to extract device features, calculate device fingerprints, and calculate the N value; And load it into the shift register Q, run it in reverse N beats, and get M1;
[0147] Step 3: Calculate shareKey = SM4 encryption (Rkey, M1); calculate SM9 parameters = SM4 decryption (shareKey, SM9 parameter ciphertext);
[0148] Step 4: Calculate Z1 = SM4 encryption (MK, R2); Calculate Z2 = SM2 signature (Pri_use, Z1); Send Z1||Z2, the center uses MK to decrypt Z1 to obtain R2 and compares it with the center's R2. If the comparison passes, it is determined that the confirmation information is correct, and if the comparison fails, it is determined that the confirmation information is wrong; verify the correctness of Z2 signature through the user's public key. If both verifications pass, the verification passes, and the network access process ends successfully. If one verification fails, the verification fails, and the network access process ends in failure.
[0149] In step S101, the authorization generation instruction provided by user A in the embodiment of the present invention includes:
[0150] (1.1) User A enters the PIN to unlock the user's private key in the device security module and the use rights of the device SM9.
[0151] (1.2) User A obtains the certificate and device ID of user B. User A can obtain the certificate and device ID of user B from the management center; or directly obtain the certificate and device ID of user B from user B through NFC or QR code.
[0152] (1.3) Obtain random number Rd from user B; user A generates instruction content information M;
[0153] (1.4) Calculate keyAB=ECDH(CertB,PriA); Calculate working key workKey=SM4 encryption(keyAB, instruction generation time TB);
[0154] (1.5) Calculate MC = SM4 encryption (workKey, Rd||M); Calculate signature = SM2 signature (user A private key, MC);
[0155] (1.6) Construct instruction content = MC||SM2 signature||A certificate.
[0156] In step S102, the device A provided by the embodiment of the present invention performs transmission protection on the instruction.
[0157] (2.1) Generate a random number R and use the SM9 private key of device A to sign the construction instruction content;
[0158] (2.2) Encrypt R using the ID of device B to obtain MR; let commandHeader = sender A device ID A || receiver B device ID B || generation time TB || expiration time TD
[0159] (2.3) Calculate command ciphertext = SM4 encryption (R, commandHeader); construct command = MR || command ciphertext || command content;
[0160] (2.4) Use the SM9 private key of device A to sign the instruction; send the instruction||instruction signature to B.
[0161] In step S103, the device B provided in the embodiment of the present invention interprets the instruction including:
[0162] (3.1) Verify the SM9 signature using the ID of device A;
[0163] (3.2) Use device B’s ID to decrypt MR and get commandHeader;
[0164] (3.3) Calculate keyAB = ECDH (CertA, PriB);
[0165] (3.4) Calculate the working key workKey = SM4 encryption (keyAB, instruction generation time TB);
[0166] (3.5) Use user A's certificate to verify sm2's signature;
[0167] (3.6) Calculate M = SM4 decryption (workKey, MC);
[0168] (3.7) Display M to user B. After obtaining user B’s authorization, device B responds.
[0169] like Figure 3-Figure 4 The IBC-PKI human-machine control interaction system based on the national secret algorithm provided in the embodiment of the present invention includes:
[0170] Internet of Things management center 1, user 3 and device 2;
[0171] User 3, used to generate instructions and authorize device execution;
[0172] IoT Management Center 1 is used to manage the correspondence between all users and their devices, generate and issue each user's SM2 certificate, and distribute SM9 co-opening parameters to each device;
[0173] Device 2 is provided with a security module; the security module is used to store and calculate device keys; generate and store user SM2 private key and public key certificate; store SM9 public parameters and provide encryption and decryption algorithms based on device ID; and store other types of keys.
[0174] The technical effects of the present invention are further described below in conjunction with specific embodiments.
[0175] Embodiment 1:
[0176] 1. IBC+PKI human-machine control instruction protection protocol based on national secret algorithm
[0177] 1.1. Human-computer interaction scenarios
[0178] Assume that Allice is going to visit Bob's home. Allic generates a command: "I'm here, please open the door", which is transmitted to Bob's access control system through the NFC on her mobile phone. The access control system prompts Bob, "Allice has arrived, do you want to open the door?" Bob agrees, and the door is automatically opened.
[0179] Such a life scenario is abstracted as follows:
[0180] like Figure 1 , user A generates a command and sends it to device B through device A. After device B interprets it, it is fed back to user B. After the user checks it, he authorizes device B to respond.
[0181] 1.2. System Logical Architecture
[0182] The Internet of Things Management Center (hereinafter referred to as the Center) is shown in the figure above. Its responsibilities are as follows:
[0183] Responsible for managing the correspondence between all persons and their devices, allowing one person to correspond to multiple devices, that is, user Ui—>{Ai0,Ai1,…Aim}, where 0 <i<n;0<j<m;
[0184] Responsible for generating and issuing SM2 certificates to each user;
[0185] Responsible for distributing SM9 co-opening parameters to each device;
[0186] The responsibilities of the equipment are as follows:
[0187] Each device is equipped with a security module, which has:
[0188] Device key storage and calculation capabilities;
[0189] Generate and store user SM2 private key and public key certificate;
[0190] Store SM9 public parameters and provide encryption and decryption algorithms based on device ID;
[0191] Store other types of keys.
[0192] 1.3 Equipment access constraints
[0193] The IoT management center initializes symmetric keys in the security device: IMK, shareKey, device root key, generates asymmetric keys for users, devices, and management center, generates device identification IDs, and dependent keys for protecting key issuance.
[0194] Before the device joins the network, the IoT management center will initially set an initial master key IMK (Initialmaster key), device root key and management center public key Pubc in the device security module to identify the source of the device.
[0195] 1.4 Network Access
[0196] 1.4.1 Generation of device fingerprint
[0197] When the device is powered on, the software and hardware information of the device is collected according to the characteristics of the device, such as CPU number, hard disk number, operating system version, IDs of certain key hardware, etc., as the characteristic information of the device, and the security module calculates the device fingerprint: device fingerprint F = SM3 (device characteristic information).
[0198] 1.4.2 Equipment Network Access Authentication
[0199] 1. The equipment completes the following tasks:
[0200] 1) The security module generates a random number R1;
[0201] 2) The security module generates the public and private key pair of the device owner,
[0202] 3) Assemble data request data NA_Req_data = device feature information || device fingerprint || owner public key || owner personal information;
[0203] 4) Using R1 as the key, SM4 algorithm is used for encryption, and the ciphertext M1 is obtained as SM4 encryption (R1, NA_Req_data).
[0204] 5) Calculate the ciphertext M2 = SM2 encryption (Pubc, R1);
[0205] 6) Calculate MAC = SM4 MAC (IMK, M2||M1);
[0206] 7)M=M2||M1||MAC
[0207] 8) Send M to the center
[0208] 1.4.3 Distribution of SM9 public parameters
[0209] The center receives the message M and does the following:
[0210] 1) Use IMK to verify MAC, MAC1 = SM4 decryption (IMK, M2||M1), compare MAC with MAC1, if they are not equal, report an error and exit. ;
[0211] 2) Decrypt R1 using the central private key, R1 = SM2 decryption (central private key, M2);
[0212] 3) Decrypt NA_Req_data using R1, NA_Req_data = SM4 decryption (R1, M1);
[0213] 4) Read the device fingerprint from NA_Req_data. If the device fingerprint does not exist in the device library, continue to register the device. If the device already exists in the library, repeated network access is not allowed.
[0214] 5) The center issues a user public key certificate, PubCert_user, to the holder;
[0215] 6) The center generates a unique identification ID for this device;
[0216] 7) The center extracts the SM9 parameter ciphertext = SM4 encryption (shareKey, SM9 parameter). The parameter ciphertext is pre-stored in the center, and the shareKey is updated regularly and has nothing to do with the device;
[0217] 8) The center generates a random number R2 and calculates Rkey=R1^R2;
[0218] 9) Calculate M1=SM4 decryption (Rkey, shareKey);
[0219] 10) Install M1 into 16-stage shift register Q (the primitive polynomial is X 16 +X 5 +X 3 +X 2 +1);
[0220] 11) Order Where Xi is the i-th byte of the device fingerprint from left to right. If N<=32, then N=the value of the N-th byte of the device fingerprint from left to right;
[0221] 12) Shift register Q cyclically moves N times to obtain the confidentiality parameter
[0222] 13) The center calculates the device master key MK=SM4 encryption (device root key, device ID) and uses the device root key as the key to encrypt the device unique ID; wherein the device root key is generated in advance by the management center and stored in the security device.
[0223] 14) The center calculates MK ciphertext = SM4 encryption (Rkey, device ID||MK) and encrypts device ID||MK using Rkey as the key.
[0224] 15) The center calculates MR2=SM4 encryption (R1, R2) and encrypts R2 using R1 as the key;
[0225] 16) The center organizes the sending of the message P = MR2 || MK ciphertext || confidentiality parameter X || SM9 parameter ciphertext || PubCert_use
[0226] 17) Calculate MAC = SM4_MAC (IMK, P);
[0227] 18) Send P||MAC to the terminal.
[0228] 1.4.4 Update of device authentication key
[0229] After receiving P||MAC, the device does the following:
[0230] 1) Verify MAC using IMK;
[0231] 2) Use R1 to decrypt R2;
[0232] 3) Calculate Rkey = R1^R2;
[0233] 4) Use Rkey to decrypt device ID and MK;
[0234] 5) Extract device features, calculate device fingerprints, and calculate N value;
[0235] 6) And load it into the shift register Q, run it in reverse N beats, and get M1;
[0236] 7) Calculate shareKey = SM4Encryption (Rkey, M1);
[0237] 8) Calculate SM9 parameters = SM4 decryption (shareKey, SM9 parameter ciphertext);
[0238] 9) Calculate Z1 = SM4 encryption (MK, R2);
[0239] 10) Calculate Z2 = SM2 signature (Pri_use, Z1); / / Pri_use user's private key
[0240] 11) Send Z1||Z2, the center uses MK to decrypt Z1 to obtain R2 and compares it with the center's R2. If the comparison is successful, it is determined that the confirmation information is correct. If the comparison fails, it is determined that the confirmation information is wrong. The correctness of the Z2 signature is verified by the user's public key. If both verifications pass, the verification passes and the network access process ends successfully. If one verification fails, the verification fails and the network access process ends in failure.
[0241] 1.4.5 Instruction protection protocol based on national secret algorithm
[0242] 1.4.5.1 Objectives
[0243] 1) User A uses his device A to generate an instruction and sends it to device B for execution.
[0244] 1.4.5.2 User A opens the device and authorizes
[0245] User A enters the PIN to unlock the user's private key in the device security module and the permission to use the device SM9.
[0246] 1.4.5.3 User A obtains User B's certificate and device ID
[0247] User A can obtain user B's certificate and device ID from the management center; or directly obtain user B's certificate and device ID from user B through NFC or QR code.
[0248] 1.4.5.4 User A authorizes the generation of instructions
[0249] 1) Obtain the random number Rd of user B; User A generates instruction content information M;
[0250] 2) Calculate keyAB = ECDH (CertB, PriA); / / PriA is user A's SM2 private key, CertB is user B's SM2 certificate;
[0251] 3) Calculate the working key workKey = SM4 encryption (keyAB, instruction generation time TB);
[0252] 4) Calculate MC = SM4 encryption (workKey, Rd||M);
[0253] 5) Calculate signature = SM2 signature (user A private key, MC);
[0254] 6) Construction instruction content = MC||SM2 signature||A certificate
[0255] 1.4.5.5 Device A performs transmission protection on instructions
[0256] 1) Generate a random number R
[0257] 2) Use the SM9 private key of device A to sign the construction instruction content
[0258] 3) Use the ID of device B to encrypt R and get MR
[0259] 4) Let commandHeader = sender A device IDA || receiver B device IDB || generation time TB || expiration time TD
[0260] 5) Calculate the command ciphertext = SM4 encryption (R, commandHeader)
[0261] 6) construct command = MR||command ciphertext||command content;
[0262] 7) Use the SM9 private key of device A to sign the instruction;
[0263] 8) Send the instruction||instruction signature to B;
[0264] 1.4.5.6 Device B interprets the command
[0265] 1) Verify the SM9 signature using the ID of device A;
[0266] 2) Use your own ID to decrypt MR and get commandHeader
[0267] 3) Calculate keyAB = ECDH (CertA, PriB); / / PriB is user B's SM2 private key, CertA is user A's certificate;
[0268] 4) Calculate the working key workKey = SM4 encryption (keyAB, instruction generation time TB);
[0269] 5) Use user A's certificate to verify sm2 signature
[0270] 6) Calculate M = SM4 decryption (workKey, MC)
[0271] 7) Display M to user B. After obtaining authorization from user B, device B responds.
[0272] Advantages of the present invention:
[0273] 1. Equipment network security
[0274] By verifying the MAC of the network access request information, the management center can be sure that the current network access device meets the predetermined requirements. By presetting the center certificate, the device management center certificate can be prevented from being replaced. The device random number R1 is encrypted and sent by the management center public key, and the management center random number R2 is encrypted and sent by R1. Therefore, Rkey has security and confidentiality characteristics.
[0275] SM9 shared parameters are encrypted only once with shareKey, and shareKey is the same for all devices. The generation of shareKey is the inverse process of the key dispersion algorithm, that is, any Rkey can find a dispersion parameter so that shareKey = SM4 encryption (Rkey, dispersion parameter) holds, therefore, dispersion parameter = SM4 decryption (Rkey, shareKey).
[0276] Based on the principle of primitive polynomials over finite fields, any register state can reach another specific state after a certain number of steps. Therefore, the dispersion parameter is regarded as a state, and a specific step length is calculated according to the characteristics of the fingerprint. The state after the mover rotates this step length is used as a confidentiality parameter. In this way, different devices have different confidentiality parameters. After moving a specific step length in reverse, the dispersion parameter of the same value can be obtained. The security of the confidentiality parameter has two points: one is to bind it with the device ID to prevent incorrect matching; the other is to be encrypted and sent, and this encryption is one-time one-key.
[0277] The confidentiality of the distributed parameters depends on the step length and the confidentiality parameters. The step length information is calculated and not reflected in the message. The calculation of the step length depends on the device fingerprint. This information is transmitted to the center using the digital envelope technology of the center's public key. Other security is effectively guaranteed. When the terminal processes, the step length is calculated in the security module. Therefore, the security of the step length is guaranteed to a certain extent.
[0278] 2. Security of instructions between people
[0279] Strong directivity: The present invention adopts SM2 ECDH algorithm to negotiate the master key of both parties AB, and disperses the working key to achieve the characteristic of one-time one-key. Only the recipient who has the private key can decrypt the instruction and execute it.
[0280] Strong credibility: A cannot deny having sent this instruction.
[0281] Non-replayability: After decryption, B verifies R2 and the validity period of the instruction, and deletes Rd after execution. If the instruction is executed repeatedly, the dual factors of Rd and the validity period will prevent the instruction from being executed again.
[0282] Uninterceptability: Since the instruction content is encrypted, anyone who intercepts the instruction cannot decrypt and execute it, and cannot extract a single piece of data from the ciphertext to reconstruct a new instruction.
[0283] 3. Anti-attack capability of instructions
[0284] 1) The instruction transmission between user A and user B uses the ECDH algorithm to ensure that both parties have a symmetric key keyAB that is closely related to their identities, ensuring that only user B who holds the private key can decrypt the instruction. Therefore, the reception of the instruction has exclusive credibility and can resist man-in-the-middle attacks. Other third parties cannot synthesize the correct keyAB with the certificate of A.
[0285] 2) When the instruction is transmitted, user B can verify the signature of user A of the instruction to ensure that the source of the instruction cannot be forged or tampered with.
[0286] 3) The working key is calculated through a decentralized algorithm that complies with financial standards to ensure that the instruction is transmitted once and for all.
[0287] 4) After each instruction is executed, device B will return a random number RD to device A. Device A will encrypt RD and send it to device B along with the instruction. In this way, device B will authenticate the identity of device A before executing the instruction. After the execution is completed, RD will be updated and overwritten. In this way, only device B can receive instructions from device A, which can effectively prevent attackers from replaying instructions.
[0288] 4) Since the data transmitted by the Internet of Things is not necessarily completely reliable, wrong data may appear. The random numbers RA, RB, and RD also play the role of testing the correctness of the current data in each stage of the process to prevent data loss.
[0289] 5) The time factor is used in the protocol to disperse the working key, which plays the role of one-time key.
[0290] 6) By establishing the expiration time, the B device can be required to forcibly update the RD, thereby ensuring that repeated replay of instructions is an invalid behavior.
[0291] 4. Security of transmission between devices A and B
[0292] The IBC device ID-based delivery method is used to enhance the transaction experience, which is more inclined to friendly instruction interaction. The delivery protection based on the SM9 algorithm ensures that the source of the confirmed data is credible. The digital envelope mechanism based on SM9 ensures that device A is sure that only device B can receive and decrypt the instruction header to obtain the generation time and complete the source of the instruction. Otherwise, any intermediate device cannot complete the decryption to obtain the generation time.
[0293] The above cases have been proven in the smart community application of a financial institution. They are used by owners to remotely open doors for visitors, realizing intelligent and secure communication among owners, mobile phones, access control systems, and visitors.
[0294] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered within the protection scope of the present invention.
Claims
1. A human-computer control interaction method, characterized in that: The human-machine control interaction method comprises: User A authorizes device A and obtains the random number, certificate and device ID of user B; after authorization, user A generates an instruction; Device A performs transmission protection on the instruction; Device B interprets the instruction; Device B displays the interpreted content to User B, User B checks the interpreted content and authorizes Device B to respond; Before user A authorizes device A, the following steps are also included: (1) The IoT management center initializes the symmetric key in the security device and sets an initial master key IMK, device root key and management center public key Pubc in the device security module before the device joins the network; (2) The device is powered on, and according to the characteristics of the device, the device's software and hardware information is collected, and the collected hardware information is used as the device's characteristic information. The device security module calculates the device fingerprint based on the device characteristic information; (3) Verify device access to the network, issue SM9 public parameters, and update device authentication keys; In step (3), 3.1 Specifically include: First, the security module generates a random number R1; the security module generates the public and private key pair of the device owner, Secondly, assemble the data request data NA_Req_data = device feature information || device fingerprint || holder public key || holder personal information; Then, using R1 as the key, SM4 algorithm is used for encryption to obtain the ciphertext M1 = SM4 encryption (R1, NA_Req_data) Furthermore, the ciphertext M2 is calculated as SM2 encrypted (Pubc, R1); MAC is calculated as SM4MAC (IMK, M2||M1); Finally, M=M2||M1||MAC; send M to the center; 3.2 Specifically include: 1) Receive information M, use IMK to verify MAC, MAC1 = SM4 encryption (IMK, M2||M1), compare MAC with MAC1, if they are not equal, report an error and exit; 2) Decrypt using the center private key to obtain R1, R1 = SM2 decryption (center private key, M2); 3) Decrypt using R1 to obtain NA_Req_data, NA_Req_data = SM4 decryption (R1, M1); 4) Read the device fingerprint from NA_Req_data. If the device fingerprint does not exist in the device library, continue to register the device. If the device already exists in the library, repeated network access is not allowed. 5) The center issues a user public key certificate PubCert_user to the holder; the center generates a unique identification ID for this device; 6) The center extracts the SM9 parameter ciphertext = SM4 encryption (shareKey, SM9 parameters); the center generates a random number R2 and calculates Rkey = R1^R2; shareKey is updated regularly and has nothing to do with the device; 7) Calculate M1=SM4 decryption (Rkey, shareKey); load M1 into 16-level register Q (the primitive polynomial is X16+X5+X3+X2+1); 8) Order Where Xi is the i-th byte of the device fingerprint from left to right; 9) Shift register Q cyclically moves N times, and we get 10) The center calculates the device master key MK=SM4 encryption (device root key, device ID) and encrypts the device unique ID using the device root key as the key; 11) The center calculates MK ciphertext = SM4 encryption (Rkey, device ID||MK) and encrypts device ID||MK using Rkey as the key; 12) The center calculates MR2=SM4 encryption (R1, R2) and uses R1 as the key to encrypt R2; the center organizes the sending of the message P=MR2||MK ciphertext||confidentiality parameter X||SM9 parameter ciphertext||PubCert_user; 13) Calculate MAC = SM4_MAC (IMK, P); 18) Send P||MAC to the terminal; 3.3 Specifically include: Step 1: Use IMK to verify MAC; use R1 to decrypt MR2 to get R2; calculate Rkey = R1^R2; use Rkey to decrypt MK ciphertext to get device ID and MK; The second step is to extract the device features, calculate the device fingerprint, and calculate the N value; obtain the register value through the confidentiality parameter X and the device ID, and load it into the register Q, and run it in reverse for N beats to get M1; Step 3: Calculate shareKey = SM4 encryption (Rkey, M1); calculate SM9 parameters = SM4 decryption (shareKey, SM9 parameter ciphertext); The fourth step is to calculate Z1 = SM4 encryption (MK, R2); calculate Z2 = SM2 signature (Pri_use, Z1), where Pri_use is the user's private key; send Z1||Z2, the center uses MK to decrypt Z1 to obtain R2 and compare it with the center's R2. If the comparison passes, it is determined that the confirmation information is correct, and if the comparison fails, it is determined that the confirmation information is incorrect; verify the correctness of the Z2 signature through the user's public key. If both verifications pass, the verification passes and the network access process ends successfully; if one verification fails, the verification fails and the network access process ends in failure.
2. The human-computer control interaction method according to claim 1, characterized in that: The instructions generated after user A authorizes include: (1.1) Obtain the random number Rd of user B; User A generates instruction content information M; (1.2) Calculate keyAB = ECDH (CertB, PriA), where PriA is the SM2 private key of user A and CertB is the SM2 certificate of user B; calculate the working key workKey = SM4 encryption (keyAB, instruction generation time TB); (1.3) Calculate MC = SM4 encryption (workKey, Rd||M); Calculate signature = SM2 signature (user A private key, MC); (1.4) Construct instruction content = MC||SM2 signature||User A certificate.
3. The human-computer control interaction method according to claim 2, characterized in that: The device A performs transmission protection on the instruction including: (2.1) Generate a random number R and use the SM9 private key of device A to sign the construction instruction content; (2.2) Encrypt R using the ID of device B to obtain MR; let commandHeader = sender A device ID A || receiver B device ID B || command generation time TB || expiration time TD (2.3) Calculate command ciphertext = SM4 encryption (R, commandHeader); construct command = MR || command ciphertext || command content; (2.4) Use the SM9 private key of device A to sign the instruction; send the instruction||instruction signature to B.
4. The human-computer control interaction method according to claim 3, characterized in that: The device B interprets the instruction including: (3.1) Verify the SM9 signature using the ID of device A; (3.2) Use your own ID to decrypt MR to get R, and use R to decrypt the command ciphertext to get commandHeader; (3.3) Calculate keyAB = ECDH (CertA, PriB); (3.4) Calculate the working key workKey = SM4 encryption (keyAB, instruction generation time TB); (3.5) Verify SM2 signature using user A’s certificate; (3.6) Calculate RD||M=SM4 decryption (workKey, MC); (3.7) Display M to user B. After obtaining user B’s authorization, device B responds.
5. A human-computer control interaction system using the human-computer control interaction method according to any one of claims 1 to 4, characterized in that: The human-machine control interaction system comprises: IoT management center, users and devices; User, used to generate instructions and authorize device execution; The IoT management center is used to manage the correspondence between all users and their devices, generate and issue each user's SM2 certificate, and distribute SM9 co-opening parameters to each device; The device is provided with a security module; the security module is used to store and calculate device keys; generate and store user SM2 private keys and public key certificates; store SM9 public parameters and provide encryption and decryption algorithms based on device ID; and store other types of keys.
6. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the human-computer control interaction method according to any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the human-computer control interaction method according to any one of claims 1 to 4.
