Message encryption method and device based on improved digital signature algorithm, and electronic equipment

By improving the digital signature algorithm, using hash functions and random bit strings to generate preprocessed messages, and combining WOTS+ and FORS algorithms to construct a hash forest, the problem of slow encryption speed in financial transactions by post-quantum cryptography algorithms is solved, achieving efficient encryption and reducing storage costs.

CN120956427APending Publication Date: 2025-11-14INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511133382.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-13
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Post-quantum cryptography algorithms are slow in encrypting financial transactions, making it impossible to complete encryption operations in a timely manner. In addition, the large amount of key and signature data increases the cost of cloud storage.

Method used

By improving the digital signature algorithm, a preprocessed message is generated using a hash function and a random bit string. Security parameters and chain length are defined. A hash forest is constructed by combining the WOTS+ and FORS algorithms to generate the final signature result and encrypt it.

Benefits of technology

It simplifies the signature generation process, improves encryption speed, reduces storage requirements, lowers cloud storage costs, and is suitable for high-frequency transactions and real-time communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120956427A_ABST
    Figure CN120956427A_ABST
Patent Text Reader

Abstract

The invention discloses a message encryption method and device based on an improved digital signature algorithm, and electronic equipment, and relates to the field of privacy computing or financial science and technology, and the method comprises the steps: carrying out the calculation through employing a hash function and a pre-generated random bit string, and obtaining a preprocessed message, the sum of chain length parameters of positions of all chains in the signature is equal to a natural number parameter, constructing a Hash forest by using an FORS algorithm, generating a one-time signature for each tree, and combining two signatures by using an upper-layer key to obtain a WOTS + signature; and encrypting the financial transaction message and the preprocessed message based on the final signature result, and transmitting an encryption result and the final signature result to the target terminal for verification. According to the method and the device, the technical problems that the encryption speed is low and the encryption operation cannot be completed in time due to the complex algorithm when the financial transaction message is encrypted by adopting a post quantum cryptography encryption mode in the related technology are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of privacy computing, fintech, or other related fields. Specifically, it relates to a message encryption method, apparatus, and electronic device based on an improved digital signature algorithm. Background Technology

[0002] With the development of the digital age, especially the continuous innovation in the field of fintech, traditional encryption algorithms are facing unprecedented challenges. In current financial transaction systems, asymmetric encryption algorithms are widely used. Algorithms such as RSA (Rivest-Shamir-Adleman Algorithm) and ECC (Elliptic Curve Cryptography), based on the mathematical properties of elliptic curves, dominate, providing essential security and privacy protection for financial transactions. However, since the introduction of the Shor algorithm, the potential threat of quantum computing has gradually become a focus of attention in the encryption field. The Shor algorithm can solve the problems of large number factorization and discrete logarithms in polynomial time, meaning that once large-scale quantum computers become available and sufficiently stable, the security foundation of traditional encryption algorithms will be destroyed, and the encryption security of the financial system will be seriously threatened.

[0003] In response to the challenges of quantum computing, post-quantum cryptography (PQC) has emerged, aiming to design encryption algorithms resistant to quantum attacks. Among these, hash-based signature algorithms, such as WOTS+ (Winternitz one-time signature), have attracted considerable attention due to their theoretical resistance to quantum attacks. The WOTS+ algorithm generates signatures through chained hash operations. Its efficiency in the signing and verification process, as well as its optimization in public key size, make it a fundamental component for building more complex signature schemes.

[0004] However, post-quantum cryptography PQC algorithms have some limitations in practical applications. Compared with traditional encryption algorithms, PQC algorithms involve more complex mathematical operations, such as polynomial multiplication and matrix operations, which results in slower signing and encryption speeds, on average 2-5 times slower. Furthermore, the amount of key and signature data generated by PQC algorithms is large. For financial systems that need to store massive amounts of keys and signatures, the database may need to be expanded by 10-100 times, leading to a significant increase in cloud storage costs.

[0005] There is currently no effective solution to the above problems. Summary of the Invention

[0006] This invention provides a message encryption method, apparatus, and electronic device based on an improved digital signature algorithm, which at least solves the technical problem in related technologies where the algorithm is complex, resulting in slow encryption speed and inability to complete the encryption operation in a timely manner when using post-quantum cryptography to encrypt financial transaction messages.

[0007] To achieve the above objectives, according to one aspect of this application, a message encryption method based on an improved digital signature algorithm is provided, comprising: receiving a financial transaction message to be signed; calculating a preprocessed message using a hash function and a pre-generated random bit string, and defining a security parameter, a chain length parameter w, and a newly added natural number parameter S; generating a hash signature WOTS+ using the private key in the underlying key pair and the preprocessed message, wherein the sum of the chain length parameters w of all chain positions in the WOTS+ signature is equal to the natural number parameter S; constructing a hash forest of K trees using the hash-based multiple one-time signature algorithm FORS, generating a one-time signature for each tree, where K is a positive integer; submitting the one-time signature to the upper-layer key pair through the hash forest, combining the WOTS+ signature and the one-time signature using the upper-layer key pair to generate a final signature result; encrypting the financial transaction message and the preprocessed message based on the final signature result, and transmitting the encryption result and the final signature result to a target terminal for verification.

[0008] Optionally, the step of calculating the preprocessed message using a hash function and a pre-generated random bit string includes: randomly generating a bit string to obtain the random bit string; and using a hash function to perform a hash calculation on the random bit string and the financial transaction information to be signed to obtain the preprocessed message.

[0009] Optionally, the steps of defining the security parameters, the chain length parameter w, and the newly added natural number parameter S include: determining the parameters for the reaction security parameters and the message length; setting the chain length parameter w, where the chain length parameter w is used to define the chain length of the WOTS+ signature; and introducing the natural number parameter S.

[0010] Optionally, the step of generating a hash signature WOTS+ using the private key in the underlying key pair and the preprocessed message includes: generating a signature using the WOTS+ algorithm with the underlying private key and the preprocessed message; during the signature generation process, enumerating the random bit string until the sum of the chain length parameters w of the chain positions mapped to by the preprocessed message equals the natural number parameter S.

