Electronic bidding file encryption transmission system and method and storage medium
Through multiple rounds of dynamic obfuscation encryption and session key negotiation, the data tampering and replay attacks in electronic bid file transmission are solved, and high-security bid file transmission is achieved.
Patent Information
- Application Number
- CN202510628240.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-05-15
AI Technical Summary
In the prior art, electronic bidding files are susceptible to data tampering, unauthorized access and replay attacks during transmission. Traditional encryption methods are insufficient in security, key negotiation is susceptible to man-in-the-middle attacks, and data integrity and freshness verification methods are single.
Multiple rounds of dynamic obfuscation encryption methods are used to divide the bid files into data blocks and generate unique identifiers. The session key is negotiated through the elliptic curve Diffie-Hermann protocol, and combined with pseudo-random fill and timestamp authentication tags to achieve dynamic parameter encryption and two-factor verification.
Effectively resist differential cryptographic analysis and dictionary attacks, enhance key usage separation, ensure data confidentiality, integrity and freshness, and improve system attack resistance.
Smart Images

Figure CN120342742A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electronic information security, relates to file encryption technology, and specifically is an electronic tender document encryption transmission system, method and storage medium. Background Art
[0002] In the field of electronic tendering and bidding, the secure transmission of electronic tender documents is the core link to ensure the fairness and legality of tendering and bidding. In the prior art, electronic tender documents face multiple security threats during the transmission process, including unauthorized access, tampering, replay attacks, etc., resulting in the leakage of tender information or the destruction of integrity. Traditional encryption transmission methods usually use fixed block cipher algorithms for data encryption, and their round function rules, permutation tables and padding methods are all statically designed. Attackers can perform differential cryptanalysis, dictionary attacks or padding attacks by analyzing fixed patterns, and the security is difficult to meet the requirements of high-sensitivity scenarios.
[0003] In terms of key negotiation, traditional solutions mostly rely on simple Diffie-Hellman protocols or pre-shared keys, lack effective identity authentication mechanisms, are vulnerable to man-in-the-middle attacks, and result in the theft of session keys; moreover, the key derivation process is not customized in combination with business scenarios, the key entropy value is insufficient or the separation of uses is not thorough enough, and there is a risk of key abuse. In addition, the existing technologies have a single means of verifying data integrity and freshness, and only verify data integrity through hash functions or message authentication codes, and cannot resist replay attacks, which may cause the receiving end to misjudge expired or forged tender documents as valid. Summary of the Invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art; for this purpose, the present invention provides an electronic tender document encryption transmission system, method and storage medium, which are used to solve the technical problems such as data tampering, unauthorized access and replay attacks that easily occur during the transmission process of electronic tender documents in the prior art.
[0005] To achieve the above object, the first aspect of the present invention provides an electronic tender document encryption transmission method, including:
[0006] Dividing the electronic tender document of the sending end into multiple data blocks, and assigning a unique identifier to each data block to obtain a data block identifier;
[0007] Generating a permutation table and a round key sequence according to the session key and the data block identifier; wherein, the session represents a communication interaction process of an electronic tender document.
[0008] Performing multiple rounds of dynamic confusion operations on the data blocks, and each round of operation includes bit operations based on the round key sequence and byte position rearrangement based on the permutation table to obtain confused data blocks;
[0009] Generate an authentication tag for the obfuscated data block, and send it to the receiving end bound with the timestamp, block identifier, session identifier, and obfuscated data block; wherein, the session identifier is used to identify each session and is generated according to a predefined rule.
[0010] The receiving end performs a reverse decryption operation on the obfuscated data block based on multiple rounds of dynamic obfuscation operations to obtain the decrypted data, and verifies the decrypted data according to the authentication tag and timestamp.
[0011] Furthermore, the splitting rule of the data block is as follows:
[0012] Judge whether the size FS of the electronic bidding document is greater than the preset file size; if so, split the electronic bidding document into data blocks according to the preset data block size BS; if not, process the electronic bidding document as a single data block.
[0013] When the size of the last data block after splitting is less than the preset data block size BS, generate pseudo-random bytes according to the following formula, and splice the pseudo-random bytes after the last data block:
[0014] PL = (BS - (FS mod BS)) mod BS, Padding = PRNG1(SK||BlockID) mod 256 PL ;
[0015] Wherein, mod represents the modulo operation, PL represents the padding length, Padding represents the pseudo-random bytes, PRNG1() represents the first pseudo-random number generator, SK represents the session key, BlockID represents the data block identifier, and || represents the data splicing operation.
[0016] Furthermore, the generation method of the session key includes:
[0017] The receiving end and the sending end initialize the key negotiation protocol based on a predefined set of elliptic curve cryptography parameters using the Diffie-Hellman key exchange protocol.
[0018] The receiving end and the sending end respectively generate temporary key pairs, including the temporary private key and temporary public key of the receiving end, and the temporary private key and temporary public key of the sending end, and the temporary public keys are exchanged through an encrypted channel.
[0019] Perform elliptic curve scalar multiplication on the temporary private key of the receiving end and the temporary public key of the sending end to calculate the shared secret point of the receiving end.
[0020] Perform elliptic curve scalar multiplication on the temporary private key of the sending end and the temporary public key of the receiving end to calculate the shared secret point of the sending end.
[0021] Extract the x - coordinate value x of the shared secret point of the receiver and the sender z , and obtain the original key material;
[0022] Use the HMAC - based key - derivation function HKDF to generate the session key SK; the input of the derivation function HKDF includes the original key material, a predefined first tag, a predefined identifier of the receiver, and a predefined identifier of the sender, where HMAC represents the Hash - based Message Authentication Code algorithm.
[0023] Furthermore, the generation method of the substitution table and the round - key sequence includes:
[0024] Input the session key, the data - block identifier, and the session - unique identifier into a hash function to generate a block - level seed;
[0025] Initialize a second pseudo - random number generator PRNG2() based on the block - level seed, and use the output of the second pseudo - random number generator to generate a substitution table and a round - key sequence. The generation rule is:
[0026] P[i]=(PRNG2(SK||BlockID)×i)mod BS (i = 0,1,…,BS - 1); where P[i] is the index value at the i - th position in the substitution table P, representing the new position of the i - th byte in the data block after confusion;
[0027] K
[0028] K r =PRNG2(SK||r)mod 2 32 (r = 1,2,…,R); where K r represents the key in the r - th round of the round - key sequence, R represents the total number of rounds, and r represents the round - number index.
[0029] Furthermore, the function of the multi - round dynamic confusion operation is:
[0030] Use the second pseudo - random number generator to generate the dynamic parameters α r and β r ;
[0031] Determine the input B of the dynamic confusion operation in the current round input : If the round - number index r = 1, the input is the current data block; if the round - number index r>1, the input is the output C of the previous round r-1 ;
[0032] XOR the current round - key K r with the input B input and perform a cyclic left - shift to obtain a preliminary confusion result B shift , and the expression is: B shift =(Binput ⊕K r ) <<< s; where s represents the number of shift bits, and <<< represents a circular left shift;
[0033] Rearrange the byte positions according to the permutation table P[i] of the current data block to obtain the rearrangement result B permuted [i], the formula is: B permuted [i] = B shift [P[i]];
[0034] Based on the dynamic parameters α r and β r , use the second pseudo-random number generator to generate the dynamic confusion factor Γ of the current data block r , the formula is: Γ r = (PRNG2(Seed dyn ||r)·α r + β r ) mod 2 32 ; where B represents the plaintext content of the current data block, Seed dyn represents the dynamic seed, which is generated by the session key, block identifier, and session identifier through a hash function;
[0035] Use the dynamic confusion factor to perform a bitwise confusion operation on the rearrangement result to obtain the current round of confusion result C r , the formula is: Where represents any operation combination of the predefined XOR / AND / OR / circular shift four operations;
[0036] Take the current round of confusion result C r as the input of the next round until the total number of rounds R is reached to obtain the confused data block.
[0037] Furthermore, the generation methods of the dynamic parameters α r and β r include:
[0038] Multiply the round index r by the first preset offset to generate the first seed, and call the second pseudo-random number generator to generate the first intermediate value;
[0039] Perform the first modulus operation on the first intermediate value, and add the preset lower limit value to the operation result to obtain the dynamic parameter α r ;
[0040] Multiply the round index r and the second preset offset to generate the second seed, and call the second pseudo-random number generator to generate the second intermediate value;
[0041] Perform the second modulus operation on the second intermediate value to obtain the dynamic parameter β r ;
[0042] Among them, the dynamic parameters α r and β r are used to generate non-linear dynamic parameters bound to the content and round of the data block.
[0043] Furthermore, the generation method of the authentication tag includes:
[0044] Using the HKDF function to generate the message authentication code MAC key K MAC ; wherein the input of the derivation function HKDF includes the session key, the session unique identifier, and the predefined second tag;
[0045] Using the HMAC algorithm to calculate the authentication tag Tag for the obfuscated data block B confused to obtain the first authentication tag, and the formula is: Tag = HMAC(K MAC , B confused ||Timestamp); wherein, Timestamp represents the timestamp.
[0046] Furthermore, the verification of the decrypted data according to the authentication tag and the timestamp includes:
[0047] Calculating the time difference between the timestamp of the encrypted data block in the decrypted data and the timestamp of data reception. If the time difference is greater than the preset time threshold, the encrypted data block is marked as an invalid data block; wherein, the encrypted data block is the obfuscated data block in the decrypted data;
[0048] Generating the authentication tag of the encrypted data block according to the generation method of the authentication tag to obtain the second authentication tag;
[0049] Judging whether the first authentication tag is consistent with the second authentication tag; if so, the encrypted data block is marked as a secure data block; if not, the encrypted data block is marked as an invalid data block;
[0050] Performing preset-order splicing on the encrypted data blocks according to the block identifier. If there are invalid data blocks, the spliced file is marked as an invalid file; otherwise, a secure electronic tendering file is obtained;
[0051] Among them, the preset order represents the logical order of the unique identifiers assigned to each data block by the sender when splitting the electronic tendering file.
[0052] The second aspect of the present invention provides an electronic tendering file encryption and transmission system, including:
[0053] A data splitting module, configured to split the electronic tendering file of the sender into multiple data blocks and assign a unique identifier to each data block;
[0054] A parameter generation module, configured to generate a permutation table and a round key sequence according to a session key and a data block identifier, where the session represents a communication interaction process of an electronic bidding document;
[0055] A data encryption module, configured to perform multiple rounds of dynamic confusion operations on a data block. Each round of operation includes bit operations based on the round key sequence and byte position rearrangement based on the permutation table to obtain a confused data block;
[0056] A data sending module, configured to generate an authentication tag for the confused data block, and send the authentication tag, together with a timestamp, a block identifier, a session identifier, and the confused data block, to a receiving end after binding;
[0057] A decryption verification module, configured to perform an inverse decryption operation on the confused data block at the receiving end based on multiple rounds of dynamic confusion operations to obtain decrypted data, and verify the decrypted data according to the authentication tag and the timestamp.
[0058] The third aspect of the present invention provides a storage medium, including:
[0059] A computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the electronic bidding document encryption transmission method described in the first aspect above are implemented, specifically including:
[0060] Dividing the electronic bidding document at the sending end into multiple data blocks and assigning unique identifiers;
[0061] Generating a permutation table and a round key sequence according to a session key and a data block identifier;
[0062] Performing multiple rounds of dynamic confusion operations including bit operations and byte position rearrangement on the data block to generate a confused data block;
[0063] Generating an authentication tag and sending it to the receiving end after binding with a timestamp, a block identifier, a session identifier, and the confused data block;
[0064] Performing an inverse decryption operation at the receiving end and verifying the decrypted data based on the authentication tag and the timestamp.
[0065] Compared with the prior art, the beneficial effects of the present invention are:
[0066] At the encryption algorithm level, the present invention constructs a new encryption system of "dynamic parameters + customized confusion". Different from traditional encryption methods that use fixed round functions, the present invention dynamically generates a unique permutation table for each data block, and introduces independent dynamic parameters in each round of confusion. Combining the confusion factors related to the round key and data content, it forms a dynamic encryption mode of "one permutation for one block and one transformation for one round", making the encryption rules for different data blocks and different rounds completely independent and unpredictable, effectively resisting common means such as differential cryptanalysis and dictionary attacks, and fundamentally breaking the regular defects of static encryption algorithms. At the same time, the multi-round iterative bit operations, byte rearrangement and non-linear transformation are superimposed to achieve multi-layer confusion and diffusion from the bit level, byte level to block level, greatly increasing the analysis difficulty for attackers;
[0067] At the key management and security verification level, the present invention constructs a full-link security protection system. The session key is negotiated and generated through the elliptic curve Diffie-Hellman protocol, and two-way identity authentication is combined with digital certificates to solve the problem of being vulnerable to man-in-the-middle attacks during the transmission process; the HKDF key derivation function is used to achieve key layering and enhance the security of separating key uses. When dividing data into blocks, pseudo-random padding and padding length verification are adopted to avoid the risk of boundary leakage, which is more difficult to reverse-analyze than traditional fixed padding; the binding mechanism of the authentication tag and timestamp forms a double verification of "content fingerprint + time window", which not only ensures that the data has not been tampered with, but also can resist replay attacks, filling the gap in freshness verification in the existing technology. In addition, the single-use of the session key and the strategy of destroying the temporary key pair achieve forward security, that is, even if the long-term private key is leaked, the historical sessions cannot be traced, significantly improving the anti-attack ability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0069] Figure 1 It is a framework schematic diagram of an electronic tender document encryption transmission system provided by the present invention;
[0070] Figure 2 It is a flow schematic diagram of an electronic tender document encryption transmission method provided by the present invention;
[0071] Figure 3 It is a flow schematic diagram of multi-round dynamic confusion operations provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0072] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0073] The electronic tender document encryption and transmission method provided by the embodiments of the present application can be applied to an electronic tender document encryption and transmission system as Figure 1 shown. As Figure 1 shown, the system includes a data segmentation module, a parameter generation module, a data encryption module, a data sending module, and a decryption verification model, and the modules are communicatively connected, where:
[0074] The data segmentation module is used to segment the electronic tender document at the sending end into multiple data blocks and assign a unique identifier to each data block;
[0075] The parameter generation module is used to generate a permutation table and a round key sequence according to the session key and the data block identifier, where the session represents a communication interaction process of an electronic tender document;
[0076] The data encryption module is used to perform multiple rounds of dynamic confusion operations on the data block. Each round of operation includes bit operations based on the round key sequence and byte position rearrangement based on the permutation table to obtain a confused data block;
[0077] The data sending module is used to generate an authentication tag for the confused data block and send the authentication tag, timestamp, block identifier, session identifier, and confused data block to the receiving end after binding;
[0078] The decryption verification module is used to perform reverse decryption operations on the confused data block at the receiving end based on multiple rounds of dynamic confusion operations to obtain decrypted data, and verify the decrypted data according to the authentication tag and timestamp.
[0079] To solve the technical problems such as data tampering, unauthorized access, and replay attacks in the transmission process of electronic tender documents in the prior art, the embodiments of the present application provide an electronic tender document encryption and transmission method. This method ensures the confidentiality, integrity, and freshness of electronic tender documents during the transmission process through multiple rounds of dynamic confusion, session key negotiation, and timestamp authentication mechanisms. Based on this, the specific implementation steps are described in detail below with reference to the accompanying drawings.
[0080] As Figure 2 shown, the electronic tender document encryption and transmission method provided by the embodiments of the present application includes the following steps:
[0081] S101. Segment the electronic tender document at the sending end into multiple data blocks and assign a unique identifier.
[0082] First, determine whether the size FS of the electronic tender document is greater than the preset file size: if it is greater, divide it into data blocks according to the preset data block size BS; if it is not greater, treat the file as a single data block.
[0083] In some implementation manners, when the size of the last data block is less than BS, padding processing is required, which may specifically include:
[0084] Calculate the padding length: PL = (BS - (FS mod BS)) mod BS to ensure that the size of the data block after padding is equal to BS;
[0085] Generate pseudo-random bytes: Generate PL pseudo-random bytes Padding through the pseudo-random number generator PRNG1(SK||BlockID), and splice them to the end of the data block to ensure that the padding between different sessions and different blocks is unpredictable, preventing attackers from inferring the file structure through the padding pattern.
[0086] It should be noted that the padding block structure is "plaintext data||Padding||Lp", where Lp is the big-endian encoding of the padding length, which can be fixed at 2 bytes, and the receiving end can verify the padding integrity by parsing Lp.
[0087] Exemplarily, if FS = 5KB and BS = 4KB, the first data block is 4KB of plaintext, BlockID = 001, the second data block is 1KB of plaintext + 3KB of padding, BlockID = 002. By calculation, the padding length PL = 3072, and the Lp encoding is 0x0C00 (big-endian). The receiving end can verify the padding integrity by parsing Lp. If the actual padding length is inconsistent with the decoded PL, it can be determined that the data has been tampered with.
[0088] S102. Generate a permutation table and a round key sequence according to the session key and the data block identifier.
[0089] First, initialize the key negotiation protocol:
[0090] The tenderer and the bidder execute the ephemeral Diffie-Hellman key exchange protocol based on a predefined set of elliptic curve cryptography parameters; among them,
[0091] The predefined set of elliptic curve cryptography parameters includes: the base point G, the prime order n, and the cofactor h, and is selected from the standard elliptic curve family; both parties exchange and verify digital certificates before communication, and the certificate contains the long-term public key PK 招标 、PK 投标 and is issued by a trusted certificate authority.
[0092] Next, generate a temporary key pair: The tenderer generates a temporary key pair (d 招标 , Q 招标 ), and the bidder generates a temporary key pair (d 投标 , Q 投标 ). The two parties exchange the public keys Q 招标 , Q 投标 through a secure channel;
[0093] Then, the two parties calculate the shared secret point: Z 招标 = d 招标 ·Q 投标 , Z 投标 = d 投标 ·Q 招标 ; where · represents elliptic curve scalar multiplication. Since elliptic curve scalar multiplication satisfies the commutative law, the points obtained by the two parties on the same elliptic curve are called the common secret point Z 招标 , and the x coordinate x z is extracted as the original key material;
[0094] Derive the session key SK through the HKDF function. The input parameters include the original key material, the first tag, and the pre-defined identifiers of both parties.
[0095] It should be noted that the tenderer and the bidder in this embodiment represent the receiving end and the sending end, respectively.
[0096] In one implementation, the derivation and authentication of the session key may include:
[0097] Define the input parameters: Salt = Nonce 招标 ||Nonce 投标 ||T 协商 ; where Nonce 招标 and Nonce 投标 are random numbers generated by both parties, and T 协商 is the key negotiation timestamp;
[0098] Define the derived information Info = "Electronic bidding session key" || the pre-defined identifier of the tenderer || the pre-defined identifier of the bidder; where "Electronic bidding session key" is the pre-defined first tag, which can also be pre-defined as other characters, and the pre-defined identifier of the tenderer and the pre-defined identifier of the bidder can be the tenderer's code and the bidder's code; similarly, the pre-defined identifier of the receiving end can be the receiving end's code, and the pre-defined identifier of the sending end can be the sending end's code. For example, the receiving end's code adopts the form of "R - device number" (e.g., R - 01 represents the 1st receiving device), and the sending end's code adopts the form of "S - device number" (e.g., S - 10 represents the 10th sending device);
[0099] Generate a session key using an HMAC-based key derivation function: SK = HKDF(x z , Salt, Info, L); where L represents the target length of the session key;
[0100] Then both parties use their long-term private keys to sign the ephemeral public keys and exchange to verify the legality of the signatures:
[0101] σ 招标 = Sign(d 招标长期 , Q 招标 ||Q 投标 ), σ 投标 = Sign(d 投标长期 , Q 投标 ||Q 招标 ); σ 招标 represents
[0102] the digital signature generated by the tenderer, σ 投标 represents the digital signature generated by the bidder, d 招标长期 represents the long-term private key of the tenderer, d 投标长期 represents the long-term private key of the bidder, used for identity binding, Sign() represents an asymmetric encryption signature algorithm, such as ECDSA or RSA-PSS, which generates a signature for data by using the private key;
[0103] If the signature verification fails, the session is aborted.
[0104] The shared secret point is the only common point calculated by both parties on the elliptic curve using their ephemeral private keys and the other party's ephemeral public keys. Its mathematical essence is the invariance of the commutativity of scalar multiplication, ensuring that both parties can reach a key consensus without transmitting the private keys. This mechanism is the core link of the session key negotiation of the present invention. Combining the standard elliptic curve parameters and digital certificate authentication, it not only ensures the cryptographic security but also realizes the engineering-level identity trusted verification, providing a secure key foundation for subsequent dynamic confusion encryption.
[0105] It should be noted that the session key SK is only valid for the current transmission session and is immediately destroyed after the session ends. Therefore, even if an attacker obtains the long-term private key, they cannot retrospectively crack the historical session keys.
[0106] In some implementation manners, the permutation table and the round key sequence generation rule are:
[0107] Input SK, BlockID, and the session unique identifier into a hash function to generate a block-level seed. The expression is:
[0108] Seed block = SHA3-256(SK||LE(BlockID)||SessionID); where LE(BlockID) represents
[0109] Indicates converting BlockID into a little - endian byte stream, SHA3 - 256() represents the 256 - bit version of the third - generation hashing algorithm, Seed block represents the block - level seed, SessionID represents the session identifier, which can be generated by combining the tenderer's temporary public key, the bidder's temporary public key, the timestamp Timestamp, and a random number;
[0110] Initialize the pseudo - random number generator PRNG2 with the block - level seed and output the permutation table P. The expression is: P[i]=(PRNG2(SK||BlockID)×i)mod BS, to obtain the new position P[i] of the i - th byte after confusion;
[0111] Generate the round key K r =PRNG2(SK||r)mod 2 32 , where r is the round index and R is the total number of rounds.
[0112] It should be noted that in the present invention, the session key SK, the data - block unique identifier BlockID, and the session identifier SessionID are bound to the hashing function SHA3 - 256 to dynamically generate the block - level seed Seed block , ensuring that the permutation table and round key of each data block have session uniqueness and data - block independence, thereby completely eliminating the security risks of static parameters;
[0113] The pseudo - random number generator initialized based on the block - level seed generates a dynamic permutation table for each data block. Its permutation rule realizes an unpredictable rearrangement of byte positions through linear transformation. At the same time, the round key is generated independently for each round, and the key range is restricted by modulo operation to form the dynamic isolation of multiple - round confusion, making it impossible for attackers to crack the encryption logic through statistical correlation;
[0114] In addition, the introduction of SessionID guarantees parameter isolation between different sessions, and the deep binding of SK and BlockID ensures that even for the same file in multiple transmissions, completely different confusion parameters will be generated, thus taking into account both forward security and the ability to resist replay attacks.
[0115] S103. Perform multi - round dynamic confusion operations on the data block.
[0116] As Figure 3 shown, each round of operation includes bitwise operation and byte rearrangement. The specific process is as follows:
[0117] Generate the dynamic parameters α r and β r : Generate a seed through the round index r and a preset offset, call PRNG2 to generate an intermediate value and obtain it through modulo operation;
[0118] Determine the input B input : The first round is the original data block, and the subsequent rounds are the outputs of the previous round;
[0119] Bit operation: B shift =(B input ⊕K r )<<<s, where s is the shift number of bits;
[0120] Byte rearrangement: Rearrange according to the permutation table P[i] to obtain B permuted [i]=B shift [P[i]], to destroy the byte correlation of the plaintext data;
[0121] Dynamic confusion: Based on the dynamic parameters α r and β r , use the second pseudo-random number generator to generate the dynamic confusion factor Γ of the current data block r , the formula is: Γ r =(PRNG2(Seed dyn ||r)·α r +β r )mod 2 32 ;
[0122] Among them, B represents the plaintext content of the current data block, Seed dyn represents the dynamic seed, which is generated by the session key, block identifier, and session identifier through a hash function. The expression is: Seed dyn =SHA3-256(SK||LE(BlockID)||SessionID);
[0123] Obtain the result of the current round through a combination of predefined XOR / AND / OR / circular shift operations Γ r ; Among them, B represents the plaintext content of the current data block, can represent a combination of XOR + circular shift operations, or other predefined operations;
[0124] Repeat until R rounds are completed to obtain the final confused data block.
[0125] Exemplarily, the dynamic parameters α r and β r can be bound to the round number to ensure that the confusion rule changes dynamically in each round, enhancing the anti-analysis ability. Their generation expressions can be: α r =PRNG2(r·8)mod 2 16 +1, β r =PRNG2(r·8+4)mod 2 32 .
[0126] In the present invention, through a dynamic parameter generation mechanism bound by rounds, it is ensured that the calculation rule of the confusion factor Γ in each round r changes dynamically and unpredictably;
[0127] Through multi-level confusion superposition (bit operation, byte rearrangement, non-linear factor perturbation), deep security protection is achieved; among them, bit operation can destroy local features at the bit level, byte rearrangement driven by a permutation table can eliminate the correlation of byte sequences, and the non-linear operation (XOR / AND / OR / rotation shift combination) of the dynamic confusion factor Γ r further introduces double randomness of the data block content and rounds, forming a multi-dimensional confusion and diffusion effect;
[0128] Due to the multi-round iteration design, the ability to resist differential analysis and statistical attacks is greatly improved by superimposing dynamic rules. Therefore, even if an attacker cracks the single-round logic, it is impossible to deduce the correlation rules across rounds or data blocks.
[0129] S104. Generate an authentication tag and send it bound to the timestamp, block identifier, session identifier, and confused data block.
[0130] Derive the message authentication code key K MAC through the HKDF function, and the expression is: K MAC = HKDF(SK, SessionID, Info = "MAC"); where "MAC" represents a predefined second tag, which can also be predefined as other characters;
[0131] Calculate the authentication tag Tag of the confused data block B confused using the HMAC algorithm, and the expression is: Tag = HMAC(K MAC , B confused ||Timestamp);
[0132] Finally, send the data block identifier BlockID, Tag, timestamp Timestamp, session identifier, and the confused data block together as a data packet to the receiving end.
[0133] In some implementation manners, the timestamp is used to resist replay attacks, and the integrity of the data needs to be verified before sending.
[0134] S105. The receiving end decrypts and verifies the data reversely;
[0135] Timestamp verification: Calculate the difference between the receiving time and the timestamp. If it exceeds the preset threshold, mark the data block as expired;
[0136] Reverse decryption: Execute the inverse calculation of dynamic parameters, inverse byte rearrangement, and inverse bit operation in the reverse order of the rounds of encryption to restore the original data block;
[0137] Authentication label verification: The receiving end generates a second authentication label according to the same rule, compares it with the received first authentication label. If they are consistent, the files are spliced according to the BlockID; otherwise, it is marked as tampered.
[0138] Exemplarily, the specific steps of reverse decryption include:
[0139] First, after the receiving end receives the transmission data packet, it parses the data packet into the following parts: Packet = BlockID || Timestamp || ciphertext block || MAC || SessionID; where the ciphertext block CR represents the encrypted data after multiple rounds of confusion;
[0140] Obtain the negotiated session key SK from the secure storage, and derive the decryption key and parameters according to the session key, including:
[0141] MAC key: K MAC ’ = HKDF(SK, Salt = SessionID, Info = "MAC");
[0142] Permutation table seed Seed 置换表 : Seed 置换表 = SHA3-256(SK || LE(BlockID) || SessionID);
[0143] Round key sequence: According to the round r = R, R-1,..., 1, call PRNG2 to reverse generate the round key: K r ’ = PRNG2(SK || r) mod 2 32 ;
[0144] Then, perform reverse dynamic confusion round by round:
[0145] First, ensure that the total number of rounds R is the same as that during encryption, and then execute:
[0146] Input the ciphertext of the current round: The input of the Rth round is the received ciphertext block CR (i.e., the received encrypted and confused data block), and the input of the subsequent rounds is the output C of the previous round r-1 ;
[0147] Taking the Rth round as an example, the reverse operations include:
[0148] (1) Generate the same dynamic confusion factor Γ as that during encryption r ’:
[0149] Calculate the dynamic seed according to the data parsed from the data packet with the session key: Seed dyn = SHA3-256(SK || LE(BlockID) || SessionID);
[0150] Γ r ’ = (PRNG2(Seeddyn||r) · α r + β r ) mod 2 32 ;
[0151] Then perform reverse operations:
[0152] (2) Perform reverse permutation table rearrangement: Generate the inverse permutation table P -1 [i] according to the permutation table P[i] generated during encryption, and satisfy P -1 [P[i]] = i, and execute: B shift ’[P -1 [i]] = B permuted ’[i];
[0153] (3) Perform reverse circular shift:
[0154] Obtain the shift number s during encryption, such as restored by K r mod 8, and then execute a circular right shift: B xor ’ = B shift ’ >>> s; where, >>> represents a circular right shift;
[0155] (3) Perform reverse round key XOR: B input ’ = B xor ’ ⊕ K r ; Note that the inverse operation of the XOR operation is itself;
[0156] Finally, use the current round output B input ’ as the input for the next round r - 1. After completing all R rounds, obtain the decrypted data block B decrypted .
[0157] Then perform data recombination and padding removal on the decrypted data block to restore it to the original plaintext, that is, the data block without padding characters:
[0158] Read the padding length field at the end of the decrypted data block: Lp = B decrypted [BS - 1];
[0159] Intercept the valid plaintext data B plain : B plain = B decrypted [0:BS - Lp - 1].
[0160] Verify the validity of the valid plaintext:
[0161] (1) Calculate the difference between the reception time and the parsed timestamp, and compare whether the difference is greater than a preset threshold; if so, it indicates that the data transmission has timed out, and the data may have been intercepted and replayed by a man-in-the-middle or the network link is abnormal, resulting in excessive delay. Therefore, mark this data block as expired data and mark this electronic bidding document as an invalid document; if not, retain this data block;
[0162] (2) Calculate the local authentication tag and mark it as the second authentication tag: MAC2 = HMAC(K MAC ’, B plain ||Timestamp)
[0163] If the second authentication tag is the same as the first authentication tag, it indicates that the data is secure and retain this data block; if the two are different, mark this data block as having been tampered with, mark this electronic bidding document as an invalid document, and terminate the current session, and renegotiate the session key SK;
[0164] When all data blocks are verified to be valid, the data blocks are sorted in order according to the identifier to obtain a secure electronic bidding document.
[0165] The embodiment of the present application also provides a computer-readable storage medium, including instructions, which when running on a computer, cause the computer to execute any of the above methods.
[0166] Therefore, if the method of the present invention is implemented in the form of software function modules and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The storage media storing the computer software product include: USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks, or optical discs, etc., which can store program codes.
[0167] Some of the data in the above formula is calculated by removing the dimension and taking its numerical value. The formula is obtained by software simulation of a large amount of collected data to obtain a formula that is closest to the actual situation; the preset parameters and preset thresholds in the formula are set by those skilled in the art according to the actual situation or obtained through simulation of a large amount of data.
[0168] The working principle of the present invention:
[0169] The encrypted transmission method of the electronic tender documents of the present invention is divided into three core stages: sender processing, secure transmission, and receiver verification. At the sender side, first, the electronic tender documents are segmented into multiple data blocks according to preset rules. If the last data block is less than the preset size, it is padded with pseudo-random bytes to ensure that each data block has the same size and is assigned a unique identifier. Subsequently, the tenderer and the bidder negotiate a session key based on the elliptic curve cryptography technology, generate a shared secret point through the temporary key pair, and then obtain the session key through the key derivation function. This key is only valid for the current session to ensure forward security. The substitution table and the round key sequence are dynamically generated using the session key and the data block information, and multiple rounds of confusion operations are performed on each data block. In each round, non-linear transformations are introduced through bit operations, byte rearrangement, and dynamic parameters to form the confused data blocks. Finally, an authentication tag is generated for the confused data blocks, and after binding information such as the timestamp and the block identifier, it is sent to the receiver side.
[0170] After receiving the data, the receiver side first verifies whether the data has expired through the timestamp to resist replay attacks, and then reversely generates the substitution table, round keys, and dynamic parameters required for decryption based on the session key and the data block information, and restores the original data blocks round by round according to the reverse encryption process. After decryption is completed, the authentication tag is recalculated and compared with the tag at the sender side to verify the data integrity. If all verifications pass, the data blocks are spliced in the order of the block identifiers, the padding content is removed, and the original electronic tender documents are restored; if any link verification fails, it is marked that the data has been tampered with or expired, and the processing flow is terminated.
[0171] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical method of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical method of the present invention.
Claims
1. An electronic tender document encryption transmission method, characterized in that, Including: Dividing the electronic tender document at the sending end into multiple data blocks, and assigning a unique identifier to each data block to obtain data block identifiers; Generating a permutation table and a round key sequence according to the session key and the data block identifier; wherein, the session key is used to encrypt the session for transmitting the electronic tender document; Performing multiple rounds of dynamic confusion operations on the data blocks to obtain confused data blocks, and each round of dynamic confusion operation includes bit operations based on the round key sequence and byte position rearrangement based on the permutation table; Generating an authentication tag for the confused data block, and binding and sending the authentication tag, the timestamp, the block identifier, the session identifier, and the confused data block to the receiving end; The receiving end performs an inverse decryption operation on the confused data block based on multiple rounds of dynamic confusion operations to obtain decrypted data, and verifies the decrypted data according to the authentication tag and the timestamp.
2. The electronic tender document encryption transmission method according to claim 1, wherein The dividing the electronic tender document at the sending end into multiple data blocks includes: Determine whether the size FS of the electronic tender document is greater than the preset file size; if so, divide the electronic tender document into data blocks according to the preset data block size BS; if not, process the electronic tender document as a single data block; where represents the ceiling operator; When the size of the last data block after division is less than the preset data block size BS, generating pseudo-random bytes according to the following formula and concatenating the pseudo-random bytes after the last data block: PL = (BS - (FS mod BS)) mod BS; Padding = PRNG1(SK||BlockID) mod 256 PL ; Where, mod represents the modulo operation, PL represents the padding length, Padding represents the pseudo-random bytes, PRNG1() represents the first pseudo-random number generator, SK represents the session key, BlockID represents the data block identifier, and || represents the data concatenation operation.
3. The electronic tender document encryption transmission method according to claim 2, wherein The generation method of the session key includes: The receiving end and the sending end initialize the key negotiation protocol based on the predefined elliptic curve cryptography parameter set by using the Diffie-Hellman key exchange protocol; The receiving end and the sending end respectively generate temporary key pairs, including the temporary private key and the temporary public key of the receiving end, and the temporary private key and the temporary public key of the sending end, and the temporary public keys are all exchanged through the encrypted channel; Performing elliptic curve scalar multiplication on the temporary private key of the receiving end and the temporary public key of the sending end to calculate the shared secret point of the receiving end; Performing elliptic curve scalar multiplication on the temporary private key of the sending end and the temporary public key of the receiving end to calculate the shared secret point of the sending end; Extract the x - coordinate value x of the shared secret point of the receiving end and the sending end z , and obtain the original key material; Generating the session key SK by using the HMAC-based extract-and-expand key derivation function HKDF; wherein the input of the derivation function HKDF includes the original key material, the predefined first tag, the predefined identifier of the receiving end, and the predefined identifier of the sending end, and the HMAC represents the hash-based message authentication code algorithm.
4. The electronic tender document encryption transmission method according to claim 3, wherein The generation method of the permutation table and the round key sequence includes: Inputting the session key, the data block identifier, and the session unique identifier into the hash function to generate a block-level seed; Initializing the second pseudo-random number generator PRNG2() based on the block-level seed, and using the second pseudo-random number generator to output the permutation table and the round key sequence, and the generation rule is: P[i] = (PRNG2(SK||BlockID) × i) mod BS (i = 0, 1,..., BS - 1); where, P[i] is the index value at the i-th position in the permutation table P, indicating the new position of the i-th byte in the data block after confusion; The function of the multiple rounds of dynamic confusion operations is: K r = PRNG2(SK||r) mod 2 32 (r = 1, 2, …, R); where K r represents the key for the r-th round in the round key sequence, R represents the total number of rounds, and r represents the round number index.
5. An electronic tender document encryption transmission method according to claim 4, characterized in that, Generate the dynamic parameters α and β of the r-th round using the second pseudo-random number generator r and β r ; Determine the input B for the dynamic obfuscation operation in the current round input : If the round index r = 1, the input is the current data block; if the round index r > 1, the input is the output C of the previous round r-1 ; The current round key K r is bitwise XORed with the input B input and then circularly left-shifted to obtain the preliminary confusion result B shift , and the expression is: B shift = (B input ⊕ K r ) <<< s; where s represents the number of shift bits, and <<< represents circular left shift; Rearrange the byte positions according to the permutation table P[i] of the current data block to obtain the rearrangement result B permuted [i], and the formula is: B permuted [i] = B shift [P[i]]; Based on dynamic parameters α r and β r , use the second pseudo-random number generator to generate the dynamic confusion factor Γ of the current data block r , and the formula is: Γ r = (PRNG2(Seed dyn ||r)·α r + β r ) mod 2 32 ; where B represents the plaintext content of the current data block, and Seed dyn represents the dynamic seed, which is generated by the session key, block identifier, and session identifier through a hash function; Perform a bitwise confusion operation on the rearrangement result using a dynamic confusion factor to obtain the current round of confusion result C r , and the formula is: Where represents any combination of operations among the four predefined operations of exclusive OR / AND / OR / circular shift; Use the current round of confusion result as the input for the next round until the total number of rounds R is reached to obtain the confused data block.
6. The electronic tender document encryption transmission method according to claim 5, wherein The dynamic parameters α r and β r are generated in the following manner: Multiply the round index r by the first preset offset to generate the first seed, and call the second pseudo-random number generator to generate the first intermediate value; Perform a first modulo operation on the first intermediate value and add a preset lower limit value to the operation result to obtain a dynamic parameter α r ; Multiply the round index r and the second preset offset to generate the second seed, and call the second pseudo-random number generator to generate the second intermediate value; Perform a second modulo operation on the second intermediate value to obtain the dynamic parameter β r .
7. A method for encrypted transmission of an electronic tender document according to claim 1, characterized in that, The generation method of the authentication tag includes: Generate the message authentication code MAC key K using the HKDF function MAC ; wherein the inputs of the HKDF function include a session key, a session unique identifier, and a predefined second tag; Use the HMAC algorithm for the obfuscated data block B confused Calculate the authentication tag Tag to obtain the first authentication tag. The formula is: Tag = HMAC(K MAC , B confused || Timestamp); where Timestamp represents the timestamp.
8. An electronic tender document encryption transmission method according to claim 1, characterized in that, Verifying the decrypted data according to the authentication tag and the timestamp includes: Calculate the time difference between the timestamp of the encrypted data block in the decrypted data and the timestamp of data reception. If the time difference is greater than the preset time threshold, mark the encrypted data block as an invalid data block; wherein, the encrypted data block is the confused data block in the decrypted data; Generate the authentication tag of the encrypted data block according to the generation method of the authentication tag to obtain the second authentication tag; Determine whether the first authentication tag is consistent with the second authentication tag; if so, mark the encrypted data block as a secure data block; if not, mark the encrypted data block as an invalid data block; Stitch the encrypted data blocks according to the block identifier. If there is an invalid data block, mark the stitched file as an invalid file, otherwise obtain the secure electronic tender file.
9. An electronic tender document encryption transmission system is applied to an electronic tender document encryption transmission method described in any one of claims 1-8, and is characterized in that, Include: A data splitting module for splitting the electronic tender file at the sending end into multiple data blocks and assigning a unique identifier to each data block; A parameter generation module for generating a permutation table and a round key sequence according to the session key and the data block identifier, where the session represents a communication interaction process of an electronic tender file; A data encryption module for performing multiple rounds of dynamic confusion operations on the data blocks. Each round of operation includes bit operations based on the round key sequence and byte position rearrangement based on the permutation table to obtain the confused data block; A data sending module for generating an authentication tag for the confused data block and sending the authentication tag, timestamp, block identifier, session identifier, and confused data block bound to the receiving end; A decryption verification module for the receiving end to perform reverse decryption operations on the confused data block based on multiple rounds of dynamic confusion operations to obtain the decrypted data, and verify the decrypted data according to the authentication tag and the timestamp.
10. A storage medium, characterized in that, Include: A computer-readable storage medium with a computer program stored thereon. When the computer program is executed by a processor, it implements the steps of the electronic tender file encryption and transmission method described in any one of claims 1-8, specifically including: Split the electronic tender file at the sending end into multiple data blocks and assign unique identifiers; Generate a permutation table and a round key sequence according to the session key and the data block identifier; Perform multiple rounds of dynamic confusion operations on the data blocks including bit operations and byte position rearrangement to generate the confused data block; Generate an authentication tag and send it to the receiving end after binding it with the timestamp, block identifier, session identifier, and confused data block; Perform reverse decryption operations at the receiving end and verify the decrypted data based on the authentication tag and the timestamp.
Citation Information
Patent Citations
Database encryption confusion method and device, equipment and storage medium
CN117688594A
Method and system for chaotic digital signature, encryption, and authentication
US20050271207A1
Systems and Methods for Custom Device Automatic Password Management
US20100325687A1
A method and a system for transmitting and receiving the data
WO2009000209A1
Providing forward secrecy in a terminating SSL / TLS connection proxy using ephemeral diffie-hellman key exchange
WO2016073552A1
Cited By
Data key encryption transmission method and system based on lockless message queue
CN121644173A
File security packaging method based on hybrid encryption and structured data stream
CN122340109A
