Key injection method and system and computer equipment
By generating quantum keys through a quantum key distribution system and combining them with a dual verification code mechanism, the security issues in the controller key transmission process are resolved, ensuring the security and integrity of the controller key and improving the security of vehicle controller software upgrades.
Patent Information
- Application Number
- CN202511345249.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, when transmitting controller keys between the Manufacturing Execution System (MES) and the Key Infrastructure System (PKI), there is a problem that the security of controller key leakage is difficult to guarantee.
By generating quantum keys using a quantum key distribution system and performing encryption and decryption operations between the manufacturing system and the key base system, the security of the controller key during transmission is ensured. The physical non-cloning property of quantum keys and the mathematical irreversibility of the encryption process are combined with a dual verification code mechanism to ensure the integrity and authenticity of the controller key.
This improves the security of the controller key, prevents its leakage during transmission, ensures the authenticity and integrity of the software upgrade package, and enhances the security of the vehicle controller.
Smart Images

Figure CN120979657A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, and in particular to a key injection method, system and computer device. Background Technology
[0002] Over-the-Air (OTA) technology is a method for remotely upgrading a vehicle's software system via mobile communication networks or Wi-Fi. When the software program in the vehicle's controller needs an upgrade, the user first performs a software update check, and the vehicle connects to the OTA server. If a new version of the controller's software program is detected, the vehicle downloads the software upgrade package from the OTA server, installs the upgrade package after download, and thus completes the software upgrade service.
[0003] After receiving the software upgrade package, the vehicle's controller needs to verify the package using its internally stored controller key to ensure its authenticity. This controller key is obtained by the manufacturing system (MES) from the key base system (PKI) during vehicle production and then written into the vehicle's controller. Currently, the security of the controller key is difficult to guarantee during transmission between the MES and PKI, posing a risk of key leakage. Summary of the Invention
[0004] Therefore, it is necessary to provide a key injection method, system, and computer device to address the aforementioned technical problems.
[0005] In a first aspect, this application provides a key injection method applied to a manufacturing system. The method includes: sending a key request to a key base system, causing the key base system to request a quantum key from a quantum key distribution system and obtain the quantum key generated by the quantum key distribution system; obtaining the quantum key generated by the quantum key distribution system; obtaining encryption key information transmitted by the key base system; the encryption key information being obtained by the key base system encrypting a controller key based on the quantum key; decrypting the encryption key information using the quantum key to obtain the controller key, and injecting the controller key into a target controller.
[0006] In one embodiment, the key request is used to instruct the key base system to request a quantum key from the quantum key distribution system, so that the first quantum key distribution device and the second quantum key distribution device of the quantum key distribution system generate quantum keys respectively through a quantum channel, the first quantum key distribution device sends the quantum key to the key base system, and the second quantum key distribution device sends the quantum key to the manufacturing system.
[0007] In one embodiment, the encryption key information is obtained by the key base system splitting the quantum key into a first key and a first initial vector, and encrypting the controller key using the first key and the first initial vector; the controller key is obtained by the key base system by looking up a table based on the vehicle identifier and controller identifier indicated in the key request.
[0008] In one embodiment, the step of decrypting the encryption key information using the quantum key to obtain the controller key includes: splitting the quantum key into a second key and a second initial vector; and decrypting the encryption key information using the second key and the second initial vector to obtain the controller key.
[0009] In one embodiment, the method further includes: obtaining a first message verification code transmitted by the key base system; the first message verification code is obtained by the key base system performing a verification code operation on the controller key based on the quantum key; performing a verification code operation on the controller key using the second key to obtain a second message verification code; performing verification code verification based on the first message verification code and the second message verification code; and if the verification code verification passes, injecting the controller key into the target controller.
[0010] Secondly, this application also provides a key injection method applied to a key infrastructure system. The method includes: in response to a key request sent by a manufacturing system, requesting a quantum key from a quantum key distribution system to enable the manufacturing system to obtain a quantum key generated by the quantum key distribution system; obtaining the quantum key generated by the quantum key distribution system; encrypting a controller key according to the quantum key to obtain encrypted key information; transmitting the encrypted key information to the manufacturing system to enable the manufacturing system to decrypt the encrypted key information using the quantum key to obtain a controller key, and injecting the controller key into a target controller.
[0011] In one embodiment, the method further includes: the key base system requesting a quantum key from the quantum key distribution system, so that a first quantum key distribution device and a second quantum key distribution device of the quantum key distribution system generate quantum keys respectively through a quantum channel; the first quantum key distribution device sends the quantum key to the key base system; and the second quantum key distribution device sends the quantum key to the manufacturing system.
[0012] In one embodiment, encrypting the controller key according to the quantum key to obtain encryption key information includes: obtaining the controller key by looking up a table based on the vehicle identifier and controller identifier indicated in the key request; splitting the quantum key into a first key and a first initialization vector; and encrypting the controller key using the first key and the first initialization vector to obtain the encryption key information.
[0013] In one embodiment, the method further includes: performing a verification code operation on the controller key using the first key to obtain a first message verification code; transmitting the first message verification code to the manufacturing system so that the manufacturing system performs a verification code operation on the controller key using the quantum key to obtain a second message verification code; performing verification code verification based on the first message verification code and the second message verification code; and injecting the controller key into the target controller if the verification code verification is successful.
[0014] Thirdly, this application also provides a key injection system, comprising: a key base system and a manufacturing system; the manufacturing system sends a key request to the key base system; the key base system, in response to the key request, requests a quantum key from a quantum key distribution system; the key base system obtains the quantum key generated by the quantum key distribution system, encrypts a controller key according to the quantum key, and obtains encrypted key information; transmits the encrypted key information to the manufacturing system; the manufacturing system obtains the quantum key generated by the quantum key distribution system and the encrypted key information transmitted by the key base system; decrypts the encrypted key information using the quantum key to obtain a controller key, and injects the controller key into a target controller.
[0015] Fourthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any one of the key injection methods described in the first and second aspects above.
[0016] The aforementioned key injection method, system, and computer equipment involve the manufacturing system sending a key request to the key base system, which then requests a quantum key from the quantum key distribution system. The key base system obtains the quantum key generated by the quantum key distribution system. The manufacturing system then obtains the encrypted key information obtained by the key base system through encrypting the controller key using the quantum key, and decrypts the encrypted key information using the quantum key to obtain the controller key, which is then injected into the target controller. The quantum key generated by the quantum key distribution system possesses resistance to quantum attacks. During controller key transmission, encryption of the controller key using the quantum key further enhances the security of the controller key and prevents its leakage. Attached Figure Description
[0017] Figure 1 This is a schematic diagram illustrating the application environment of the key injection method in one embodiment;
[0018] Figure 2 This is a flowchart illustrating a key injection method applied to a manufacturing system in one embodiment;
[0019] Figure 3 This is a flowchart illustrating a method for decrypting and determining a controller key in one embodiment;
[0020] Figure 4 This is a flowchart illustrating a verification code verification method in one embodiment;
[0021] Figure 5 This is a flowchart illustrating a key injection method applied to a key infrastructure system in one embodiment;
[0022] Figure 6 This is a flowchart illustrating a method for generating encryption key information in one embodiment;
[0023] Figure 7 This is a block diagram of a key injection system in one embodiment;
[0024] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0026] Vehicles typically include multiple vehicle controllers. For example, the vehicle's electronic and electrical systems are divided into different domains, each responsible for controlling specific vehicle functions. These domains include powertrain domain controllers, chassis domain controllers, cockpit domain controllers, autonomous driving domain controllers, and body domain controllers. The powertrain domain controller is responsible for the vehicle's drive, energy management, and power output control; the chassis domain controller is responsible for the vehicle's driving stability, handling, and safety; the cockpit domain controller is responsible for in-vehicle human-machine interface (HMI), infotainment, and digital experience; the autonomous driving domain controller is responsible for environmental perception, decision-making and planning, and autonomous driving execution; and the body domain controller is responsible for the centralized control of the vehicle's body electronics and comfort systems. In addition to the domain controllers mentioned above, there are also independent or dedicated controllers, such as gateway controllers, airbag controllers, and keyless entry controllers.
[0027] During vehicle use, software upgrades or fault detection of the vehicle controller are required. Software upgrades necessitate verification of the upgrade package using the corresponding controller key; similarly, external devices require verification using the corresponding controller key when connected to the vehicle controller. Therefore, each vehicle controller typically has multiple controller keys, each corresponding to a different function for verification. These controller keys are usually written into the corresponding vehicle controller by the Manufacturing Execution System (MES) during the vehicle manufacturing phase.
[0028] Taking a vehicle controller software upgrade as an example, Over-the-Air (OTA) technology is a technique that allows for remote wireless upgrades of a vehicle's software system via mobile communication networks or Wi-Fi. When the software program in the vehicle controller needs an upgrade, the user first performs a software update check, and the vehicle connects to the OTA server. When a new version of the software program in the vehicle controller is detected, the vehicle downloads the software upgrade package from the OTA server. After the download is complete, the software upgrade package is installed, thus completing the software upgrade service.
[0029] After receiving the software upgrade package, the vehicle controller needs to verify the package using its internally stored controller key to ensure its authenticity. This controller key is obtained by the manufacturing system (MES) from the key base system (PKI) during vehicle production and is then written into the vehicle's controller. Currently, the security of the controller key is difficult to guarantee during transmission between the MES and PKI, posing a risk of key leakage.
[0030] The embodiments of this application are applied to, for example, Figure 1 In the application environment shown, the key writing system includes: a manufacturing system, a quantum key distribution system, and a key infrastructure system.
[0031] The Manufacturing Execution System (MES) is a crucial system connecting an enterprise's upper-level planning and management system with its lower-level industrial control system. The main functions of an MES include production scheduling, process management, resource management, data acquisition and monitoring, and performance analysis. Production scheduling involves receiving production plans from the Enterprise Planning System (ERP) and breaking them down into work orders, then assigning these work orders to specific production lines or workstations. Process management defines the operational steps, parameters, and tooling used for each process. Resource management tracks material consumption, monitors equipment status, and manages maintenance plans. Data acquisition and monitoring collects equipment operating data through Supervisory Control and Data Acquisition (SCADA) systems, Programmable Logic Controllers (PLCs), and sensors. Performance analysis generates KPI reports such as production efficiency, yield, and downtime. The MES also writes the acquired controller keys into the corresponding vehicle controllers.
[0032] A quantum key distribution system includes a first quantum key distribution device and a second quantum key distribution device. Both the first and second quantum key distribution devices are QKD (Quantum Key Distribution Device) devices. QKD devices are hardware systems based on quantum mechanics principles that achieve secure key distribution and are a core component of quantum communication technology. QKD devices can generate and distribute secure symmetric keys between communicating parties; these generated symmetric keys maintain long-term security even against quantum computer attacks. The first and second quantum key distribution devices can generate quantum keys using protocols such as BB84.
[0033] Public Key Infrastructure (PKI) is a framework of technologies, policies, services, and management based on public-key cryptography. It aims to provide core security services such as confidentiality, integrity, authentication, and non-repudiation for scenarios including network communication, data storage, and identity authentication. Taking a vehicle controller software upgrade as an example, the PKI pre-obtains the verification public key from the OTA server. This verification public key corresponds to both the vehicle identifier and the controller identifier. When the Manufacturing Execution System (MES) obtains the verification public key for the corresponding vehicle controller, it retrieves the corresponding verification public key from the PKI, i.e., the controller key, and writes it to the vehicle controller. When the OTA server generates the software upgrade package, it digitally signs the package using its verification private key. After receiving the software upgrade package, the vehicle controller verifies the digital signature using its controller key. If the verification passes, the software upgrade package is considered authentic and valid, and the OTA upgrade is performed based on the software upgrade package.
[0034] When actually writing the controller key to the vehicle controller, the manufacturing system first sends a key request to the key base system. After receiving the key request, the key base system requests a quantum key from the quantum key distribution system. The quantum key distribution system generates a quantum key and sends it to both the manufacturing system and the key base system. Both the manufacturing system and the key base system receive the quantum key generated by the quantum key distribution system. The key base system encrypts the controller key using the quantum key, obtaining the encrypted key information, and transmits this encrypted key information to the manufacturing system. The manufacturing system obtains the encrypted key information, decrypts it using the quantum key, and obtains the controller key. The manufacturing system then writes the controller key to the corresponding target controller.
[0035] In one embodiment, such as Figure 2 As shown, a key injection method is provided, which is applied to a manufacturing system and includes the following steps:
[0036] Step 201: Send a key request to the key infrastructure system.
[0037] During vehicle manufacturing, when a controller key needs to be written to the target controller of the vehicle, a key request is first generated and sent to the key base system. The target controller can be any controller within the vehicle, such as a powertrain domain controller, chassis domain controller, cockpit domain controller, autonomous driving domain controller, body domain controller, gateway controller, airbag controller, or keyless entry controller. This embodiment does not specifically limit the type of target controller, only requiring that the target controller needs to have a controller key written to it. The manufacturing system determines the target controller for which a controller key needs to be written and generates a key request based on the vehicle identifier and controller identifier of the target controller. The vehicle identifier can be a code assigned by the manufacturer to uniquely identify the vehicle, such as a VIN code. The controller identifier can be the type of controller or the controller's own unique serial number, such as a hardware serial number or ECUID.
[0038] After receiving a key request, the key base system requests a quantum key from the quantum key distribution system and obtains the quantum key generated by the quantum key distribution system. The quantum key distribution system includes a first quantum key distribution device and a second quantum key distribution device. The first quantum key distribution device is connected to the key base system; the second quantum key distribution device is connected to the manufacturing system. Upon receiving the key request, the key base system sends a quantum key request to the first quantum key distribution device. The first and second quantum key distribution devices generate quantum keys synchronously, meaning the quantum keys generated by the first and second quantum key distribution devices are identical. For example, the first and second quantum key distribution devices can generate quantum keys via the BB84 protocol. After generating the quantum key, the first quantum key distribution device transmits the quantum key to the key base system, and the second quantum key distribution device transmits the quantum key to the manufacturing system.
[0039] Step 202: Obtain the quantum key generated by the quantum key distribution system.
[0040] After the manufacturing system sends a key request to the key base system, the key base system requests a quantum key from the quantum key distribution system, and the second quantum key distribution device transmits the generated quantum key to the manufacturing system.
[0041] Step 203: Obtain the encryption key information transmitted by the key base system.
[0042] The encryption key information is obtained by encrypting the controller key using a quantum key distribution device (QKD) via a key base system. After receiving the QKD transmitted from the first quantum key distribution device, the key base system encrypts the controller key using the QKD to obtain the encryption key information. Understandably, after receiving a key request, the key base system also needs to look up the corresponding controller key in its stored key management table using the vehicle identifier and controller identifier indicated in the key request. The key base system pre-stores controller keys corresponding to all vehicle identifiers and all controller identifiers. Upon receiving a key request, it can look up the corresponding controller key in the table based on the vehicle identifier and controller identifier carried in the key request. After obtaining the controller key and the QKD, the key base system encrypts the controller key using the QKD to obtain the encryption key information. The encryption algorithm used for the controller key can be a symmetric encryption algorithm such as AES or SM4. This embodiment does not limit the specific encryption algorithm, as long as it can be used to encrypt the controller key using the QKD. After generating the encryption key information, the key base system transmits the encryption key information to the manufacturing system. The manufacturing system obtains the encryption key information transmitted by the key base system.
[0043] Step 204: Decrypt the encryption key information using quantum key distribution to obtain the controller key, and then inject the controller key into the target controller.
[0044] After receiving the quantum key transmitted by the second quantum key distribution device and the encryption key information transmitted by the key base system, the manufacturing system decrypts the encryption key information using the quantum key to obtain the controller key. The decryption algorithm of the quantum key corresponds to the encryption algorithm used in the encryption key information, and can be a symmetric decryption algorithm such as AES or SM4. This embodiment does not limit the specific decryption algorithm, as long as it can be used to decrypt the encryption key information using the quantum key. After obtaining the controller key through decryption, the manufacturing system writes the controller key into the corresponding target controller.
[0045] The manufacturing system and the target controller can be connected directly or indirectly. A direct connection means the manufacturing system and the target controller are connected directly via wired or wireless means; an indirect connection means the manufacturing system and the target controller are connected through an intermediate device, such as the Vehicle Configuration and Testing System (VCATS). The manufacturing system can write the controller key into the target controller directly or indirectly.
[0046] In this embodiment, the manufacturing system sends a key request to the key base system, enabling the key base system to request a quantum key from the quantum key distribution system. The key base system then obtains the quantum key generated by the quantum key distribution system. The manufacturing system then obtains the encrypted key information obtained by the key base system through encrypting the controller key using the quantum key, and decrypts the encrypted key information using the quantum key to obtain the controller key, which is then injected into the target controller. The quantum key generated by the quantum key distribution system possesses resistance to quantum attacks. During controller key transmission, encryption of the controller key using the quantum key further enhances the security of the controller key and prevents its leakage.
[0047] This embodiment triggers the quantum key distribution process by sending a key request to the key base system, obtains the quantum key generated by the quantum key distribution system, further encrypts and protects the controller key with the quantum key and transmits it, and finally decrypts and recovers the controller key with the quantum key and injects it into the target controller. This means that the generation, transmission and storage of the key all adopt the combination of the physical non-cloning property of the quantum key and the mathematical irreversibility of the encryption process, thereby improving the security of the controller key and preventing the controller key from being leaked.
[0048] In one embodiment, a key request is used to instruct the key base system to request a quantum key from the quantum key distribution system, so that a first quantum key distribution device and a second quantum key distribution device of the quantum key distribution system generate quantum keys respectively through a quantum channel. The first quantum key distribution device sends the quantum key to the key base system, and the second quantum key distribution device sends the quantum key to the manufacturing system.
[0049] After receiving a key request, the key-based system sends a quantum key request to the first quantum key distribution device. The first and second quantum key distribution devices then generate quantum keys, respectively. The first and second quantum key distribution devices are connected via a quantum channel and a classical channel.
[0050] After receiving a quantum key request, the first quantum key distribution device generates a quantum key using its own quantum random number generator. The quantum random number generator (QRNG) is a device that utilizes the inherent randomness of quantum physics processes to generate truly random numbers. The random numbers generated by the quantum random number generator are unpredictable. The quantum random number generator generates a random number of a preset number of bits and uses this random number as the quantum key. The preset number of bits can be adjusted based on actual usage requirements; this embodiment does not impose a specific limitation.
[0051] The first quantum key distribution device encodes the quantum key based on a preset quantum coding basis using a single-photon polarization encoder, and then transmits the encoded quantum key to the second quantum key distribution device through a quantum channel. The single-photon polarization encoder is a quantum state conversion device that maps the bits of the quantum key to the polarization direction of photons. This device can be implemented using a combination of a laser source and a polarization controller. The preset quantum coding basis can be either a rectangular coding basis or a diagonal coding basis. When the preset quantum coding basis is a rectangular coding basis, the photon polarization directions are horizontal and vertical, with horizontal polarization representing a bit value of 0 and vertical polarization representing a bit value of 1. When the preset quantum coding basis is a diagonal coding basis, the photon polarization directions are +45° and -45°, with +45° polarization representing a bit value of 0 and -45° polarization representing a bit value of 1. The first quantum key distribution device can choose either a rectangular or diagonal coding basis as its preset quantum coding basis. Based on a preset quantum coding basis, the quantum key is encoded using a single-photon polarization encoder. For example, a laser source is controlled to generate single photons. The polarization direction is selected according to each bit value of the quantum key and the preset quantum coding basis. A polarization controller then polarizes the single photons to obtain an encoded photon sequence, which is used as the encoded quantum key. For instance, when the preset quantum coding basis is a right-angle coding basis, bit 0 is encoded as a horizontally polarized photon, and bit 1 is encoded as a vertically polarized photon; when the preset quantum coding basis is a diagonal coding basis, bit 0 is encoded as a photon polarized at +45 degrees, and bit 1 is encoded as a photon polarized at -45 degrees. After obtaining the encoded quantum key, it is transmitted to a second quantum key distribution device via a quantum channel.
[0052] The first quantum key distribution device transmits a preset quantum encoding basis to the second quantum key distribution device through a classical channel. Since the first and second quantum key distribution devices need to use a unified quantum encoding basis, the first quantum key distribution device also needs to transmit the preset quantum encoding basis to the second quantum key distribution device through a classical channel.
[0053] The second quantum key distribution device uses a single-photon polarization decoder to decode the encoded quantum key based on a preset quantum coding basis, thus obtaining the quantum key. The single-photon polarization decoder can be an optical device including a polarization beam splitter, waveplate, and detector array, used to analyze the photon polarization state. The single-photon polarization decoder can select the quantum coding basis by adjusting the polarization analysis direction. For example, a quarter-wave plate or half-wave plate can be used to change the optical axis angle to match a right-angle coding basis or a diagonal coding basis. For instance, after receiving the encoded quantum key, the polarization analysis direction is selected based on the preset quantum coding basis. When the preset quantum coding basis is a right-angle coding basis, the horizontal polarization of the photon is decoded as a bit value 0, and the vertical polarization of the photon is decoded as a bit value 1; when the preset quantum coding basis is a diagonal coding basis, the +45-degree polarization of the photon is decoded as a bit value 0, and the -45-degree polarization of the photon is decoded as a bit value 1. This decodes the quantum key.
[0054] After generating a quantum key, the first quantum key distribution device sends the quantum key to the key base system. After generating a quantum key, the second quantum key distribution device sends the quantum key to the manufacturing system.
[0055] This embodiment requests a quantum key from a quantum key distribution system via a key foundation system. This allows a first quantum key distribution device and a second quantum key distribution device to generate quantum keys and send them to the target system via a quantum channel. A dual-device distribution mechanism leverages the physical properties of the quantum channel to achieve key synchronization. Quantum key consistency is ensured through the generation and transmission of quantum states by the quantum key distribution devices. The non-eavesdropping nature of the quantum channel, combined with the collaborative operation of the key distribution devices, further enhances the security of the quantum key.
[0056] In one embodiment, the controller key is obtained by the key base system by looking up a table based on the vehicle identifier and controller identifier indicated in the key request.
[0057] After receiving a key request, the key base system needs to retrieve the vehicle identifier and controller identifier from the request. These identifiers indicate the corresponding target controller. The key base system pre-stores controller keys corresponding to all vehicle identifiers and all controller identifiers. After obtaining the vehicle identifier and controller identifier, it determines the corresponding controller key by looking up the corresponding identifier in a table. This controller key corresponds to the target controller. Identifier-based table lookup can be achieved by querying the pre-configured key database using a combination of the vehicle identifier and controller identifier. Furthermore, identifier-based table lookup can be implemented using SQL queries, key-value store lookups, and hash table quick location, thereby avoiding controller key injection errors.
[0058] In one embodiment, the encryption key information is obtained by the key base system splitting the quantum key into a first key and a first initial vector, and encrypting the controller key using the first key and the first initial vector.
[0059] After receiving the quantum key transmitted by the first quantum key distribution device, the key-based system needs to split the quantum key into a first key and a first initialization vector. Specifically, the bit length of the quantum key needs to be determined first, and then the quantum key is split according to this bit length. For example, if the quantum key is 512 bits long, the first 256 bits can be used as the first key, and the last 256 bits as the first initialization vector. If the quantum key is 300 bits long, the first key can be used from the first bit onwards for the next 256 bits, and the first initialization vector from the last bit onwards for the next 256 bits. The first key is used as the master key for the encryption algorithm to encrypt the controller key. The first initialization vector can be the start vector parameter of a symmetric encryption algorithm, used to prevent duplicate plaintext from generating identical ciphertext and enhance the randomness of the encryption process. The first key and the first initialization vector together constitute the parameter set of the encryption algorithm. This parameter set is used to encrypt the controller key, thereby obtaining the encryption key information. The encryption algorithm can be a symmetric encryption algorithm such as AES or SM4. This embodiment does not limit the specific encryption algorithm, as long as it can encrypt the controller key using the first key and the first initialization vector. Preferably, the encryption algorithm can be the AES256-GCM algorithm.
[0060] In one embodiment, such as Figure 3 As shown, a method for decrypting and determining the controller key is provided, which specifically includes the following steps:
[0061] Step 301: Split the quantum key into a second key and a second initial vector.
[0062] After receiving the quantum key transmitted by the second quantum key distribution device, the manufacturing system needs to split the quantum key into a second key and a second initialization vector. Specifically, the bit length of the quantum key needs to be determined first, and then the quantum key is split according to the bit length. For example, if the quantum key is 512 bits long, the first 256 bits can be used as the second key, and the last 256 bits as the second initialization vector. If the quantum key is 300 bits long, the second key can be used from the first bit onwards for the next 256 bits, and the second initialization vector from the last bit onwards for the next 256 bits. The second key is used as the master key for the decryption algorithm to decrypt the encrypted key information. The second initialization vector can be an initial offset parameter used in the decryption process, which can be used to eliminate pattern repetition in the encrypted data. The second key and the second initialization vector together constitute the parameter set of the decryption algorithm.
[0063] Understandably, the way the key-based system splits the quantum key to obtain the first key and the first initial vector is exactly the same as the way the manufacturing system splits the quantum key to obtain the second key and the second initial vector. When the quantum keys are the same, the first key and the second key are identical, and the first initial vector and the second initial vector are identical. Therefore, after the key-based system uses the first key and the first initial vector to encrypt the controller key to obtain the encrypted key information, the manufacturing system can use the second key and the second initial vector to decrypt the encrypted key information to obtain the controller key.
[0064] Step 302: Decrypt the encryption key information using the second key and the second initial vector to obtain the controller key.
[0065] The second key and the second initial vector together constitute the parameter set of the decryption algorithm. This parameter set is used to decrypt the encryption key information to obtain the controller key. The decryption algorithm can be a symmetric decryption algorithm such as AES or SM4; understandably, the encryption algorithm and its corresponding decryption algorithm are the same. Preferably, the decryption algorithm is the AES256-GCM algorithm.
[0066] This embodiment enhances the security of the controller key injection process by splitting the quantum key into an independent decryption key and an initialization vector. This requires the decryption process to simultaneously satisfy dual verification conditions for both the key and the initialization vector. Even if a branch parameter is leaked, the encrypted key information cannot be decrypted, further improving the security of the controller key.
[0067] In one embodiment, such as Figure 4 As shown, a verification code verification method is provided. Specifically, it includes the following steps:
[0068] Step 401: Obtain the first message verification code transmitted by the key base system.
[0069] The first message verification code is obtained by the key base system performing a verification code operation on the controller key using the quantum key. To ensure the authenticity and integrity of the controller key are not tampered with, the key base system can also perform a verification code operation on the controller key using the first key after splitting the quantum key to obtain a first key and a first initial vector, thus obtaining the first message verification code. The verification code operation can be an algorithm such as EAS-CMAC; this embodiment does not impose specific limitations, as long as it can generate a message verification code. After obtaining the first message verification code, the key base system sends it to the manufacturing system. The manufacturing system then receives the first message verification code transmitted by the key base system.
[0070] Step 402: Perform a verification code operation on the controller key using the second key to obtain the second message verification code.
[0071] After splitting the quantum key into a second key and a second initialization vector, the manufacturing system uses the second key to perform a verification code operation on the controller key to obtain a second message verification code. The verification code operation can be an algorithm such as EAS-CMAC; this embodiment does not impose specific limitations, only requiring the ability to generate a message verification code. It is understood that the algorithm for generating the first message verification code is exactly the same as the method for generating the second message verification code.
[0072] Step 403: Perform verification based on the first message verification code and the second message verification code. If the verification code verification is successful, inject the controller key into the target controller.
[0073] Since the algorithm for generating the first message verification code is exactly the same as the method for generating the second message verification code, and when the quantum key is the same, the first key and the second key are also exactly the same, if the controller key is the same, the generated first message verification code and the second message verification code will also be exactly the same. In this case, the verification code is verified by injecting the controller key into the target controller. If the first message verification code and the second message verification code are different, it indicates that there is an anomaly in the controller key transmission. In this case, the manufacturing system regenerates the key request and requests the controller key from the key base system.
[0074] This embodiment provides a first message verification code transmitted by the key base system, and a second message verification code obtained by performing verification code calculation on the controller key using the second key. Verification code verification is performed based on the first message verification code and the second message verification code. If the verification code verification is successful, the controller key is injected into the target controller. By introducing a dual verification code verification mechanism, integrity verification is performed during the controller key injection process, thereby ensuring that the controller key has not been tampered with and further ensuring the accuracy of the controller key.
[0075] Based on the same inventive concept, this application also provides a key injection method. This method is applied to a key infrastructure system. The solution provided by this method is similar to the implementation described in the key injection method applied to a manufacturing system. Therefore, the specific limitations of the key injection method applied to a key infrastructure system provided below can be found in the limitations of the key injection method applied to a manufacturing system described above. Figure 5 As shown, a key injection method is provided, which is applied to a key infrastructure system and includes the following steps:
[0076] Step 501: In response to the key request sent by the manufacturing system, request a quantum key from the quantum key distribution system.
[0077] During the vehicle manufacturing process, when it is necessary to write a controller key into the target controller of the vehicle, the manufacturing system first generates a key request and sends it to the key base system. The manufacturing system determines the target controller that needs to have its controller key written to, and generates a key request based on the vehicle identifier and controller identifier of the target controller.
[0078] After receiving a key request, the key base system requests a quantum key from the quantum key distribution system and obtains the quantum key generated by the quantum key distribution system. The quantum key distribution system includes a first quantum key distribution device and a second quantum key distribution device; the first quantum key distribution device is connected to the key base system, and the second quantum key distribution device is connected to the manufacturing system. Upon receiving the key request, the key base system sends a quantum key request to the first quantum key distribution device. The first and second quantum key distribution devices generate quantum keys synchronously, meaning the quantum keys generated by the first and second quantum key distribution devices are identical. For example, the first and second quantum key distribution devices can generate quantum keys via the BB84 protocol. After generating the quantum key, the first quantum key distribution device transmits the quantum key to the key base system, and the second quantum key distribution device transmits the quantum key to the manufacturing system.
[0079] Step 502: Obtain the quantum key generated by the quantum key distribution system.
[0080] The key base system requests a quantum key from the quantum key distribution system, and the first quantum key distribution device transmits the generated quantum key to the key base system.
[0081] Step 503: Encrypt the controller key using the quantum key to obtain the encryption key information.
[0082] After receiving the quantum key transmitted by the first quantum key distribution device, the key base system encrypts the controller key using the quantum key to obtain the encrypted key information. Understandably, after receiving a key request, the key base system also needs to look up the corresponding controller key in its stored key management table using the vehicle identifier and controller identifier indicated in the key request. The key base system pre-stores controller keys corresponding to all vehicle identifiers and all controller identifiers. Upon receiving a key request, it can determine the corresponding controller key by looking up the table based on the vehicle identifier and controller identifier carried in the key request. After obtaining the controller key and the quantum key, the key base system encrypts the controller key using the quantum key to obtain the encrypted key information. The encryption algorithm used for the controller key with the quantum key can be a symmetric encryption algorithm such as AES or SM4. This embodiment does not limit the specific encryption algorithm, as long as it can encrypt the controller key using the quantum key.
[0083] Step 504: The encryption key information is transmitted to the manufacturing system so that the manufacturing system can decrypt the encryption key information using the quantum key to obtain the controller key, and then inject the controller key into the target controller.
[0084] After generating the encryption key information, the key base system transmits it to the manufacturing system. Upon receiving the quantum key transmitted by the second quantum key distribution device and the encryption key information transmitted by the key base system, the manufacturing system decrypts the encryption key information using the quantum key to obtain the controller key. The decryption algorithm used by the quantum key corresponds to the encryption algorithm used in the encryption key information and can be a symmetric decryption algorithm such as AES or SM4. This embodiment does not limit the specific decryption algorithm, as long as it can be used to decrypt the encryption key information using the quantum key. After obtaining the controller key through decryption, the manufacturing system writes the controller key into the corresponding target controller.
[0085] This embodiment sends a key request through the key base system to trigger the quantum key distribution process, obtains the quantum key generated by the quantum key distribution system, further encrypts and protects the controller key with the quantum key and transmits it, and finally the manufacturing system decrypts and recovers the controller key with the quantum key and injects it into the target controller. This means that the generation, transmission and storage of the key all adopt the combination of the physical non-cloning property of the quantum key and the mathematical irreversibility of the encryption process, thereby improving the security of the controller key and preventing the controller key from being leaked.
[0086] In one embodiment, the key base system requests a quantum key from the quantum key distribution system, so that a first quantum key distribution device and a second quantum key distribution device of the quantum key distribution system generate quantum keys respectively through a quantum channel. The first quantum key distribution device sends the quantum key to the key base system, and the second quantum key distribution device sends the quantum key to the manufacturing system.
[0087] In one embodiment, such as Figure 6 As shown, a method for generating encryption key information is provided, which specifically includes the following steps:
[0088] Step 601: Based on the vehicle identifier and controller identifier indicated in the key request, look up the table to obtain the controller key.
[0089] After receiving a key request, the key base system needs to retrieve the vehicle identifier and controller identifier from the request. These identifiers indicate the corresponding target controller. The key base system pre-stores controller keys corresponding to all vehicle identifiers and all controller identifiers. After obtaining the vehicle identifier and controller identifier, it determines the corresponding controller key by looking up the corresponding identifier in a table. This controller key corresponds to the target controller. Identifier-based table lookup can be achieved by querying the pre-configured key database using a combination of the vehicle identifier and controller identifier. Furthermore, identifier-based table lookup can be implemented using SQL queries, key-value store lookups, and hash table quick location, thereby avoiding controller key injection errors.
[0090] Step 602: Split the quantum key into a first key and a first initial vector.
[0091] After receiving the quantum key transmitted by the first quantum key distribution device, the key-based system needs to split the quantum key into a first key and a first initialization vector. Specifically, the bit length of the quantum key needs to be determined first, and then the quantum key is split according to this bit length. For example, if the quantum key is 512 bits long, the first 256 bits can be used as the first key, and the last 256 bits as the first initialization vector. If the quantum key is 300 bits long, the first key can be used from the first bit onwards for the next 256 bits, and the first initialization vector can be used from the last bit onwards for the next 256 bits. The first key is used as the master key for the encryption algorithm to encrypt the controller key. The first initialization vector can be the start vector parameter of a symmetric encryption algorithm, used to prevent duplicate plaintext from generating identical ciphertext, thus enhancing the randomness of the encryption process.
[0092] Step 603: Encrypt the controller key using the first key and the first initial vector to obtain the encryption key information.
[0093] The first key and the first initialization vector together constitute the parameter set of the encryption algorithm. This parameter set is used to encrypt the controller key, thereby obtaining the encryption key information. The encryption algorithm can be a symmetric encryption algorithm such as AES or SM4. This embodiment does not limit the specific encryption algorithm, as long as it can encrypt the controller key using the first key and the first initialization vector. Preferably, the encryption algorithm can be the AES256-GCM algorithm.
[0094] After obtaining the quantum key and encryption key information, the manufacturing system splits the quantum key into a second key and a second initial vector, and decrypts the encryption key information using the second key and the second initial vector to obtain the controller key.
[0095] In one embodiment, to ensure the authenticity and integrity of the controller key are not tampered with, the controller key also needs to be verified. Specifically, this includes the following steps:
[0096] Step 1: Perform a verification code operation on the controller key using the first key to obtain the first message verification code.
[0097] After splitting the quantum key to obtain a first key and a first initial vector, the key-based system performs a verification code operation on the controller key using the first key to obtain a first message verification code. The verification code operation can be an algorithm such as EAS-CMAC; this embodiment does not impose specific limitations, as long as it can generate a message verification code.
[0098] Step 2: Transmit the first message verification code to the manufacturing system so that the manufacturing system can perform verification code calculation on the controller key using quantum key distribution to obtain the second message verification code; perform verification code verification based on the first message verification code and the second message verification code. If the verification code verification is successful, inject the controller key into the target controller.
[0099] After receiving the first message verification code, the key base system sends it to the manufacturing system. The manufacturing system, after splitting the quantum key into a second key and a second initialization vector, performs a verification code operation on the controller key using the second key to obtain the second message verification code. The verification code operation can be an algorithm such as EAS-CMAC; this embodiment is not specifically limited, as long as it can generate a message verification code. It is understood that the algorithm for generating the first message verification code is exactly the same as the method for generating the second message verification code. Since the algorithm for generating the first message verification code is exactly the same as the method for generating the second message verification code, and when the quantum key is the same, the first key and the second key are also exactly the same, if the controller key is the same, the generated first message verification code and the second message verification code will also be exactly the same. In this case, the verification code is verified by injecting the controller key into the target controller. If the first message verification code and the second message verification code are different, it indicates that there is an anomaly in the controller key transmission. The manufacturing system then regenerates the key request and requests the controller key from the key base system.
[0100] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0101] Based on the same inventive concept, this application also provides a key injection system. The solution provided by this system is similar to the solution described in the key injection method above. Therefore, the specific limitations of the key injection system provided below can be found in the limitations of the key injection method above, and will not be repeated in this embodiment.
[0102] like Figure 7As shown, a key injection system is provided, comprising: a key base system and a manufacturing system; the manufacturing system sends a key request to the key base system; in response to the key request, the key base system requests a quantum key from a quantum key distribution system; the key base system obtains the quantum key generated by the quantum key distribution system, encrypts the controller key according to the quantum key, and obtains encrypted key information; the encrypted key information is transmitted to the manufacturing system; the manufacturing system obtains the quantum key generated by the quantum key distribution system and the encrypted key information transmitted by the key base system; the encrypted key information is decrypted using the quantum key to obtain the controller key, and the controller key is injected into the target controller.
[0103] Specifically, the manufacturing system sends a key request to the key base system. Upon receiving the key request, the key base system requests a quantum key from the quantum key distribution system. The quantum key distribution system then sends the quantum key to both the manufacturing system and the key base system. After receiving the key request, the key base system searches for the controller key based on the vehicle identifier and controller identifier in the key request, then encrypts the controller key using the quantum key to obtain the encrypted key information, which is transmitted to the manufacturing system. The manufacturing system decrypts the encrypted key information using the quantum key to obtain the controller key, and then injects the controller key into the target controller.
[0104] In one specific embodiment, a specific key injection method is provided. The Manufacturing Execution System (MES) first requests the signature public key corresponding to the target controller from the Key Infrastructure System (PKI). Upon receiving the request, the PKI requests QKD device 1 to generate a 512-bit quantum random number, which is also the quantum key. Two QKD devices, QKD 1 and QKD 2, located in different data centers, simultaneously generate the same quantum random number. QKD device 1 sends the quantum random number to the Key Infrastructure System, and QKD device 2 sends the quantum random number to the Manufacturing Execution System. The PKI splits the 512-bit quantum key: the first 256 bits of the quantum random number are used as the symmetric key (first key); the last 256 bits are used as the IV (Initial Vector) of the symmetric algorithm (first initialization vector). The Manufacturing Execution System splits the 512-bit quantum key: the first 256 bits of the quantum random number are used as the symmetric key (second key); the last 256 bits are used as the IV (Initial Vector) of the symmetric algorithm (second initialization vector). The Key Infrastructure Infrastructure (PKI) system encrypts the controller key of the target controller using a first key and a first vector to obtain encrypted key information. This encryption uses the AES256-GCM algorithm. Simultaneously, to ensure the authenticity and integrity of the controller key, the PKI system uses the first key to apply the EAS-CMAC algorithm to the controller key to generate a first message verification code. The PKI system packages the encrypted key information and the first message verification code and sends them to the Manufacturing Execution System (MES). During packaged transmission, either the TLS 1.2 protocol or a plaintext transmission protocol can be used. The MES system decrypts the encrypted key information using a second key and a second initialization vector to obtain the controller key. It then uses the second key to apply the EAS-CMAC algorithm to the controller key to generate a second message verification code. If decryption is successful and the message verification code is verified, the controller key is injected into the target controller.
[0105] This embodiment achieves quantum attack resistance by simultaneously sending the first key and the first initialization vector, or simultaneously sending the second key and the second initialization vector, through a QKD device, thereby further reducing the probability of key renegotiation. Adding a message verification code to the controller key further enhances the protection of the controller key's integrity and authenticity.
[0106] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a key injection method applied to a manufacturing system or a key injection method applied to a key-based system.
[0107] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0108] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement any of the key injection methods described above, either applied to a manufacturing system or applied to a key infrastructure system.
[0109] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0110] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0111] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method of key injection, the method comprising: The method is applied to a production manufacturing system, and the method comprises: sending a key request to a key base system to make the key base system request a quantum key from a quantum key distribution system and obtain the quantum key generated by the quantum key distribution system; obtaining the quantum key generated by the quantum key distribution system; obtaining encrypted key information transmitted by the key base system; the encrypted key information is obtained by encrypting a controller key by the key base system according to the quantum key; decrypting the encrypted key information by the quantum key to obtain the controller key, and injecting the controller key into a target controller.
2. The method of claim 1, wherein the key request is used to instruct the key base system to request a quantum key from the quantum key distribution system, so that a first quantum key distribution device and a second quantum key distribution device of the quantum key distribution system generate quantum keys through a quantum channel respectively, the first quantum key distribution device sends the quantum key to the key base system, and the second quantum key distribution device sends the quantum key to the production manufacturing system.
3. The method of claim 1, wherein the encrypted key information is obtained by splitting the quantum key into a first key and a first initial vector by the key base system, and encrypting the controller key by the first key and the first initial vector; the controller key is obtained by the key base system based on a vehicle identifier and a controller identifier indicated in the key request. decrypting the encrypted key information by the quantum key to obtain the controller key comprises: splitting the quantum key into a second key and a second initial vector; 4. The method of claim 1, wherein, decrypting the encrypted key information by the second key and the second initial vector to obtain the controller key. The method further comprises: obtaining a first message verification code transmitted by the key base system; the first message verification code is obtained by performing a verification code operation on the controller key by the key base system according to the quantum key; 5. The method of claim 4, wherein, performing a verification code operation on the controller key by the second key to obtain a second message verification code; performing a verification code verification based on the first message verification code and the second message verification code, and injecting the controller key into a target controller if the verification code verification is passed. The method is applied to a key base system, and the method comprises: in response to a key request sent by a production manufacturing system, requesting a quantum key from a quantum key distribution system to make the production manufacturing system obtain a quantum key generated by the quantum key distribution system; 6. A method of key injection, the method comprising: obtaining the quantum key generated by the quantum key distribution system; encrypting a controller key according to the quantum key to obtain encrypted key information; transmitting the encrypted key information to the production manufacturing system to make the production manufacturing system decrypt the encrypted key information by the quantum key to obtain the controller key, and inject the controller key into a target controller. The method further comprises: 7. The method of claim 6, wherein, The key base system requests a quantum key from the quantum key distribution system, so that the first quantum key distribution device and the second quantum key distribution device of the quantum key distribution system generate quantum keys respectively through a quantum channel. The first quantum key distribution device sends the quantum key to the key base system, and the second quantum key distribution device sends the quantum key to the manufacturing system.
8. The method of claim 6, wherein, The step of encrypting the controller key using the quantum key to obtain the encryption key information includes: The controller key is obtained by looking up a table based on the vehicle identifier and controller identifier indicated in the key request; The quantum key is split into a first key and a first initial vector; The controller key is encrypted using the first key and the first initial vector to obtain the encryption key information.
9. The method of claim 8, wherein, The method further includes: The first message verification code is obtained by performing a verification code operation on the controller key using the first key. The first message verification code is transmitted to the manufacturing system, so that the manufacturing system can perform verification code calculation on the controller key using the quantum key to obtain the second message verification code; the verification code is verified based on the first message verification code and the second message verification code, and if the verification code verification is successful, the controller key is injected into the target controller.
10. A key injection system, characterized by, The key injection system includes: a key infrastructure system and a production and manufacturing system; The manufacturing system sends a key request to the key infrastructure system; In response to the key request, the key infrastructure system requests a quantum key from the quantum key distribution system; The key base system acquires the quantum key generated by the quantum key distribution system, encrypts the controller key according to the quantum key, and obtains the encryption key information; the encryption key information is then transmitted to the manufacturing system. The manufacturing system acquires the quantum key generated by the quantum key distribution system and the encryption key information transmitted by the key base system; it decrypts the encryption key information using the quantum key to obtain the controller key, and injects the controller key into the target controller. 11.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-10. When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-5 or 6-9.
Citation Information
Cited By
Receiving apparatus, transmitting apparatus, transmission system, receiving method and transmitting method
US12659068B2
Receiving apparatus, transmitting apparatus, transmission system, receiving method and transmitting method
US20240223298A1