Electronic seal anti-counterfeiting identification method and system based on quantum random number
By using quantum random number generators and quantum entanglement pairing technology, the security vulnerability of predictable signature order in blockchain multi-signature electronic seal systems has been solved, achieving high security and reliable anti-counterfeiting identification of electronic seals. This technology is suitable for applications with high security requirements, such as financial contracts, medical documents, and legal documents.
Patent Information
- Application Number
- CN202511371205.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-24
- Publication Date
- 2025-12-12
AI Technical Summary
In existing blockchain multi-signature electronic seal systems, the predictability of signature order leads to security vulnerabilities. This means that even if the number of malicious nodes does not reach the theoretical attack threshold, the system is still at risk of being successfully attacked, thus reducing the anti-counterfeiting capabilities of electronic seals.
An electronic seal anti-counterfeiting identification method based on quantum random numbers is adopted. A true random number sequence is generated by a quantum random number generator. Combined with quantum entanglement pairing and blockchain state binding, the randomized selection of signature nodes and randomized scheduling of signature timing are realized, generating quantum anti-counterfeiting feature codes, and multi-dimensional verification is performed to ensure the authenticity of the electronic seal.
It effectively eliminates the predictability of signature order, improves the anti-counterfeiting security and reliability of electronic seals, can resist advanced persistent threats, and enhances the credibility and legal validity of electronic documents in the digital business environment.
Smart Images

