A method, medium, and terminal for transmitting safety information from intelligent metering devices.
By classifying and separating security information into two files, encapsulating multiple keys, and selecting adaptive security archives, the problems of multi-market compatibility and information exposure in the transmission of security information of smart metering devices are solved. This enables efficient transmission of security information and full lifecycle traceability, and improves transmission security and anti-tampering capabilities.
Patent Information
- Application Number
- CN202611404284.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2046-09-10
AI Technical Summary
The lack of a unified security transmission framework for the secure information transmission of smart metering devices in existing technologies leads to incompatibility between multiple market delivery solutions, increased attack surface due to the coupling of security information and logistics information, excessive exposure of security information when third-party verification agencies are involved, imperfect transmission key management mechanism, unsound key traceability mechanism, and insufficient document integrity verification capability.
The method employs security information classification and dual-file separation, multi-layer key encapsulation and encryption, adaptive security profile selection and configuration, third-party verification agency security verification subset generation, multi-level integrity verification and digital signature, and full lifecycle key traceability. It establishes a relationship through device serial number, uses a cryptographically secure pseudo-random number generator to generate independent initialization vectors, adaptively selects encryption schemes, controls key exposure levels, generates independent verification files and transmits them through different channels, and establishes a full lifecycle traceability chain.
It achieves reduced costs for multi-market adaptation, minimizes the exposure of security information, enhances anti-tampering capabilities, improves security auditing and incident response capabilities, and enhances key isolation and transmission security.
Smart Images

