Ciphertext generation method, server, medium and device based on Hilbert transform

By introducing the Hilbert transform and the iterative use of the buffer initial value in the SHA-1 algorithm, the problem of the SHA-1 algorithm being broken is solved, the security of the input information and resistance to brute force cracking are improved, and the ciphertext is maintained Length and interface format consistency.

CN114091070BInactive Publication Date: 2024-08-23BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111404967.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-24
Publication Date
2024-08-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing SHA-1 algorithm was broken after computer computing power increased, and it needs to be enhanced to improve security.

Method used

The ciphertext generation method based on Hilbert transform is adopted, by converting the input information into decimal ASCII code, using the fitting toolbox to obtain the piecewise function, and performing Hilbert transform, and then perform SHA-1 after generating the ciphertext. Algorithmic encryption, if the ciphertext is divided into multiple data blocks, the buffer initial value of the previous data block is used as the initial value of the next data block during the calculation of the next data block to increase security.

Benefits of technology

Even if the attacker obtains the ciphertext through SHA-1 decryption, it is still the encrypted ciphertext, which improves the security of the input information, increases the difficulty of brute force cracking, reduces the cost of transformation, and maintains the 160-bit ciphertext length interface and Message format consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114091070B
    Figure CN114091070B
Patent Text Reader

Abstract

The present application discloses a ciphertext generation method, server, medium and device based on Hilbert transform, which can be applied to the blockchain field or the financial field. After obtaining the input information, the input information is first encrypted to obtain the first ciphertext, and then the first ciphertext is encrypted by the SHA-1 algorithm. In the present application, if the first message corresponding to the input information is divided into multiple data blocks, then in the process of calculating the next data block, the initial value of the buffer corresponding to the next data block is the final value of the buffer of the previous data block, that is, the second ciphertext obtained is not only related to the first ciphertext but also to the number of data blocks divided into the first message. If brute force cracking is performed, it is necessary to crack the number of data blocks divided into the first message and the first ciphertext. Brute force cracking is more difficult, thereby improving security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and more specifically, to a ciphertext generation method, server, medium and device based on Hilbert transform. Background Art

[0002] SHA-1 (Secure Hash Algorithm) is a function that generates 160-bit ciphertext and is widely used in the prior art. However, with the continuous development of computer computing power, security personnel have successfully cracked the SHA-1 algorithm.

[0003] Therefore, how to enhance and strengthen the existing SHA-1 is an inevitable requirement for technological development. Summary of the invention

[0004] In view of this, the present application provides a ciphertext generation method, server, medium and device based on Hilbert transform.

[0005] To achieve the above objectives, this application provides the following technical solutions:

[0006] According to a first aspect of an embodiment of the present disclosure, a ciphertext generation method based on Hilbert transform is provided, comprising:

[0007] Get the input information to be stored in the blockchain;

[0008] Convert the input information into decimal ASCII codes to obtain a first character string consisting of the decimal ASCII codes;

[0009] Obtaining M coordinates from the first character string, wherein the horizontal coordinate of the coordinate is the position of the first character string, the vertical coordinate of the coordinate is the character at the position, and the total number of characters contained in the first character string is M;

[0010] Using the fitting toolbox for the M coordinates, we obtain the first piecewise function: {k0≤t<k1, i=1; k1≤t<k2, i=2;...;k n-1 ≤t<k n , i=n};

[0011] Performing Hilbert transformation on the piecewise function to obtain a second piecewise function;

[0012] Sampling values ​​from the second piecewise function to obtain M discrete values ​​to obtain a first ciphertext composed of the M discrete values;

[0013] The length of the first ciphertext is padded to 512 bits*Q to obtain a first message, where Q is any integer greater than or equal to 1;

[0014] Dividing the first message into Q data blocks, the number of bits of the data blocks is 512 bits;

[0015] Set the initial value of G to 1;

[0016] For the Gth data block, perform the following operations:

[0017] Dividing the data block into 16 target sub-data blocks, the number of bits of the target sub-data blocks is 32 bits;

[0018] Performing operations on the 16 target sub-data blocks to obtain 64 operation sub-data blocks to obtain 80 sub-data blocks, wherein the number of bits of the operation sub-data blocks is 32 bits, and the 80 sub-data blocks include the 16 target sub-data blocks and the 64 operation sub-data blocks;

[0019] Get 80 preset constants K t ; The value of t is 0, 1, 2, ..., 79;

[0020] Get the initial value of the buffer identifier H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4;

[0021] Assign the initial value of H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 to the first parameter, the second parameter, the third parameter, the fourth parameter, and the fifth parameter, respectively;

[0022] Set the initial value of P to 0;

[0023] For t = P, the following calculation is performed:

[0024] TEMP=S5(H0)+f t (H1,H2,H3)+H4+W t +K t ; H4=H3; H3=H2; H2=S 30 (H1); H1 = H0; H0 = TEMP; where W t is the t+1th sub-data block among the 80 sub-data blocks, f t (H1, H2, H3) is a pre-set function; S5(H0) means shifting H0 left by 5 bits; S 30 (H1) means shifting H1 left by 30 bits;

[0025] Set P=P+1, return to step t=P, and perform the following calculations until P is equal to 80 to obtain the values ​​of the buffer identifiers H0, H1, H2, H3, and H4;

[0026] Let the final value of H0 = the value of H0 + the first parameter, the final value of H1 = the value of H1 + the second parameter, the final value of H2 = the value of H2 + the third parameter, the final value of H3 = the value of H3 + the fourth parameter, and the final value of H4 = the value of H4 + the fifth parameter;

[0027] The final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 are used as the initial value of H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 of the buffer corresponding to the G+1th data block, respectively;

[0028] Set G=G+1, return to step 1 and perform the following operations on the Gth data block until G is greater than Q;

[0029] In the order of H0, H1, H2, H3, and H4, a 160-bit hash value consisting of the final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 is obtained;

[0030] Based on the 160-bit hash value, obtain a second ciphertext;

[0031] The second ciphertext is stored in the blockchain.

[0032] According to a second aspect of an embodiment of the present disclosure, there is provided a ciphertext generation device based on Hilbert transform, comprising:

[0033] A first acquisition module, used to acquire input information to be stored in the blockchain;

[0034] A first conversion module, used for converting the input information into decimal ASCII codes to obtain a first character string consisting of the decimal ASCII codes;

[0035] A second acquisition module is used to obtain M coordinates from the first character string, wherein the horizontal coordinate of the coordinate is the position of the first character string, the vertical coordinate of the coordinate is the character at the position, and the total number of characters contained in the first character string is M;

[0036] The third acquisition module is used to use the fitting toolbox for the M coordinates to obtain the first piecewise function: {k0≤t<k1,i=1; k1≤t<k2,i=2;...;k n-1 ≤t<k n ,i=n};

[0037] A second conversion module, used for performing Hilbert transformation on the piecewise function to obtain a second piecewise function;

[0038] A fourth acquisition module, used for sampling and obtaining M discrete values ​​from the second piecewise function to obtain a first ciphertext composed of the M discrete values;

[0039] A padding and expansion module, used for padding and expanding the length of the first ciphertext to 512 bits*Q to obtain a first message, where Q is any integer greater than or equal to 1;

