Electronic voucher encryption transmission method based on national secret algorithm and dynamic key negotiation

CN122601176APending Publication Date: 2026-08-18JIANGXI SOGE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610692620.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-19
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0005]本发明提供基于国密算法与动态密钥协商的电子凭证加密传输方法,解决相关技术中多份电子凭证在批量传输过程中缺乏整体性加密绑定与高效核验机制、存在数据篡改风险及跨凭证一致性无法保障的技术问题

Benefits of technology

本发明提供了一种基于国密算法与动态密钥协商的电子凭证加密传输方法,解决了批量凭证密钥协商计算开销随凭证数量线性增长、属性级时效管理失控以及跨凭证共享字段一致性校验存在隐私暴露的技术问题,取得了以下技术效果:通过将多份凭证属性聚合为单一指纹并执行单次SM2密钥协商,使SM2椭圆曲线点运算次数降低至常数级别;通过为每个属性独立构造衰减密钥链并形成跨凭证属性级衰减密钥矩阵,实现了多凭证异构有效期场景下属性级独立时效控制;通过基于衰减密钥的加密态摘要异或归约机制生成跨凭证加密态一致性校验令牌,使接收方无需获取共享字段明文即可完成一致性验证,减少了隐私暴露面。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601176A_ABST
    Figure CN122601176A_ABST
Patent Text Reader

Abstract

The present application relates to the field of information security and cryptography technology, and discloses an electronic certificate encryption transmission method based on a national secret algorithm and dynamic key negotiation, which obtains multiple pieces of electronic certificate structured data and generates batch certificate aggregation attribute fingerprint; single SM2 dynamic key negotiation is performed to generate a batch shared basic session key; three-level key derivation is performed to construct an attribute-level attenuation key chain matrix; target transmission attributes are determined and cross-certificate encrypted state consistency check tokens are generated; single-attribute commitment and cross-certificate combined binding commitment are generated; SM4-GCM encryption transmission is performed; the receiver decrypts and performs time effectiveness, integrity and shared field consistency multidimensional verification; the present application reduces batch certificate key negotiation calculation overhead, realizes attribute-level independent time effectiveness control, and supports cross-certificate shared field consistency check in an encrypted state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of information security and cryptography, and more specifically, to a method for encrypted transmission of electronic credentials based on national cryptographic algorithms and dynamic key negotiation. Background Technology

[0002] In cross-domain encrypted transmission scenarios of electronic credentials, the sender needs to encrypt and transmit multiple electronic credentials (such as business licenses, qualification certificates, credit rating certificates, etc.) to the receiver for batch verification.

[0003] In existing technical solutions, the sender independently performs a complete SM2 key negotiation and key derivation process for each credential, and generates a unified decay key sequence with the overall validity period of the credential as the granularity; in terms of cross-credential shared field consistency verification, the receiver needs to decrypt the original text of the relevant fields in each credential and compare them one by one.

[0004] The aforementioned existing technologies have the following drawbacks: First, as the number of credentials increases, the number of SM2 elliptic curve operations increases linearly with the number of credentials, resulting in significant computational delays in batch transmission scenarios; Second, attributes in different credentials have differentiated independent validity periods, and a unified decay key sequence cannot independently control the validity period of individual attributes, posing a risk of loss of control over attribute-level validity management; Third, under selective disclosure requirements, the recipient must decrypt the original text of all relevant shared fields before performing a consistency comparison, increasing the privacy exposure surface. Summary of the Invention

[0005] This invention provides an encrypted transmission method for electronic credentials based on national cryptographic algorithms and dynamic key negotiation, which solves the technical problems in related technologies such as the lack of overall encryption binding and efficient verification mechanism, the risk of data tampering, and the inability to guarantee cross-credential consistency when multiple electronic credentials are transmitted in batches.

[0006] This invention discloses an encrypted transmission method for electronic vouchers based on national cryptographic algorithms and dynamic key negotiation, comprising: acquiring structured data of multiple electronic vouchers to be encrypted and transmitted in batches; calculating digests of each attribute value of each voucher using the SM3 hash algorithm; concatenating all digests according to the lexicographical order of voucher number and attribute identifier and performing SM3 operation to generate a batch voucher aggregated attribute fingerprint; performing a single SM2 dynamic key negotiation based on the sender's SM2 private key and the receiver's SM2 public key, using the batch voucher aggregated attribute fingerprint as an additional input to the key derivation function to generate a batch shared basic session key; and performing a three-level key derivation using the batch shared basic session key as the root key: concatenating the root key with each voucher number and performing SM3 operation to generate a voucher-level intermediate key, and then... The authentication-level intermediate key is concatenated with each attribute identifier and then subjected to SM3 operation to generate attribute-level seed keys. Each attribute-level seed key is concatenated with its corresponding attribute value and then subjected to SM3 operation to generate individual attribute commitments. All individual attribute commitments are concatenated with a one-time binding random number in lexicographical order and then subjected to SM3 operation to generate cross-credential combination binding commitments. The cross-credential combination binding commitments are used as additional input to the key derivation function to generate an encrypted transmission session key. The encrypted transmission session key is used to perform authentication encryption operations on the transmitted data, generating an encrypted transmission ciphertext packet and sending it to the receiver. The receiver recovers the encrypted transmission session key and decrypts the encrypted transmission ciphertext packet, recalculates each individual attribute commitment and the cross-credential combination binding commitment, compares them with the received commitments, and outputs batch verification results.

[0007] Furthermore, the generation of the batch shared basic session key also includes: obtaining the independent validity period parameter of each attribute of each voucher, arranging all validity period parameters in lexicographical order according to the voucher number and attribute identifier, and performing SM3 operation to generate a global validity period aggregate digest; using the global validity period aggregate digest and the batch voucher aggregate attribute fingerprint as additional inputs to the key derivation function to generate a batch shared basic session key containing validity period binding.