[0011] Optionally, the step of constructing a hash forest of K trees using the hash-based multiple one-time signature algorithm FORS includes: generating K hash-based trees, wherein each tree contains multiple leaf nodes; generating a multiple one-time signature based on the underlying private key for each tree; controlling the hash of the last tree to always expose the first leaf, and setting the last b bits of the hash output to zero, wherein the first leaf is the leaf with index 0, and b is a positive integer greater than 1.

[0012] Optionally, the step of combining the WOTS+ signature and the one-time signature using the upper-level key pair to generate the final signature result includes: submitting the one-time signature of each tree to the upper-level key pair; and using the upper-level key pair without authentication to combine the WOTS+ signature and the one-time signature to generate the final signature result.

[0013] Optionally, the step of transmitting the encryption result and the final signature result to the target terminal for verification includes: at the target terminal, verifying the encryption result in the encrypted data packet; and using the public key of the upper-layer key pair to verify the final signature result to confirm the integrity and authenticity of the financial transaction message.

[0014] According to another aspect of the present invention, a message encryption device based on an improved digital signature algorithm is also provided, comprising: a message receiving unit for receiving a financial transaction message to be signed; a message calculation unit for calculating a preprocessed message using a hash function and a pre-generated random bit string, and defining a security parameter, a chain length parameter w, and a newly added natural number parameter S; a first signature unit for generating a hash signature WOTS+ using the private key in the underlying key pair and the preprocessed message, wherein the sum of the chain length parameters w of all chain positions in the WOTS+ signature is equal to the natural number parameter S; a second signature unit for constructing a hash forest of K trees using the hash-based multiple one-time signature algorithm FORS, generating a one-time signature for each tree, where K is a positive integer; a signature combination unit for submitting the one-time signature to the upper-layer key pair through the hash forest, combining the WOTS+ signature and the one-time signature using the upper-layer key pair to generate a final signature result; and a message encryption unit for encrypting the financial transaction message and the preprocessed message based on the final signature result, and transmitting the encryption result and the final signature result to a target terminal for verification.

[0015] Optionally, the message calculation unit includes: a bit string generation module, used to randomly generate a bit string to obtain the random bit string; and a message calculation module, used to perform hash calculation on the random bit string and the financial transaction information to be signed using a hash function to obtain the preprocessed message.

[0016] Optionally, when defining security parameters, chain length parameter w, and the newly added natural number parameter S, the message calculation unit includes: a parameter determination module for determining the parameters of the security parameters and message length; a chain length setting module for setting the chain length parameter w, wherein the chain length parameter w is used to define the chain length of the WOTS+ signature; and a natural number parameter import module for importing the natural number parameter S.

[0017] Optionally, the first signature unit includes: a first signature generation module, used to generate a signature using the underlying private key and the preprocessed message through the WOTS+ algorithm; and an enumeration module, used to enumerate the random bit string during the signature generation process until the sum of the chain length parameters w of the chain positions mapped to by the preprocessed message equals the natural number parameter S.

[0018] Optionally, the second signature unit includes: a hash tree generation module for generating K hash-based trees, wherein each tree contains multiple leaf nodes; a second signature generation module for generating a multi-one-time signature based on the underlying private key for each tree; and a setting module for controlling the hash of the last tree to always expose the first leaf, and setting the last b bits of the hash output to be zero, wherein the first leaf is the leaf with index 0, and b is a positive integer greater than 1.

[0019] Optionally, the signature combination unit includes: a signature submission module for submitting a one-time signature for each tree to the upper-level key pair; and a signature combination module for combining the WOTS+ signature and the one-time signature using the upper-level key pair without authentication to generate the final signature result.

[0020] Optionally, the message encryption unit includes: an encryption verification module for verifying the encryption result in the encrypted data packet at the target terminal; and a signature verification module for verifying the final signature result using the public key of the upper-layer key pair to confirm the integrity and authenticity of the financial transaction message.

[0021] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the message encryption method based on the improved digital signature algorithm described above.

[0022] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the message encryption method based on the improved digital signature algorithm described above.

[0023] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the message encryption method based on the improved digital signature algorithm described in any one of the above embodiments.

[0024] In this disclosure, a financial transaction message to be signed can be received; a preprocessed message can be calculated using a hash function and a pre-generated random bit string, and security parameters, chain length parameter w, and a newly added natural number parameter S can be defined; a hash signature WOTS+ can be generated using the private key in the underlying key pair and the preprocessed message, wherein the sum of the chain length parameters w of all chain positions in the WOTS+ signature is equal to the natural number parameter S; a hash forest of K trees can be constructed using the hash-based one-time signature algorithm FORS, and a one-time signature can be generated for each tree, where K is a positive integer; the one-time signature can be submitted to the upper-layer key pair through the hash forest, and the WOTS+ signature and the one-time signature can be combined using the upper-layer key pair to generate the final signature result; the financial transaction message and the preprocessed message can be encrypted based on the final signature result, and the encrypted result and the final signature result can be transmitted to the target terminal for verification.

[0025] Based on the above-mentioned publicly available information, we can move beyond the original framework of SPHINCS+ and modify the original structure (introducing an additional parameter S, where the sum of the chain length parameters w of all chain positions in the WOTS+ signature equals the natural number parameter S). This simplifies the computation steps, speeds up encryption and signature generation, and by restricting and modifying the data structure, eliminates some signatures, thereby directly simplifying the process, improving efficiency, and enabling faster message encryption. This solves the technical problem in related technologies where post-quantum cryptography is used to encrypt financial transaction messages, resulting in complex algorithms, slow encryption speed, and inability to complete encryption operations in a timely manner. Attached Figure Description

[0026] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0027] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a message encryption method based on an improved digital signature algorithm is shown.

[0028] Figure 2 This is a flowchart of an optional message encryption method based on an improved digital signature algorithm according to an embodiment of the present invention;

[0029] Figure 3This is a schematic diagram of an optional message encryption device based on an improved digital signature algorithm according to an embodiment of the present invention;

[0030] Figure 4 This is a structural block diagram of an electronic device that performs a message encryption method based on an improved digital signature algorithm according to an embodiment of this application. Detailed Implementation