[0040] A first division module, used for dividing the first message into Q data blocks, the number of bits of the data blocks is 512 bits;

[0041] A first setting module, used to set the initial value of G to 1;

[0042] For the Gth data block, perform the following operations:

[0043] A second division module is used to divide the data block into 16 target sub-data blocks, and the number of bits of the target sub-data blocks is 32 bits;

[0044] A calculation module, used for performing calculation on the 16 target sub-data blocks to obtain 64 calculation sub-data blocks, so as to obtain 80 sub-data blocks, wherein the number of bits of the calculation sub-data blocks is 32 bits, and the 80 sub-data blocks include the 16 target sub-data blocks and the 64 calculation sub-data blocks;

[0045] The fifth acquisition module is used to obtain 80 preset constants K t ; The value of t is 0, 1, 2, ..., 79;

[0046] A sixth acquisition module, used to acquire an initial value of the identifier H0 of the buffer, an initial value of H1, an initial value of H2, an initial value of H3, and an initial value of H4;

[0047] A first assignment module, used for assigning the initial value of H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 to the first parameter, the second parameter, the third parameter, the fourth parameter, and the fifth parameter, respectively;

[0048] The second assignment module is used to set the initial value of P to 0;

[0049] The calculation module is used to perform the following calculation for t=P:

[0050] TEMP=S5(H0)+f t (H1,H2,H3)+H4+W t +K t ; H4=H3; H3=H2; H2=S 30 (H1); H1 = H0; H0 = TEMP; where W tis the t+1th sub-data block among the 80 sub-data blocks, f t (H1, H2, H3) is a pre-set function; S5(H0) means shifting H0 left by 5 bits; S 30 (H1) means shifting H1 left by 30 bits;

[0051] The first trigger module is used to set P=P+1 and return to the calculation module until P is equal to 80 to obtain the values ​​of the identifiers H0, H1, H2, H3 and H4 of the buffer;

[0052] The third assignment module is used to make the final value of H0 = the value of H0 + the first parameter, the final value of H1 = the value of H1 + the second parameter, the final value of H2 = the value of H2 + the third parameter, the final value of H3 = the value of H3 + the fourth parameter, and the final value of H4 = the value of H4 + the fifth parameter;

[0053] a fourth assignment module, used to use the final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 as the initial value of H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 of the buffer corresponding to the G+1th data block, respectively;

[0054] The second trigger module is used to set G=G+1 and return to the second division module until G is greater than Q;

[0055] A seventh acquisition module, used to obtain a 160-bit hash value consisting of a final value of H0, a final value of H1, a final value of H2, a final value of H3, and a final value of H4 in the order of H0, H1, H2, H3, and H4;

[0056] An eighth acquisition module, configured to obtain a ciphertext based on the 160-bit hash value;

[0057] A storage module is used to store the ciphertext in a blockchain.

[0058] According to a third aspect of an embodiment of the present disclosure, a server is provided, including:

[0059] processor;

[0060] a memory for storing instructions executable by the processor;

[0061] The processor is configured to execute the instructions to implement the ciphertext generation method based on Hilbert transform as described in the first aspect.

[0062] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of a server, the server is enabled to execute the ciphertext generation method based on Hilbert transform as described in the first aspect.

[0063] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, which can be directly loaded into an internal memory of a computer, wherein the memory is the memory included in the server shown in the third aspect and contains software code, and after the computer program is loaded and executed, the ciphertext generation method based on Hilbert transform as described in the first aspect can be implemented.

[0064] It can be known from the above technical solution that the ciphertext generation method based on Hilbert transform provided by the present application, after obtaining the input information, first encrypts the input information, and the encryption process is as follows: convert the input information into a decimal ASCII code to obtain a first character string composed of the decimal ASCII code; obtain M coordinates from the first character string, the horizontal coordinate of the coordinate is the position located in the first character string, the vertical coordinate of the coordinate is the character at the position, and the total number of characters contained in the first character string is M; use the fitting toolbox for the M coordinates to obtain a first piecewise function:

[0065] {k0≤t<k1,i=1; k1≤t<k2,i=2;...;k n-1 ≤t<k n , i=n}; perform Hilbert transform on the piecewise function to obtain a second piecewise function; sample and obtain M discrete values ​​from the second piecewise function to obtain a first ciphertext composed of the M discrete values; and then perform SHA-1 algorithm encryption on the first ciphertext. Even if an attacker decrypts the first ciphertext through SHA-1, the first ciphertext is still an encrypted ciphertext, so the input information cannot be cracked, thereby improving security. And in the present application, if the first message is divided into multiple data blocks, then in the process of calculating the next data block, the initial value of the identifier H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 of the buffer corresponding to the next data block are the final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 obtained from the previous data block. That is, the second ciphertext obtained is not only related to the process of encrypting the input information to obtain the first ciphertext, but also related to the number of data blocks into which the first message is divided. If brute force cracking is required, it is necessary to try to crack the number of data blocks into which the first message is divided, as well as the process of cracking the encryption of the input information to obtain the first ciphertext. Compared with the prior art, brute force cracking is more difficult, thereby improving the security of the input information. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0067] Figure 1 A structural diagram of a blockchain device provided in an embodiment of the present application;

[0068] Figure 2 A structural diagram of the blockchain provided in the embodiment of the present application;

[0069] Figure 3 A flowchart of a ciphertext generation method based on Hilbert transform provided in an embodiment of the present application;

[0070] Figures 4a to 4c , which is a schematic diagram of input information filling and expansion provided in an embodiment of the present application;

[0071] Figure 5 The schematic diagram of sorting a data block into 16 target sub-data blocks is shown;

[0072] Figure 6 A structural diagram of a ciphertext generation device based on Hilbert transform provided in an embodiment of the present application;

[0073] Figure 7 The invention is a block diagram showing a device for a server according to an exemplary embodiment. DETAILED DESCRIPTION

[0074] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0075] The embodiments of the present application provide a ciphertext generation method, device, server, medium and product based on Hilbert transform. Before introducing the technical solution provided by the embodiments of the present application, the application environment involved in the embodiments of the present application is first described.

[0076] like Figure 1 , which is a structural diagram of a blockchain device provided in an embodiment of the present application.

[0077] The blockchain device includes multiple nodes 11, which can be electronic devices or servers.

[0078] Exemplarily, the electronic device can be any electronic product that can interact with a user through one or more methods such as a keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device, for example, a mobile phone, a laptop computer, a tablet computer, a PDA, a personal computer, a wearable device, a smart TV, a PAD, etc.

[0079] Exemplarily, the server may be a single server, a server cluster consisting of multiple servers, or a cloud computing server center. The server may include a processor, a memory, a network interface, and the like.

[0080] The blockchain device includes multiple nodes that respectively store an identical blockchain.

[0081] For any node among the multiple nodes, the node stores the node identifiers of other nodes in the blockchain device, so that the generated block can be broadcast to other nodes in the blockchain device according to the identifiers of other nodes.

[0082] In order to enable those skilled in the art to better understand the embodiments of the present application, the structure of the blockchain is introduced in detail below.

[0083] like Figure 2 As shown in Figure 1, the blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information feature values, version numbers, timestamps, and difficulty values, and the block body stores input information. The next block of the genesis block uses the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information feature values ​​of the current block, the block header feature values, version numbers, timestamps, and difficulty values ​​of the parent block, and so on. This ensures that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block.