[0008] Furthermore, after the three-level key derivation, the method further includes: obtaining the independent validity period parameter for each attribute of each voucher; dividing the validity period of each attribute into an independent time window sequence according to a preset window granularity, wherein the total number of time windows is equal to the total validity period divided by the window granularity and rounded up; using the seed key at each attribute level as the end anchor point of the attenuation key chain, performing SM3 operations sequentially from the end to the start direction to generate the attenuation key sequence for each attribute; organizing the attenuation key sequences of all attributes of all vouchers into a cross-voucher attribute level attenuation key matrix, wherein the rows of the attenuation key matrix correspond to the combination of voucher number and attribute identifier, and the columns correspond to the time window number; when generating each single attribute commitment, extracting the attenuation key corresponding to each attribute in the current time window from the cross-voucher attribute level attenuation key matrix to replace the attribute level seed key in the commitment calculation.

[0009] Furthermore, the method for determining the current time window number is as follows: based on the start timestamp of the validity period of the attribute, calculate the difference between the current system timestamp and the start timestamp, divide the difference by the window granularity of the attribute, and round up to obtain the current time window number; when the current time window number exceeds the total number of time windows for the attribute, mark the attribute as expired and remove it from the target transmission attribute subset.

[0010] Furthermore, before generating the encrypted transmission ciphertext packet, the method further includes: scanning the field identifiers of all credentials, identifying field identifiers that exist simultaneously in two or more credentials, and generating a cross-credential shared field mapping table; for each shared field in the cross-credential shared field mapping table, obtaining the attribute value of the field in each credential and the corresponding current window attenuation key, concatenating the current window attenuation key with the field value and performing SM3 operation to generate the encrypted digest of the field in each credential; performing XOR reduction operation on the encrypted digests of the same shared field in all related credentials to generate a cross-credential encrypted consistency verification token for the shared field.

[0011] Furthermore, the XOR reduction operation is performed as follows: when the number of credentials containing the shared field is even, the encrypted digests of all related credentials are directly subjected to bitwise XOR reduction; when the number of credentials containing the shared field is odd, the first digest in the encrypted digest sequence is used as the base value, and the encrypted digest of each subsequent credential is subjected to bitwise XOR operation with the base value before reduction; when the attribute value of the shared field is consistent in all related credentials and the corresponding decay keys are valid, the cross-credential encrypted consistency verification token is zero.

[0012] Furthermore, the one-time binding random number is generated by a cryptographically secure pseudo-random number generator, and one is generated in each batch transmission request; the generation method of the cross-credential combination binding commitment is as follows: the single attribute commitments corresponding to the attributes that actually need to be transmitted in all credentials are concatenated with the one-time binding random number in lexicographical order of credential number and attribute identifier, and the concatenation result is subjected to SM3 operation.

[0013] Furthermore, the authentication encryption operation employs the SM4-GCM authentication encryption algorithm. The transmitted data includes: the cross-credential combination binding commitment, each individual attribute commitment, the current time window number of each attribute, the decay key chain verification path information, the one-time binding random number, the set of attribute values ​​to be transmitted, each cross-credential encrypted state consistency verification token, and the cross-credential shared field mapping table; the decay key chain verification path information includes the derivation steps between the current window number and the starting window number; the encrypted transmission ciphertext packet includes the ciphertext data output by SM4-GCM, the authentication tag, and the GCM initialization vector.

[0014] Furthermore, the receiver's output of batch verification results includes the following verification steps: For each transmission attribute, starting from its current window attenuation key, perform SM3 operations sequentially to derive the attenuation key of the first window. Compare the derivation result with the publicly announced commitment anchor point of the attribute published by the issuer in advance. If they match, the validity period of the attribute is verified. Recalculate each single attribute commitment using each attribute value and the corresponding attenuation key. Concatenate all recalculated single attribute commitments with the one-time binding random number in lexicographical order and perform SM3 operations to recalculate the cross-credential combination binding commitment. Compare this with the received cross-credential combination binding commitment. Check whether each cross-credential cryptographic consistency verification token is zero. When all attribute validity period verifications are passed, the cross-credential combination binding commitments are consistent, and all consistency verification tokens are zero, output the verification result as passed. Otherwise, output the verification failure result and the specific reason for failure.

[0015] This invention discloses an electronic credential encryption transmission system based on national cryptographic algorithms and dynamic key negotiation, comprising: an aggregate fingerprint generation module for acquiring structured data of multiple electronic credentials and generating batch credential aggregate attribute fingerprints using the SM3 hash algorithm; a key negotiation module for performing a single SM2 dynamic key negotiation based on the sender's SM2 private key and the receiver's SM2 public key, using the batch credential aggregate attribute fingerprints as additional input to the key derivation function to generate a batch shared basic session key; a three-level key derivation module for sequentially generating credential-level intermediate keys and attribute-level seed keys using the batch shared basic session key as the root key; a commitment generation module for generating individual attribute commitments and cross-credential combination binding commitments; an encrypted transmission module for generating an encrypted transmission session key and performing authentication encryption operations, generating an encrypted transmission ciphertext packet and sending it to the receiver; and a decryption verification module for the receiver to recover the encrypted transmission session key, decrypt the encrypted transmission ciphertext packet, recalculate and compare each commitment, and output the batch verification result.

[0016] The beneficial effects of this invention are as follows: This invention provides an encrypted transmission method for electronic credentials based on national cryptographic algorithms and dynamic key negotiation. It solves the technical problems of linearly increasing computational overhead for batch credential key negotiation with the number of credentials, uncontrolled attribute-level validity management, and privacy exposure in cross-credential shared field consistency verification. The method achieves the following technical effects: by aggregating multiple credential attributes into a single fingerprint and performing a single SM2 key negotiation, the number of SM2 elliptic curve point operations is reduced to a constant level; by independently constructing a decaying key chain for each attribute and forming a cross-credential attribute-level decaying key matrix, attribute-level independent validity control is achieved in scenarios with heterogeneous validity periods for multiple credentials; and by generating a cross-credential encrypted state consistency verification token through an XOR reduction mechanism based on the decaying key's encrypted digest, the receiver can complete consistency verification without obtaining the plaintext of shared fields, reducing the privacy exposure surface. Attached Figure Description