[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0033] To facilitate understanding of the present invention by those skilled in the art, some terms or nouns involved in the various embodiments of the present invention are explained below:

[0034] Post-Quantum Cryptography (PQC): Post-quantum cryptography aims to design encryption algorithms that can withstand attacks from quantum computers, ensuring the continuity of secure communication and data protection in a quantum computing environment.

[0035] The Winternitz One-Time Signature Scheme (WOTS) is a hash-based one-time signature algorithm characterized by its efficient signing and verification process and optimized public key size. Each private key can only be used to sign one message, thus enhancing security. WOTS is widely used as the underlying signature mechanism in signature algorithms such as SPHINCS+.

[0036] Winternitz OTS Plus (WOTS+) is an improved version of the one-time signature scheme. It enhances the security and efficiency of standard WOTS primarily by introducing a pre-hashing mechanism. It effectively reduces the size of the public key and signature while maintaining good security performance.

[0037] Hash Oriented Reusable Signatures (HORS) is a hash function-based signature algorithm. Unlike the traditional WOTS, it allows multiple one-time signatures to be generated per key. HORS improves signature reusability by selectively using a subset of key material to generate signatures.

[0038] Flexible OTS-based Signatures (FORS): FORS is an improvement on the HORS algorithm. It enables flexible reuse of signatures by constructing signatures using a variable number of WOTS+ signatures. FORS is used as a component in signature algorithms such as SPHINCS+ to build more advanced signature structures.

[0039] The SPHINCS+ digital signature algorithm, or SPHINCS+ for short, is a high-efficiency post-quantum digital signature algorithm that combines WOTS+ and FORS one-time signature algorithms with Merkle tree technology to achieve a multi-layered signature structure.

[0040] A Merkle tree is a binary tree structure used for data integrity verification. Each leaf node contains the hash of the data, while each non-leaf node contains a combination of the hashes of its child nodes. Merkle trees are used in signature algorithms such as SPHINCS+ to build a key hierarchy to support multiple signatures and verifications.

[0041] A hash function maps input data of arbitrary size to output data (hash value) of fixed size. Hash functions play a central role in scenarios such as digital signatures and data integrity verification. In the SPHINCS+ algorithm, the hash function is used to generate signatures and verify their correctness.

[0042] A pseudorandom function (PRF) is a key-controlled deterministic function whose output appears random but can be repeatedly generated using the same key and input. In the SPHINCS+ algorithm, the PRF is used to generate the underlying key pair, ensuring the unpredictability and security of the signature.

[0043] It should be noted that the message encryption method and apparatus based on the improved digital signature algorithm in this disclosure can be used in the field of privacy computing technology for the encryption of financial transaction messages based on the improved digital signature algorithm SPHINCS+, and can also be used in any field other than the field of privacy computing technology for the encryption of financial transaction messages based on the improved digital signature algorithm SPHINCS+. This disclosure does not limit the application field of the message encryption method and apparatus based on the improved digital signature algorithm.

[0044] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, and displayed data) collected in this public disclosure are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with the relevant laws, regulations, and standards of the relevant regions, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse. For example, this system has interfaces with relevant users or organizations. Before obtaining relevant information, a request to obtain the information needs to be sent to the aforementioned user or organization through the interface, and the relevant information is obtained only after receiving consent from the aforementioned user or organization.

[0045] It should be noted that in this disclosure, customer information is collected and analyzed, and users are provided with corresponding operation entry points to choose whether to agree to or reject the automated decision results; if the user chooses to reject, the process will proceed to the expert decision-making process.

[0046] The following embodiments of the present invention can be applied to various systems / applications / devices based on improved digital signature algorithms for message encryption. The present invention can be applied to financial technology transaction security scenarios (such as banking, payment systems, digital currency transactions, etc.). It can improve the encryption efficiency and storage economy of transaction messages while maintaining defense against quantum computer attacks. It can also be applied to digital certificate and timestamp services, enabling quantum-secure encryption of certificate and timestamp information to ensure its continued validity and unforgeability in the future quantum computing era.

[0047] By optimizing the WOTS+ and FORS algorithms, this invention reduces the time for signature generation and verification, and improves the efficiency of encryption processing, which is particularly beneficial for high-frequency transactions and real-time communication.

[0048] By simplifying the data structure of signatures and public keys, this invention significantly reduces storage space requirements, thereby lowering the cost of cloud and local storage, which is particularly important for financial systems that handle large amounts of data and keys.

[0049] Furthermore, by adjusting parameters, this invention can flexibly balance different security and performance requirements, making it suitable for various application scenarios, especially in environments requiring high performance and quantum security.

[0050] The present invention will now be described in detail with reference to various embodiments.

[0051] Example 1

[0052] According to an embodiment of the present invention, an embodiment of a message encryption method based on an improved digital signature algorithm is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0053] The message encryption method based on the improved digital signature algorithm provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram is shown for a computer terminal (or mobile device) used to implement a message encryption method based on an improved digital signature algorithm. Figure 1 As shown, computer terminal 10 (or mobile device) may include one or more ( Figure 1 (Illustrated as 102a, 102b, ..., 102n) Processor 102 (processor 102 may include, but is not limited to, a microprocessor MCU (Microcontroller Unit) or a programmable gate array (FPGA), etc.), memory 104 for storing data, and transmission device 106 for communication functions. In addition, it may include: a display, input / output interface (I / O interface), Universal Serial Bus (USB) port (which may be included as one of the ports of a BUS bus), network interface, power supply, and / or camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0054] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0055] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the message encryption method based on the improved digital signature algorithm in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the aforementioned message encryption method based on the improved digital signature algorithm. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0056] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0057] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0058] Under the aforementioned operating environment, this application provides the following: Figure 2 The message encryption method shown is based on an improved digital signature algorithm. Figure 2 This is a flowchart of an optional message encryption method based on an improved digital signature algorithm according to an embodiment of the present invention, such as... Figure 2As shown, the method includes the following steps:

[0059] Step S201: Receive the financial transaction message to be signed.