Figure CN121125272A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of information security, and in particular to an electronic seal anti-counterfeiting identification method and system based on quantum random numbers. BACKGROUND
[0002] The existing electronic seal technology mainly adopts a digital signature scheme based on a PKI public key infrastructure, and verifies the legality of the seal by issuing a digital certificate by a certificate authority. The traditional electronic seal system relies on a centralized certificate management mechanism, uses an RSA or ECC asymmetric encryption algorithm to generate a digital signature, and records the seal generation time through a time stamp server. With the development of blockchain technology, a decentralized electronic seal scheme based on a smart contract has emerged, which uses the tamper-proof nature of the blockchain to ensure the credibility of the seal, disperses the trust risk through a multi-signature mechanism, and reduces the dependence on a single authority.
[0003] The existing technology has significant security defects. The traditional centralized electronic seal scheme relies heavily on the credibility of the certificate authority. Once the CA authority is attacked or has internal problems, the entire trust chain will face the risk of collapse. More critically, the existing blockchain multi-signature electronic seal system generally adopts a deterministic node selection and signature execution strategy. The selection order of the signature nodes is usually based on node ID sorting, stake size or polling mechanism, etc. predictable algorithms, and the signature execution timing also follows a fixed time interval or block height rule. This deterministic design allows attackers to predict future signature patterns by analyzing historical signature data, thereby planning targeted attack schemes.
[0004] When malicious nodes can predict the signature execution sequence, they can implement a timing correlation attack by refusing to participate in the signature or deliberately delaying the response in a critical time window to disrupt the multi-signature process. At the same time, the predictable signature pattern creates conditions for selective participation attacks. Attackers can selectively participate in signature processes that are beneficial to them while avoiding unfavorable situations. More seriously, when the number of signature nodes of the system approaches the Byzantine fault tolerance threshold, malicious nodes with prediction capabilities can maximize their influence on the signature result by coordinating attack strategies, even forcing the system to lower the security threshold to maintain basic functions. This predictability problem caused by deterministic algorithms fundamentally undermines the security assumptions of the multi-signature mechanism, making the system still face the risk of successful attack even if the number of malicious nodes does not reach the theoretical attack threshold, ultimately leading to a significant reduction in the anti-counterfeiting ability of the electronic seal. SUMMARY
[0005] The application provides an electronic seal anti-counterfeiting identification method and system based on quantum random numbers, which is used for solving the security vulnerability problem caused by the predictability of the signature sequence in the multi-signature electronic seal system of the block chain, and improving the security and reliability of the electronic seal anti-counterfeiting identification.
[0006] In a first aspect, the application provides an electronic seal anti-counterfeiting identification method based on quantum random numbers, which comprises:
[0007] Step S1: a quantum random number generator samples a quantum physical process to generate a true random number sequence, performs entropy extraction processing on the true random number sequence, and obtains a quantum random seed;
[0008] Step S2: according to the current attack threat degree of the electronic seal signature history mode analysis, the quantum random seed is distributed and used according to the threat level, the random selection is performed on the block chain signature node, and the signature node sequence is obtained;
[0009] Step S3: the nodes in the signature node sequence are paired and bound in a quantum correlation manner, the execution time sequence of the electronic seal multi-signature is randomized and scheduled, the predictability of the signature sequence is eliminated, and a signature execution scheme is obtained;
[0010] Step S4: the block chain state at the time of generating the electronic seal is extracted, the quantum random seed is bound with the block chain state, and a quantum anti-counterfeiting feature code is generated for the electronic seal;
[0011] Step S5: the quantum anti-counterfeiting feature code of the electronic seal to be verified is extracted, quantum randomness inspection, signature time sequence verification and block chain state verification are performed, the authenticity of the electronic seal is determined, and the anti-counterfeiting identification result is output.
[0012] Optionally, step S1 comprises:
[0013] The photon polarization measurer detects the polarization direction of the single-photon quantum state, generates a random bit of 0 or 1 based on the quantum superposition state collapse mechanism, and obtains an original quantum bit stream;
[0014] The original quantum bit stream is grouped by consecutive bit pairs, when the two bit values in the bit pair are not equal, the first bit value is extracted, and when the two bit values in the bit pair are equal, a discard operation is performed, and a de-biased quantum bit sequence is obtained;
[0015] The de-biased quantum bit sequence is subjected to quantum randomness quality detection, and a randomness deviation value is calculated based on chi-square statistical test, when the randomness deviation value is less than a set threshold, the detection is passed, and a qualified quantum bit stream is obtained;
[0016] The qualified quantum bit stream is equally divided by 256-bit length, a hash function operation is performed on each 256-bit segment, and a timestamp identifier is attached, to obtain a quantum random seed.
[0017] Optionally, step S2 comprises:
[0018] Statistical deviation analysis is performed on the electronic seal history signature time interval data, a signature time sequence abnormality degree value is calculated, and an abnormal score value is obtained;
[0019] Periodic detection is performed on the response time distribution of the blockchain signature node, a time sequence mode repetition degree value is calculated, and a mode score value is obtained;
[0020] The abnormal score value and the mode score value are weighted and accumulated, the threat level is divided according to the accumulation result, and the attack threat degree is obtained;
[0021] Based on the attack threat degree, the quantum random seed is subjected to segmented cutting processing, the random number segments after cutting are subjected to modular operation selection on the blockchain verification node, the effective node is selected through the historical reliability data of the node, and a signature node sequence is obtained.
[0022] Optionally, step S3 comprises:
[0023] The total number of nodes in the signature node sequence is adjusted to an even number, a virtual placeholder node is added when the total number of nodes is odd, and an even node set is obtained;
[0024] Quantum entanglement pairing processing is performed on the even node set, a node pairing weight matrix is generated based on the quantum random seed, a node pairing relationship is determined through maximum weight matching calculation, and an entanglement pairing combination is obtained;
[0025] According to the pairing constraint condition in the entanglement pairing combination, the electronic seal signature position is allocated, when the first node is allocated to the first position, its paired node must be allocated to the last position, when the first node is allocated to the second position, its paired node must be allocated to the second last position, and so on, to obtain a mirror-symmetric position allocation relationship, and a position constraint relationship is obtained;
[0026] Based on the position constraint relationship, the execution time window of the electronic seal multi-signature is randomly allocated, and different segments of the quantum random seed are used to determine the signature time sequence of each node, to obtain a signature execution scheme.
[0027] Optionally, step S4 comprises:
[0028] Data collection is performed on the blockchain network state at the electronic seal generation moment, current block hash value, previous block hash value, block height and timestamp information are extracted, and a blockchain state snapshot is obtained;
[0029] hashing the quantum fingerprint data in the quantum random seed with the blockchain state snapshot, irreversibly associating quantum physical characteristics with the blockchain state through a cryptographic binding algorithm, to obtain a quantum state binding code;
[0030] encrypting and packaging the content hash value of the electronic seal, the document identifier, and the seal image feature based on the quantum state binding code, deeply fusing seal semantic information with quantum physical characteristics, to obtain seal content binding data;
[0031] performing multi-layer hash superposition operation on the quantum state binding code and the seal content binding data, generating an anti-counterfeiting identifier with quantum physical uniqueness and blockchain space-time anchoring characteristics, to obtain a quantum anti-counterfeiting feature code.
[0032] Optionally, the hashing the quantum fingerprint data in the quantum random seed with the blockchain state snapshot, irreversibly associating quantum physical characteristics with the blockchain state through a cryptographic binding algorithm, to obtain a quantum state binding code, comprises:
[0033] extracting the first 64 bits from the quantum random seed as quantum fingerprint original data, performing SHA-256 hash operation on the quantum fingerprint original data to obtain a quantum fingerprint hash value, wherein SHA-256 is a secure hash algorithm that outputs a fixed 256-bit hash digest for any length of input data;
[0034] concatenating the current block hash value and the previous block hash value in the blockchain state snapshot in order, performing SHA-256 hash operation on the concatenated block hash string to obtain a block state hash value;
[0035] performing cryptographic fusion processing on the quantum fingerprint hash value and the block state hash value based on the HMAC key hash message authentication code algorithm, taking the quantum fingerprint hash value as the key and the block state hash value as the message, performing HMAC-SHA256 operation to obtain fusion hash data, wherein the HMAC algorithm ensures the secure binding of the key and the message through two hash operations;
[0036] performing exclusive OR operation on the fusion hash data and the block height value, performing modulo operation on the exclusive OR result and the timestamp data, performing final hash digest calculation on the modulo operation result to obtain a quantum state binding code.
[0037] Optionally, step S5 comprises:
[0038] The intelligent verification contract reads the quantum anti-counterfeiting feature code from the electronic seal file to be verified, performs data segment division processing on the quantum anti-counterfeiting feature code in a predefined format, extracts a quantum state binding code part and a seal content binding data part, and obtains separated verification data;
[0039] The quantum state binding code in the separated verification data is compared and verified with a recomputed quantum fingerprint hash value, the integrity and authenticity of the binding code are verified through an HMAC verification algorithm, when the verification is passed, the quantum characteristic is confirmed to be effective, and a quantum randomness verification state is obtained;
[0040] Based on the entanglement pairing identifier in the separated verification data, the position constraint relationship of the signature node is reconstructed, the actual execution order of the signature is matched and verified with the mirror-symmetrical distribution mode, when the position relationship satisfies the entanglement constraint, the signature timing is confirmed to be correct, and a signature timing verification state is obtained;
[0041] The blockchain state identifier in the separated verification data is compared and verified with the actual blockchain state at the verification time, when the state hash values are completely matched, the blockchain binding is confirmed to be effective, the quantum randomness verification state, the signature timing verification state and the blockchain state verification state are subjected to logical AND operation, and an anti-counterfeiting identification result of electronic seal authenticity determination is obtained.
[0042] In a second aspect, the present application provides an electronic seal anti-counterfeiting identification system based on quantum random numbers, comprising:
[0043] A sampling module is configured to sample a quantum physical process by a quantum random number generator to generate a true random number sequence, and perform entropy extraction processing on the true random number sequence to obtain a quantum random seed;
[0044] A distribution module is configured to analyze a current attack threat level according to an electronic seal signature history mode, distribute and use the quantum random seed according to the threat level, and randomly select a blockchain signature node to obtain a signature node sequence;
[0045] A pairing module is configured to pair and bind nodes in the signature node sequence in a quantum correlation manner, randomize the execution timing of the electronic seal multi-signature, eliminate the predictability of the signature order, and obtain a signature execution scheme;
[0046] A binding module is configured to extract a blockchain state when an electronic seal is generated, bind the quantum random seed with the blockchain state, and generate a quantum anti-counterfeiting feature code for the electronic seal;
[0047] A determination module is configured to extract a quantum anti-counterfeiting feature code from the electronic seal to be verified, perform quantum randomness inspection, signature timing verification and blockchain state verification, determine the authenticity of the electronic seal and output an anti-counterfeiting identification result.
[0048] In a third aspect, an electronic seal anti-counterfeiting identification device based on quantum random numbers is provided, comprising a memory and at least one processor, the memory storing instructions; the at least one processor invokes the instructions in the memory to enable the electronic seal anti-counterfeiting identification device based on quantum random numbers to perform the electronic seal anti-counterfeiting identification method based on quantum random numbers described above.
[0049] In a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium storing instructions, when executed on a computer, enabling the computer to perform the electronic seal anti-counterfeiting identification method based on quantum random numbers described above.
[0050] In the technical scheme provided in the present application, a quantum random number generator is used to sample a quantum physical process to generate a true random number sequence, and an entropy extraction process is performed to obtain a quantum random seed, thereby fundamentally eliminating the predictability problem existing in a conventional pseudo-random number generator. The intrinsic randomness of the quantum physical process ensures the truly random characteristics of the random number sequence in the statistical and information theory levels, and provides an unpredictable random source for subsequent node selection and signature scheduling. A threat adaptive node selection mechanism analyzes the current attack threat level according to the electronic seal signature history mode, and distributes and uses the quantum random seed according to the threat level, thereby realizing dynamic adjustment of the security strength, automatically improving the randomness strength when a potential attack is detected, and reasonably saving quantum resources in a safe environment. A quantum entanglement pairing binding mechanism pairs the signature nodes in a quantum correlation manner, randomizes the execution timing of the multi-signature of the electronic seal, establishes a dependency constraint relationship between the nodes, so that even if an attacker obtains part of the node position information, the complete signature sequence cannot be inferred, and the predictability of the signature order is effectively eliminated.
[0051] The quantum state binding mechanism extracts the blockchain state when the electronic seal is generated, and the quantum random seed is bound to the blockchain state in a cryptographic manner to generate a quantum anti-counterfeiting feature code, realizing irreversible association of quantum physical characteristics and blockchain space-time state. Any environmental or temporal difference will result in completely different anti-counterfeiting identifiers. The multi-dimensional verification framework performs quantum randomness testing, signature timing verification and blockchain state checking on the electronic seal to be verified, checks the integrity of the quantum state binding code through the HMAC verification algorithm, reconstructs the entangled pairing relationship to verify the mirror symmetry distribution of the signature execution, and compares the blockchain state hash value to confirm the effectiveness of the space-time anchoring. This triple verification mechanism ensures the comprehensiveness and reliability of the anti-counterfeiting identification process, and any single link attack cannot bypass the complete verification framework. Especially in the application fields such as financial contracts, medical documents and legal documents, which have extremely high security requirements, the quantum random number driven algorithm and the multi-verification model of the present application can effectively resist advanced persistent threats based on statistical analysis, providing electronic seals with unprecedented anti-counterfeiting protection capabilities, and significantly improving the credibility and legal effectiveness of electronic documents in the digital business environment. BRIEF DESCRIPTION OF DRAWINGS
[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative labor.
[0053] Figure 1 An embodiment schematic diagram of the electronic seal anti-counterfeiting identification method based on quantum random numbers in the embodiments of the present application;
[0054] Figure 2 An embodiment schematic diagram of the electronic seal anti-counterfeiting identification system based on quantum random numbers in the embodiments of the present application;
[0055] Figure 3 The structure schematic diagram of the electronic seal anti-counterfeiting identification device based on quantum random numbers in the embodiments of the present application. DETAILED DESCRIPTION
[0056] The electronic seal anti-counterfeiting method and system based on quantum random numbers provided by the embodiments of the present application are provided. The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" or "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0057] For ease of understanding, the specific process of the embodiments of the present application is described below. Please refer to Figure 1 One embodiment of the electronic seal anti-counterfeiting method based on quantum random numbers in the embodiments of the present application includes:
[0058] Step S1: The quantum random number generator samples the quantum physical process to generate a true random number sequence, performs entropy extraction processing on the true random number sequence, and obtains a quantum random seed;
[0059] Step S2: According to the current attack threat degree of the electronic seal signature history mode analysis, the quantum random seed is distributed and used according to the threat level, the random selection is performed on the block chain signature node, and the signature node sequence is obtained;
[0060] Step S3: The nodes in the signature node sequence are paired and bound in a quantum correlation manner, the execution time sequence of the electronic seal multi-signature is randomized and scheduled, the predictability of the signature order is eliminated, and the signature execution scheme is obtained;
[0061] Step S4: The block chain state at the time of generating the electronic seal is extracted, the quantum random seed is bound with the block chain state, and the quantum anti-counterfeiting feature code is generated for the electronic seal;
[0062] Step S5: The quantum anti-counterfeiting feature code of the electronic seal to be verified is extracted, quantum randomness test, signature time sequence verification and block chain state verification are performed, the authenticity of the electronic seal is determined, and the anti-counterfeiting identification result is output.
[0063] It can be understood that the execution subject of the present application can be an electronic seal anti-counterfeiting system based on quantum random numbers, and can also be a terminal or a server, which is not limited here. The embodiments of the present application take the server as the execution subject for example.
[0064] Specifically, the photon polarization measurer acquires true randomness by exploiting the physical phenomenon of single photons passing through a polarizing beam splitter, each photon is in a superposition state of horizontal and vertical polarization before measurement, and the wave function collapses irreversibly at the moment of measurement, randomly determining one of the polarization states. The randomness generated by this quantum physical process is fundamentally different from traditional pseudo-random number generators, which are based on mathematical algorithms that, although computationally complex, are still theoretically predictable. Von Neumann's debiasing algorithm specifically addresses possible systematic biases in quantum devices, such as a device that tends to produce more horizontally polarized photons. The algorithm eliminates this bias by only retaining pairs of adjacent photons with different states, specifically by outputting 0 for 01 combinations, 1 for 10 combinations, and discarding 00 or 11 combinations. The chi-square statistical test assesses randomness by comparing the observed frequencies of various bit patterns with the expected frequencies of an ideal random distribution. The calculation involves squaring the difference between the observed and expected values for each pattern, dividing by the expected value, and summing all the results to obtain the test statistic. The smaller this value, the better the randomness.
[0065] Electronic seal signature history pattern analysis identifies potential attack patterns by collecting signature behavior data from each signing node in the blockchain network over a period of time. Statistical bias analysis calculates the variance and standard deviation of the signature time intervals for each node. Normal nodes should have relatively random distribution of signature intervals, while attacked or maliciously controlled nodes tend to concentrate signatures in specific time periods. Periodic detection discovers whether there are repetitive patterns by analyzing the response time series of the nodes. The autocorrelation function calculates the correlation of the sequence with itself at different time lags, and high correlation indicates periodic behavior. Threat level classification is based on the weighted combination of anomaly scores and pattern scores. Different threat levels correspond to different intensity quantum random number usage strategies. In high threat situations, more random bits are needed to ensure unpredictability of selection. Modular arithmetic node selection converts quantum random number segments into integer indices within a limited range, mapping random numbers to specific nodes by dividing them by the total number of nodes and taking the remainder. This mapping preserves the unpredictability of the original random numbers.
[0066] The quantum entanglement pairing process draws on the concept of correlation between particles in quantum entanglement to establish a dependency constraint relationship between the signing nodes. The total number of nodes is adjusted to ensure the integrity of the pairing, and the virtual nodes added when there are an odd number of nodes are ignored in actual execution but participate in pairing calculations. The pairing weight matrix generation hashes each node identifier with a different segment of quantum random numbers, and the operation result fills the corresponding position of the matrix to obtain a numerical matrix reflecting the potential correlation strength between nodes. The Hungarian algorithm finds the maximum perfect match in the matrix by iterating the weight. The algorithm first assigns an initial label to each row and column of the matrix, then finds the edges with equal labels to form a match, and constantly adjusts the labels until the maximum weight match covering all nodes is found. The mirror-symmetric position allocation ensures that the position relationship of the paired nodes in the signature sequence is fixed, and the first node is at position i, then the paired node must be at position n+1-i. This constraint makes it impossible to infer the complete sequence even if part of the position information is leaked. The time window randomization converts different segments of quantum random numbers into the signature delay time of each node, and each node must complete the signature operation within its exclusive time window.
[0067] The blockchain state snapshot records the network environment information at the moment of electronic seal generation, including the hash digest of the current processing block, the hash value of the previous block, the serial number position of the current block on the chain, and the timestamp accurate to seconds. The quantum fingerprint data is extracted from the first 64 bits of the quantum random seed, which carries the characteristic information of the quantum physical process. The SHA-256 hash algorithm compresses the input data into a fixed-length digest through complex mathematical transformations, including message padding, block processing, and multiple rounds of iteration. Each round of operation involves a nonlinear function, a modulo addition operation, and a bit shift operation, and finally outputs a unique 256-bit digest value. The HMAC algorithm is based on the hash function and realizes the secure binding of the key and the message through two layers of hash operations. The inner layer operation hashes the message after XORing the key with the input padding value, and the outer layer operation hashes the inner layer result after XORing the key with the output padding value. The double-layer structure resists various cryptographic attacks. The XOR operation performs a bitwise "XOR" logical operation on two binary numbers, outputting 0 for the same bit and 1 for the different bit. The modulo operation takes the remainder of the dividend divided by the divisor.
[0068] When the smart verification contract executes verification, it first parses the data structure of the quantum anti-counterfeiting feature code, separating data segments with different functions according to the format standard used during generation. Quantum state binding code verification re-executes the complete binding code generation process, using the same quantum fingerprint and blockchain state information to calculate the expected binding code value, comparing it bit-by-bit with the value stored in the anti-counterfeiting feature code. HMAC verification recalculates the message authentication code; the verification process requires the same key and message input, and the consistency between the calculation result and the original authentication code confirms data integrity and source authenticity. Entangled pairing identifier verification reconstructs the pairing relationships and positional constraints between nodes, checking whether the actual signature execution strictly follows the preset mirror-symmetric distribution; any deviation indicates that the signature process has been tampered with or forged. Blockchain state verification re-obtains the state information by accessing the current blockchain network, calculating a new state hash value and comparing it with the record in the anti-counterfeiting feature code; a state mismatch indicates that the electronic seal may have been generated in a different environment or that the state information has been tampered with. The three verification results are finally synthesized through Boolean logic AND operations; only when all verifications pass is the electronic seal confirmed to be authentic and valid; failure of any verification results in anti-counterfeiting identification failure.
[0069] In one specific embodiment, step S1 includes:
[0070] The photon polarization meter detects the polarization direction of a single-photon quantum state and generates random bits of 0 or 1 based on the quantum superposition state collapse mechanism to obtain the original quantum bit stream;
[0071] The original quantum bit stream is grouped into consecutive bit pairs. When the two bit values in a bit pair are not equal, the first bit value is extracted. When the two bit values in a bit pair are equal, a discard operation is performed to obtain a debiased quantum bit sequence.
[0072] A quantum randomness quality test is performed on the debiased qubit sequence. The randomness deviation value is calculated based on the chi-square statistical test. When the randomness deviation value is less than a set threshold, the test is passed and a qualified qubit stream is obtained.
[0073] The qualified quantum bit stream is divided into equal-length segments of 256 bits each. A hash function is performed on each 256-bit segment and a timestamp is added to obtain a quantum random seed.
[0074] Specifically, the photon polarization meter achieves quantum state detection through the interaction of a single photon with a polarization beamsplitter. Before passing through the beamsplitter, the single photon is in a superposition of horizontal and vertical polarization. The measurement causes an irreversible collapse of the quantum state, randomly determining it to be either horizontally or vertically polarized. The horizontally polarized state is encoded as bit 0, and the vertically polarized state is encoded as bit 1. Continuously measuring multiple single photons generates a stream of primitive qubits. This random number generation based on quantum physics phenomena is fundamentally different from traditional pseudo-random number generators. The latter rely on complex mathematical algorithms, which, although difficult to predict, are essentially deterministic. In contrast, the generation of quantum random numbers is based on the Heisenberg uncertainty principle, guaranteeing true randomness at the physical level.
[0075] The processing of consecutive bit pairs employs the von Neumann debiasing algorithm to eliminate potential systematic biases in quantum devices. This algorithm determines whether to output or discard a bit pair by examining the combination patterns of adjacent bits. When encountering a bit pair of 01, the algorithm extracts the first bit 0 as the output; when encountering a bit pair of 10, it extracts the first bit 1 as the output; and when encountering a bit pair of 00 or 11, it performs a discard operation without producing any output. This processing mechanism is based on statistical principles: in an ideal random sequence, 01 and 10 have equal probabilities of occurrence, as do 00 and 11. By retaining only the first bit of complementary bit pairs, potential biases in the device can be eliminated. The debiased quantum bit sequence is statistically closer to an ideal uniform distribution.
[0076] Quantum randomness quality testing assesses the randomness level of debiased qubit sequences using a chi-square statistical test. This test divides the qubit sequence into multiple subsequences of a specific length and counts the frequency of each possible qubit pattern within each subsequence. The chi-square statistic is calculated by comparing the observed frequency of each pattern with the theoretical expected frequency. Specifically, it is calculated by squared the difference between the observed frequency and the expected frequency of each pattern, divided by the expected frequency, and then summing the results for all patterns. The expected frequency is calculated based on an ideal random distribution; for a qubit pattern of length k, the expected frequency equals the total number of subsequences divided by 2 to the power of k. The calculated chi-square statistic is compared with a preset critical value. If the statistic is less than the critical value, the qubit sequence passes the randomness test; if the statistic is greater than or equal to the critical value, the sequence exhibits non-random characteristics and needs to be regenerated.
[0077] A qualified quantum bit stream is divided into equal-length 256-bit segments, each segment treated as an independent data unit for hash function operation. The hash function operation uses the SHA-256 algorithm, which compresses input data of arbitrary length into a fixed-length 256-bit digest value through complex mathematical transformations. The SHA-256 algorithm first pads the input data to meet specific length requirements, then divides the padded data into 512-bit message blocks. Each message block undergoes 64 rounds of iterative computation to generate an intermediate hash value, ultimately outputting a 256-bit hash digest. A timestamp records the precise time of the hash operation. The timestamp and hash value are concatenated to obtain the quantum random seed. The addition of the timestamp ensures that even with the same 256-bit input segment, different seed values will be generated.
[0078] In one specific embodiment, step S2 includes:
[0079] Perform statistical deviation analysis on the historical signature time interval data of electronic seals, calculate the numerical value of the signature time sequence anomaly, and obtain the anomaly score value;
[0080] Periodic detection is performed on the response time distribution of blockchain signature nodes, the repetition value of the time sequence pattern is calculated, and the pattern score is obtained.
[0081] The anomaly score and the pattern score are weighted and accumulated, and the threat level is determined based on the accumulated result to obtain the degree of attack threat.
[0082] The quantum random seed is segmented based on the degree of attack threat. The segmented random number is then used to select blockchain verification nodes through modulo operation. Valid nodes are then filtered through the historical reliability data of the nodes to obtain the signature node sequence.
[0083] Specifically, statistical deviation analysis of historical signature time interval data for electronic seals identifies abnormal patterns by collecting signature behavior records of each signature node in the blockchain network over a specific period of time. The statistical deviation analysis first extracts the time interval between two consecutive signature operations of each node, constructing a time series from these time intervals. Then, the mean and standard deviation of this series are calculated as a benchmark for normal behavior. The degree of anomaly is quantified by comparing the deviation of the actual time interval from the benchmark mean. Specifically, the deviation value is obtained by subtracting the benchmark mean from each time interval, and then standardizing the deviation value by dividing it by the standard deviation. The standardized deviation value reflects the degree of anomaly of the time interval relative to the normal distribution. When a node's signature time intervals frequently appear in a specific time period or exhibit obvious clustering characteristics, its standardized deviation value will increase significantly, indicating that the node is suspected of being attacked or maliciously controlled. The anomaly score is obtained by averaging the absolute values of all standardized deviation values; the larger the value, the more the node's signature behavior deviates from the normal pattern.
[0084] Periodicity detection of blockchain signature node response time distribution identifies potential attack patterns by analyzing the time delay between a node receiving a signature request and returning a signature result. The response time data collection process records the start and completion timestamps of each signature operation; the difference between these two times represents the response time. Periodicity detection employs autocorrelation analysis, calculating the correlation between the response time series and its own time lags at different times. The autocorrelation calculation involves multiplying the original time series element-wise with its lagged versions, summing the results, and then dividing by the series length to obtain the correlation coefficient. The time series pattern repetition value is determined by identifying the peak value of the autocorrelation coefficient. When the correlation coefficient corresponding to a certain lag value is significantly higher than other lag values, it indicates that the response time series exhibits a repetitive pattern within that lag period. The pattern score is calculated based on the product of the maximum autocorrelation coefficient and its corresponding period. A high pattern score indicates that the node's response time exhibits a clear periodicity, which is often a typical characteristic of automated attack programs.
[0085] The weighted summation of anomaly and pattern scores comprehensively assesses threat levels by assigning different weight coefficients to the two scores. The weighted summation process multiplies the anomaly score by its corresponding weight coefficient and the pattern score by its corresponding weight coefficient, then adds the two weighted results to obtain the overall threat score. The weight coefficients are assigned based on statistical analysis of historical attack data. Anomaly scores typically have a higher weight because abnormal signature time distributions are a direct manifestation of attack behavior, while pattern scores have a relatively lower weight because periodic patterns, while suspicious, can also be caused by normal business processes. Threat level classification is based on a comparison of the summation result with a preset threshold. A summation result exceeding the high-threat threshold is classified as high-threat, a result within the medium range is classified as standard-threat, and a result below the low-threat threshold is classified as low-threat.
[0086] The threat level determines the segmentation strategy of the quantum random seed, with different threat levels corresponding to different random number usage intensities. The segmentation process divides the quantum random seed into segments of predetermined lengths based on the threat level: high threat levels use 512-bit segments, standard threat levels use 256-bit segments, and low threat levels use 128-bit segments. The segmented random numbers are then converted into unsigned integer values, with the binary bit sequence being weighted and summed according to bit weights. A modulo operation is performed, taking the modulo of the converted integer value with the total number of available blockchain verification nodes. The result serves as the index position of the candidate node in the node list. Historical node reliability data includes metrics such as the node's uptime ratio, signature success rate, and response speed. The screening process sets minimum requirements for each metric; only nodes that simultaneously meet all requirements are selected into the valid node set.
[0087] In one specific embodiment, step S3 includes:
[0088] Adjust the total number of nodes in the signature node sequence to an even number. When the total number of nodes is odd, add virtual placeholder nodes to obtain an even number of nodes.
[0089] Quantum entanglement pairing is performed on an even-numbered set of nodes. A node pairing weight matrix is generated based on a quantum random seed. The node pairing relationship is determined by the maximum weight matching calculation, resulting in an entangled pairing combination.
[0090] The electronic seal signature position is allocated according to the pairing constraints in the entangled pairing combination. When the first node is allocated to the first position, its paired node must be allocated to the last position. When the first node is allocated to the second position, its paired node must be allocated to the second to last position. And so on, to obtain a mirror-symmetric position allocation relationship and a position constraint relationship.
[0091] The execution time window of the electronic seal multi-signature is randomly allocated based on the position constraint relationship. Different fragments of the quantum random seed are used to determine the signature timing of each node, thus obtaining the signature execution scheme.
[0092] Specifically, the adjustment of the total number of nodes in the signature node sequence addresses the technical limitation of the quantum entanglement pairing algorithm requiring an even number of nodes. When the signature node sequence obtained from the previous step contains an odd number of nodes, the algorithm automatically adds a virtual placeholder node to make the total number of nodes even. The virtual placeholder node does not participate in the actual signature operation but participates in the pairing calculation process; its existence ensures that each real node can find a pairing partner. The identifier of the virtual node is generated by inverting the hash value of the real node identifier. This generation method ensures the uniqueness of the virtual node identifier and a clear mathematical relationship with the real node identifier. The even-numbered node set provides the data foundation for subsequent pairing processing; each node has a definite index position and identification information within the set.
[0093] Quantum entanglement pairing borrows the concept of correlation between entangled particles in quantum physics, establishing dependency constraints between electronic seal signing nodes to eliminate the predictability of signature order. The node pairing weight matrix generation process hashes different segments of the quantum random seed with the identifiers of each node, filling the corresponding positions in the weight matrix with the results. Specifically, the quantum random seed is segmented into 64-bit segments, each segment is concatenated with a node identifier, and then input into the SHA-256 hash function. The first 32 bits of the hash output are converted into unsigned integers as weight values. The rows and columns of the weight matrix correspond to different nodes, and each element in the matrix represents the weight of a pair of corresponding nodes. The maximum weight matching calculation uses the Hungarian algorithm to find the perfect matching scheme with the largest total weight. This algorithm iteratively adjusts node labels and searches for augmenting paths to gradually construct the optimal match. The Hungarian algorithm first assigns an initial label to each node, then finds edges with equal labels to form an initial match. When a match is incomplete, the algorithm adjusts the node labels and searches for matching edges again, repeating this process until a perfect match covering all nodes is found. Entangled pairings record the relationships between each pair of nodes. These relationships mean that any change in the position of a node will affect the positional arrangement of its paired nodes.
[0094] The electronic seal signature position allocation is based on the pairing constraints in entangled pairing combinations to achieve a mirror-symmetric position layout. This layout ensures that even if an attacker obtains partial node position information, they cannot deduce the signature sequence. The position allocation algorithm sets the total number of nodes to n, with positions numbered from 1 to n. When the first node in a pair is assigned to position i, its paired node must be assigned to position n + 1 - i. The process of establishing the mirror-symmetric relationship first determines the master and slave nodes in each pair. The position of the master node is determined by the corresponding fragment of a quantum random seed, and the position of the slave node is automatically calculated using the mirror-symmetric formula. The position allocation process employs a constraint satisfaction problem-solving framework, using pairing constraints and position uniqueness constraints as constraints. A backtracking search algorithm is used to find a position allocation scheme that satisfies all constraints. The constraint checking process verifies whether each position allocation violates the mirror-symmetry principle and the node uniqueness principle. When a constraint conflict is found, the algorithm backtracks to the previous step and tries other allocation schemes. The position constraint relationship records the final position arrangement of each node and the corresponding position of its paired node. This relationship constitutes the basic framework for electronic seal signature execution.
[0095] The randomized allocation of execution time windows for electronic seal multi-signatures combines positional constraints with a time dimension, further enhancing the unpredictability of the signing process by assigning a dedicated signing time window to each node. The time window allocation process extracts dedicated random number fragments for each node from a quantum random seed; the length of these fragments is determined based on the total number of nodes and time precision requirements. The time window calculation converts these random number fragments into time delay values. This conversion process involves accumulating binary random numbers according to bit weights to obtain a decimal value, which is then mapped to a preset time range. A base time window is set as a common start time reference for all nodes; each node's actual signing time equals the base time plus its corresponding random delay value. The duration of the time window is also determined using quantum random numbers, ensuring that each node has not only a random start time but also a random end time. The signature execution scheme integrates information from both positional and time constraints, resulting in a signature scheduling plan that specifies when and where each node performs the signing operation.
[0096] In one specific embodiment, step S4 includes:
[0097] Data is collected on the blockchain network state at the moment the electronic seal is generated, and the current block hash value, previous block hash value, block height and timestamp information are extracted to obtain a blockchain state snapshot;
[0098] The quantum fingerprint data in the quantum random seed is fused with the blockchain state snapshot through hash operation, and the quantum physical properties are irreversibly associated with the blockchain state through a cryptographic binding algorithm to obtain the quantum state binding code;
[0099] Based on quantum state binding codes, the content hash value, document identifier and seal image features of electronic seals are encrypted and encapsulated, and the semantic information of the seals is deeply integrated with quantum physical properties to obtain seal content binding data.
[0100] By performing multi-layer hash superposition operations on the quantum state binding code and the seal content binding data, an anti-counterfeiting mark with quantum physical uniqueness and blockchain spatiotemporal anchoring characteristics is generated, resulting in a quantum anti-counterfeiting feature code.
[0101] Specifically, the blockchain network state data collection at the moment of electronic seal generation obtains real-time network state information by accessing blockchain nodes. This information forms the spatiotemporal binding basis between the electronic seal and the specific blockchain environment. The current block hash value is generated through the blockchain network's consensus mechanism, reflecting the data digest of the latest confirmed block. This hash value is generated by double hashing the block header information using SHA-256 and contains key information such as the Merkle root, timestamp, and random number of all transaction data in the block. The hash value of the previous block is recorded in the block header of the current block, resulting in the chain structure of the blockchain. Each block contains the hash value of its predecessor, ensuring the immutability and temporal integrity of the blockchain. The block height represents the current block's position in the entire blockchain, incrementing from zero in the genesis block, with the height increasing by one for each new block generated. The timestamp records the precise time of block generation, typically stored in Unix timestamp format, representing the number of seconds since 00:00 on January 1, 1970. A blockchain state snapshot combines these four key pieces of information into structured data. This snapshot uniquely identifies the state of the blockchain network at the moment the electronic seal is generated. Even slight differences in time or state will result in completely different snapshot data.
[0102] The fusion process of quantum fingerprint data from a quantum random seed and hashing a blockchain state snapshot cryptographically links quantum physical properties with the blockchain state. The quantum fingerprint data is extracted from the first 64 bits of the quantum random seed; this data carries the physical characteristics of quantum state collapse during photon polarization measurement. The cryptographic binding algorithm employs the HMAC key-hash message authentication code mechanism, which securely binds the key and message through two nested hash operations. The binding process first inputs the quantum fingerprint data as the key and the blockchain state snapshot as the message, then performs the inner layer of the HMAC operation. The inner layer XORs the key with a fixed inner padding value, concatenates the XOR result with the message data, and inputs it into the SHA-256 hash function to generate the inner hash value. The outer layer XORs the key with the outer padding value, concatenates the XOR result with the inner hash value, and performs another SHA-256 hash operation, finally outputting a 256-bit authentication code. This two-layer hash structure ensures that the cryptographic binding between the quantum fingerprint and the blockchain state possesses unforgeability and integrity verification capabilities. The quantum state binding code carries the information linking the quantum physical process with the spatiotemporal state of the blockchain; any change to either side will result in a completely different binding code.
[0103] The encrypted encapsulation of electronic seal content uses quantum state binding codes to cryptographically protect the semantic information of the seal, deeply integrating the actual content of the seal with quantum physical properties. The content hash value of the electronic seal is generated by performing a SHA-256 hash operation on the seal text content. This hash value is a unique digital fingerprint of the seal content; any change to the content will produce a completely different hash value. Document identification includes metadata information such as the document's filename, creation time, and document size, which is stored in a structured JSON format. Seal image features are obtained by processing the seal image using a feature extraction algorithm. The extraction process converts the seal image to a grayscale image, performs edge detection and texture analysis, and extracts numerical vectors representing the visual features of the seal. The encrypted encapsulation process uses the symmetric encryption algorithm AES-256, and the encryption key is generated from the quantum state binding code through a key derivation function. The key derivation process takes the quantum state binding code as input and performs multiple rounds of iterative operations through the PBKDF2 key derivation function. Each round of operations includes HMAC calculation and XOR operation, ultimately outputting a 256-bit encryption key. The encryption process sequentially concatenates the seal content hash value, document identifier, and seal image features into plaintext data. Then, a derived key is used to perform AES-256 encryption on the plaintext data to produce ciphertext data. The seal content binding data contains the encrypted seal information and auxiliary parameters used for decryption verification; these data are inextricably linked to the quantum state binding code.
[0104] Multi-layer hash superposition operation merges the quantum state binding code with the seal content binding data to generate a quantum-physically unique anti-counterfeiting feature code. The superposition operation employs a hierarchical hash structure. The first layer concatenates the quantum state binding code with the seal content binding data in a fixed format, including a data length identifier, a data type identifier, and the actual data content, ensuring the structured and unique nature of the concatenated result. The second layer performs a SHA-256 hash operation on the concatenated data to generate the first-layer hash value. The third layer concatenates the first-layer hash value with the timestamp generated by the electronic seal, and then performs a SHA-512 hash operation to generate a longer hash digest. The fourth layer performs a final concatenation and hash operation with the hash result of the third layer and the checksum of the quantum random seed. The checksum is obtained by performing a modulo-2 addition operation on all bits of the quantum random seed. The quantum anti-counterfeiting feature code consists of the result of the final hash operation. This feature code simultaneously carries the random characteristics of the quantum physical process, the spatiotemporal state of the blockchain network, and the semantic content of the electronic seal, with these three elements forming an inseparable cryptographic link.
[0105] In one specific embodiment, the process of performing a hash operation to fuse the quantum fingerprint data in the quantum random seed with the blockchain state snapshot can specifically include the following steps:
[0106] The first 64 bits are extracted from the quantum random seed as the original data of the quantum fingerprint. The SHA-256 hash operation is performed on the original data of the quantum fingerprint to obtain the quantum fingerprint hash value. SHA-256 is a secure hash algorithm that outputs a fixed 256-bit hash digest when inputting data of arbitrary length.
[0107] The current block hash value and the previous block hash value in the blockchain state snapshot are concatenated in order, and the SHA-256 hash operation is performed on the concatenated block hash string to obtain the block state hash value;
[0108] The HMAC key hash message authentication code algorithm performs cryptographic fusion processing on quantum fingerprint hash value and block state hash value. The quantum fingerprint hash value is used as the key and the block state hash value is used as the message. HMAC-SHA256 operation is performed to obtain fused hash data. The HMAC algorithm ensures the secure binding of key and message through two hash operations.
[0109] The fused hash data and the block height value are XORed together. The XOR result is then moduloed with the timestamp data. Finally, the modulo result is used to calculate the final hash digest to obtain the quantum state binding code.
[0110] Specifically, the extraction process of the first 64 bits from the quantum random seed obtains the original quantum fingerprint data from a 256-bit quantum random seed by bit position positioning. These 64 bits carry the physical characteristic information of quantum state collapse during photon polarization measurement. The extraction operation reads bits 0 to 63 of the seed data from left to right according to binary bit order, resulting in a 64-bit continuous bit string. The SHA-256 hash operation performs a cryptographic transformation on this 64-bit original quantum fingerprint data. This algorithm belongs to the SHA-2 cryptographic hash function family and compresses the input data into a fixed-length digest through complex mathematical operations. The SHA-256 algorithm first preprocesses the input data by adding a 1 bit to the end of the data, then adding several 0 bits to make the data length satisfy the condition modulo 512 remainder 448, and finally adding 64 bits to represent the original data length, making the total length a multiple of 512. The preprocessed data is divided into 512-bit message blocks. Each message block is processed through 64 rounds of iterative operations. Each round of operations includes operations such as selection function, main function, constant addition, and circular left shift, and finally outputs a 256-bit quantum fingerprint hash value.
[0111] The concatenation of the current block hash and the previous block hash in the blockchain state snapshot follows a fixed data structure format, combining two 64-bit hexadecimal strings into a 128-bit composite string. The concatenation operation follows the order of current block hash first, then previous block hash, ensuring the uniqueness and consistency of the result. The current block hash reflects the data state of the most recently confirmed block, while the previous block hash establishes a chain relationship with the previous block; their concatenation yields a comprehensive representation of the states of two consecutive blocks. The concatenated block hash string is 128 hexadecimal characters long, corresponding to 512 bits of binary data. The SHA-256 hash operation performs the same cryptographic transformation process as quantum fingerprint data on the concatenated block hash string, outputting a 256-bit block state hash value after preprocessing, block division, and iterative operations on the 512-bit input data. The block state hash value uniquely identifies the blockchain's dual-block state at the time the electronic seal is generated; any change in block data will result in a completely different hash value.
[0112] The HMAC key-hash message authentication code algorithm uses the quantum fingerprint hash value as the key input and the block state hash value as the message input, achieving secure binding of the two data through a two-layer hash structure. The HMAC algorithm first defines two fixed padding constants: an inner padding constant is a repeating sequence of 0x36, and an outer padding constant is a repeating sequence of 0x5C. The length of both constants is equal to the block size of the underlying hash function. The inner operation extends the 256-bit quantum fingerprint hash value to 512 bits, then performs a bitwise XOR operation with the inner padding constant. If the corresponding bits in the XOR operation are the same, the output is 0; otherwise, it is 1. The XOR result is concatenated with the 256-bit block state hash value to obtain 768 bits of inner input data. This data is then subjected to SHA-256 hashing to produce a 256-bit inner hash value. The outer operation performs an XOR operation with the quantum fingerprint hash value and the outer padding constant. The XOR result is concatenated with the inner hash value and subjected to SHA-256 hashing again, finally outputting 256 bits of fused hash data. The two-layer structure of the HMAC algorithm ensures that the cryptographic binding between the key and the message is collision-resistant and unforgeable, so that even if an attacker knows the message content, they cannot generate a valid authentication code without knowing the key.
[0113] The XOR operation between the merged hash data and the block height requires converting the numerical block height into a binary format of the same length as the merged hash data. The block height, a 64-bit unsigned integer, needs to be extended to 256 bits, padding with zeros at higher bits until the required length is reached. The XOR operation performs a bitwise XOR operation between the 256-bit merged hash data and the extended block height data, outputting 0 for identical bits and 1 for different bits, resulting in a 256-bit XOR result. The modulo operation of the timestamp data converts the XOR result into a large integer, then performs a modulo operation on the timestamp value. The result of the modulo operation represents the remainder after dividing the XOR result by the timestamp. The modulo operation result is then converted back to binary format and input into the SHA-256 hash function for final digest calculation. The hash operation, through the same preprocessing, block division, and iteration process, compresses the modulo operation result into a 256-bit quantum state binding code. The quantum state binding code integrates information from four dimensions: quantum physical properties, the blockchain's dual-block state, block height, and timestamp, resulting in a multi-layered cryptographic binding relationship.
[0114] In one specific embodiment, step S5 includes:
[0115] The smart verification contract reads the quantum anti-counterfeiting feature code from the electronic seal file to be verified, performs data segmentation on the quantum anti-counterfeiting feature code according to a predefined format, extracts the quantum state binding code part and the seal content binding data part to obtain the separated verification data.
[0116] The quantum state binding code in the separated verification data is compared and verified with the recalculated quantum fingerprint hash value. The integrity and authenticity of the binding code are verified by the HMAC verification algorithm. When the verification is successful, the quantum property is confirmed to be valid, and the quantum randomness verification state is obtained.
[0117] The positional constraint relationship of the signature nodes is reconstructed based on the entangled pairing identifiers in the separation verification data. The actual execution signature order is matched and verified with the mirror symmetric distribution pattern. When the positional relationship satisfies the entanglement constraint, the signature timing is confirmed to be correct, and the signature timing verification status is obtained.
[0118] The blockchain state identifier in the separated verification data is compared with the actual blockchain state at the verification time. When the state hash values match completely, the blockchain binding is confirmed to be valid. Logical AND operation is performed on the quantum randomness verification state, signature timing verification state, and blockchain state verification state to obtain the anti-counterfeiting identification result for determining the authenticity of the electronic seal.
[0119] Specifically, the smart verification contract reads the quantum anti-counterfeiting feature code from the electronic seal file to be verified by parsing the file's specific data structure to locate and extract the anti-counterfeiting identification information. The quantum anti-counterfeiting feature code is stored in the electronic seal file according to a predefined data format, which includes three parts: a data header identifier, a data length field, and the actual data content. Data segmentation processing cuts the quantum anti-counterfeiting feature code according to the format specification, using fixed demarcation identifiers. These demarcation identifiers use a special byte sequence to mark the start and end positions of different data segments. The quantum state binding code is located in the first 256 bits of the anti-counterfeiting feature code and contains cryptographic information linking quantum physical properties to the blockchain state. The seal content binding data is located in the subsequent data segments and contains the encrypted seal content hash value, document identifier, and seal image features. Separating the verification data involves extracting each component from the composite anti-counterfeiting feature code through a parsing process. Each component carries a type identifier and length information to ensure correct data identification and extraction.
[0120] The verification process of comparing the quantum state binding code in the separated verification data requires re-executing the complete binding code generation process to obtain the expected verification result. The recalculation process first obtains the same quantum fingerprint data from the verification environment. This data maintains consistency with the quantum random seed used during electronic seal generation, ensuring that the same input produces the same output through the deterministic characteristics of the cryptographic hash function. The quantum fingerprint hash value is recalculated by performing a SHA-256 operation on the original quantum fingerprint data. This hash value must be completely consistent with the calculation result during seal generation. The HMAC verification algorithm uses the recalculated quantum fingerprint hash value as the key and the blockchain state information as the message, performing the same HMAC operation process as during generation. The inner operation of the HMAC algorithm XORs the key with the inner padding constant and concatenates it with the message data for hashing. The outer operation XORs the key with the outer padding constant and concatenates it with the inner result for hashing again. The final output authentication code is compared bit-by-bit with the value stored in the quantum state binding code. When the comparison result is a perfect match, it indicates that the integrity and authenticity of the quantum state binding code are confirmed, and the quantum randomness verification state is set to pass. When any mismatch exists, the verification state is set to fail.
[0121] The reconstruction process of entangled pair identifiers restores the positional constraints of signing nodes by parsing the pairing relationship information stored in the separation verification data. Entangled pair identifiers contain mapping information between node identifiers and pairing relationships; the association between each pair of nodes is identified by a unique pairing number. The positional constraint reconstruction algorithm recalculates the position allocation of each node in the signature sequence based on the pairing information. The position calculation follows the mathematical principle of mirror symmetry distribution, meaning that paired nodes exhibit a symmetrical distribution pattern in the position sequence. The process of obtaining the actual execution signature order obtains the true execution sequence by querying the signature records of transactions corresponding to the electronic seals in the blockchain network. This sequence records the actual time order and positional arrangement of each node's participation in signing. The matching verification process compares the reconstructed theoretical positional constraints with the actual execution order node by node. The verification process checks whether the actual position of each node conforms to its pairing constraints. When the positional relationships of all nodes satisfy the constraints of mirror symmetry distribution, the signature timing verification state is set to correct; when any positional constraint violation is found, the verification state is set to incorrect.
[0122] The hash comparison process for the blockchain state identifier verifies the validity of the state binding by re-acquiring the blockchain network state at the verification time. The blockchain state identifier, extracted from the separated verification data, contains key information such as the block hash value, block height, and timestamp at the time the electronic seal was generated. The process of obtaining the actual blockchain state at the verification time involves accessing blockchain network nodes to query the network state at a specified point in time. The query operation locates the corresponding block based on the timestamp and extracts the state information. The hash value recalculation process concatenates and hashes the acquired actual state information in the same format as at the time of generation. The calculation process includes standard steps such as data preprocessing, block partitioning, and iterative transformation. The comparison process precisely matches the recalculated hash value with the original hash value stored in the blockchain state identifier. The matching process uses byte-level comparison to ensure absolute consistency. When the state hash values match perfectly, the validity of the blockchain state binding is confirmed, indicating that the electronic seal was indeed generated under the specified blockchain environment and time conditions. The logical AND operation performs a logical AND operation on three Boolean values: the quantum randomness verification state, the signature timing verification state, and the blockchain state verification state. The final result is true only when all three states are true; any false state results in overall verification failure. The anti-counterfeiting identification result determines the authenticity of the electronic seal based on the output of the logical AND operation. A true value indicates that the electronic seal has been confirmed as genuine and valid through all verification steps, while a false value indicates that the electronic seal has been forged or tampered with.
[0123] The above describes the electronic seal anti-counterfeiting identification method based on quantum random numbers in the embodiments of this application. The following describes the electronic seal anti-counterfeiting identification system based on quantum random numbers in the embodiments of this application. Please refer to [link / reference]. Figure 2 One embodiment of the electronic seal anti-counterfeiting identification system based on quantum random numbers in this application includes:
[0124] The sampling module is used by the quantum random number generator to sample the quantum physical process, generate a true random number sequence, and perform entropy extraction processing on the true random number sequence to obtain a quantum random seed;
[0125] The allocation module is used to analyze the current attack threat level based on the historical pattern of electronic seal signatures, allocate the quantum random seed according to the threat level, and perform random selection on the blockchain signature nodes to obtain a signature node sequence.
[0126] The pairing module is used to pair and bind the nodes in the signature node sequence according to quantum correlation, randomize the execution time of the electronic seal multi-signature, eliminate the predictability of the signature order, and obtain the signature execution scheme.
[0127] The binding module is used to extract the blockchain state when the electronic seal is generated, bind the quantum random seed to the blockchain state, and generate a quantum anti-counterfeiting feature code for the electronic seal.
[0128] The determination module is used to extract the quantum anti-counterfeiting feature code of the electronic seal to be verified, perform quantum randomness verification, signature timing verification and blockchain state verification, determine the authenticity of the electronic seal and output the anti-counterfeiting identification result.
[0129] above Figure 2 The electronic seal anti-counterfeiting identification system based on quantum random numbers in this embodiment of the invention will be described in detail from the perspective of modular functional entities. The electronic seal anti-counterfeiting identification device based on quantum random numbers in this embodiment of the invention will be described in detail from the perspective of hardware processing.
[0130] Reference Figure 3 This invention also provides an electronic seal anti-counterfeiting identification device based on quantum random numbers. This device can be a server, and its internal structure can be as follows: Figure 3 As shown, the quantum random number-based electronic seal anti-counterfeiting identification device includes a processor, memory, display screen, input device, network interface, and database connected via a system bus. The processor, designed as a computer, provides computational and control capabilities. The memory of the quantum random number-based electronic seal anti-counterfeiting identification device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the quantum random number-based electronic seal anti-counterfeiting identification device stores the data corresponding to this embodiment. The network interface of the quantum random number-based electronic seal anti-counterfeiting identification device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the above-described method.
[0131] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the quantum random number-based electronic seal anti-counterfeiting identification device to which the present invention is applied.
[0132] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the electronic seal anti-counterfeiting identification method based on quantum random numbers.
[0133] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0134] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, 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 to cause a quantum random number-based electronic seal anti-counterfeiting identification device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0135] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for anti-counterfeiting identification of electronic seals based on quantum random numbers, characterized in that, The method includes: Step S1: The quantum random number generator samples the quantum physical process to generate a true random number sequence, and performs entropy extraction processing on the true random number sequence to obtain the quantum random seed; Step S2: Analyze the current attack threat level based on the historical pattern of electronic seal signatures, allocate the quantum random seed according to the threat level, and randomly select blockchain signature nodes to obtain a signature node sequence; Step S3: Pair and bind the nodes in the signature node sequence according to quantum correlation, and randomly schedule the execution time of the electronic seal multi-signature to eliminate the predictability of the signature order and obtain the signature execution scheme. Step S4: Extract the blockchain state at the time of electronic seal generation, bind the quantum random seed with the blockchain state, and generate a quantum anti-counterfeiting feature code for the electronic seal; Step S5: Extract the quantum anti-counterfeiting feature code of the electronic seal to be verified, perform quantum randomness verification, signature timing verification and blockchain state verification, determine the authenticity of the electronic seal and output the anti-counterfeiting identification result.
2. The electronic seal anti-counterfeiting identification method based on quantum random numbers according to claim 1, characterized in that, Step S1 includes: The photon polarization meter detects the polarization direction of a single-photon quantum state and generates random bits of 0 or 1 based on the quantum superposition state collapse mechanism to obtain the original quantum bit stream; The original quantum bit stream is grouped into consecutive bit pairs. When the two bit values in a bit pair are not equal, the first bit value is extracted. When the two bit values in a bit pair are equal, a discard operation is performed to obtain a debiased quantum bit sequence. A quantum randomness quality test is performed on the debiased qubit sequence. The randomness deviation value is calculated based on the chi-square statistical test. When the randomness deviation value is less than a set threshold, the test is passed and a qualified qubit stream is obtained. The qualified quantum bit stream is divided into equal-length segments of 256 bits each. A hash function is performed on each 256-bit segment and a timestamp is added to obtain a quantum random seed.
3. The electronic seal anti-counterfeiting identification method based on quantum random numbers according to claim 1, characterized in that, Step S2 includes: Perform statistical deviation analysis on the historical signature time interval data of electronic seals, calculate the numerical value of the signature time sequence anomaly, and obtain the anomaly score value; Periodic detection is performed on the response time distribution of blockchain signature nodes, the repetition value of the time sequence pattern is calculated, and the pattern score is obtained. The anomaly score and the pattern score are weighted and accumulated, and the threat level is divided according to the accumulation result to obtain the attack threat level. Based on the attack threat level, the quantum random seed is segmented and cut. The segmented random number is then used to select blockchain verification nodes through modulo operation. Valid nodes are then filtered through historical reliability data of the nodes to obtain a sequence of signature nodes.
4. The electronic seal anti-counterfeiting identification method based on quantum random numbers according to claim 1, characterized in that, Step S3 includes: The total number of nodes in the signature node sequence is adjusted to an even number. When the total number of nodes is odd, virtual placeholder nodes are added to obtain an even number of nodes. Quantum entanglement pairing is performed on the even-numbered node set. A node pairing weight matrix is generated based on the quantum random seed. The node pairing relationship is determined by the maximum weight matching calculation to obtain the entangled pairing combination. The electronic seal signature position is allocated according to the pairing constraints in the entangled pairing combination. When the first node is allocated to the first position, its paired node must be allocated to the last position. When the first node is allocated to the second position, its paired node must be allocated to the second to last position. And so on, to obtain a mirror-symmetric position allocation relationship and a position constraint relationship. Based on the positional constraints, the execution time window for multiple signatures of electronic seals is randomly allocated, and different fragments of the quantum random seed are used to determine the signature timing of each node, thus obtaining a signature execution scheme.
5. The electronic seal anti-counterfeiting identification method based on quantum random numbers according to claim 1, characterized in that, Step S4 includes: Data is collected on the blockchain network state at the moment the electronic seal is generated, and the current block hash value, previous block hash value, block height and timestamp information are extracted to obtain a blockchain state snapshot; The quantum fingerprint data in the quantum random seed is fused with the blockchain state snapshot through a hash operation, and the quantum physical properties are irreversibly associated with the blockchain state through a cryptographic binding algorithm to obtain the quantum state binding code; Based on the quantum state binding code, the content hash value, document identifier and seal image features of the electronic seal are encrypted and encapsulated, and the semantic information of the seal is deeply integrated with the quantum physical properties to obtain the seal content binding data. The quantum state binding code and the seal content binding data are subjected to multi-layer hash superposition operation to generate an anti-counterfeiting mark with quantum physical uniqueness and blockchain spatiotemporal anchoring characteristics, thus obtaining a quantum anti-counterfeiting feature code.
6. The electronic seal anti-counterfeiting identification method based on quantum random numbers according to claim 5, characterized in that, The process of fusing the quantum fingerprint data from the quantum random seed with the blockchain state snapshot through a hash operation, and irreversibly associating the quantum physical properties with the blockchain state using a cryptographic binding algorithm to obtain a quantum state binding code includes: The first 64 bits are extracted from the quantum random seed as the original data of the quantum fingerprint. The SHA-256 hash operation is performed on the original data of the quantum fingerprint to obtain the quantum fingerprint hash value. SHA-256 is a secure hash algorithm that outputs a fixed 256-bit hash digest when inputting data of arbitrary length. The current block hash value and the previous block hash value in the blockchain state snapshot are concatenated in order, and the SHA-256 hash operation is performed on the concatenated block hash string to obtain the block state hash value. The quantum fingerprint hash value and the block state hash value are cryptographically fused based on the HMAC key hash message authentication code algorithm. The quantum fingerprint hash value is used as the key and the block state hash value is used as the message. HMAC-SHA256 operation is performed to obtain fused hash data. The HMAC algorithm ensures the secure binding of the key and the message through two hash operations. The fused hash data and the block height value are XORed, the XOR result is moduloed with the timestamp data, and the final hash digest is calculated on the modulo result to obtain the quantum state binding code.
7. The electronic seal anti-counterfeiting identification method based on quantum random numbers according to claim 1, characterized in that, Step S5 includes: The smart verification contract reads the quantum anti-counterfeiting feature code from the electronic seal file to be verified, performs data segmentation processing on the quantum anti-counterfeiting feature code according to a predefined format, extracts the quantum state binding code part and the seal content binding data part to obtain the separated verification data. The quantum state binding code in the separated verification data is compared and verified with the recalculated quantum fingerprint hash value. The integrity and authenticity of the binding code are verified by the HMAC verification algorithm. When the verification is successful, the quantum property is confirmed to be valid, and the quantum randomness verification state is obtained. Based on the entangled pairing identifiers in the separated verification data, the positional constraint relationship of the signature nodes is reconstructed, and the actual execution signature order is matched and verified with the mirror symmetric distribution pattern. When the positional relationship satisfies the entanglement constraint, the signature timing is confirmed to be correct, and the signature timing verification status is obtained. The blockchain state identifier in the separated verification data is compared with the actual blockchain state at the verification time. When the state hash values match completely, the blockchain binding is confirmed to be valid. Logical AND operation is performed on the quantum randomness verification state, the signature timing verification state, and the blockchain state verification state to obtain the anti-counterfeiting identification result for determining the authenticity of the electronic seal.
8. An electronic seal anti-counterfeiting identification system based on quantum random numbers, characterized in that, For implementing the quantum random number-based electronic seal anti-counterfeiting identification method as described in any one of claims 1-7, the quantum random number-based electronic seal anti-counterfeiting identification system comprises: The sampling module is used by the quantum random number generator to sample the quantum physical process, generate a true random number sequence, and perform entropy extraction processing on the true random number sequence to obtain a quantum random seed; The allocation module is used to analyze the current attack threat level based on the historical pattern of electronic seal signatures, allocate the quantum random seed according to the threat level, and perform random selection on the blockchain signature nodes to obtain a signature node sequence. The pairing module is used to pair and bind the nodes in the signature node sequence according to quantum correlation, randomize the execution time of the electronic seal multi-signature, eliminate the predictability of the signature order, and obtain the signature execution scheme. The binding module is used to extract the blockchain state when the electronic seal is generated, bind the quantum random seed to the blockchain state, and generate a quantum anti-counterfeiting feature code for the electronic seal. The determination module is used to extract the quantum anti-counterfeiting feature code of the electronic seal to be verified, perform quantum randomness verification, signature timing verification and blockchain state verification, determine the authenticity of the electronic seal and output the anti-counterfeiting identification result.
9. An electronic seal anti-counterfeiting identification device based on quantum random numbers, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the electronic seal anti-counterfeiting identification method based on quantum random numbers as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run by the processor, it causes the processor to execute the electronic seal anti-counterfeiting identification method based on quantum random numbers as described in any one of claims 1 to 7.