[0017] Figure 1 This is a flowchart of the electronic credential encryption transmission method based on national cryptographic algorithms and dynamic key negotiation according to the present invention; Figure 2 This is a distribution diagram of the independent validity periods of each attribute of the present invention; Figure 3 This is a comparison chart of the total number of time windows for each attribute of the present invention; Figure 4 This is a diagram illustrating the derivation process of the AID003-2 attenuation key chain of the present invention; Figure 5 This is a distribution diagram of the number of data items in the encrypted transmission ciphertext packet of the present invention; Figure 6 This is a summary chart of the FIN-P three-dimensional verification results of the present invention. Detailed Implementation

[0018] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.

[0019] This embodiment provides a method for encrypted transmission of electronic credentials based on national cryptographic algorithms and dynamic key negotiation, such as... Figure 1 As shown, it includes the following steps: Step 1: Obtain structured data from multiple electronic vouchers and generate batch voucher aggregate attribute fingerprints; Get the data to be transmitted in batches with encryption A structured collection of electronic vouchers, in which The total number of electronic vouchers to be encrypted and transmitted in batches, the first... The voucher contains One attribute, For the first The total number of attributes contained in a voucher, the first voucher number The attribute values ​​of each attribute are denoted as: The voucher number is recorded as The attribute identifier is denoted as Before performing the hash operation, check all attribute values. voucher number and attribute identifiers UTF-8 encoding is used uniformly to convert non-numeric string data into byte sequences, ensuring that the input for subsequent SM3 operations is standardized binary data. The SM3 hash algorithm is then used to calculate the digest of each attribute value for each voucher. ,in For the first voucher number The digests of each attribute value after SM3 hashing are concatenated, arranged lexicographically by voucher number and attribute identifier. SM3 is then performed on the concatenated result to generate a batch voucher aggregated attribute fingerprint. :

[0020] in, For batch voucher aggregation attribute fingerprint, This indicates a data concatenation operation. The SM3 digest of the first attribute value of the first document. The SM3 digest of the second attribute value of the first voucher. For the first voucher number The SM3 digest of each attribute value is sorted lexicographically first by... Sort in ascending order, within the same voucher, by The documents are sorted in ascending order, with both the voucher number and attribute identifier being compared character by character according to their Unicode encoding values. The deterministic nature of the sorting rules ensures that the sender and receiver can reconstruct the concatenated result in the same order, thereby guaranteeing the consistency of the aggregated attribute fingerprints of batch vouchers.

[0021] Step 2: Perform a single SM2 dynamic key negotiation to generate a batch shared base session key; Based on the sender's SM2 private key SM2 public key of the recipient Perform a single SM2 dynamic key negotiation, where The sender's SM2 private key. For the recipient's SM2 public key, aggregate the attribute fingerprint of the bulk credentials. Additional inputs to the key derivation function participate in the key derivation operation to generate batch shared underlying session keys. :

[0022] in, To share the base session key in batches, This is the shared secret value obtained during the SM2 key negotiation process by performing elliptic curve point operations on the sender's temporary key pair and the receiver's temporary key pair. The target key length parameter. To conform to the key derivation function defined in the GM / T 0003 standard, it internally uses the SM3 hash algorithm to iteratively process the input data and outputs a specified length. Key materials. , The key materials used in the subsequent steps are all byte sequences with consistent dimensions. The splicing operation is performed at the byte level and does not involve direct computation of heterogeneous physical quantities.

[0023] In this step, regardless of the number of vouchers to be transmitted, the SM2 elliptic curve point operation is performed only once, while the batch voucher aggregation attribute fingerprint... The attribute information of all credentials is aggregated into a single digest for key derivation, so that the generated batch shared base session key is bound to the attribute content of all credentials.

[0024] Furthermore, to bind the batch-shared base session key to the validity period parameters of the credentials, in addition to step 2, the validity period parameters of each attribute of each credential are also incorporated into the key derivation process. Specifically, the independent validity period parameters of each attribute of each credential are obtained. , The duration of the attribute from its effective date to its expiration date is represented in integer seconds. Before being used in calculations, it is uniformly encoded as a fixed-endian byte sequence to eliminate concatenation ambiguities caused by inconsistent encoding lengths of different validity period values. All validity period parameters are arranged lexicographically by voucher number and attribute identifier, and then SM3 calculation is performed to generate a global validity period aggregate summary. :

[0025] in, For global validity period aggregated summary, For the first voucher number The validity period parameter of each attribute (a big-endian fixed-length byte sequence in integer seconds). This refers to the validity period parameter of the first attribute of the first voucher. This refers to the validity period parameter of the second attribute of the first voucher. For the first voucher number The validity period parameters of each attribute are arranged in the same lexicographical order as in step 1. The global validity period aggregation summary is then generated. fingerprint of batch voucher aggregation attribute Together, these serve as additional inputs to the key derivation function to generate a bulk shared underlying session key that includes time-limited bindings:

[0026] Through this optimization, the batch sharing of basic session keys is not only bound to the content of the credential attributes, but also to the validity period parameters of all attributes. Tampering with the validity period parameter of any attribute will lead to inconsistent key derivation results.

[0027] Step 3: Perform three-level key derivation to generate attribute-level encryption keys; To share the base session key in bulk Using the root key, a three-level key derivation is performed to generate independent encryption keys for each attribute of each credential. The inputs to each level of the SM3 operation are byte sequences, where... and UTF-8 encoding has been completed in step 1. The key material itself is a fixed-length byte sequence. Each concatenation operation is performed at the byte level and does not involve direct computation of heterogeneous physical quantities.

[0028] Step 301: Transfer the root key With each voucher number After concatenating the components, perform the SM3 operation to generate a credential-level intermediate key. :

[0029] in, For the first The voucher-level intermediate key corresponding to each voucher.

[0030] Step 302: Transfer the credential-level intermediate key With each attribute identifier After concatenating the components separately, perform SM3 operations to generate attribute-level seed keys. :