[0060] In this embodiment, the system first receives financial transaction messages that require digital signatures. These messages can involve data related to financial operations, including but not limited to transfer requests, payment confirmations, and transaction records. Receiving such messages typically occurs during interactions between the client and server, or at any node involved in transaction authentication, ensuring the integrity and tamper-proof nature of the messages.

[0061] Step S202: Calculate the preprocessed message using a hash function and a pre-generated random bit string, and define the security parameter, chain length parameter w, and the newly added natural number parameter S.

[0062] This embodiment uses a hash function to preprocess the financial transaction message, typically a secure hash function such as SHA-256 or SHA-3, to generate a fixed-length output, usually called a message digest or hash value. In this step, to enhance the efficiency and security of the signature algorithm, the received financial transaction message is concatenated with a pre-generated random bit string, and then the combination is processed using a hash function. This step increases the unpredictability and uniqueness of the message, making the signature more secure, and also adds additional verification conditions, making the signature verification process more efficient.

[0063] Optionally, the step of calculating the preprocessed message using a hash function and a pre-generated random bit string includes: randomly generating a bit string to obtain a random bit string; and using a hash function to perform hash calculation on the random bit string and the financial transaction information to be signed to obtain the preprocessed message.

[0064] In this embodiment, a random bit string is first generated. This random bit string acts as an additional security layer to enhance the generation process of the preprocessed message. For the security of financial transactions, the addition of the random bit string increases the difficulty for attackers to predict or reverse engineer the preprocessed message, thereby improving the overall security of the system.

[0065] Furthermore, this embodiment utilizes a hash function to perform hash calculations on the received random bit string and the financial transaction information to be signed, generating a preprocessed message. Here, the hash function converts input data of arbitrary length into a fixed-length output, commonly referred to as a hash value or message digest. This process is unidirectional, meaning the original input cannot be deduced from the hash value, and it also exhibits the property that small changes can lead to significant changes, i.e., the avalanche effect. Through this hash calculation, the financial transaction information is transformed into a highly generalized message digest that is difficult to reverse, which, combined with the random bit string, forms the preprocessed message. The purpose of this is to simplify complex information during the subsequent signature generation process, while also increasing the efficiency and security of the signature verification process.

[0066] Optionally, the steps of defining the security parameters, the chain length parameter w, and the newly added natural number parameter S include: determining the parameters for the reaction security parameters and the message length; setting the chain length parameter w, where the chain length parameter w is used to define the chain length of the WOTS+ signature; and introducing the natural number parameter S.

[0067] The security parameter 'n' determines the scale of computational attacks the signature algorithm in this embodiment can withstand. Optionally, 'n' is related to the message length and the desired security level. In post-quantum cryptography, the choice of security parameters is particularly critical because it directly affects the strength of the signature algorithm and its ability to defend against quantum computer attacks. Choosing an appropriate 'n' ensures the security of the signature while balancing the use of computational and storage resources.

[0068] The chain length parameter *w*, specifically the Winternitz parameter in the WOTS+ algorithm, defines the length of the signature chain. This directly affects the signature generation and verification process. In the traditional WOTS+ algorithm, the size of *w* impacts both efficiency and security; increasing *w* can reduce the signature size but may increase the complexity of signature verification. In this embodiment, the choice of *w* needs to be coordinated with the security parameter *n* and other parameters to achieve an optimal balance between performance and security.

[0069] Furthermore, this embodiment introduces an additional natural number parameter S to further optimize the randomness and verification efficiency in the signature process. S is used to construct an additional mathematical condition: the goal of the signature algorithm is to find a suitable random bit string s such that the cumulative value of each chain position in the generated bit string d (obtained through the hash function H(s||m)) equals S. This reduces the complexity and size of the signature while increasing the intuitiveness and speed of the verification process. The definition and use of S are the core of this embodiment's improvement to the SPHINCS+ (SPHINCS Plus, a post-quantum-secure signature algorithm) algorithm. By restricting specific properties of the signature space, the goals of improving efficiency and reducing storage requirements are achieved.

[0070] Step S203: Generate a hash signature WOTS+ using the private key in the underlying key pair and the preprocessed message, wherein the sum of the chain length parameters w of all chain positions in the WOTS+ signature is equal to the natural number parameter S.

[0071] Optionally, the step of generating a hash signature WOTS+ using the private key in the underlying key pair and the preprocessed message includes: generating a signature using the WOTS+ algorithm with the underlying private key and the preprocessed message; during the signature generation process, enumerating random bit strings until the sum of the chain length parameters w of the chain positions mapped to by the preprocessed message equals the natural number parameter S.

[0072] In step S203 of this embodiment, the core action involves generating a special digital signature called the WOTS+ signature using the private key from the underlying key pair and the previously calculated preprocessed message. WOTS+ is a hash-based signature scheme designed to provide one-time signature capabilities while enhancing security and reducing signature size by adding extra layers and optimizations to the original Winternitz signature. In this step, the preprocessed message is combined with the underlying private key and follows the specific rules of the WOTS+ algorithm to generate a signature. This signature process involves the creation of multiple hash chains, the length of which is determined by the chain length parameter w.

[0073] To ensure the signature's unique property—that the sum of the chain length parameters *w* at all chain positions in the WOTS+ signature equals a pre-defined natural number parameter *S*—this embodiment employs a unique signature generation strategy. This strategy involves enumerating random bit strings. The system continuously tries different random bit strings until it finds one that satisfies the condition: after processing the preprocessed message and this random bit string using a hash function, the sum of the *w* values ​​mapped to each hash chain position exactly equals *S*. While this enumeration process increases the initial signature generation time, the resulting signature has a more compact data structure and a faster verification mechanism because the verifier only needs to confirm whether the sum condition is met, without needing to verify each chain individually. This method significantly simplifies the signature generation and verification process while maintaining a certain level of security, particularly for scenarios involving large-scale financial transactions, significantly improving efficiency and reducing storage costs.