[0084] When generating each block in the blockchain, the node where the blockchain is located needs to perform SHA-1 algorithm calculation on the input information when receiving the input information, and store the obtained 160-bit ciphertext as the characteristic value of the input information in the block header. After obtaining the block body and block header, the current block is obtained. Subsequently, the node where the blockchain is located sends the newly generated block to other nodes according to the node identification of other nodes, and other nodes verify the newly generated block and add the newly generated block to the blockchain stored in it after completing the verification.

[0085] With the continuous development of computer computing power and the accumulation of collision cipher libraries in the application of the SHA-1 algorithm, the ciphertext generated by the SHA-1 algorithm may be cracked by brute force. If the SHA-1 algorithm is replaced with other algorithms, such as the SHA-2 algorithm, to prevent the ciphertext generated by it from being cracked by brute force, but the SHA-2 algorithm generates 256-bit ciphertext, which is different from the 160-bit ciphertext generated by the SHA-1 algorithm. This improvement will affect the interface and message format, increase the cost of transformation, and is more difficult.

[0086] The embodiment of the present application provides a method for improving SHA-1, so that the length of the ciphertext obtained by the improved SHA-1 algorithm remains 160 bits, thereby eliminating the need to improve the interface and message format, thereby reducing the transformation cost.

[0087] The ciphertext generation method based on Hilbert transform provided in the embodiment of the present application can be applied to any application scenario using SHA-1, for example, the calculation scenario of the characteristic value of bank transaction data. The input information is different in different application scenarios. For example, in the calculation scenario of the characteristic value of bank transaction data, the input information is transaction data.

[0088] The following is a description of the ciphertext generation method based on Hilbert transform provided in an embodiment of the present application.

[0089] like Figure 3 As shown, it is a flowchart of the ciphertext generation method based on Hilbert transform provided in an embodiment of the present application, and the method includes the following steps S301 to S324.

[0090] Step S301: Obtain input information to be stored in the blockchain.

[0091] Exemplarily, the input information may be transaction data, such as transfer transaction data.

[0092] Step S302: convert the input information into decimal ASCII codes to obtain a first character string consisting of the decimal ASCII codes.

[0093] For example, the input information may be in binary or hexadecimal.

[0094] Step S303: obtaining M coordinates from the first character string, wherein the horizontal coordinate of the coordinate is the position of the first character string, the vertical coordinate of the coordinate is the character at the position, and the total number of characters contained in the first character string is M.

[0095] Assuming that the first character string is {J1, J2, J3, J4, J5, J6}, then M=6, and the 6 coordinates are (1, J1), (2, J2), (3, J3), (4, J4), (5, J5), and (6, J6).

[0096] Step S304: Use the fitting toolbox for the M coordinates to obtain a first piecewise function: {k0≤t<k1, i=1; k1≤t<k2, i=2;...;k n-1 ≤t<k n , i=n}.

[0097] Exemplarily, the fitting toolbox may be a cftool fitting toolbox.

[0098] It can be understood that after fitting through the fitting toolbox, a first piecewise function composed of a finite number of trigonometric functions can be obtained, where n represents the number of trigonometric functions, that is, the number of segments of the first piecewise function, where k0, k1, k2, k3, k4, ..., k n Represents the critical value of a piecewise function.

[0099] After fitting by the fitting toolbox, a1(t), a2(t), ..., a n (t); These are all known functions.

[0100] Step S305: performing Hilbert transform on the piecewise function to obtain a second piecewise function.

[0101] Step S306: sampling from the second piecewise function to obtain M discrete values, so as to obtain a first ciphertext composed of the M discrete values.

[0102] Exemplarily, the second piecewise function S(t) is also a function with t as an independent variable, and can take values ​​from t=1, 2, 3…, M, respectively, to obtain M discrete values, and the M discrete values ​​are: S(1), S(2), S(3), …, S(M). The M discrete values ​​are sorted in order of S(1), S(2), S(3), …, S(M) to obtain the first ciphertext, that is, the first ciphertext is: S(1)S(2)S(3)…S(M).

[0103] The embodiment of the present application introduces the idea of ​​Hilbert transform, divides the natural language signal into two branches, the real part and the imaginary part, and then processes it using the principle of complex number processing, thereby achieving reinforcement optimization of the SHA-1 algorithm to enhance the security of blockchain used in business scenarios with higher security levels.

[0104] Step S307: padding the length of the first ciphertext to 512 bits*Q to obtain a first message, where Q is any integer greater than or equal to 1.

[0105] There are multiple ways of filling and expanding provided in the embodiments of the present application. The embodiments of the present application provide but are not limited to the following three.

[0106] The first implementation of step S307 includes steps A11 to A14.

[0107] Step A11: Add a 1 to the end of the first ciphertext.

[0108] Exemplarily, the first ciphertext is binary data.

[0109] Exemplarily, if the length of the first ciphertext is an integer multiple of 512, then there is no need to perform a padding and expansion operation; if the length of the first ciphertext is not an integer multiple of 512, then a padding and expansion operation is required.

[0110] Step A12: Add 0 after the 1 in the first ciphertext until the length of the second message after the padding is 448 modulo 512.

[0111] Exemplarily, if the remainder after the length of the first ciphertext is modulo 512 is 448, steps A11 to A12 may not be performed. If the remainder after the length of the first ciphertext is modulo 512 is not 448, steps A11 to A12 may be performed.

[0112] Step A13: Add a 1 at the end of the second message.

[0113] Step A14: add 63 zeros after the 1 in the second message to obtain the first message.

[0114] In order for those skilled in the art to better understand the implementation of the first step S307, an example is given below.

[0115] like Figure 4a As shown, it is a schematic diagram of the first ciphertext padding expansion provided in an embodiment of the present application.

[0116] Assuming that the length of the first ciphertext is 600 bits, the modulo remainder of the first ciphertext to 512 is 88, and a 1 and 359 0s are added to the first ciphertext to obtain the second message. A 1 and 63 0s are added to the second message to obtain the first message.

[0117] The second implementation of step S307 includes steps A21 to A23.

[0118] Step A21: Add a 1 to the end of the first ciphertext.

[0119] Exemplarily, the first ciphertext is binary data.

[0120] Exemplarily, if the length of the first ciphertext is an integer multiple of 512, then there is no need to perform a padding and expansion operation; if the length of the first ciphertext is not an integer multiple of 512, then a padding and expansion operation is required.

[0121] Step A22: Add 0 after the 1 in the first ciphertext until the length of the second message after the padding is 448 modulo 512.

[0122] Exemplarily, if the remainder after the length of the first ciphertext is modulo 512 is 448, steps A21 to A22 may not be performed. If the remainder after the length of the first ciphertext is modulo 512 is not 448, steps A21 to A22 may be performed.

[0123] Step A23: Add 64 ones to the end of the second message to obtain the first message.

[0124] In order for those skilled in the art to better understand the implementation of the second step S307, an example is given below.

[0125] like Figure 4b As shown, it is a schematic diagram of the first ciphertext padding expansion provided in an embodiment of the present application.