Figure CN122933274B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent metering technology, and in particular relates to a method, medium and terminal for transmitting safety information of intelligent metering equipment. Background Technology
[0002] Smart metering devices (especially smart meters) are core terminal devices in Advanced Metering Infrastructure (AMI) systems, and their secure deployment directly impacts the information security of the entire smart grid. Before leaving the factory, the Key Management System (KMS) generates a set of security keys for each smart meter, including a MasterKey (MK), a Global Unicast Encryption Key (GUEK), an Authentication Key (AK), and a Broadcast Key (BK). These keys need to be securely transmitted from the manufacturer to the customer's Head End System (HES) or Key Management System upon meter delivery, enabling the customer's system to establish secure communication with the meter after deployment. This transmission process is typically achieved through a Shipment File.
[0003] The existing solutions have many shortcomings:
[0004] The lack of a unified secure transmission framework leads to high costs for adaptation across multiple markets. The European market uses non-XML Encryption standard XML format and RSA-2048+AES-256-CBC encryption schemes; the Southeast Asian market uses AES-128-GCM+RSA-OAEP scheme based on the XML Encryption standard; the Latin American market uses plain text format; and the South African market uses fixed-width ASCII format. These schemes are incompatible in terms of file format, encryption algorithm, key system, and signature mechanism, requiring manufacturers to maintain multiple independent sets of code and tools, increasing development, testing, and maintenance costs, and also raising the risk of secure information leakage due to human error.
[0005] The coupling of security and logistics information increases the attack surface. Device role keys (MK, GUEK, AK, BK) and device logistics information (serial number, batch number, communication module information, etc.) are mixed in the same XML file's Body / Shipment / Device_attributes structure. Although the key values are encrypted, metadata information such as the key's location, quantity, and type is visible to anyone who can access the file. In the Southeast Asian market solution, although SSF and LSF are separated, the EncryptedData in the SSF still embeds logistics information such as the device serial number. This coupling allows attackers to analyze the file structure to obtain the distribution characteristics of device security information, providing intelligence for targeted attacks.
[0006] The transmission key management mechanism is not robust enough, posing risks in intermediate stages. In existing schemes, the generation, use, and destruction of transmission keys (TKs) lack unified standards. For example, in European schemes, the IV (Instant Viaduct) increments by 1 sequentially within a single file; this predictable IV generation method reduces encryption strength. In some schemes, the random number generation of the TK does not explicitly require the use of CSPRNG, posing a risk of insufficient randomness. Furthermore, the TK is embedded in the file transmission immediately after encrypting the device key, lacking an additional layer of protection during transmission.
[0007] The involvement of third-party verification agencies leads to excessive exposure of security information. In the European scheme, the simplified Shipment File submitted to the verification agency, while retaining only the Master_key, still contains the complete encryption structure and transmission key information. During decryption, the verification agency can obtain the plaintext values of TK and MK, exceeding the scope required for verifying only the meter's secure communication function. Furthermore, the verification result file returned by the agency is also transmitted in its complete format, resulting in information redundancy.
[0008] The file integrity verification mechanism is simplistic and lacks sufficient anti-tampering capabilities. Some market solutions (such as those in Latin America and South Africa) completely lack file integrity verification mechanisms, making it impossible to detect tampering during transmission. While the European solution uses checksum files (containing SHA-256 digests and RSA signatures), the checksum files are transmitted separately from the main file, posing a risk of simultaneous replacement. Although the Southeast Asian market solution uses digital signatures, the signature and the signed content are in the same file, lacking physical isolation.
[0009] The key traceability mechanism is imperfect, and full lifecycle management is lacking. In existing solutions, there is a lack of a unified traceability identifier in each link of key generation, encryption, transmission and import. Although European solutions use SHA-1 fingerprints, they are only used for local verification, and a complete traceability chain from production to deployment has not been formed. Other solutions even lack any form of key traceability mechanism, making it difficult to locate the problematic link once a security incident occurs.
[0010] Therefore, how to overcome the above shortcomings of the prior art has become an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0011] In view of the deficiencies of the prior art, the purpose of the present invention is to provide a method for transmitting security information of smart metering equipment, so as to solve the technical problems in the prior art that the lack of a unified, secure and low-exposure transmission framework leads to incompatible multi-market delivery solutions, the coupling of security information and logistics information increases the attack surface, and the security information is excessively exposed when a third-party verification institution participates; in addition, the present invention also provides a transmission medium and a terminal for security information of smart metering equipment.
[0012] In order to solve the above technical problems, the present invention adopts the following technical solution:
[0013] In a first aspect, the present invention provides a method for transmitting security information of smart metering equipment, comprising the following steps:
[0014] S10. Security information classification and dual-file separation: Before the delivery of smart metering equipment from the factory, the key management system classifies the information of each equipment into two major categories: security sensitive information and logistics information; generating a security delivery file from the security sensitive information, and generating a logistics delivery file from the logistics information, where the security delivery file and the logistics delivery file are two physically independent files, and an association relationship is established through the equipment serial number;
[0015] S20. Multi-layer key encapsulation and encryption: The security sensitive information in the security delivery file is encrypted and protected by adopting a multi-layer key encapsulation mechanism, including: randomly generating a transmission key by using a cryptographically secure pseudo-random number generator, where the transmission key includes a key value and an initialization vector; using the transmission key and the initialization vector independently generated by each device key, adopting a symmetric encryption algorithm to encrypt each role key of each device one by one to generate a ciphertext; asymmetrically encrypting the transmission key with the asymmetric public key provided by the customer to generate the ciphertext of the transmission key; calculating a digest for the plaintext value of each device key to generate a fingerprint of the key;
[0016] S30. Adaptive Security Profile Selection and Configuration: Multiple security profiles are preset, and the corresponding encryption scheme is automatically selected and configured according to the security requirements of the target market. The configuration parameters of the security profile include encryption algorithm identifier, key length, padding mode, digest algorithm, signature algorithm, file format, whether to enable dual file separation, whether to enable verification agency process, and verification agency key exposure level.
[0017] S40. Generation of Security Verification Subset by Third-Party Verification Agency: When a third-party verification agency is required to participate in verification, a subset of security information containing only the master key for each device is extracted from the complete security delivery document to generate a security verification subset file; an independent verification transmission key is generated for the verification subset file, and the verification transmission key is encrypted using the verification agency's asymmetric public key; the verification subset file is digitally signed using the manufacturer's private key; after the verification agency completes the verification, it returns a list of device serial numbers that failed verification, and the manufacturer removes the device records that failed verification from the delivery document accordingly, generating the final delivery document;
[0018] S50. Multi-level Integrity Verification and Digital Signature: An integrity verification mechanism is adopted, which includes: recalculating the fingerprint after decrypting the device key during the file parsing stage and comparing it with the fingerprint recorded in the file; calculating the digest value of the entire content of the secure delivery file, signing the digest value using the manufacturer's private key to generate a signature value; generating a verification file physically separate from the secure delivery file, the verification file containing the filename, file size, digest value, and manufacturer's public key of the secure delivery file, and the verification file and the secure delivery file are transmitted through different communication channels;
[0019] S60. Full Lifecycle Key Traceability: Establish a full lifecycle traceability chain for the security information of each device from generation to deployment, including traceability information for key generation, key encryption, file delivery, verification agency, and key import; all traceability information is associated through a unified traceability identifier, which includes the device serial number and production batch number, spanning the entire lifecycle of the key.
[0020] Furthermore, in S10, the security-sensitive information includes the device master key, global unicast encryption key, authentication key, broadcast key, advanced security authentication key, advanced security authentication GMAC key, and digital certificate; the logistics information includes the device serial number, logical device name, device type, device batch number, pallet number, box number, production date, hardware version, firmware version, software version, model code, system title, product code, communication type, communication parameters, time zone, and security mechanism type identifier; the logistics delivery document is a plaintext document and does not contain any key information; the secure delivery document does not contain any plaintext logistics information.
[0021] Furthermore, in S20, the key value of the transmission key is 256 bits, and the initialization vector is 128 bits; each device key is encrypted using its own independent initialization vector, which is independently generated by a cryptographically secure pseudo-random number generator; the symmetric encryption algorithm is the AES-256-CBC algorithm, using PKCS#7 padding mode; the asymmetric encryption algorithm is the RSA-2048 algorithm, using RSA PKCS#1 v1.5 padding mode; the encryption product of each device key includes the encrypted ciphertext and the initialization vector corresponding to the ciphertext, and the ciphertext is Base64 encoded and embedded in the XML structure of the secure delivery file; the fingerprint is a SHA-1 digest, which is stored together with the encrypted ciphertext in the secure delivery file.
[0022] Furthermore, for devices using carrier communication, if it is necessary to transmit the Pre-Shared Key parameter, an independent PSK transmission key is generated. The PSK transmission key contains a 256-bit key value and a 128-bit initialization vector, which is generated by a cryptographically secure pseudo-random number generator. The PSK value is encrypted using the AES-256-CBC algorithm using the PSK transmission key, and then the PSK transmission key is encrypted using the RSA-2048 algorithm using the PSK private public key provided by the customer. The encryption of the PSK transmission key uses an independent key system, which is isolated from the device key encryption.
[0023] Furthermore, in S30, multiple security profiles include advanced security profiles, standard security profiles, basic security profiles, and extensible security profiles. The advanced security profile employs an encryption scheme of RSA-2048 plus AES-256-CBC plus SHA-256 plus RSA digital signature to generate dual files—a secure delivery document and a logistics delivery document—as well as an independent verification file, supporting third-party verification processes. The standard security profile uses the XML Encryption standard, employing an AES-128-GCM plus RSA-OAEP encryption scheme to generate dual files—a secure delivery document and a logistics delivery document—in XML Encryption format, using S / MIME for overall encryption and then transmitting in DER format. The basic security profile uses a fixed-width text format, does not include key encryption, generates a logistics delivery document, and verifies file integrity using SHA-256 digests. The extensible security profile defines custom encryption algorithm combinations, key lengths, file formats, and security procedures through a configuration file.
[0024] Furthermore, in S40, the security verification subset file does not contain any information about the global unicast encryption key, authentication key, and broadcast key; the verification transmission key is independent of the transmission key used in the formal delivery document; the security verification subset file controls the range of security information that the verification agency can obtain through the verification agency key exposure level parameter, and the key exposure level parameter settings include exposing only the master key, exposing the fingerprints of the master key and other keys but not exposing the ciphertext, and not exposing any keys but only providing the device serial number.
[0025] Furthermore, in step S50, before importing the secure delivery file, the receiver first verifies whether the filename and size in the independent verification file match; then verifies the SHA-256 digest value; and finally verifies the digital signature inside the secure delivery file. After all verifications are successful, the key decryption and import operations are performed.
[0026] Furthermore, in S60, the traceability information for key generation records the device serial number, key type, SHA-1 fingerprint, generation timestamp, generating operator identifier, and production batch number; the traceability information for key encryption records the transmission key identifier, initialization vector value, encryption algorithm, encryption timestamp, client public key certificate serial number used, and encapsulation timestamp; the traceability information for file delivery records the filename, file SHA-256 digest, digital signature value, delivery timestamp, recipient identifier, and security file type of the securely delivered file; the traceability information for the verification agency records the filename, key exposure level, verification result return time, and list of verification failure devices of the verification subset file submitted to the verification agency; and the traceability information for key import records the device serial number, key fingerprint verification result, import timestamp, importing operator identifier, and system identifier.
[0027] In a second aspect, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described above.
[0028] Thirdly, the present invention also provides an electronic terminal, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to cause the terminal to perform the method described above.
[0029] Compared with existing technologies, the method, medium, and terminal for transmitting safety information of intelligent metering devices provided by this invention have at least the following advantages:
[0030] Existing technologies lack a unified, secure, and low-exposure delivery framework, leading to incompatibility between multi-market delivery solutions, increased attack surface due to the coupling of security and logistics information, and excessive exposure of security information when third-party verification agencies are involved. This invention addresses this by employing an adaptive security profile mechanism, providing a single method to cover the full spectrum of market demands, from fully encrypted (Europe), standard encrypted (Southeast Asia), to unencrypted (Latin America, South Africa). When adding a new market, only security profile parameters need to be configured, without modifying the core code, reducing the development workload for multi-market adaptation from "new project level" to "configuration file level." This invention uses a cryptographically secure pseudo-random number generator to independently generate random initialization vectors for each device key. In AES-CBC mode, predictable initialization vectors allow attackers to potentially infer the encryption relationship of subsequent ciphertexts through known plaintext attacks. Independent random initialization vectors ensure that the encryption of each ciphertext is completely independent, eliminating such attack vectors. The verification subset of this invention contains only the master key, uses the verification agency's independent public key to encrypt the independently transmitted key, and supports a "fingerprint-only, no ciphertext exposure" mode through key exposure level control parameters, further reducing the exposure of security information at the verification agency stage compared to existing technologies. In the three-layer verification of this invention, independent verification files are transmitted through different communication channels, achieving physical isolation. For an attacker to successfully tamper with the delivery file, they would need to simultaneously breach all three layers of verification mechanisms and replace files transmitted through two channels. Compared to the single verification mechanism of existing technologies, the anti-tampering capability is significantly enhanced. This invention uses a unified traceability identifier throughout the entire key lifecycle, recording only fingerprints and metadata (excluding plaintext) at all stages. In the event of a security incident, the problematic stage (generation, encryption, delivery, verification, or import) can be quickly located, significantly improving security auditing and incident response capabilities compared to existing technologies. This invention uses an independent transmission key TK_PSK and an independent public key to encrypt the PSK, achieving encrypted isolation between the PSK and the device key. Even if the transmission key of the device key is compromised, the PSK parameters remain independently protected, improving the isolation of security information compared to existing technologies. Attached Figure Description
[0031] To more clearly illustrate the solution of the present invention, a brief introduction will be given to the drawings used in the description of the embodiments below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0032] Figure 1 A flowchart illustrating a method for transmitting safety information in an intelligent metering device, as provided in an embodiment of the present invention.
[0033] Figure 2 This is a schematic diagram of a dual-file separation mechanism for a method of transmitting safety information of intelligent metering equipment provided in an embodiment of the present invention;
[0034] Figure 3(a) is a schematic diagram of device key encryption (first layer) in a multi-layer key encapsulation structure of a method for transmitting security information of a smart metering device provided in an embodiment of the present invention;
[0035] Figure 3(b) is a schematic diagram of the transmission key encapsulation (second layer) in the multi-layer key encapsulation structure of a method for transmitting security information of a smart metering device provided in an embodiment of the present invention;
[0036] Figure 4 An adaptive security profile selection flowchart for a method of transmitting security information of intelligent metering equipment provided in an embodiment of the present invention;
[0037] Figure 5 A flowchart of a third-party verification agency's verification process for a method of transmitting security information of intelligent metering equipment provided in an embodiment of the present invention;
[0038] Figure 6(a) is a flowchart of the first layer of the three-layer integrity verification process of a method for transmitting security information of a smart metering device provided in an embodiment of the present invention.
[0039] Figure 6(b) is a flowchart of the second layer of the three-layer integrity verification process of a method for transmitting security information of a smart metering device provided in an embodiment of the present invention.
[0040] Figure 6(c) is a flowchart of the third layer of the three-layer integrity verification process of a method for transmitting security information of a smart metering device provided in an embodiment of the present invention.
[0041] Figure 7 This is a full lifecycle traceability diagram of a method for transmitting safety information of intelligent metering equipment provided in an embodiment of the present invention. Detailed Implementation
[0042] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Preferred embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the invention.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0044] This invention provides a method for transmitting security information of smart metering devices, applied in the factory delivery process of smart metering devices (smart meters, data acquisition units (DCUs), communication modules, etc.). The method for transmitting security information of smart metering devices includes the following steps: S10, Security Information Classification and Dual-File Separation: Before the smart metering devices are delivered, the key management system classifies the information of each device into two categories: security-sensitive information and logistics information; security-sensitive information is used to generate a security delivery file, and logistics information is used to generate a logistics delivery file. The security delivery file and the logistics delivery file are two physically independent files, and their association is established through the device serial number; S20, Multi-layer Key Encapsulation Encryption: Security-sensitive information in secure delivery documents is protected using a multi-layered key encapsulation mechanism, including: randomly generating a transmission key using a cryptographically secure pseudo-random number generator, the transmission key containing a key value and an initialization vector; using the transmission key and an independently generated initialization vector for each device key, encrypting each role's key on each device individually using a symmetric encryption algorithm to generate ciphertext; using a customer-provided asymmetric public key to perform asymmetric encryption on the transmission key, generating ciphertext of the transmission key; calculating a digest of the plaintext value of each device key to generate the fingerprint of that key; S30, Adaptive Security Profile Selection and Configuration: Multiple security profiles are preset, automatically selecting and configuring based on the security requirements of the target market. Configure the corresponding encryption scheme. The security profile configuration parameters include encryption algorithm identifier, key length, padding mode, digest algorithm, signature algorithm, file format, whether to enable dual file separation, whether to enable the verification agency process, and the verification agency key exposure level. S40, Third-Party Verification Agency Security Subset Generation: When a third-party verification agency is required for verification, extract a subset of security information containing only the master key for each device from the complete security delivery document to generate a security verification subset file; generate an independent verification transmission key for the verification subset file, and encrypt the verification transmission key using the verification agency's asymmetric public key; digitally sign the verification subset file using the manufacturer's private key; after the verification agency completes the verification... The system returns a list of device serial numbers that failed verification. The manufacturer uses this list to remove the failed device records from the delivery file and generates the final delivery file. S50, Multi-level Integrity Verification and Digital Signature: An integrity verification mechanism is employed, including: decrypting the device key during the file parsing phase, recalculating the fingerprint, and comparing it with the fingerprint recorded in the file; calculating the digest value of the entire secure delivery file, signing the digest value using the manufacturer's private key to generate a signature value; and generating a verification file physically separate from the secure delivery file. The verification file contains the secure delivery file's filename, file size, digest value, and the manufacturer's public key. The verification file and the secure delivery file are transmitted through different communication channels.S60, Full Lifecycle Key Traceability: Establishes a full lifecycle traceability chain for the security information of each device, from generation to deployment, including key generation traceability, key encryption traceability, file delivery traceability, verification agency traceability, and key import traceability; all traceability information is associated through a unified traceability identifier, which includes the device serial number and production batch number, spanning the entire key lifecycle.
[0045] This invention addresses the problems in existing technologies, such as the lack of a unified, secure, and low-exposure delivery framework, which leads to incompatibility between multi-market delivery solutions, increased attack surface due to the coupling of security information and logistics information, and excessive exposure of security information when third-party verification agencies are involved.
[0046] To enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0047] This invention provides a method for transmitting safety information in smart metering devices, applied in the factory delivery process of smart metering devices (smart meters, data acquisition units (DCUs), communication modules, etc.), combined with... Figures 1 to 7 In this embodiment, the method for transmitting safety information of the intelligent metering device includes the following steps:
[0048] S10. Security Information Classification and Dual-File Separation: Before the smart metering equipment is delivered to the factory, the key management system classifies the information of each device into two categories: security-sensitive information and logistics information. Security-sensitive information is used to generate a security delivery file, and logistics information is used to generate a logistics delivery file. The security delivery file and the logistics delivery file are two physically independent files, and their association is established through the device serial number.
[0049] Specifically, in this embodiment, security-sensitive information includes: the device master key MK, the global unicast encryption key GUEK, the authentication key AK, the broadcast key BK, the HLS authentication key (hlssecret), the HLS GMAC key (hlsgmac), and related digital certificates (TLS certificate, key negotiation certificate, signing certificate, etc.). This information has high confidentiality requirements; its leakage would directly threaten the security of the device and its host AMI system. Logistics information includes: device serial number, logical device name, device type, device batch number, pallet number, box number, production date, hardware version, firmware version, software version, model code, system title, product code, communication type, communication parameters (IP address, port number, DLMS address, etc.), time zone, and security mechanism type identifier (e.g., HLS_5_GMAC, which only identifies the type and does not contain the key value). This information does not involve the key itself, but it still has a certain degree of commercial sensitivity.
[0050] Furthermore, in this embodiment, after classification, security-sensitive information and logistics information are generated into two independent files: a Secure Delivery File (SSF) and a Logistics Delivery File (LSF). The SSF contains only encrypted security information, while the LSF contains only plaintext logistics information. The two files are associated through the device serial number, but are physically stored and transmitted completely separately. This dual-file separation mechanism achieves complete physical isolation between security information and logistics information, reducing the exposure surface of security information. Even if an unauthorized party obtains the LSF, they cannot obtain any key information; and since the SSF does not contain any plaintext logistics information, even if an attacker obtains the SSF, they cannot associate it with the deployment location and communication parameters of the specific device.
[0051] S20. Multi-layer Key Encapsulation and Encryption: A multi-layer key encapsulation mechanism is used to encrypt and protect security-sensitive information in the secure delivery file. This includes: randomly generating a transmission key TK using a cryptographically secure pseudo-random number generator (CSPRNG), where TK contains a 256-bit key value and a 128-bit initialization vector (IV); generating a unique TK and IV for each SSF file. Unlike existing technologies where IVs increment by 1 for each key, this method uses an independent random IV for each device key. The IV is generated independently using the CSPRNG, eliminating the security risks associated with predictable IVs. Using the transmission key and the independently generated initialization vector for each device key, a symmetric encryption algorithm is used to encrypt each role's key for each device, generating ciphertext; the transmission key is then asymmetrically encrypted using a customer-provided asymmetric public key, generating ciphertext; a digest is calculated for the plaintext value of each device key, generating the fingerprint of that key.
[0052] Specifically, in this embodiment, the multi-layer key encapsulation and encryption are as follows:
[0053] Device Key Encryption (First Layer of Encryption): Using a TK and an IV independently generated for each device key, the AES-256-CBC algorithm (PKCS#7 padding mode) is used to encrypt each role key (MK, GUEK, AK, BK, etc.) of each device one by one. The encryption product of each device key includes the encrypted ciphertext (CipherValue) and the corresponding IV. The encrypted ciphertext is Base64 encoded and embedded in the SSF XML structure. The XML structure follows the W3C XML Encryption standard (xenc:EncryptedKey / xenc:CipherData / xenc:CipherValue), and each encryption key contains the following attributes: key type identifier (e.g., mk, guek, ak, bk, etc.), encryption algorithm identifier, referenced transport key identifier (transportKeyID), initialization vector (keyIV), and encrypted key value (key).
[0054] Transmission key encapsulation (second layer of encryption): Using the customer-provided RSA-2048 public key (distributed via an X.509 certificate), the TK is asymmetrically encrypted using the RSA PKCS#1 v1.5 padding algorithm to generate the ciphertext of the TK. This ciphertext is embedded in the Header / Security / Transport_key node of the SSF. Since only the customer possesses the corresponding RSA private key, even if the SSF file is intercepted, an attacker cannot decrypt it to obtain the TK, and therefore cannot decrypt the device key.
[0055] Key fingerprint generation: A SHA-1 digest is calculated for the plaintext value of each device key to generate a fingerprint (FingerPrint) for that key. The fingerprint does not contain the plaintext key information, but it can be used to verify the key's correctness in subsequent steps and to enable key traceability. The fingerprint is stored in the SSF along with the encrypted ciphertext.
[0056] In some other embodiments, the XML format of SSF and LSF can be replaced with JSON format (more lightweight in Web API scenarios) or Protocol Buffers binary format (more efficient in bandwidth-constrained scenarios). The checksum verification file can be replaced with a digital signature node embedded in the main file (sacrificing the advantage of physical isolation but simplifying file management).
[0057] Furthermore, this embodiment also includes PSK parameter encryption: For devices using carrier communication (PLC), if it is necessary to transmit PSK (Pre-Shared Key) parameters, an independent transmission key TK_PSK (256-bit Key + 128-bit IV, generated by CSPRNG) is generated. The PSK value is encrypted using AES-256-CBC using TK_PSK, and then TK_PSK is encrypted using RSA-2048 using the PSK private public key (Public_key_Customer_PSK) provided by the customer. The PSK encryption uses an independent key system, which is isolated from the device key encryption.
[0058] In some other embodiments, the AES-256-CBC algorithm used for device key encryption can be replaced with AES-256-GCM (providing integrated encryption and authentication), ChaCha20-Poly1305 (offering better performance on platforms without hardware AES acceleration), or SM4-CBC (using national cryptographic algorithms to meet compliance requirements in the domestic market). The RSA-2048 used for transport key encapsulation can be replaced with ECC (elliptic curve cryptography, such as P-256 curves, resulting in shorter keys for the same security strength) or SM2 (national cryptographic asymmetric encryption algorithm). SHA-1 fingerprints can be replaced with SHA-256 or SM3 digest algorithms to enhance security.
[0059] S30, Adaptive Security Profile Selection and Configuration: Multiple security profiles are preset. Based on the security requirements of the target market, the system automatically selects and configures the corresponding encryption scheme. Configuration parameters for the security profile include encryption algorithm identifier, key length, padding mode, digest algorithm, signature algorithm, file format, whether to enable dual file separation, whether to enable verification authority procedures, and the verification authority key exposure level. By reading the target market configuration, the system automatically selects the appropriate security profile and executes the corresponding encryption and file generation processes.
[0060] Specifically, in this embodiment, the encryption scheme includes:
[0061] Advanced Security Profile (Profile-A): Suitable for markets with the highest security requirements (such as the European market). Employs a complete encryption scheme of RSA-2048 + AES-256-CBC + SHA-256 + RSA digital signature, generating SSF + LSF dual files + an independent Checksum signature file, supporting third-party verification processes.
[0062] Standard Security Profile (Profile-B): Suitable for markets with high security requirements (such as Southeast Asia). It adopts the XMLEncryption standard, uses the AES-128-GCM + RSA-OAEP (MGF1-SHA256) encryption scheme, generates two files: SSF (XMLEncryption format) + LSF, uses S / MIME for overall encryption, and then converts them to DER format for transmission.
[0063] Basic Security Profile (Profile-C): Suitable for markets with low security requirements or no encryption requirements (such as Latin America and South Africa). It uses a fixed-width text format, does not include key encryption, but still generates an LSF file and verifies file integrity using SHA-256 digest. No SSF is generated under this profile (because the target market has no need for secure information transmission).
[0064] Extensible Security Profiles (Profile-X): Supports defining custom combinations of encryption algorithms, key lengths, file formats, and security procedures through configuration files to adapt to the specific needs of new markets in the future without modifying the core code.
[0065] In other embodiments, where SSF and Checksum files are transmitted through different communication channels, these channels can be alternatives such as SFTP + encrypted email, HTTPS API upload + SFTP, physical media (USB flash drive) delivery + SFTP, or blockchain-based evidence storage + SFTP. The key principle is that the two files are transmitted through physically or logically different channels to prevent single-point attacks from simultaneously replacing them.
[0066] In other embodiments, the security profile configuration method can be replaced by: automatic identification based on market code (automatically matching security profiles according to target country codes), automatic identification based on customer certificates (analyzing policy extension fields in customer X.509 certificates to determine security requirements), or dynamic acquisition based on server configuration (pulling the latest security profile configuration from the cloud server in real time).
[0067] S40. Generation of Security Verification Subset by Third-Party Verification Agency: When a third-party verification agency is required to participate in verification, a subset of security information containing only the master key for each device is extracted from the complete security delivery document to generate a security verification subset file (Verification Subset); an independent verification transmission key is generated for the verification subset file, and the verification transmission key is encrypted using the verification agency's asymmetric public key; the verification subset file is digitally signed using the manufacturer's private key; after the verification agency completes the verification, it returns a list of device serial numbers that failed verification, and the manufacturer removes the device records that failed verification from the delivery document accordingly, generating the final delivery document.
[0068] Specifically, in this embodiment, the process of generating the security verification subset file is as follows:
[0069] Subset content control: Extract a subset of security information for each device containing only the master key MK from the complete SSF. Unlike existing technologies, this method does not include any information (including encrypted ciphertext and fingerprints) of other role keys such as GUEK, AK, and BK in the subset file, minimizing the security information exposed to verification authorities.
[0070] Independent Transmission Key: Generate an independent transmission key TK_verify (different from the TK used in the official delivery documents) for the verification subset files. Encrypt TK_verify using the verification authority's RSA public key (instead of the client's public key) to ensure that only the verification authority can decrypt it.
[0071] Subset file signing: The verification subset file is RSA-2048 signed using the manufacturer's private key, and the verification authority can verify the authenticity of the file using the manufacturer's public key.
[0072] Verification result return: After the verification agency completes the verification, it returns a list of device serial numbers that failed the verification (containing only serial numbers and no key information). The manufacturer then removes the device records that failed the verification from the delivery documents and generates the final delivery documents.
[0073] Key Exposure Level Control: The key exposure level parameter (exposure_level) configured in the security profile for the verification agency can be set to "master_key_only" (expose only MK), "master_key_with_fingerprint" (expose the fingerprints of MK and other keys but not the ciphertext), or "none" (do not expose any keys, only provide the device serial number for the verification agency to test itself).
[0074] In other embodiments, the scheme that only includes the MK in the verification subset can be replaced by: only including a list of device serial numbers (the verification agency communicates directly with the device through its own system for verification, without requiring any keys), or including a fingerprint containing the MK and other keys (without ciphertext; the verification agency verifies fingerprint matching but does not decrypt the keys). The choice of alternative depends on the verification agency's verification capabilities and the security protocols between the two parties.
[0075] S50, Multi-layered Integrity Verification and Digital Signature: An integrity verification mechanism is adopted, which includes: recalculating the fingerprint after decrypting the device key during the file parsing stage and comparing it with the fingerprint recorded in the file; calculating the digest value of the entire content of the secure delivery file, signing the digest value with the manufacturer's private key to generate a signature value; generating a verification file that is physically separate from the secure delivery file, the verification file containing the file name, file size, digest value of the secure delivery file and the manufacturer's public key, and transmitting the verification file and the secure delivery file through different communication channels.
[0076] Specifically, in this embodiment, a three-level integrity verification mechanism is adopted, as follows:
[0077] The first layer is encrypted fingerprint verification: each encrypted device key is accompanied by its plaintext SHA-1 fingerprint. During the file parsing phase, the device key is decrypted, the SHA-1 fingerprint is recalculated, and compared with the fingerprint recorded in the file to verify that the key has not been tampered with during encryption and transmission.
[0078] The second layer is file-level digital signature: The SHA-256 algorithm is used to calculate the digest value (DigestValue) of the entire SSF file (Header and Body nodes), and the digest value is signed using the manufacturer's RSA-2048 private key to generate the signature value (SignatureValue). Simultaneously, an X.509 certificate embedding node (Signature / KeyInfo node) is generated within the file. The recipient uses the manufacturer's public key to verify the signature, confirming the authenticity of the file's origin and the integrity of its content.
[0079] The third layer consists of a separate checksum file: a checksum file is generated that is physically separate from the SSF file. This checksum file contains the SSF filename, file size, SHA-256 digest value (encrypted using the manufacturer's private key via RSA-2048), and the manufacturer's RSA public key (X.509 certificate format). The checksum file and the SSF are transmitted through different communication channels (e.g., the checksum file is transmitted via SFTP, and the SSF is transmitted via encrypted email), achieving physical isolation and preventing attackers from replacing both files simultaneously.
[0080] Before importing the SSF, the receiver performs three layers of verification: first, it verifies whether the filename and size in the independent verification file match; then, it verifies the SHA-256 digest value; and finally, it verifies the digital signature inside the SSF. Key decryption and import can only proceed after all three layers of verification pass.
[0081] S60, Full Lifecycle Key Traceability: Establish a full lifecycle traceability chain for the security information of each device from generation to deployment, including traceability information for key generation, key encryption, document delivery, verification agency, and key import; all traceability information is associated through a unified traceability identifier, which includes the device serial number and production batch number, spanning the entire lifecycle of the key.
[0082] Specifically, in this embodiment, the traceability information for key generation includes the device serial number, key type, SHA-1 fingerprint, generation timestamp, generation operator identifier, and production batch number recorded for each device's key during generation. The traceability information for key encryption includes the encryption parameters for each device's key: the TK identifier used, IV value, encryption algorithm, and encryption timestamp. The TK encapsulation record includes the client public key certificate serial number used and the encapsulation timestamp. The traceability information for file delivery includes the filename, file SHA-256 digest, digital signature value, delivery timestamp, recipient identifier, and security profile type for each SSF file. The traceability information for the verification agency includes the verification subset file information submitted to the verification agency: filename, key exposure level, verification result return time, and list of devices that failed verification. The traceability information for key import includes the device serial number, key fingerprint verification result, import timestamp, import operator identifier, and system identifier recorded by the client system when importing the key. All traceability information is associated with a unified traceability identifier (TraceID), which is generated by combining the device serial number and production batch number and persists throughout the key's entire lifecycle. The traceability information is stored in a separate traceability log file, which does not contain any plaintext keys, but only fingerprints and metadata information.
[0083] In some other embodiments, the independent storage of traceability log files can be replaced by: blockchain notarization (putting traceability information on the blockchain and using the immutability of the blockchain to enhance traceability credibility) or Trusted Platform Module (TPM) secure storage (using hardware security modules to protect traceability information).
[0084] This invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the methods in this embodiment.
[0085] This invention also provides an electronic terminal, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal performs any of the methods in this embodiment.
[0086] As will be understood by those skilled in the art, the computer-readable storage medium described in this embodiment allows for the implementation of all or part of the steps in the above method embodiments by computer program-related hardware. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0087] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver, and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication between them. The memory is used to store computer programs, the communication interface is used to perform communication, and the processor and the transceiver are used to run the computer programs, so that the electronic terminal performs the steps of the above method.
[0088] Compared with existing technologies, the methods, media, and terminals for transmitting security information of smart metering devices described in the above embodiments suffer from several drawbacks. Existing technologies lack a unified, secure, and low-exposure transmission framework, leading to incompatibility between multi-market delivery solutions, increased attack surface due to the coupling of security and logistics information, and excessive exposure of security information when third-party verification agencies are involved. This invention addresses these issues through an adaptive security profile mechanism, providing a single method to cover the full spectrum of market demands, from fully encrypted (Europe), standard encrypted (Southeast Asia), to unencrypted (Latin America, South Africa). When adding a new market, only security profile parameters need to be configured, without modifying the core code, reducing the development workload for multi-market adaptation from "new project level" to "configuration file level." Furthermore, this invention uses a cryptographically secure pseudo-random number generator to independently generate random initialization vectors for each device key. In AES-CBC mode, predictable initialization vectors allow attackers to potentially infer the encryption relationship of subsequent ciphertexts through known plaintext attacks. Independent random initialization vectors, however, ensure that the encryption of each ciphertext is completely independent, eliminating such attack vectors. The verification subset of this invention contains only the master key, uses an independent public key from the verification agency to encrypt the independent transmission key, and supports a "fingerprint-only, no ciphertext exposure" mode through key exposure level control parameters, further reducing the exposure of security information at the verification agency stage compared to existing technologies. In the three-layer verification of this invention, independent verification files are transmitted through different communication channels, achieving physical isolation. For an attacker to successfully tamper with the delivery file, they need to simultaneously break through all three layers of verification mechanisms and replace files transmitted through two channels. Compared to the single verification mechanism of existing technologies, the anti-tampering capability is significantly enhanced. This invention uses a unified traceability identifier throughout the entire key lifecycle, recording only fingerprints and metadata (excluding plaintext) at all stages. In the event of a security incident, the problematic stage (generation, encryption, delivery, verification, or import) can be quickly located, significantly improving security auditing and event response capabilities compared to existing technologies. This invention uses an independent transmission key TK_PSK and an independent public key to encrypt the PSK, achieving encrypted isolation between the PSK and the device key. Even if the transmission key of the device key is compromised, the PSK parameters remain independently protected, improving the isolation of security information compared to existing technologies.
[0089] Obviously, the embodiments described above are merely preferred embodiments of the present invention, and not all embodiments. The accompanying drawings illustrate preferred embodiments of the present invention, but do not limit the scope of the patent. The present invention can be implemented in many different forms; rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this invention.
Claims
1. A method for transferring security information of a smart metering device, characterized in that Includes the following steps: S10. Security Information Classification and Dual File Separation: Before the smart metering equipment is delivered from the factory, the key management system classifies the information of each device into two major categories: security sensitive information and logistics information. The security-sensitive information is used to generate a security delivery document, and the logistics information is used to generate a logistics delivery document. The security delivery document and the logistics delivery document are two physically independent documents, and their association is established through the device serial number. S20. Multi-layer key encapsulation and encryption: Security-sensitive information in the secure delivery file is encrypted using a multi-layer key encapsulation mechanism, including: randomly generating a transmission key using a cryptographically secure pseudo-random number generator, the transmission key containing a key value and an initialization vector; using the transmission key and the initialization vector independently generated for each device key, encrypting each role key of each device individually using a symmetric encryption algorithm to generate ciphertext; performing asymmetric encryption on the transmission key using an asymmetric public key provided by the customer to generate ciphertext of the transmission key; calculating a digest of the plaintext value of each device key to generate a fingerprint of the key; S30. Adaptive Security Profile Selection and Configuration: Multiple security profiles are preset, and the corresponding encryption scheme is automatically selected and configured according to the security requirements of the target market. The configuration parameters of the security profile include encryption algorithm identifier, key length, padding mode, digest algorithm, signature algorithm, file format, whether to enable dual file separation, whether to enable verification agency process, and verification agency key exposure level. S40. Generation of Security Verification Subset by Third-Party Verification Agency: When a third-party verification agency is required to participate in verification, a subset of security information containing only the master key for each device is extracted from the complete security delivery document to generate a security verification subset file; an independent verification transmission key is generated for the verification subset file, and the verification transmission key is encrypted using the verification agency's asymmetric public key; the verification subset file is digitally signed using the manufacturer's private key; after the verification agency completes the verification, it returns a list of device serial numbers that failed verification, and the manufacturer removes the device records that failed verification from the delivery document accordingly, generating the final delivery document; S50. Multi-level Integrity Verification and Digital Signature: An integrity verification mechanism is adopted, which includes: recalculating the fingerprint after decrypting the device key during the file parsing stage and comparing it with the fingerprint recorded in the file; calculating the digest value of the entire content of the secure delivery file, signing the digest value using the manufacturer's private key to generate a signature value; generating a verification file physically separate from the secure delivery file, the verification file containing the filename, file size, digest value, and manufacturer's public key of the secure delivery file, and the verification file and the secure delivery file are transmitted through different communication channels; S60. Full Lifecycle Key Traceability: Establish a full lifecycle traceability chain for the security information of each device from generation to deployment, including key generation traceability, key encryption traceability, file delivery traceability, verification agency traceability, and key import traceability; all traceability information is associated through a unified traceability identifier, which includes the device serial number and production batch number, spanning the entire lifecycle of the key.
2. The method of claim 1, wherein, In step S10, the security-sensitive information includes the device master key, global unicast encryption key, authentication key, broadcast key, advanced security authentication key, advanced security authentication GMAC key, and digital certificate; the logistics information includes the device serial number, logical device name, device type, device batch number, pallet number, box number, production date, hardware version, firmware version, software version, model code, system title, product code, communication type, communication parameters, time zone, and security mechanism type identifier; the logistics delivery document is a plaintext document and does not contain any key information; the secure delivery document does not contain any plaintext logistics information.
3. The method of claim 1, wherein the method further comprises: In step S20, the key value of the transmission key is 256 bits, and the initialization vector is 128 bits. Each device key is encrypted using its own independent initialization vector, which is independently generated by a cryptographically secure pseudo-random number generator. The symmetric encryption algorithm is AES-256-CBC, using PKCS#7 padding mode. The asymmetric encryption algorithm is RSA-2048, using RSA PKCS#1 v1.5 padding mode. The encryption product of each device key includes the encrypted ciphertext and the corresponding initialization vector. The ciphertext is Base64 encoded and embedded in the XML structure of the secure delivery file. The fingerprint is a SHA-1 digest, stored together with the encrypted ciphertext in the secure delivery file.
4. The method of claim 3, wherein, For devices using carrier communication, if it is necessary to transmit the Pre-Shared Key parameter, an independent PSK transmission key is generated. The PSK transmission key contains a 256-bit key value and a 128-bit initialization vector, which is generated by a cryptographically secure pseudo-random number generator. The PSK value is encrypted using the AES-256-CBC algorithm using the PSK transmission key, and then the PSK transmission key is encrypted using the RSA-2048 algorithm using the PSK private public key provided by the customer. The encryption of the PSK transmission key uses an independent key system, which is isolated from the device key encryption.
5. The method of claim 1, wherein, In S30, various security profiles include advanced security profiles, standard security profiles, basic security profiles, and extensible security profiles. The advanced security profile uses an encryption scheme of RSA-2048 plus AES-256-CBC plus SHA-256 plus RSA digital signature to generate two files: a secure delivery file and a logistics delivery file, as well as an independent verification file, and supports third-party verification processes. The standard security profile uses the XML Encryption standard, employing an AES-128-GCM plus RSA-OAEP encryption scheme to generate two files: a secure delivery file and a logistics delivery file in XML Encryption format, which are then encrypted using S / MIME and transmitted in DER format. The basic security profile uses a fixed-width text format, does not include key encryption, generates a logistics delivery file, and verifies file integrity using SHA-256 digests. The extensible security profile defines custom encryption algorithm combinations, key lengths, file formats, and security procedures through a configuration file.
6. The method of claim 1, wherein, In step S40, the security verification subset file does not contain any information about the global unicast encryption key, authentication key, or broadcast key; the verification transmission key is independent of the transmission key used in the formal delivery document; the security verification subset file controls the range of security information that the verification agency can obtain through the verification agency key exposure level parameter, and the key exposure level parameter settings include exposing only the master key, exposing the fingerprints of the master key and other keys but not exposing the ciphertext, and not exposing any keys but only providing the device serial number.
7. The method of claim 1, wherein the method further comprises: In step S50, before importing the secure delivery file, the receiver first verifies whether the filename and size in the independent verification file match; then verifies the SHA-256 digest value; and finally verifies the digital signature inside the secure delivery file. After all verifications are successful, the key decryption and import operations are performed.
8. The method of claim 1, wherein, In step S60, the key generation traceability record includes the device serial number, key type, SHA-1 fingerprint, generation timestamp, generation operator identifier, and production batch number; the key encryption traceability record includes the transmission key identifier, initialization vector value, encryption algorithm, encryption timestamp, customer public key certificate serial number used, and encapsulation timestamp; the file delivery traceability record includes the file name, file SHA-256 digest, digital signature value, delivery timestamp, recipient identifier, and security file type of the securely delivered file; the verification agency traceability record includes the file name, key exposure level, verification result return time, and list of verification failure devices of the verification subset file submitted to the verification agency; and the key import traceability record includes the device serial number, key fingerprint verification result, import timestamp, import operator identifier, and system identifier.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 8.
10. An electronic terminal, characterized in that include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to cause the terminal to perform the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Media data encryption method, system, device and storage medium
CN109067814A
Systems and Methods for Secure Transaction Management and Electronic Rights Protection
US20110197285A1