[0074] The generation of WOTS+ signatures not only relies on the private key in the underlying key pair but also cleverly utilizes preprocessed messages and the natural number parameter S. By enumerating random bit strings, it ensures that the generated signature satisfies a specific mathematical constraint: the sum of the chain length parameters w equals S. This method improves the efficiency of the signature algorithm while maintaining defense against quantum attacks, providing advanced technical support for the security protection of financial transaction data. Furthermore, due to the signature optimization, this embodiment also helps reduce the high costs associated with storing large amounts of signature data in cloud computing environments. It can handle massive transaction records and financial systems that require frequent signature verification. In other words, by optimizing the signature generation process, it achieves the goal of fast and efficient signing of financial transaction information while ensuring post-quantum security.

[0075] Step S204: Construct a hash forest of K trees using the hash-based one-time signature algorithm FORS, and generate a one-time signature for each tree, where K is a positive integer.

[0076] Optionally, step S204 includes: generating K hash-based trees, each containing multiple leaf nodes; generating a multi-one-time signature based on the underlying private key for each tree; controlling the hash of the last tree to always expose the first leaf, and setting the last b bits of the hash output to zero, where the first leaf is the leaf with index 0, and b is a positive integer greater than 1.

[0077] Each tree is generated starting with the hash of the underlying private key. The private key is expanded into the private keys of multiple leaf nodes through a hash function. The root public key of each hash tree is derived from the public keys of the leaf nodes through hierarchical hashing operations, forming a tree structure. The public key of the leaf node is calculated using the corresponding private key and hash function.

[0078] For each tree, multiple one-time signatures are generated based on the underlying private key: Unlike traditional hash signature schemes, such as HORS, which can only generate one signature per hash tree, the FORS algorithm allows multiple one-time signatures to be generated per tree. This is thanks to the flexible use of its underlying private key and the subtree-based signature mechanism. In this embodiment, the underlying private key of each hash tree is used to generate multiple one-time signatures to adapt to the signing requirements of different messages, while maintaining the security and one-time signature principle.

[0079] Furthermore, in this embodiment of the invention, the hash of the last tree is always made public by exposing the first leaf node, and the last b bits of the hash output are all set to zero, further optimizing the signature generation and verification process. By controlling the hash output of the last tree, it is ensured that its last b bits (b is a positive integer greater than 1) are always zero, and the first leaf node with index 0 is made public. This reduces the amount of information that needs to be stored and verified during the signature process. That is, when the signature is generated, there is no need to store additional hash values ​​for the verification path of the last leaf node. The verifier can directly check whether the last b bits of the hash output are zero and whether the first leaf node is made public, thus simplifying the verification process. Once this is enforced, the verifier knows that only signatures that show leaf 0 in the last tree are valid and can directly check it in the result digest value. Therefore, the signature itself does not require an actual authentication path. This means that we now only need to store a counter in the signature, instead of storing a counter in the entire authentication path of the last tree.

[0080] Step S205: Submit a one-time signature to the upper-layer key pair through the hash forest, and combine the WOTS+ signature and the one-time signature using the upper-layer key pair to generate the final signature result.

[0081] Optionally, the step of combining the WOTS+ signature and the one-time signature using the upper-level key pair to generate the final signature result includes: submitting the one-time signature of each tree to the upper-level key pair; and combining the WOTS+ signature and the one-time signature using the upper-level key pair without authentication to generate the final signature result.

[0082] First, the one-time signature of each tree needs to be submitted to the key pair located at the upper level of the hash forest. The hash forest structure consists of multiple layers of hash trees, with the root node of each layer serving as the leaf node of the next layer, ultimately forming a tree structure. Through this multi-layered structure, SPHINCS+ can effectively generate and verify signatures while maintaining defenses against quantum computing attacks.

[0083] Next, a higher-level key pair is used for signature combination. This higher-level key pair contains a public-private key pair used to connect signatures across different hash trees, ensuring the security and integrity of the entire signature process. Unlike the authentication process in traditional signature algorithms, in this embodiment, the higher-level key pair is primarily used for signature combination, not for directly verifying the signer's identity. That is, the higher-level key pair does not directly perform authentication during signature combination; instead, it serves as part of the signature chain, ensuring the consistency and unforgeability of signatures from the bottom to the top.

[0084] The process of generating the final signature in this embodiment involves merging the underlying WOTS+ signature with the one-time signature combined with the upper-level key pair. This includes concatenating all lower-level signatures in a predefined order and then encrypting or signing them using the upper-level key pair. The final signature will contain all the necessary information so that the recipient can verify the correctness of the signature and the integrity of the message, while also preserving the defense against quantum computing threats.

[0085] In this embodiment, submitting the one-time signature of each tree (the tree to which the one-time signature generated by the FORS algorithm belongs) to the upper-level key pair is the starting point of the signature combination process. This ensures that the lower-level signatures can be integrated into the higher-level signature structure, ultimately forming a complete and coherent signature chain. By submitting the one-time signature to the upper-level key pair, not only is the complexity of the signature increased, but the resistance to quantum attacks during signature verification is also improved.

[0086] In combining WOTS+ signatures and one-time signatures, the use of the upper-layer key pair does not involve traditional authentication. This means that the combination of signatures is not based on verifying the signer's identity or proving they possess a specific key, but rather on the structure and mathematical properties of the algorithm to ensure the consistency and security of the signatures. Specifically, the upper-layer key pair encrypts or signs the lower-layer signatures using its private key, while the public key is used to decrypt or verify these signatures during the verification phase. This process not only reduces the computational burden of signature generation but also simplifies the signature verification process, while maintaining the overall security and quantum resistance of the signatures.

[0087] After the WOTS+ and FORS signatures are generated, the final signature results are integrated to form a complete signature data packet.

[0088] Step S206: Encrypt the financial transaction message and the preprocessed message based on the final signature result, and transmit the encryption result and the final signature result to the target terminal for verification.

[0089] Optionally, the step of transmitting the encryption result and the final signature result to the target terminal for verification includes: at the target terminal, verifying the encryption result in the encrypted data packet; and using the public key of the upper-layer key pair to verify the final signature result to confirm the integrity and authenticity of the financial transaction message.