[0126] Assuming that the length of the first ciphertext is 600 bits, the modulo remainder of the first ciphertext to 512 is 88, and after adding a 1 and 359 0s to the first ciphertext, the second message is obtained. After adding 64 1s to the second message, the first message is obtained.

[0127] The third implementation of step S307 includes step A31 to step A32.

[0128] Step A31: Add a 1 to the end of the first ciphertext.

[0129] Exemplarily, the first ciphertext is binary data.

[0130] Exemplarily, if the length of the first ciphertext is an integer multiple of 512, then there is no need to perform a padding and expansion operation; if the length of the first ciphertext is not an integer multiple of 512, then a padding and expansion operation is required.

[0131] Step A32: Add 0 after the 1 in the first ciphertext until the remainder of the length of the first message after the padding is 0 after taking the modulo 512, so as to obtain the first message.

[0132] In order for those skilled in the art to better understand the implementation of the third step S307, an example is given below.

[0133] like Figure 4c As shown, it is a schematic diagram of the first ciphertext padding expansion provided in an embodiment of the present application.

[0134] Assuming that the length of the first ciphertext is 600 bits, the remainder of the first ciphertext modulo 512 is 88, and a 1 and 423 0s are added after the first ciphertext to obtain the first message.

[0135] Step S308: Divide the first message into Q data blocks, where the number of bits of the data blocks is 512 bits.

[0136] by Figures 4a to 4c For example, Q=2.

[0137] Exemplarily, in the embodiment of the present application, the first message is divided into Q data blocks, and one data block is obtained for every 512 bits of data obtained starting from the header of the first message.

[0138] Step S309: Set the initial value of G to 1.

[0139] Step S310: Perform the following operations for the Gth data block:

[0140] Step S311: Divide the data block into 16 target sub-data blocks, and the bit number of the target sub-data blocks is 32 bits.

[0141] Step S312: perform operations on the 16 target sub-data blocks to obtain 64 operation sub-data blocks to obtain 80 sub-data blocks, the bit number of the operation sub-data blocks is 32 bits, and the 80 sub-data blocks include 16 target sub-data blocks and 64 operation sub-data blocks.

[0142] Step S313: Obtain 80 preset constants K t ; The value of t is 0, 1, 2, …, 79.

[0143] In an alternative implementation, each of the 80 constants is different.

[0144] In an optional implementation, the values ​​of the 80 constants are as follows:

[0145] K t = first preset value (0<=t<=19)

[0146] K t = second preset value (20<=t<=39)

[0147] K t = third preset value (40<=t<=59)

[0148] Kt = fourth preset value (60<=t<=79).

[0149] In an optional implementation, the 80 constants corresponding to different data blocks may be different, for example, the corresponding relationship between the 16 target sub-data blocks obtained in step S311 and the 80 constants may be preset, that is, the 80 constants may be different for different data blocks.

[0150] In an optional implementation, the 80 constants corresponding to different input information may be different, for example, the corresponding relationship between the input information and the 80 constants may be preset, that is, the 80 constants may be different depending on the input information.

[0151] In an optional implementation, the 80 constants corresponding to different data blocks may be the same.

[0152] In an optional implementation, the first preset value is 0x5A827999, the second preset value is 0x6ED9EBA1, the third preset value is 0x8F1BBCDC, and the fourth preset value is 0xCA62C1D6.

[0153] Exemplarily, the 80 sub-data blocks include, in sequence: 16 target sub-data blocks and 64 operation sub-data blocks.

[0154] The order of the 16 target sub-data blocks is: sorted according to the order in which the target sub-data blocks are obtained by dividing the data blocks.

[0155] like Figure 5 As shown, it is a schematic diagram of sorting that a data block is divided into 16 target sub-data blocks.

[0156] Starting from the head of the data block, each time 32 bits of data are extracted to obtain a target sub-data block, the target sub-data block 1, the target sub-data block 2, the target sub-data block 3, the target sub-data block 4, ..., the target sub-data block 16 can be obtained in sequence. The order of the above 16 target sub-data blocks is: target sub-data block 1, target sub-data block 2, target sub-data block 3, target sub-data block 4, ..., target sub-data block 16.

[0157] In an optional implementation, there are multiple implementations of step S312. The embodiment of the present application provides but is not limited to the following implementation. The method includes steps B11 to B14.

[0158] Step B11: Set the initial value of R to 0.

[0159] Step B12: Let t = R, and perform the following operations:

[0160] Step B13: W t =Mt (0≤t<16), where M t is the t+1th target sub-data block; W t =S1(W t-3 XOR W t-14 XOR W t-16 )(16≤t≤79); where S1 refers to shifting left by 1 bit.

[0161] Step B14: Set R=R+1, and return to step B12 until R equals 80.

[0162] The above 80 sub-data blocks are: W0, W1, W2, W3, ..., W 79 .

[0163] In an optional implementation, at least one of the 16 target sub-data blocks may be subjected to a logic operation to obtain 64 operation sub-data blocks. The above-mentioned XOR operation is not limited.

[0164] Step S314: Obtain the initial value of the buffer identifier H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4.

[0165] In an optional implementation, for the first data block, that is, when step S314 is executed for the first time, the initial values ​​of the buffer zone identifiers H0, H1, H2, H3, and H4 corresponding to the 16 target sub-data blocks can be found from the correspondence between the pre-set 16 sub-data blocks and the initial values ​​of the buffer zone identifiers H0, H1, H2, H3, and H4.

[0166] That is, H corresponding to different target sub-blocks i The initial value of is different. Since the target sub-data block is related to the input information, the randomness and the algorithm's anti-brute force cracking ability are increased, and the algorithm performance consumption is small. It can be ported and implemented on different platforms and hardware devices to meet the requirements of various usage scenarios of blockchain in financial business systems.

[0167] In an optional implementation, the buffer {Hi} is initialized to the following value:

[0168] H0=0x67452301

[0169] H1=0xEFCDAB89

[0170] H2 = 0x98BADCFE

[0171] H3=0x10325476

[0172] H4=0xC3D2E1F0

[0173] Step S315: assign the initial value of H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 to the first parameter, the second parameter, the third parameter, the fourth parameter, and the fifth parameter, respectively.

[0174] Step S316: Set the initial value of P to 0.

[0175] Step S317: For t=P, perform the following calculation:

[0176] TEMP=S5(H0)+f t (H1,H2,H3)+H4+W t +K t ; H4=H3; H3=H2; H2=S 30 (H1); H1 = H0; H0 = TEMP; where W t is the t+1th sub-data block among the 80 sub-data blocks, f t (H1, H2, H3) is a pre-set function; S5(H0) means shifting H0 left by 5 bits; S 30 (H1) means shifting H1 left by 30 bits.

[0177] For example, f t (H1, H2, H3) is a pre-set function with H1, H2, H3 as independent variables. For example, the pre-set function f t (H1,H2,H3) are as follows:

[0178] f t (H1,H2,H3)=(H1 AND H2)or((NOT H1)AND H3)(0<=t<=19)

[0179] f t (H1,H2,H3)=H1 XOR H2 XOR H3(20<=t<=39)

[0180] f t (H1,H2,H3)=(H1 AND H2)or(H1 AND H3)or(H2 AND H3)(40<=t<=59)