[0031] in, For the first voucher number Each attribute corresponds to an attribute-level seed key.

[0032] Through the above three-level key derivation structure, the root key Derived step by step through SM3 hash operation Each is a unique attribute-level seed key, among which Indicates all The total number of attributes of the voucher. This represents the total number of vouchers. For the first The number of attributes for each document is specified, and each attribute-level seed key is associated only with the corresponding document number and attribute identifier. The root key is the first level, the document-level intermediate key is the second level, and the attribute-level seed key is the third level. One-way derivation between levels is achieved through SM3 hash operations. The document-level intermediate key or root key cannot be derived from the attribute-level seed key, and the root key cannot be derived from the document-level intermediate key. This one-wayness is guaranteed by the original image property of the SM3 hash algorithm.

[0033] Furthermore, in order to achieve independent time-sensitivity control at the attribute level, the following steps are also included in step 3: Get the independent validity period parameter for each attribute of each voucher. (in integer seconds), according to the preset window granularity (in integer seconds) the first voucher number The validity period of each attribute is divided into: Each independent time window:

[0034] in, For the first voucher number The total number of time windows for each attribute The total validity period of this attribute (in integer seconds). The window granularity for this attribute (in integer seconds). This indicates the rounding up operation. and With the same dimensions, dividing the two yields the dimensionless number of windows. Different attributes can use different window granularities. For example, when the validity period of a credit rating attribute is 30 days, a window granularity of 1 day can be used, dividing it into 30 time windows; when the validity period of a qualification license attribute is 3 years, a window granularity of 30 days can be used, dividing it into 36 time windows.

[0035] With attribute-level seed key Starting from the time window number corresponding to the attribute The attribute-level decay key sequence is derived through reverse SM3 chained hashing. Specifically, the attribute-level seed key is used as the anchor point at the end of the decay key chain, and... SM3 operations are performed sequentially from the end to the beginning:

[0036] in For the first voucher number The attribute in the first The decay key corresponding to each time window The time window number is defined, and its value range is [value range missing]. to , No. The time interval corresponding to the first time window is the first time interval starting from the validity period of this attribute. Seconds to the Seconds. The construction direction of the decay key chain is from the end (the second). The process proceeds backward from the starting point (the first window) to verify that the direction of the process is forward from the starting point to the ending point: Given the first window... Attenuation key for each window It can be accessed through The attenuation key for the first window is derived through the forward SM3 operation. However, it is known that the first The decay key for the first window cannot be derived from the first window. The attenuation key for each window. The sender only publishes the attenuation key for the initial window. This serves as the public commitment anchor for the attribute. When an attribute exceeds its independent validity period, the sender cannot obtain the decay key that exceeds the window range, and therefore cannot construct a valid commitment for the expired attribute.

[0037] Furthermore, the one-way nature of the aforementioned reverse SM3 chained hash is guaranteed by the original characteristics of the SM3 hash algorithm: given a decaying key at any position in the chain... Because SM3 is a one-way hash function, it cannot be obtained from... The precursor value was calculated in reverse. Therefore, the party holding the current window decay key cannot forge the decay key for future windows, thus ensuring that the time limit constraint of the decay key chain cannot be bypassed.

[0038] The attenuation key sequences for all attributes of all vouchers are organized into a cross-voucher attribute-level attenuation key matrix. Rows in the cross-voucher attribute-level attenuation key matrix correspond to combinations of voucher numbers and attribute identifiers, while columns correspond to time window numbers. After generating the cross-voucher attribute-level attenuation key matrix, the validity start time, window granularity, and number of windows for each attribute of each voucher are also organized into a global configuration table in lexicographical order of voucher number and attribute identifier. This global configuration table serves as the unified query basis for subsequent time window positioning and key indexing.

[0039] Furthermore, the time window number corresponding to the current system timestamp. The method for determining this is as follows: using the start time of the attribute's validity period as a benchmark, calculate the difference between the current system time and the start time (in integer seconds), and divide it by the window granularity. Round up to the nearest whole number.

[0040] in For the first voucher number Each attribute corresponds to a time window number in the current system time. This is the current system timestamp (in integer seconds). For the first voucher number The validity period start timestamp of each attribute (in integer seconds). This represents the window granularity (in integer seconds) for this attribute. The calculated result is the row and column coordinates used to index the current window's attenuation key from the global configuration table and the cross-credential attribute level attenuation key matrix. When The calculation result exceeds the total number of windows for this attribute. When this occurs, it indicates that the attribute has exceeded its independent validity period.

[0041] Step 4: Determine the target transmission attributes and generate a cross-credential cryptographic state consistency verification token; Based on the recipient's verification requirements, determine the subset of attributes that need to be encrypted and transmitted for each credential. Obtain the current system timestamp and determine the current time window number for each target attribute based on the global configuration table. Extract the corresponding attribute-level attenuation key from the cross-credential attribute-level attenuation key matrix. For attributes that have exceeded their independent validity period, if the window number corresponding to the current system time... Total number of windows exceeding this attribute If the key value corresponding to the number does not exist in the cross-credential attribute level decay key matrix, the attribute selection process marks the attribute as expired and removes it from the target transmission attribute subset.

[0042] Furthermore, in order to complete the consistency verification of shared fields across credentials in the encrypted state, the following steps are also included in step 4: Step 401: Scan the field identifiers of all vouchers, identify field identifiers that exist simultaneously in two or more vouchers, and generate a cross-voucher shared field mapping table. The cross-voucher shared field mapping table records each shared field identifier and a list of voucher numbers in which it is located.