[0090] In this embodiment, the encryption result and the final signature result together constitute an encrypted data packet, which is then sent to a designated target terminal, such as the server of another banking system, payment platform, or financial regulatory agency. At the target terminal, the encryption result in the encrypted data packet is first decrypted, requiring the same key used during encryption. If symmetric encryption is used, the same key is used; if asymmetric encryption is used, the corresponding public key is used.

[0091] After the decryption step is completed, the target terminal verifies the encryption result to ensure that the decryption process was error-free and the data has not been tampered with. Verification may include checking data integrity, such as by recalculating the hash value and comparing it with the expected value to confirm the originality and consistency of the data. In addition, the target terminal also checks the data format and logic to ensure that the decrypted information can be correctly interpreted and processed.

[0092] To further confirm the integrity and authenticity of the financial transaction message, this embodiment requires the target terminal to verify the final signature result using the public key from the upper-layer key pair. The upper-layer key pair mentioned in this embodiment is a non-one-time signature tool used in SPHINCS+ or similar PQC algorithms to encapsulate the lower-level one-time signature, typically based on a more complex signature algorithm. The target terminal matches the final signature result with the received financial transaction message, verifying the signature's validity using the public key, thus confirming the sender's identity and that the message content has not been altered during transmission.

[0093] Through the above steps, a financial transaction message to be signed can be received; a preprocessed message can be calculated using a hash function and a pre-generated random bit string, and security parameters, chain length parameter w, and a newly added natural number parameter S can be defined; a hash signature WOTS+ can be generated using the private key in the underlying key pair and the preprocessed message, where the sum of the chain length parameters w of all chain positions in the WOTS+ signature is equal to the natural number parameter S; a hash forest of K trees can be constructed using the hash-based one-time signature algorithm FORS, and a one-time signature can be generated for each tree, where K is a positive integer; the one-time signature is submitted to the upper-layer key pair through the hash forest, and the WOTS+ signature and the one-time signature are combined using the upper-layer key pair to generate the final signature result; the financial transaction message and the preprocessed message are encrypted based on the final signature result, and the encrypted result and the final signature result are transmitted to the target terminal for verification. In this embodiment, the original framework of SPHINCS+ can be deviated from, and the original structure can be modified (by introducing an additional parameter S, where the sum of the chain length parameters w of all chain positions in the WOTS+ signature equals the natural number parameter S). This simplifies the computation steps, speeds up encryption and signature generation, and by restricting and modifying the data structure, some signatures are eliminated, thereby directly simplifying the process, improving efficiency, and enabling faster message encryption. This solves the technical problem in related technologies where post-quantum cryptography is used to encrypt financial transaction messages, resulting in complex algorithms, slow encryption speed, and inability to complete encryption operations in a timely manner.

[0094] The following describes in detail another optional implementation method.

[0095] This implementation involves two modifications: modifications to the WOTS+ algorithm and modifications to the FORS algorithm.

[0096] 1. Receive financial transaction messages awaiting signature.

[0097] First, receive financial transaction messages that require digital signatures. These messages may contain data related to financial operations, including but not limited to transfer requests, payment confirmations, and transaction records.

[0098] II. Modifications to the WOTS+ algorithm.

[0099] In the traditional WOTS and WOTS+ algorithms, there are two parameters, n and w. Parameter n is the security parameter and message length. Parameter w is the Winternitz parameter, which defines the length of the chain. In this embodiment, an additional parameter S is introduced, which is a natural number. Instead of signing the message m, we sign d = H(s||m), where s is a short random bit string. Then, we choose s such that the resulting bit string d satisfies the following property: d is mapped to the positions a1, ..., alen1 ∈ [w] in the len1 chain. The goal of the signature algorithm is to find a suitable s by enumeration that satisfies: a1 + ... + alen1 = S. This means that the sum of all bits is always equal to a fixed value, which is easily checked by the verifier, so we do not need to sign its value, thus greatly reducing the size of the signature and the verification time.

[0100] The security of this scheme stems from the difficulty of forging WOTS signatures and the difficulty of finding a message that conflicts with a subspace of the hash function. This is because a forged message m either conflicts with the message m used in the signature lookup or does not. If there is no conflict, then the forgery is a valid WOTS forgery of a new message (H(m*) ≠ H(m)). If the two messages conflict, then m* is clearly a conflicting message of m.

[0101] III. Modifications to the FORS algorithm.

[0102] The FORS scheme uses k trees, each containing t = 2b leaves. A signature is a set of leaf nodes with their path verification, one for each tree. In this embodiment, the hash of the last tree is forced to always expose the first leaf (the leaf with index 0), meaning the last b bits of the message digest signed by FORS are all zero.

[0103] First, the counter `i` and the message to be signed are hashed. Then, the signer enumerates the value of `i` until a message digest with the counter ends with `b` zeros is found, and signs it. Once this is enforced, the verifier knows that only a signature showing a leaf 0 in the last tree is valid and can check it directly in the resulting digest value. Therefore, the signature itself does not require an actual authentication path, meaning this embodiment only needs to store the counter in the signature, not in the entire authentication path of the last tree.

[0104] The security analysis of this implementation is the same as that of FORS. Assuming all k trees exist, and the same leaves are always exposed in the last tree, the probability that an attacker finds a message pair with all k leaves open is not higher; on the contrary, because in the last tree, regardless of how many signatures are provided, the attacker always only has one leaf open, there is no degradation in the security of the tree.

[0105] The security analysis of FORS is divided into two parts: either an adversary can break the security properties of the hash functions used to compute leaves and trees, or an adversary can break the message digest function of the so-called Interleaved Target Subset Resilience (ITSR). Because the overall success probability of an attacker against ITSR is the product of the success probabilities of each individual tree, and the probability depends only on the number of leaves exposed in each tree, not on the position of the exposed leaves, the security of the scheme is essentially the same as the original FORS. Furthermore, the security remains unchanged even if not all trees are the same size. This means that we can choose a different size for the last tree, t′=2b′, instead of t=2b, which further enhances security.

[0106] Fourth, encrypt the financial transaction message and the preprocessed message based on the final signature result, and transmit the encryption result and the final signature result to the target terminal for verification.