[0181] f t (H1, H2, H3)=H1 XOR H2 XOR H3 (60<=t<=79).

[0182] In an optional implementation, f t(H1, H2, H3) can be piecewise functions or not. The above is only an example and does not apply to f. t (H1, H2, H3) causes limitation.

[0183] Step S318: Set P=P+1, and return to step S317 until P is equal to 80 to obtain the values ​​of the buffer zone identifiers H0, H1, H2, H3, and H4.

[0184] Step S319: Let the final value of H0 = the value of H0 + the first parameter, the final value of H1 = the value of H1 + the second parameter, the final value of H2 = the value of H2 + the third parameter, the final value of H3 = the value of H3 + the fourth parameter, and the final value of H4 = the value of H4 + the fifth parameter.

[0185] Step S320: Use the final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 as the initial value of H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 of the buffer area corresponding to the G+1th data block, respectively.

[0186] That is, when step S314 is executed for the second time, the buffer identifier H is obtained. i Initial value = H obtained when step S319 is executed for the first time i The final value of .

[0187] When step S314 is executed for the third time, the buffer identifier H is obtained. i The initial value of = H obtained when step S319 is executed for the second time i The final value of . And so on and so forth.

[0188] If the first message is divided into multiple data blocks, multiple iterations may be required. The final value of H0, H1, H2, H3, and H4 obtained in the previous data block are the initial value of H0, H1, H2, H3, and H4 of the next data block. Therefore, the final ciphertext is related to the number of iterations, making the ciphertext more difficult to crack.

[0189] Step S321: Set G=G+1, and return to step S310 until G is greater than Q.

[0190] Step S322: In the order of H0, H1, H2, H3, H4, a 160-bit hash value is formed by the final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4.

[0191] Understandably, H iThe length of the value is 32 bits, so 5 H i A 160-bit hash value.

[0192] Step S323: Based on the 160-bit hash value, obtain a second ciphertext.

[0193] In an optional implementation, a 160-bit hash value is determined as the second ciphertext.

[0194] Step S324: Store the second ciphertext in the blockchain.

[0195] Exemplarily, the ciphertext can be stored as a characteristic value of the input information in a corresponding block in the blockchain.

[0196] The ciphertext generation method based on Hilbert transform provided by the present application first encrypts the input information after obtaining the input information, and the encryption process is as follows: converting the input information into a decimal ASCII code to obtain a first character string composed of the decimal ASCII code; obtaining M coordinates from the first character string, wherein the abscissa of the coordinate is the position of the first character string, the ordinate of the coordinate is the character at the position, and the total number of characters contained in the first character string is M; using the fitting toolbox for the M coordinates, obtaining a first piecewise function: {k0≤t<k1,i=1; k1≤t<k2,i=2;...;k n-1 ≤t<k n , i=n}; perform Hilbert transform on the piecewise function to obtain a second piecewise function; sample and obtain M discrete values ​​from the second piecewise function to obtain a first ciphertext composed of the M discrete values; and then perform SHA-1 algorithm encryption on the first ciphertext. Even if an attacker decrypts the first ciphertext through SHA-1, the first ciphertext is still an encrypted ciphertext, so the input information cannot be cracked, thereby improving security. And in the present application, if the first message is divided into multiple data blocks, then in the process of calculating the next data block, the initial value of the identifier H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 of the buffer corresponding to the next data block are the final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 obtained from the previous data block. That is, the second ciphertext obtained is not only related to the process of encrypting the input information to obtain the first ciphertext, but also related to the number of data blocks into which the first message is divided. If brute force cracking is required, it is necessary to try to crack the number of data blocks into which the first message is divided, as well as the process of cracking the encryption of the input information to obtain the first ciphertext. Compared with the prior art, brute force cracking is more difficult, thereby improving the security of the input information.

[0197] Because the SHA-1 algorithm has been used for a long time, attackers have accumulated a considerable number of dictionary libraries. In order to further enhance its security and improve its ability to resist dictionary attacks and adapt to the increasingly deteriorating security situation, it is necessary to further reinforce the secure hash algorithm 1. After the secure hash algorithm 1 is further reinforced by the embodiment of the present application, even if the hash value of the input information is leaked, the improved algorithm is invalid through the current dictionary library, and the hash value cannot be reversely cracked, further enhancing the security of the blockchain business.

[0198] In an optional implementation, in order to further improve the security of input information, the present application also provides the following method, which is a process of reassigning 80 constants, and the process includes the following steps C11 to C16.

[0199] Step C11: The 80 constants K t Convert to decimal number K' t , to get 80 K' t .

[0200] Step C12: Based on the 80 K' t Get 80 coordinates (t, K' t ).