[0043] Step 402: For each shared field in the cross-credential shared field mapping table ( (For the shared field sequence number), retrieve the attribute value of this field in each voucher. With the corresponding current window decay key ,in For shared fields In the For each document, the corresponding attribute number is used to concatenate the current window attenuation key with the field value, and then SM3 operations are performed to generate the cryptographic digest of that field for each document. :

[0044] in, For the first The first voucher Cryptographic digest of each shared field For shared fields In the The corresponding attribute number in the voucher. This is the attribute value of the shared field in the voucher (a byte sequence that has been fully UTF-8 encoded). This is the decay key corresponding to this attribute in the current time window.

[0045] Step 403: Combine the same shared fields Perform an XOR reduction operation on the cryptographic digests of all relevant credentials to generate a cross-credential cryptographic consistency verification token for that shared field. For a set of credentials containing this shared field ( The number of credentials that include this shared field. For each voucher number containing this shared field), when When the number is even, the cross-credential cryptographic consistency verification token is calculated as follows:

[0046] in For the first Cross-credential cryptographic consistency verification token with shared fields This indicates a bitwise XOR operation. For evidence The Middle Cryptographic digest of each shared field For evidence The Middle Cryptographic digest of each shared field For evidence The Middle The encrypted digests of a shared field are identical when the attribute value of that shared field is consistent across all related credentials and the corresponding decay keys are valid, resulting in an XOR reduction of zero. Conversely, if the value of that field is inconsistent across any credential or the corresponding attribute has expired, leading to different decay keys, the XOR reduction result is non-zero. When the number is odd, the first digest in the encrypted digest sequence is used. As a baseline, the cross-credential cryptographic consistency verification token calculation is adjusted as follows:

[0047] Each subsequent credential's encrypted digest is XORed with the base value and then reduced. When all field values ​​are the same, the result of each XOR pair is zero, and the final reduction result is also zero.

[0048] Furthermore, when When the number is odd, the above formula for calculating the cross-credential cryptographic consistency verification token, after expansion, is equivalent to... indivual and to Jointly participate in XOR reduction. Because... An even number of identical values. The XOR result is zero, therefore when all field values ​​are consistent (i.e., all...), the XOR result is zero. When the values ​​are equal, the final reduction result is equivalent to the original value. zero values ​​and indivual The XOR operation of the given value still results in zero after simplification. The judgment logic remains consistent when the number is even.

[0049] Step 5: Generate single-attribute commitments and cross-credential combination binding commitments; For each attribute that needs to be transmitted for each credential, use the corresponding current window decay key. With attribute value After concatenation, the SM3 operation is performed to generate a single-attribute commitment. :

[0050] in, For the first voucher number Single-attribute commitment for each attribute.

[0051] Generate globally bound random numbers ,in Generated by a cryptographically secure pseudo-random number generator, one is generated in each batch transmission request. This is used to bind all single-attribute commitments to the same transmission session, ensuring that commitment values ​​between different transmission requests are not correlated. All single-attribute commitments of all credentials are bound to a random number. After arranging the documents in lexicographical order by document number and attribute identifier, concatenate them, perform the SM3 operation on the concatenated result, and generate a cross-document combination binding commitment. :

[0052] in To bind commitments across document combinations, Indicates the first The actual number of attributes to be transmitted in the voucher (excluding expired attributes). For the single attribute commitment of the first attribute of the first document, For the single-attribute commitment of the second attribute of the first document, For the first voucher number Single-attribute commitment for each attribute.

[0053] Step 6: Perform encrypted transmission and generate encrypted transmission ciphertext packets; Based on the sender's SM2 private key SM2 public key of the recipient Perform SM2 dynamic key negotiation to bind commitments across credential combinations. As additional input to the key derivation function, generate the encrypted transmission session key. :

[0054] in To encrypt the transmission of session keys, This is the shared secret value used in this SM2 key negotiation process. The target key length parameter has the same meaning as in step 2.

[0055] Use encrypted transmission of session keys As the symmetric key for the SM4-GCM authentication encryption algorithm, perform SM4-GCM authentication encryption operations on the following data combinations: commitments bound across credential combinations. Each single attribute commitment Current time window number for each attribute , decrementing key chain verification path information, binding random number 1. Set of attribute values ​​to be transmitted Cross-credential cryptographic consistency verification token And a cross-credential shared field mapping table. Among them, the attenuation key chain verification path information refers to the intermediate parameters required for the receiver to derive the public commitment anchor point from the current window attenuation key, including the number of derivation steps between the current window number and the starting window number, i.e. Step 1. SM4-GCM is a Galois / counter mode based on the SM4 block cipher algorithm. This mode generates a message authentication tag while encrypting the message. The receiver can verify the integrity and authenticity of the ciphertext by verifying the authentication tag. The SM4-GCM algorithm outputs ciphertext data and the authentication tag, assembles the ciphertext data, authentication tag, and GCM initialization vector into an encrypted transmission ciphertext packet, and sends it to the receiver.

[0056] Step 7: The receiver decrypts and performs multi-dimensional verification, outputting batch verification results; The receiver uses its own SM2 private key and the sender's SM2 public key to perform the corresponding SM2 key negotiation to recover the encrypted transmission session key. Using encrypted transmission session keys Perform SM4-GCM authentication and decryption on the encrypted transmission ciphertext packet, and obtain the plaintext data after verifying the validity of the authentication tag.

[0057] Step 701: For each transport attribute, decay the key from its current window. Depart, proceed in sequence The attenuation key for the first window is derived forward from the next SM3 operation:

[0058] in , For the receiver in the forward derivation process in step 701, the first The intermediate derived values ​​corresponding to each window. The derivation key for the first window. Anchor point of public commitment to this attribute as announced in advance by the issuing party The comparison is performed. If they match, the attenuation key of the attribute is confirmed to be within the valid time window, and the timeliness verification is passed; if they do not match, the timeliness verification of the attribute is marked as failed.

[0059] Furthermore, the forward derivation direction in step 701 is opposite to the construction direction of the attenuation key chain: the attenuation key chain is constructed in reverse from the end to the start in step 3, while the receiver derives it forward from the current window to the start in step 701. Both derivations are in the same direction (towards the start), but their starting points are different. The receiver holds the attenuation key for the current window. By decaying the key in the current window The initial window attenuation key can be obtained by continuously performing SM3 operations. Then, anchor the commitment publicly made by the issuing party. By comparison, it can be verified whether the decay key belongs to a valid entry in a legitimate key chain, without the recipient needing to possess the complete decay key chain.

[0060] Step 702: Utilize the attribute values With the corresponding attenuation key Recalculate the commitments for each individual attribute ,in The first recalculated for the recipient voucher number For each attribute's single-attribute commitment, recalculate all single-attribute commitments and bind random numbers. After arranging the documents in lexicographical order according to the same document number and attribute identifier, concatenate them, perform SM3 operation to recalculate the cross-document combination binding commitment. ,in The cross-document portfolio binding commitment is recalculated for the recipient, and the cross-document portfolio binding commitment is... Binding commitments to received cross-credential combinations Perform a comparison. If they match, it confirms that all transmission attributes of all credentials originated from the same transmission request and that the attribute values ​​have not been tampered with; if they do not match, mark the integrity verification as failed.

[0061] Step 703: Check the received cross-credential cryptographic consistency verification tokens. Is it a zero value? If it's a cross-credential cryptographic consistency verification token... If the value is zero, then the shared field is confirmed. The values ​​are consistent across all relevant credentials; if the cross-credential cryptographic consistency verification token is valid. If the value is non-zero, a cross-document field inconsistency alert is generated, indicating the inconsistent shared field identifier. .

[0062] Step 704: Summarize the verification results of each dimension from Step 701 to Step 703. When the timeliness verification of all attributes passes, the cross-voucher combination binding commitment comparison is consistent, and the consistency verification tokens of all shared fields are all zero, output the result of the multi-voucher attribute combination verification passing; otherwise, output the verification failure result and the specific reason for failure.

[0063] The following is an example of an application of the present invention, such as Figure 2-6 As shown, the implementation process is as follows: In 20XX, a supply chain finance platform conducted batch qualification verification of its suppliers. Supplier A (code: ENT-A) was required to encrypt and transmit three electronic certificates to the finance platform (code: FIN-P): a business license (certificate number CID001), a construction engineering qualification license (certificate number CID002), and a corporate credit rating certificate (certificate number CID003). The Unified Social Credit Code field appeared in both CID001 and CID002, constituting a shared field across certificates. ENT-A, as the sender, held its own SM2 private key and FIN-P's SM2 public key; FIN-P, as the receiver, held its own SM2 private key and ENT-A's SM2 public key. The three certificates had 3, 3, and 2 attributes respectively, each with a distinct and independent validity period.

[0064] ENT-A reads structured data from three vouchers on the local data storage medium, totaling eight attributes. All attribute values, voucher numbers, and attribute identifiers are uniformly encoded into UTF-8 and converted into byte sequences before performing SM3 operations.

[0065] Table 1 Original attribute data of three vouchers

[0066] Sort the vouchers in ascending order by voucher number (CID001, CID002, CID003), and within the same voucher, sort them in ascending order by attribute identifier (AID). Concatenate the eight SM3 digests sequentially, perform SM3 operations on the concatenated result, and generate a batch voucher aggregated attribute fingerprint.

[0067] Example of calculation results: = D4C8E1A37F920B56… (32 bytes, hexadecimal, the first 8 bytes are shown here).

[0068] ENT-A performs a single SM2 dynamic key negotiation based on its own SM2 private key and FIN-P's SM2 public key to obtain a shared secret value. Simultaneously, it generates a global validity aggregate digest based on the independent validity parameters of each of the eight attributes. The specific validity parameters are as follows.

[0069] Table 2 Validity parameters for each attribute

[0070] Each validity period parameter is encoded using a big-endian fixed-length byte sequence and then concatenated lexicographically. An SM3 operation is then performed to obtain the global validity period aggregate digest, which, along with the shared secret value and the aggregate attribute fingerprint, participates in key derivation.

[0071] The key length is 256 bits, and the output batch shared basic session key (32 bytes) is bound to all credential attribute content and all attribute validity period parameters.

[0072] Using the bulk shared basic session key as the root key, a three-level key derivation is performed. First, the credential-level intermediate key is calculated for each of the three credentials. For example, the credential-level intermediate key corresponding to CID001 is:

[0073] Then, an attribute-level seed key is calculated for each attribute, for example, AID001-2 corresponds to CID001:

[0074] For each attribute, a time window is defined based on its independent validity period and preset window granularity. Taking the credit rating result attribute (CID003, AID003-2) as an example, the validity period is 30 days (2,592,000 seconds), the window granularity is 1 day (86,400 seconds), and the total number of time windows is:

[0075] Taking the qualification level attribute (CID002, AID002-2) as an example, the validity period is 3 years (94,608,000 seconds), the window granularity is 30 days (2,592,000 seconds), and the total number of time windows is:

[0076] Table 3. Time window configuration for each attribute (part of the global configuration table)

[0077] Taking AID003-2 as an example, the reverse SM3 chain hash starts from the end-decaying key and executes sequentially:

[0078] The initial window decay key is finally obtained and published as the public commitment anchor for this attribute. Assuming the current system timestamp is 1716228000 seconds, the validity period start timestamp is 1714500000 seconds, the window granularity is 86400 seconds, and the current window number is:

[0079] The current window number 20 is within the total number of windows (30), and its attributes are valid.

[0080] The verification requirement of FIN-P specifies the transmission of all three attributes of CID001, all three attributes of CID002, and all two attributes of CID003. ENT-A scans all voucher field identifiers and identifies the Unified Social Credit Code field (identified by AID001-2 and AID002-1) which appears in both CID001 and CID002, generating a cross-voucher shared field mapping table with shared field number SF-1.

[0081] For SF-1, obtain the current window decay key of AID001-2 in CID001 and the current window decay key of AID002-1 in CID002. Both have the same attribute value (91310000XXXXXXXX01). Calculate the cryptographic digest for each:

[0082]

[0083] Since the value of this field is the same in both credentials, and both current window decay keys are derived from the same batch shared base session key through three levels of derivation (different paths but the same root key), the two cryptographic digests are equal provided the key is valid and the field value is consistent. The number of credentials containing SF-1 is 2 (an even number), and the cross-credential cryptographic consistency verification token is:

[0084] A result of zero indicates that the Unified Social Credit Code field is consistent in both vouchers.

[0085] Calculate single-attribute commitments for each of the eight target transmission attributes (all attributes are within their validity period). Taking the credit rating result attribute of CID003 as an example, the current window number is 20, and the corresponding attenuation key is the attenuation key for window number 20. The single-attribute commitment is as follows:

[0086] ENT-A generates a globally one-time bound random number (32 bytes, generated by a cryptographically secure pseudo-random number generator). The eight single-attribute commitments are concatenated with the bound random number in lexicographical order, and then an SM3 operation is performed. The actual number of attributes to be transmitted for each of the three documents is equal to the total number of attributes (no expired attributes). This generates a cross-document combined bound commitment.

[0087] ENT-A performs SM2 dynamic key negotiation again based on its own SM2 private key and FIN-P's SM2 public key to obtain a new shared secret value. It then uses the combined binding commitment as additional input to derive the encrypted transmission session key.

[0088] Using the encrypted transmission session key as the SM4-GCM symmetric key, the following data is authenticated and encrypted, assembled into an encrypted transmission ciphertext packet, and sent to FIN-P.

[0089] Table 4. List of contents of encrypted transmission packets

[0090] FIN-P uses its own SM2 private key and ENT-A's SM2 public key to recover the encrypted transmission session key, performs SM4-GCM authentication decryption, and obtains plaintext data after verifying the authentication tag.

[0091] Taking the credit rating result attribute (CID003, AID003-2) as an example, the current window number is 20. FIN-P starts from the received window 20 decay key and performs 19 consecutive SM3 operations to derive the window 1 decay key in a forward manner:

[0092] The deduced window 1 decay key is compared with the commitment anchor publicly disclosed by the issuer. If they match, the timeliness verification is successful.

[0093] FIN-P recalculates eight single-attribute commitments using each attribute value and the corresponding attenuation key. After concatenating and binding random numbers, it performs SM3 operations to obtain the recalculated combined binding commitment. This is then compared with the received combined binding commitment. If they match, the integrity verification is successful.

[0094] Check if the consistency verification token is zero. If the token value is 0, it confirms that the Unified Social Credit Code is consistent in CID001 and CID002.

[0095] The results of the three verifications are summarized and output as follows.

[0096] Table 5 Summary of Batch Verification Results

[0097] Throughout the process, data originates from eight original attribute values ​​of three credentials. In step 1, these values ​​are aggregated into a single fingerprint. In step 2, the fingerprint, along with the validity period aggregate digest, is bound to the bulk shared basic session key output by the unique SM2 negotiation. In step 3, the fingerprint is expanded into eight independent attribute-level decay key chains through a three-level derivation process and organized into a global configuration table. In step 4, the decay keys and attribute values ​​are used to generate a cryptographic digest, which is then XORed and reduced to a consistency verification token. In step 5, each attribute commitment is bound to a random number and concatenated to form a combined commitment. In step 6, the combined commitment is further bound to the transmission session key and encrypted. Finally, in step 7, the receiver completes the three-dimensional verification of timeliness, integrity, and consistency along the reverse path of the data chain. The output data of each step serves as the input for subsequent steps, forming a complete closed data flow from the original attributes to the final verification conclusion.

[0098] It is understood that data preprocessing methods known to those skilled in the art include data cleaning, data transformation, and data reduction. Data transformation includes type conversion and normalization and standardization. Although the dimensions and types of data were omitted in the description of the preceding embodiments, data preprocessing is a technical knowledge known to those skilled in the art and a prerequisite step in data processing. Therefore, the previously described well-known data preprocessing steps were not described independently.

[0099] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.

Claims

1. A method for encrypted transmission of electronic credentials based on national cryptographic algorithms and dynamic key negotiation, characterized in that, Includes the following steps: Obtain structured data of multiple electronic vouchers to be transmitted in batches with encryption, use the SM3 hash algorithm to calculate the digest of each attribute value of each voucher, arrange all digests in lexicographical order of voucher number and attribute identifier, concatenate them and perform SM3 operation to generate batch voucher aggregated attribute fingerprint; A single SM2 dynamic key negotiation is performed based on the sender's SM2 private key and the receiver's SM2 public key. The batch credential aggregation attribute fingerprint is used as an additional input to the key derivation function to generate a batch shared basic session key. Using the aforementioned batch shared basic session key as the root key, perform three-level key derivation: concatenate the root key with each credential number and perform SM3 operation to generate a credential-level intermediate key; concatenate the credential-level intermediate key with each attribute identifier and perform SM3 operation to generate an attribute-level seed key. After concatenating the seed key and corresponding attribute value at each attribute level, SM3 operation is performed to generate each single attribute commitment. All single attribute commitments are then concatenated with a one-time binding random number in lexicographical order and SM3 operation is performed to generate cross-credential combination binding commitments. The cross-credential combination binding commitment is used as an additional input to the key derivation function to generate an encrypted transmission session key. The encrypted transmission session key is then used to perform authentication encryption operations on the transmitted data to generate an encrypted transmission ciphertext packet, which is then sent to the recipient. The receiver recovers the encrypted transmission session key and decrypts the encrypted transmission ciphertext packet, recalculates each single-attribute commitment and cross-credential combination binding commitment, compares them with the received commitment, and outputs the batch verification results.

2. The method for encrypted transmission of electronic credentials based on national cryptographic algorithms and dynamic key negotiation according to claim 1, characterized in that, The generation of the batch shared basic session key further includes: obtaining the independent validity period parameter of each attribute of each voucher, arranging all validity period parameters in lexicographical order according to voucher number and attribute identifier, and performing SM3 operation to generate a global validity period aggregate digest; using the global validity period aggregate digest and the batch voucher aggregate attribute fingerprint as additional inputs to the key derivation function to generate a batch shared basic session key containing validity period binding.

3. The method for encrypted transmission of electronic credentials based on national cryptographic algorithms and dynamic key negotiation according to claim 1, characterized in that, The three-level key derivation process further includes: obtaining the independent validity period parameter for each attribute of each voucher; dividing the validity period of each attribute into an independent time window sequence according to a preset window granularity, with the total number of time windows equal to the total validity period divided by the window granularity and rounded up; using the seed key at each attribute level as the end anchor point of the decay key chain, performing SM3 operations sequentially from the end to the start direction to generate the decay key sequence for each attribute; organizing the decay key sequences of all attributes of all vouchers into a cross-voucher attribute level decay key matrix, where the rows of the decay key matrix correspond to the combination of voucher number and attribute identifier, and the columns correspond to the time window number; when generating each single attribute commitment, extracting the decay key corresponding to each attribute in the current time window from the cross-voucher attribute level decay key matrix to replace the attribute level seed key in the commitment calculation.

4. The method for encrypted transmission of electronic credentials based on national cryptographic algorithms and dynamic key negotiation according to claim 3, characterized in that, The method for determining the current time window number is as follows: based on the start timestamp of the validity period of the attribute, calculate the difference between the current system timestamp and the start timestamp, divide the difference by the window granularity of the attribute, and round up to obtain the current time window number; when the current time window number exceeds the total number of time windows for the attribute, mark the attribute as expired and remove it from the target transmission attribute subset.

5. The method for encrypted transmission of electronic credentials based on national cryptographic algorithms and dynamic key negotiation according to claim 3, characterized in that, Before generating the encrypted transmission ciphertext packet, the method further includes: scanning the field identifiers of all credentials, identifying field identifiers that exist simultaneously in two or more credentials, and generating a cross-credential shared field mapping table; for each shared field in the cross-credential shared field mapping table, obtaining the attribute value of the field in each credential and the corresponding current window attenuation key, concatenating the current window attenuation key with the field value and performing SM3 operation to generate the encrypted digest of the field in each credential; performing XOR reduction operation on the encrypted digests of the same shared field in all related credentials to generate a cross-credential encrypted state consistency verification token for the shared field.

6. The method for encrypted transmission of electronic credentials based on national cryptographic algorithms and dynamic key negotiation according to claim 5, characterized in that, The XOR reduction operation is performed as follows: when the number of credentials containing the shared field is even, the encrypted digests of all related credentials are directly subjected to bitwise XOR reduction; when the number of credentials containing the shared field is odd, the first digest in the encrypted digest sequence is used as the base value, and the encrypted digest of each subsequent credential is subjected to bitwise XOR operation with the base value before reduction; when the attribute value of the shared field is consistent in all related credentials and the corresponding decay keys are valid, the cross-credential encrypted consistency verification token is zero.

7. The method for encrypted transmission of electronic credentials based on national cryptographic algorithms and dynamic key negotiation according to claim 1, characterized in that, The one-time binding random number is generated by a cryptographically secure pseudo-random number generator, and one is generated in each batch transmission request; the cross-credential combination binding commitment is generated by concatenating the single-attribute commitments corresponding to the attributes that actually need to be transmitted in all credentials with the one-time binding random number in lexicographical order of credential number and attribute identifier, and performing SM3 operation on the concatenation result.

8. The method for encrypted transmission of electronic credentials based on national cryptographic algorithms and dynamic key negotiation according to claim 5, characterized in that, The authentication encryption operation employs the SM4-GCM authentication encryption algorithm. The transmitted data includes: the cross-credential combination binding commitment, each individual attribute commitment, the current time window number of each attribute, the decay key chain verification path information, the one-time binding random number, the set of attribute values ​​to be transmitted, each cross-credential encrypted state consistency verification token, and the cross-credential shared field mapping table; the decay key chain verification path information includes the derivation steps between the current window number and the starting window number; the encrypted transmission ciphertext packet includes the ciphertext data output by SM4-GCM, the authentication tag, and the GCM initialization vector.

9. The method for encrypted transmission of electronic credentials based on national cryptographic algorithms and dynamic key negotiation according to claim 8, characterized in that, The receiver outputs batch verification results including the following verification steps: For each transmission attribute, starting from its current window attenuation key, perform SM3 operations sequentially to derive the attenuation key of the first window. Compare the derivation result with the publicly announced commitment anchor point of the attribute in advance published by the issuer. If they match, the validity period of the attribute is verified. Recalculate each single attribute commitment using each attribute value and the corresponding attenuation key. Concatenate all recalculated single attribute commitments with the one-time binding random number in lexicographical order and perform SM3 operations to recalculate the cross-credential combination binding commitment. Compare this with the received cross-credential combination binding commitment. Check whether each cross-credential cryptographic consistency verification token is zero. When all attribute validity period verifications are passed, the cross-credential combination binding commitments match, and all consistency verification tokens are zero, output the verification result as passed. Otherwise, output the verification failure result and the specific reason for failure.

10. An electronic credential encryption transmission system based on national cryptographic algorithms and dynamic key negotiation, used to execute the electronic credential encryption transmission method based on national cryptographic algorithms and dynamic key negotiation as described in any one of claims 1 to 9, characterized in that, include: The aggregate fingerprint generation module is used to acquire structured data from multiple electronic vouchers and generate batch voucher aggregate attribute fingerprints using the SM3 hash algorithm. The key negotiation module is used to perform a single SM2 dynamic key negotiation based on the sender's SM2 private key and the receiver's SM2 public key, and to generate a batch shared basic session key by using the batch credential aggregation attribute fingerprint as an additional input to the key derivation function. The three-level key derivation module is used to generate credential-level intermediate keys and attribute-level seed keys sequentially, using the batch shared basic session key as the root key; the commitment generation module is used to generate each single-attribute commitment and cross-credential combination binding commitment. The encrypted transmission module is used to generate an encrypted transmission session key and perform authentication encryption operations, generate an encrypted transmission ciphertext packet and send it to the recipient; The decryption and verification module is used by the receiver to recover the encrypted transmission session key, decrypt the encrypted transmission ciphertext packet, recalculate and compare each commitment, and output batch verification results.