[0107] This implementation breaks away from the original framework of SPHINCS+, changes the original structure, and omits some signatures by restricting and modifying the data structure, thereby directly simplifying the process, improving efficiency, and reducing the size of the algorithm.

[0108] However, after testing and comparison, the solution in this embodiment is more effective in compressing the signature space, while the security of SPHINCS+ is not affected by the adjustable hash function, pseudo-random number and other schemes. Therefore, the security is not significantly reduced.

[0109] The following is a detailed description with reference to another embodiment.

[0110] Example 2

[0111] The message encryption device based on the improved digital signature algorithm provided in this embodiment includes multiple implementation units, each of which corresponds to the implementation steps in Embodiment 1 above. Its specific implementation method and beneficial effects can be referred to the foregoing method embodiments, and will not be repeated here.

[0112] Figure 3 This is a schematic diagram of an optional message encryption device based on an improved digital signature algorithm according to an embodiment of the present invention, such as... Figure 3As shown, the message encryption device based on the improved digital signature algorithm may include: a message receiving unit 31, a message calculation unit 32, a first signature unit 33, a second signature unit 34, a signature combination unit 35, and a message encryption unit 36.

[0113] The message receiving unit 31 is used to receive financial transaction messages to be signed.

[0114] The message calculation unit 32 is used to calculate the preprocessed message using a hash function and a pre-generated random bit string, and to define security parameters, chain length parameter w, and a newly added natural number parameter S.

[0115] The first signature unit 33 is used to generate a hash signature WOTS+ using the private key in the underlying key pair and the preprocessed message, wherein the sum of the chain length parameters w of all chain positions in the WOTS+ signature is equal to the natural number parameter S.

[0116] The second signature unit 34 is used to construct a hash forest of K trees using the hash-based multiple one-time signature algorithm FORS, and generate a one-time signature for each tree, where K is a positive integer.

[0117] The signature combination unit 35 is used to submit a one-time signature to the upper-layer key pair through the hash forest, and use the upper-layer key pair to combine the WOTS+ signature and the one-time signature to generate the final signature result.

[0118] The message encryption unit 36 ​​is used to encrypt the financial transaction message and the preprocessed message based on the final signature result, and transmit the encryption result and the final signature result to the target terminal for verification.

[0119] The aforementioned message encryption device based on the improved digital signature algorithm can receive a financial transaction message to be signed by the message receiving unit 31, calculate a preprocessed message by the message calculation unit 32 using a hash function and a pre-generated random bit string, and define security parameters, chain length parameters w, and a newly added natural number parameter S. The first signature unit 33 generates a hash signature WOTS+ using the private key in the underlying key pair and the preprocessed message, wherein the sum of the chain length parameters w of all chain positions in the WOTS+ signature is equal to the natural number parameter S. The second signature unit 34 constructs a hash forest of K trees using the hash-based multiple one-time signature algorithm FORS, and generates a one-time signature for each tree. The signature combination unit 35 submits the one-time signature to the upper-layer key pair through the hash forest, and combines the WOTS+ signature and the one-time signature using the upper-layer key pair to generate the final signature result. The message encryption unit 36 ​​encrypts the financial transaction message and the preprocessed message based on the final signature result, and transmits the encryption result and the final signature result to the target terminal for verification. In this embodiment, the original framework of SPHINCS+ can be deviated from, and the original structure can be modified (by introducing an additional parameter S, where the sum of the chain length parameters w of all chain positions in the WOTS+ signature equals the natural number parameter S). This simplifies the computation steps, speeds up encryption and signature generation, and by restricting and modifying the data structure, some signatures are eliminated, thereby directly simplifying the process, improving efficiency, and enabling faster message encryption. This solves the technical problem in related technologies where post-quantum cryptography is used to encrypt financial transaction messages, resulting in complex algorithms, slow encryption speed, and inability to complete encryption operations in a timely manner.

[0120] Optionally, the message calculation unit includes: a bit string generation module, used to randomly generate a bit string to obtain a random bit string; and a message calculation module, used to perform hash calculation on the random bit string and the financial transaction information to be signed using a hash function to obtain a preprocessed message.

[0121] Optionally, when defining security parameters, chain length parameter w, and the newly added natural number parameter S, the message calculation unit includes: a parameter determination module for determining the parameters of the security parameters and message length; a chain length setting module for setting the chain length parameter w, wherein the chain length parameter w is used to define the chain length of the WOTS+ signature; and a natural number parameter import module for importing the natural number parameter S.

[0122] Optionally, the first signature unit includes: a first signature generation module, used to generate a signature using the underlying private key and the preprocessed message through the WOTS+ algorithm; and an enumeration module, used to enumerate random bit strings during the signature generation process until the sum of the chain length parameters w of the chain positions mapped to by the preprocessed message equals the natural number parameter S.

[0123] Optionally, the second signature unit includes: a hash tree generation module for generating K hash-based trees, each tree containing multiple leaf nodes; a second signature generation module for generating a multi-one-time signature based on the underlying private key for each tree; and a setting module for controlling the hash of the last tree to always expose the first leaf and setting the last b bits of the hash output to zero, where the first leaf is the leaf with index 0 and b is a positive integer greater than 1.

[0124] Optionally, the signature combination unit includes: a signature submission module for submitting a one-time signature for each tree to the upper-level key pair; and a signature combination module for combining the WOTS+ signature and the one-time signature using the upper-level key pair without authentication to generate the final signature result.

[0125] Optionally, the message encryption unit includes: an encryption verification module for verifying the encryption result in the encrypted data packet at the target terminal; and a signature verification module for verifying the final signature result using the public key of the upper-layer key pair to confirm the integrity and authenticity of the financial transaction message.

[0126] The aforementioned message encryption device based on the improved digital signature algorithm may further include a processor and a memory. The aforementioned message receiving unit 31, message calculation unit 32, first signature unit 33, second signature unit 34, signature combination unit 35, message encryption unit 36, etc., are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.

[0127] The aforementioned processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and by adjusting kernel parameters, encrypted processing of financial transaction messages based on improved digital signature algorithms can be achieved.

[0128] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0129] Example 3