[0201] Step C13: For the 80 coordinates (t, K' t )Using the fitting toolbox, we get the third piecewise function:

[0202] {L0≤t<L1,i=1; L1≤t<L2,i=2;...;L m-1 ≤t<L m ,i=m}.

[0203] Exemplarily, the fitting toolbox may be a cftool fitting toolbox.

[0204] It can be understood that after fitting through the fitting toolbox, a third piecewise function composed of a finite number of trigonometric functions can be obtained, where m represents the number of trigonometric functions, that is, the number of segments of the third piecewise function, where L0, L1, L2, L3, L4, ..., L m Represents the critical value of a piecewise function.

[0205] After fitting by the fitting toolbox, b1(t), b2(t), ..., b m (t); These are all known functions.

[0206] Step C14: performing Hilbert transform on the third piecewise function to obtain a fourth piecewise function.

[0207] Step C15: Sampling 80 discrete values ​​from the fourth piecewise function.

[0208] Step C16: Sort the 80 discrete values ​​from small to large according to the horizontal axis, and assign them to the 80 constants in sequence.

[0209] In summary, 80 constants are reassigned, and when executing step S317, the formula TEMP=S5(H0)+f t (H1,H2,H3)+H4+W t +K t When K t is a reassigned constant. The values ​​of H0, H1, H2, H3, and H4 obtained based on the 80 reassigned constants are different from the values ​​of H0, H1, H2, H3, and H4 obtained based on the 80 preset constants. Therefore, the second ciphertext obtained is also related to the 80 reassigned constants. If the second ciphertext needs to be cracked, the 80 reassigned constants also need to be cracked. Compared with the existing technology, brute force cracking is more difficult, thereby improving the security of the input information.

[0210] The embodiment of the present application encrypts the input information multiple times, such as the first encryption to obtain the first ciphertext; the second encryption, reassigning 80 constants; the third encryption, if the first message is divided into multiple data blocks, then in the process of calculating the next data block, the initial value of the identifier H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 of the buffer corresponding to the next data block are the final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 obtained by the previous data block, so that the second ciphertext is related to the number of iterations. However, the length of the final second ciphertext is still 160 bits, which has not changed.

[0211] The Hilbert transform-based ciphertext generation method provided in the embodiment of the present application improves the security of the characteristic value of the input information of the blockchain. Attackers cannot use the current SHA-1 dictionary library to reversely decrypt the characteristic value, thus avoiding the possibility of brute force cracking.

[0212] The method is described in detail in the embodiments disclosed in the above-mentioned application. The method of the application can be implemented by various forms of devices. Therefore, the application also discloses a device, and a specific embodiment is given below for detailed description.

[0213] like Figure 6As shown, it is a structural diagram of a ciphertext generation device based on Hilbert transform provided in an embodiment of the present application, the device includes: a first acquisition module 601, a first conversion module 602, a second acquisition module 603, a third acquisition module 604, a second conversion module 605, a fourth acquisition module 606, a padding expansion module 607, a first division module 608, a first setting module 609, a second division module 610, an operation module 611, a fifth acquisition module 612, a sixth acquisition module 613, a first assignment module 614, a second assignment module 615, a calculation module 616, a first trigger module 617, a third assignment module 618, a fourth assignment module 619, a second trigger module 620, a seventh acquisition module 621, an eighth acquisition module 622 and a storage module 623, wherein:

[0214] A first acquisition module 601 is used to acquire input information to be stored in the blockchain;

[0215] A first conversion module 602, configured to convert the input information into decimal ASCII codes to obtain a first character string consisting of the decimal ASCII codes;

[0216] A second acquisition module 603 is used to obtain M coordinates from the first character string, where the horizontal coordinate of the coordinate is the position of the first character string, the vertical coordinate of the coordinate is the character at the position, and the total number of characters included in the first character string is M;

[0217] The third acquisition module 604 is used to use the fitting toolbox for the M coordinates to obtain a first piecewise function:

[0218] {k0≤t<k1, i=1; k1≤t<k2, i=2;...;k n-1 ≤t<k n , i=n};

[0219] A second conversion module 605, configured to perform a Hilbert transform on the piecewise function to obtain a second piecewise function;

[0220] A fourth acquisition module 606 is used to sample and obtain M discrete values ​​from the second piecewise function to obtain a first ciphertext composed of the M discrete values;

[0221] A padding and expansion module 607, configured to pad and expand the length of the first ciphertext to 512 bits*Q to obtain a first message, where Q is any integer greater than or equal to 1;

[0222] A first division module 608, configured to divide the first message into Q data blocks, where the number of bits of the data blocks is 512 bits;

[0223] A first setting module 609, used to set the initial value of G to 1;

[0224] The second partitioning module 610 is configured to perform the following operations on the Gth data block:

[0225] Dividing the data block into 16 target sub-data blocks, the number of bits of the target sub-data blocks is 32 bits;

[0226] A calculation module 611 is used to perform calculations on the 16 target sub-data blocks to obtain 64 calculation sub-data blocks to obtain 80 sub-data blocks, wherein the number of bits of the calculation sub-data blocks is 32 bits, and the 80 sub-data blocks include the 16 target sub-data blocks and the 64 calculation sub-data blocks;

[0227] The fifth acquisition module 612 is used to obtain 80 preset constants K t ; The value of t is 0, 1, 2, ..., 79;

[0228] A sixth acquisition module 613 is used to acquire the initial value of the identifier H0 of the buffer, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4;

[0229] A first assignment module 614, configured to assign the initial value of H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 to the first parameter, the second parameter, the third parameter, the fourth parameter, and the fifth parameter, respectively;

[0230] A second value assignment module 615, used to set the initial value of P to 0;

[0231] The calculation module 616 is used to perform the following calculation for t=P:

[0232] TEMP=S5(H0)+f t (H1,H2,H3)+H4+W t +K t ; H4=H3; H3=H2; H2=S 30 (H1); H1 = H0; H0 = TEMP; where W t is the t+1th sub-data block among the 80 sub-data blocks, f t (H1, H2, H3) is a pre-set function; S5(H0) means shifting H0 left by 5 bits; S 30 (H1) means shifting H1 left by 30 bits;

[0233] The first trigger module 617 is used to set P=P+1 and return to the calculation module until P is equal to 80 to obtain the values ​​of the identifiers H0, H1, H2, H3 and H4 of the buffer;

[0234] The third assignment module 618 is used to set the final value of H0 = the value of H0 + the first parameter, the final value of H1 = the value of H1 + the second parameter, the final value of H2 = the value of H2 + the third parameter, the final value of H3 = the value of H3 + the fourth parameter, and the final value of H4 = the value of H4 + the fifth parameter;

[0235] The fourth assignment module 619 is used to use the final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 as the initial value of the identifier H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 of the buffer corresponding to the G+1th data block, respectively;

[0236] The second trigger module 620 is used to set G=G+1 and return to the second division module until G is greater than Q;

[0237] A seventh acquisition module 621 is used to obtain a 160-bit hash value consisting of the final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 in the order of H0, H1, H2, H3, and H4;

[0238] An eighth acquisition module 622, configured to obtain a ciphertext based on the 160-bit hash value;

[0239] The storage module 623 is used to store the ciphertext in the blockchain.

[0240] In an optional implementation, the method further includes:

[0241] The third conversion module is used to convert the 80 constants K t Convert to decimal number K' t , to get 80 K' t ;

[0242] The ninth acquisition module is used based on the 80 K' t Get 80 coordinates (t, K' t );

[0243] The tenth acquisition module is used for the 80 coordinates (t, K' t )Using the fitting toolbox, we get the third piecewise function:

[0244] {L0≤t<L1,i=1; L1≤t<L2,i=2;...;L m-1 ≤t<L m ,i=m};

[0245] a fourth conversion module, configured to perform a Hilbert transform on the third piecewise function to obtain a fourth piecewise function;

[0246] A sampling module, used for sampling 80 discrete values ​​from the fourth piecewise function;

[0247] The fifth assignment module is used to sort the 80 discrete values ​​from small to large according to the horizontal axis, and assign them to the 80 constants in sequence.

[0248] In an optional implementation, the supplementary expansion module includes:

[0249] A first padding unit, used to pad a 1 at the end of the first ciphertext;

[0250] A second padding unit is used to pad 0 after the 1 in the first ciphertext padding until the length of the second message after the padding has a remainder of 448 after taking the modulus of 512;

[0251] A third padding unit, used for padding a 1 at the end of the second message;

[0252] The fourth padding unit is used to add 63 zeros after the padding 1 of the second message to obtain the first message.

[0253] In an optional implementation, the first preset value is 0x5A827999, the second preset value is 0x6ED9EBA1, the third preset value is 0x8F1BBCDC, and the fourth preset value is 0xCA62C1D6.

[0254] In an optional implementation, the preset function f t (H1,H2,H3) are as follows:

[0255] f t (H1,H2,H3)=(H1 AND H2)or((NOT H1)AND H3)(0<=t<=19)

[0256] f t (H1,H2,H3)=H1 XOR H2 XOR H3(20<=t<=39)

[0257] f t (H1,H2,H3)=(H1 AND H2)or(H1 AND H3)or(H2 AND H3)(40<=t<=59)

[0258] f t (H1, H2, H3)=H1 XOR H2 XOR H3 (60<=t<=79).

[0259] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0260] Figure 7 The invention is a block diagram showing a device for a server according to an exemplary embodiment.

[0261] The server includes, but is not limited to, a processor 71 , a memory 72 , a network interface 73 , an I / O controller 74 , and a communication bus 75 .

[0262] It should be noted that those skilled in the art can understand that Figure 7 The server structure shown in the figure does not constitute a limitation on the server, and the server may include Figure 7 More or fewer components may be shown, or certain components may be combined, or the components may be arranged differently.

[0263] Combine the following Figure 7 A detailed introduction to each component of the server:

[0264] The processor 71 is the control center of the server. It uses various interfaces and lines to connect various parts of the entire server. It executes various functions of the server and processes data by running or executing software programs and / or modules stored in the memory 72, and calling data stored in the memory 72, so as to monitor the server as a whole. The processor 71 may include one or more processing units; illustratively, the processor 71 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 71.

[0265] The processor 71 may be a central processing unit (CPU), or an application specific integrated circuit ASIC (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;

[0266] The memory 72 may include a memory, such as a high-speed random access memory (RAM) 721 and a read-only memory (ROM) 722, and may also include a large-capacity storage device 723, such as at least one disk storage, etc. Of course, the server may also include hardware required for other services.

[0267] The memory 72 is used to store executable instructions of the processor 71. The processor 71 has the function of generating a ciphertext based on Hilbert transform.

[0268] A wired or wireless network interface 73 is configured to connect the server to a network.

[0269] The processor 71, the memory 72, the network interface 73 and the I / O controller 74 may be interconnected via a communication bus 75, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.

[0270] In an exemplary embodiment, the server may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the above-mentioned Hilbert transform-based ciphertext generation method.

[0271] In an exemplary embodiment, the present disclosure provides a storage medium including instructions, such as a memory 72 including instructions, and the instructions can be executed by a processor 71 of a server to complete the above method. Optionally, the storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a tape, a floppy disk, and an optical Hilbert transform-based ciphertext generation device, etc.

[0272] In an exemplary embodiment, a computer-readable storage medium is also provided, which can be directly loaded into the internal memory of a computer, such as the above-mentioned memory 72, and contains software code. After being loaded and executed by a computer, the computer program can implement the steps shown in any embodiment of the above-mentioned ciphertext generation method based on Hilbert transform.

[0273] In an exemplary embodiment, a computer program product is also provided, which can be directly loaded into the internal memory of a computer, such as the memory included in the server, and contains software code. After being loaded and executed by a computer, the computer program can implement the steps shown in any embodiment of the above-mentioned ciphertext generation method based on Hilbert transform.

[0274] It should be noted that the Hilbert transform-based ciphertext generation method, server, medium, and device provided by the present invention can be used in the blockchain field or the financial field. The above is only an example and does not limit the application field of the Hilbert transform-based ciphertext generation method, server, medium, and device provided by the present invention.

[0275] It should be noted that the features described in the various embodiments in this specification can be replaced or combined with each other. For the device or system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0276] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0277] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0278] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A ciphertext generation method based on Hilbert transform, characterized in that: include: Get the input information to be stored in the blockchain; Convert the input information into decimal ASCII codes to obtain a first character string consisting of the decimal ASCII codes; Obtaining M coordinates from the first character string, wherein the horizontal coordinate of the coordinate is the position of the first character string, the vertical coordinate of the coordinate is the character at the position, and the total number of characters contained in the first character string is M; Using the fitting toolbox for the M coordinates, we obtain the first piecewise function: Wherein, n is the number of trigonometric functions constituting the first piecewise function obtained by the fitting toolbox, k0, k1, k2, k3, k4, ..., k n represents the critical value of the first piecewise function; a i (t) To preset known functions; Performing Hilbert transformation on the piecewise function to obtain a second piecewise function; Sampling values ​​from the second piecewise function to obtain M discrete values ​​to obtain a first ciphertext composed of the M discrete values; The length of the first ciphertext is padded to 512 bits*Q to obtain a first message, where Q is any integer greater than or equal to 1; Dividing the first message into Q data blocks, the number of bits of the data blocks is 512 bits; Set the initial value of G to 1; For the Gth data block, perform the following operations: Dividing the data block into 16 target sub-data blocks, the number of bits of the target sub-data blocks is 32 bits; Performing operations on the 16 target sub-data blocks to obtain 64 operation sub-data blocks to obtain 80 sub-data blocks, wherein the number of bits of the operation sub-data blocks is 32 bits, and the 80 sub-data blocks include the 16 target sub-data blocks and the 64 operation sub-data blocks; Get 80 preset constants K t ; The value of t is 0, 1, 2, ..., 79; Get the initial value of the buffer identifier H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4; Assign the initial value of H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 to the first parameter, the second parameter, the third parameter, the fourth parameter, and the fifth parameter, respectively; Set the initial value of P to 0; For t = P, the following calculation is performed: TEMP=S5(H0)+f t (H1,H2,H3)+H4+W t +K t ;H4=H3;H3=H2;H2=S 30 (H1);H1= H0; H0 = TEMP; where W t is the t+1th sub-data block among the 80 sub-data blocks, f t (H1, H2, H3) are pre-set functions; S5(H0) means shifting H0 left by 5 bits; S 30 (H1) means shifting H1 left by 30 bits; Among them, the pre-set function f t (H1,H2,H3) are as follows: f t (H1,H2,H3)=(H1 AND H2)or((NOT H1)AND H3),0<=t<=19; f t (H1,H2,H3)=H1 XOR H2 XOR H3,20<=t<=39; f t (H1,H2,H3)=(H1 AND H2)or(H1 AND H3)or(H2 AND H3),40<=t<=59; f t (H1,H2,H3)=H1 XOR H2 XOR H3,60<=t<=79; Set P=P+1, return to step t=P, and perform the following calculations until P is equal to 80 to obtain the values ​​of the buffer identifiers H0, H1, H2, H3, and H4; Let the final value of H0 = the value of H0 + the first parameter, the final value of H1 = the value of H1 + the second parameter, the final value of H2 = the value of H2 + the third parameter, the final value of H3 = the value of H3 + the fourth parameter, and the final value of H4 = the value of H4 + the fifth parameter; The final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 are used as the initial value of H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 of the buffer corresponding to the G+1th data block, respectively; Set G=G+1, return to step 1 and perform the following operations on the Gth data block until G is greater than Q; In the order of H0, H1, H2, H3, and H4, a 160-bit hash value consisting of the final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 is obtained; Among them, the length of H0, H1, H2, H3, and H4 are all 32 bits; Based on the 160-bit hash value, obtain a second ciphertext; The second ciphertext is stored in the blockchain.