[0130] Embodiments of this application may provide an electronic device. Figure 4 This is a structural block diagram of an electronic device that implements a message encryption method based on an improved digital signature algorithm according to an embodiment of this application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4 Only one of the following is shown: processor 402, memory 404, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0131] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the message encryption method and apparatus based on the improved digital signature algorithm in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the aforementioned message encryption method based on the improved digital signature algorithm. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0132] The processor can access information and applications stored in memory via a transmission device to perform the following steps: receiving a financial transaction message to be signed; calculating a preprocessed message using a hash function and a pre-generated random bit string, and defining security parameters, chain length parameter w, and a newly added natural number parameter S; generating a hash signature WOTS+ using the private key in the underlying key pair and the preprocessed message, where the sum of the chain length parameters w for all chain positions in the WOTS+ signature equals the natural number parameter S; constructing a hash forest of K trees using the hash-based one-time signature algorithm FORS, generating a one-time signature for each tree, where K is a positive integer; submitting the one-time signature to the upper-level key pair through the hash forest, combining the WOTS+ signature and the one-time signature using the upper-level key pair to generate the final signature result; encrypting the financial transaction message and the preprocessed message based on the final signature result, and transmitting the encrypted result and the final signature result to the target terminal for verification.

[0133] Those skilled in the art will understand that Figure 4 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 4 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 4 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 4 The different configurations shown.

[0134] Those skilled in the art will understand that all or part of the steps in the various message encryption methods based on improved digital signature algorithms in the above embodiments can be implemented by a program instructing the hardware of the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0135] Example 4

[0136] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the message encryption method based on the improved digital signature algorithm provided in Embodiment 1.

[0137] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the message encryption method based on any one of the above embodiments in the first embodiment.

[0138] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0139] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the message encryption method based on the improved digital signature algorithm described in various embodiments of this application.

[0140] This application also provides a computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the message encryption method based on the improved digital signature algorithm described in various embodiments of this application.

[0141] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0142] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0143] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0144] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0145] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0146] 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 computer 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, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0147] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A message encryption method based on an improved digital signature algorithm, characterized in that, include: Receive financial transaction messages awaiting signature; The preprocessed message is calculated using a hash function and a pre-generated random bit string, and security parameters, chain length parameter w, and a newly added natural number parameter S are defined. A hash signature WOTS+ is generated using the private key from the underlying key pair and the preprocessed message, wherein... The sum of the chain length parameters w of all chain positions in the WOTS+ signature is equal to the natural number parameter S; A hash forest of K trees is constructed using the hash-based one-time signature algorithm FORS, and a one-time signature is generated for each tree, where K is a positive integer; The one-time signature is submitted to the upper-layer key pair through the hash forest, and the WOTS+ signature and the one-time signature are combined using the upper-layer key pair to generate the final signature result; The financial transaction message and the preprocessed message are encrypted based on the final signature result, and the encryption result and the final signature result are transmitted to the target terminal for verification.

2. The encryption method according to claim 1, characterized in that, The steps for calculating the preprocessed message using a hash function and a pre-generated random bit string include: A random bit string is generated to obtain the random bit string; The preprocessed message is obtained by hashing the random bit string and the financial transaction information to be signed using a hash function.

3. The encryption method according to claim 1, characterized in that, The steps for defining the security parameter, the chain length parameter w, and the newly added natural number parameter S include: Determine the parameters for reaction safety and message length; Set the chain length parameter w, where the chain length parameter w is used to define the chain length of the WOTS+ signature; Introduce the natural number parameter S.

4. The encryption method according to claim 1, characterized in that, The steps of generating a hash signature WOTS+ using the private key in the underlying key pair and the preprocessed message include: A signature is generated using the underlying private key and the preprocessed message via the WOTS+ algorithm. During the signature generation process, the random bit string is enumerated until the sum of the chain length parameter w of the chain position mapped to the preprocessed message equals the natural number parameter S.

5. The encryption method according to claim 1, characterized in that, The steps to construct a hash forest of K trees using the hash-based multiple one-time signature algorithm FORS include: Generate K hash-based trees, where each tree contains multiple leaf nodes; For each tree, generate a multi-one-time signature based on the underlying private key; The hash of the last tree is always exposed to the first leaf, and the last b bits of the hash output are set to zero, where the first leaf is the leaf with index 0 and b is a positive integer greater than 1.

6. The encryption method according to claim 1, characterized in that, The steps of combining the WOTS+ signature and the one-time signature using the upper-layer key pair to generate the final signature result include: Submit a one-time signature for each tree to the upper-level key pair; Using the upper-layer key pair without authentication, the WOTS+ signature and the one-time signature are combined to generate the final signature result.

7. The encryption method according to claim 1, characterized in that, The steps of transmitting the encryption result and the final signature result to the target terminal for verification include: On the target terminal, verify the encryption result in the encrypted data packet; The public key of the upper-layer key pair is used to verify the final signature result to confirm the integrity and authenticity of the financial transaction message.

8. A message encryption device based on an improved digital signature algorithm, characterized in that, include: The message receiving unit is used to receive financial transaction messages to be signed; The message calculation unit is used to calculate the preprocessed message using a hash function and a pre-generated random bit string, and defines security parameters, chain length parameter w, and a newly added natural number parameter S. The first signature unit is used to generate a hash signature WOTS+ using the private key in the underlying key pair and the preprocessed message, wherein the sum of the chain length parameters w of all chain positions in the WOTS+ signature is equal to the natural number parameter S. The second signature unit is used to construct a hash forest of K trees using the hash-based multiple one-time signature algorithm FORS, and to generate a one-time signature for each tree, where K is a positive integer; The signature combination unit is used to submit the one-time signature to the upper-layer key pair through the hash forest, and use the upper-layer key pair to combine the WOTS+ signature and the one-time signature to generate the final signature result; The message encryption unit is used to encrypt the financial transaction message and the preprocessed message based on the final signature result, and transmit the encryption result and the final signature result to the target terminal for verification.

9. An electronic device, characterized in that, The device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the message encryption method based on the improved digital signature algorithm as described in any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the message encryption method based on the improved digital signature algorithm as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Digital asset management method and device, equipment, storage medium and program product

    CN121644058A