2. The ciphertext generation method based on Hilbert transform according to claim 1, characterized in that: In the above, 80 preset constants K are obtained. t After that, it also includes: The 80 constants K t Convert to decimal number K' t , to get 80 K' t ; Based on the 80 K' t Get 80 coordinates (t, K' t ); For the 80 coordinates (t, K' t )Using the fitting toolbox, we get the third piecewise function: Wherein, m is the number of trigonometric functions constituting the third piecewise function obtained by the fitting toolbox; L0, L1, L2, L3, L4, ..., L m represents the critical value of the third piecewise function; b i (t) To preset known functions; Performing Hilbert transformation on the third piecewise function to obtain a fourth piecewise function; Sampling 80 discrete values ​​from the fourth piecewise function; The 80 discrete values ​​are sorted from small to large according to the horizontal axis, and are assigned to the 80 constants in sequence.

3. The ciphertext generation method based on Hilbert transform according to claim 1, characterized in that: The step of padding and expanding the length of the first ciphertext to 512 bits*Q to obtain a first message includes: Add a 1 to the end of the first ciphertext; Add 0 after the 1 in the first ciphertext, until the length of the second message after the padding is 448 modulo 512; Add a 1 at the end of the second message; 63 zeros are added after the padded 1 in the second message to obtain the first message.

4. The ciphertext generation method based on Hilbert transform according to any one of claims 1 to 3, characterized in that: The step of performing operations on the 16 target sub-data blocks to obtain 64 operation sub-data blocks includes: Set the initial value of R to 0; Let t = R and do the following: W t =M t , 0≤t<16, where M t is the t+1th target sub-data block; Wt=S1(W t-3 XOR W t-14 XOR W t-16 ), 16≤t≤79; where S1 means shifting left by 1 bit; Let R=R+1, return to step t=R, and perform the following operations until R equals 80.

5. A ciphertext generation device based on Hilbert transform, characterized in that: include: A first acquisition module, used to acquire input information to be stored in the blockchain; A first conversion module, used for converting the input information into decimal ASCII codes to obtain a first character string consisting of the decimal ASCII codes; A second acquisition module is used to obtain M coordinates from the first character string, wherein the horizontal coordinate of the coordinate is the position of the first character string, the vertical coordinate of the coordinate is the character at the position, and the total number of characters contained in the first character string is M; The third acquisition module is used to use the fitting toolbox for the M coordinates to obtain the first piecewise function: Wherein, n is the number of trigonometric functions constituting the first piecewise function obtained by the fitting toolbox, k0, k1, k2, k3, k4, ..., k n represents the critical value of the first piecewise function; a i (t) is a preset known function; a second conversion module, used for performing Hilbert transform on the piecewise function to obtain a second piecewise function; A fourth acquisition module, used for sampling and obtaining M discrete values ​​from the second piecewise function to obtain a first ciphertext composed of the M discrete values; A padding and expansion module, used for padding and expanding the length of the first ciphertext to 512 bits*Q to obtain a first message, where Q is any integer greater than or equal to 1; A first division module, used for dividing the first message into Q data blocks, the number of bits of the data blocks is 512 bits; A first setting module, used to set the initial value of G to 1; For the Gth data block, perform the following operations: A second division module is used to divide the data block into 16 target sub-data blocks, and the number of bits of the target sub-data blocks is 32 bits; A calculation module, used for performing calculation on the 16 target sub-data blocks to obtain 64 calculation sub-data blocks, so as to obtain 80 sub-data blocks, wherein the number of bits of the calculation sub-data blocks is 32 bits, and the 80 sub-data blocks include the 16 target sub-data blocks and the 64 calculation sub-data blocks; The fifth acquisition module is used to obtain 80 preset constants K t ; The value of t is 0, 1, 2, ..., 79; A sixth acquisition module, used to acquire an initial value of the identifier H0 of the buffer, an initial value of H1, an initial value of H2, an initial value of H3, and an initial value of H4; A first assignment module, used for assigning the initial value of H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 to the first parameter, the second parameter, the third parameter, the fourth parameter, and the fifth parameter, respectively; The second assignment module is used to set the initial value of P to 0; The calculation module is used to perform the following calculation for t=P: TEMP=S5(H0)+f t (H1,H2,H3)+H4+W t +K t ;H4=H3;H3=H2;H2=S 30 (H1);H1= H0; H0 = TEMP; where W t is the t+1th sub-data block among the 80 sub-data blocks, f t (H1, H2, H3) are pre-set functions; S5(H0) means shifting H0 left by 5 bits; S 30 (H1) means shifting H1 left by 30 bits; Among them, the pre-set function f t (H1,H2,H3) are as follows: f t (H1,H2,H3)=(H1 AND H2)or((NOT H1)AND H3),0<=t<=19; f t (H1,H2,H3)=H1 XOR H2 XOR H3,20<=t<=39; f t (H1,H2,H3)=(H1 AND H2)or(H1 AND H3)or(H2 AND H3),40<=t<=59; f t (H1, H2, H3) = H1 XOR H2 XOR H3, 60 <= t <= 79; the first trigger module is used to set P = P + 1, and return to the calculation module until P is equal to 80, so as to obtain the values ​​of the identifiers H0, H1, H2, H3, and H4 of the buffer; The third assignment module is used to make the final value of H0 = the value of H0 + the first parameter, the final value of H1 = the value of H1 + the second parameter, the final value of H2 = the value of H2 + the third parameter, the final value of H3 = the value of H3 + the fourth parameter, and the final value of H4 = the value of H4 + the fifth parameter; a fourth assignment module, used to use the final value of H0, the final value of H1, the final value of H2, the final value of H3, and the final value of H4 as the initial value of H0, the initial value of H1, the initial value of H2, the initial value of H3, and the initial value of H4 of the buffer corresponding to the G+1th data block, respectively; The second trigger module is used to set G=G+1 and return to the second division module until G is greater than Q; A seventh acquisition module, used to obtain a 160-bit hash value consisting of a final value of H0, a final value of H1, a final value of H2, a final value of H3, and a final value of H4 in the order of H0, H1, H2, H3, and H4; Wherein, the lengths of H0, H1, H2, H3, and H4 are all 32 bits; an eighth acquisition module is used to obtain a ciphertext based on the 160-bit hash value; A storage module is used to store the ciphertext in a blockchain.

6. The ciphertext generation device based on Hilbert transform according to claim 5, characterized in that: Also includes: The third conversion module is used to convert the 80 constants K t Convert to decimal number K' t , to get 80 K' t ; The ninth acquisition module is used based on the 80 K' t Get 80 coordinates (t, K' t ); The tenth acquisition module is used for the 80 coordinates (t, K' t )Using the fitting toolbox, we get the third piecewise function: Wherein, m is the number of trigonometric functions constituting the third piecewise function obtained by the fitting toolbox; L0, L1, L2, L3, L4, ..., L m represents the critical value of the third piecewise function; b i (t) is a preset known function; a fourth conversion module, used for performing Hilbert transform on the third piecewise function to obtain a fourth piecewise function; A sampling module, used for sampling 80 discrete values ​​from the fourth piecewise function; The fifth assignment module is used to sort the 80 discrete values ​​from small to large according to the horizontal axis, and assign them to the 80 constants in sequence.

7. The ciphertext generation device based on Hilbert transform according to claim 5, characterized in that: The supplementary expansion module comprises: A first padding unit, used to pad a 1 at the end of the first ciphertext; A second padding unit is used to pad 0 after the 1 in the first ciphertext padding until the length of the second message after the padding has a remainder of 448 after taking the modulus of 512; A third padding unit, used for padding a 1 at the end of the second message; The fourth padding unit is used to add 63 zeros after the padding 1 of the second message to obtain the first message.

8. A server, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the Hilbert transform-based ciphertext generation method as described in any one of claims 1 to 4.

9. A computer-readable storage medium, when instructions in the storage medium are executed by a processor of a server, enables the server to execute the ciphertext generation method based on Hilbert transform as described in any one of claims 1 to 4.

10. A computer program product that can be directly loaded into the internal memory of a computer, wherein the memory is the memory contained in the server described in claim 8 and contains software code. After being loaded and executed by a computer, the computer program can implement the Hilbert transform-based ciphertext generation method described in any one of claims 1 to 4.