CN113761561B - SHA1 encryption method and device based on convolution optimization - Google Patents

SHA1 encryption method and device based on convolution optimization Download PDF

Info

Publication number
CN113761561B
CN113761561B CN202111109884.0A CN202111109884A CN113761561B CN 113761561 B CN113761561 B CN 113761561B CN 202111109884 A CN202111109884 A CN 202111109884A CN 113761561 B CN113761561 B CN 113761561B
Authority
CN
China
Prior art keywords
target
buffer
encryption
processing
intermediate quantity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111109884.0A
Other languages
Chinese (zh)
Other versions
CN113761561A (en
Inventor
王公桃
叶雪峰
李理
吕鹏
孙波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202111109884.0A priority Critical patent/CN113761561B/en
Publication of CN113761561A publication Critical patent/CN113761561A/en
Application granted granted Critical
Publication of CN113761561B publication Critical patent/CN113761561B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Abstract

The invention discloses a convolution optimization-based SHA1 encryption method and device, which are applied to the fields of artificial intelligence, blockchain and finance, wherein the convolution processing is carried out on an original message to convert an obtained target bit character string into a first buffer area intermediate quantity, a second buffer area intermediate quantity and a third buffer area intermediate quantity; performing convolution processing on the intermediate quantity of the second buffer zone to obtain a second target intermediate quantity of the buffer zone; re-assigning the first buffer intermediate quantity, determining a first encryption abstract based on the obtained first target buffer intermediate quantity and the second target buffer intermediate quantity, and performing ECC elliptic encryption processing on the first encryption abstract and performing shift encryption processing on the obtained second encryption abstract to obtain a target encryption abstract. Convolution, ECC elliptic encryption and shift processing are adopted in the encryption process based on SHA1, so that the encryption complexity is improved and the risk of violent cracking is reduced under the condition that the lengths of the first encryption abstract and the target encryption abstract are unchanged.

Description

SHA1 encryption method and device based on convolution optimization
Technical Field
The invention relates to the technical field of blockchain, in particular to a convolution optimization-based SHA1 encryption method and device.
Background
In the existing application system, an SHA1 algorithm widely exists, and when the SHA1 algorithm is applied to a blockchain to generate a hash value, the SHA1 algorithm generates a 160-bit hash value, and after the SHA1 algorithm is used for years, the SHA1 algorithm can be cracked by an attacker through dictionary violence, so that the security of a hash ciphertext value is threatened.
In the prior art, an attacker uses a special GPU, AI equipment, a supercomputer and the like, so that the hash collision operation speed can be greatly improved, and the possibility of violent cracking exists after a large number of collision password libraries are accumulated because the hash value is shorter.
Disclosure of Invention
In view of this, the invention provides a convolution optimization-based SHA1 encryption method and apparatus, which are used for solving the problem that in the prior art, an attacker uses a special GPU, AI equipment, a supercomputer and the like, so that the hash collision operation speed can be greatly improved, and the probability of violent cracking exists after a large number of collision password libraries are accumulated because of a short hash value. The specific scheme is as follows:
a convolution optimization-based SHA1 encryption method comprising:
performing convolution processing on the original message to obtain a target bit character string;
converting the target bit string into a first buffer intermediate quantity, a second buffer intermediate quantity and a third buffer intermediate quantity;
performing convolution processing on the intermediate quantity of the second buffer zone to obtain a second target intermediate quantity of the buffer zone;
reassigning the first buffer intermediate amount based on the second target buffer intermediate amount and the third buffer intermediate amount to obtain a first target buffer intermediate amount;
determining a first encrypted digest based on the first target buffer intermediate amount and the second target buffer intermediate amount;
performing ECC elliptic curve encryption processing on the first encrypted abstract to obtain a second encrypted abstract;
and performing shift encryption processing on the second encrypted digest to obtain a target encrypted digest, wherein the encrypted digest has the same length as the target encrypted digest.
The method, optionally, carries out convolution processing on the original message to obtain the target bit character string, and comprises the following steps:
converting the original message into a bit string based on the SHA1 algorithm;
and selecting a convolution function, and taking the product of the convolution function and the bit character string as a target bit character string.
The method, optionally, converting the target bit string into a first buffer intermediate amount, a second buffer intermediate amount, and a third buffer intermediate amount, includes:
acquiring the capacity of a first buffer area and a second buffer area;
storing corresponding characters in the bit character strings into corresponding buffer areas according to the capacity of each buffer area to obtain the intermediate quantity of the first buffer area and the intermediate quantity of the second buffer area;
converting the bit string to the third buffer intermediate quantity.
In the above method, optionally, the first target buffer intermediate amount and the second target buffer intermediate amount are at least one, and determining the first encrypted digest based on the first target buffer intermediate amount and the second target buffer intermediate amount includes:
determining a second target buffer intermediate amount corresponding to each first target buffer intermediate amount;
and summing the intermediate quantity of the second target buffer zone corresponding to the intermediate quantity of the current first target buffer zone to obtain a first encryption abstract.
The method, optionally, performs shift encryption processing on the encrypted digest to obtain a target encrypted digest, including:
acquiring each number in the encrypted abstract, and summing the numbers to obtain a number sum;
performing modular processing on the digital sum and a preset numerical value to obtain a shift length;
and carrying out shift processing on the digital digest based on the shift length to obtain a target encrypted digest.
A convolution optimization-based SHA1 encryption apparatus comprising:
the first convolution processing module is used for carrying out convolution processing on the original message to obtain a target bit character string;
the conversion module is used for converting the target bit character string into a first buffer area intermediate quantity, a second buffer area intermediate quantity and a third buffer area intermediate quantity;
the second convolution processing module is used for carrying out convolution processing on the intermediate quantity of the second buffer zone to obtain a second target intermediate quantity of the buffer zone;
the assignment module is used for reassigning the first buffer intermediate quantity based on the second target buffer intermediate quantity and the third buffer intermediate quantity to obtain a first target buffer intermediate quantity;
the determining module is used for determining a first encryption digest based on the first target buffer intermediate quantity and the second target buffer intermediate quantity;
the ECC encryption module is used for carrying out ECC elliptic curve encryption processing on the first encryption abstract to obtain a second encryption abstract;
and the shift processing module is used for carrying out shift encryption processing on the second encryption digest to obtain a target encryption digest, wherein the length of the encryption digest is the same as that of the target encryption digest.
The above apparatus, optionally, the first convolution processing module includes:
a conversion unit for converting the original message into a bit string based on the SHA1 algorithm;
and the selecting and determining unit is used for selecting a convolution function and taking the product of the convolution function and the bit character string as a target bit character string.
The above apparatus, optionally, the conversion module includes:
the acquisition unit is used for acquiring the capacities of the first buffer area and the second buffer area;
the storage unit is used for storing corresponding characters in the bit character strings into the corresponding buffer areas according to the capacity of each buffer area to obtain the intermediate quantity of the first buffer area and the intermediate quantity of the second buffer area;
and the conversion unit is used for converting the bit character string into the intermediate quantity of the third buffer area.
In the above apparatus, optionally, the first target buffer intermediate amount and the second target buffer intermediate amount are at least one, and the determining module includes:
a determining unit configured to determine a second target buffer intermediate amount corresponding to each of the first target buffer intermediate amounts;
and the summing unit is used for summing the intermediate quantity of the second target buffer zone corresponding to the intermediate quantity of the current first target buffer zone to obtain a first encrypted digest.
The above apparatus, optionally, the shift processing module includes:
the obtaining and summing unit is used for obtaining each number in the encrypted abstract, and summing the numbers to obtain a number sum;
the module taking unit is used for carrying out module taking processing on the digital sum and a preset numerical value to obtain a shift length;
and the shift processing unit is used for carrying out shift processing on the digital digest based on the shift length to obtain a target encrypted digest.
Compared with the prior art, the invention has the following advantages:
the invention discloses a convolution optimization-based SHA1 encryption method and device, which are applied to the fields of artificial intelligence, blockchain and finance, and comprise the following steps: performing convolution processing on the original message to convert the obtained target bit character string into a first buffer area intermediate quantity, a second buffer area intermediate quantity and a third buffer area intermediate quantity; performing convolution processing on the intermediate quantity of the second buffer zone to obtain a second target intermediate quantity of the buffer zone; and re-assigning the first buffer intermediate based on the second target buffer intermediate and the third buffer intermediate, determining a first encryption digest by the obtained first target buffer intermediate and the second target buffer intermediate, performing ECC elliptic encryption processing on the first encryption digest to obtain a second encryption digest, and performing shift encryption processing on the second encryption digest to obtain a target encryption digest, wherein the lengths of the first encryption digest and the second encryption digest are the same. In the encryption process based on SHA1, convolution, ECC elliptic encryption and shift processing are adopted, so that the encryption complexity is improved and the risk of violent cracking is reduced under the condition that the lengths of the first encryption abstract and the target encryption abstract are unchanged.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a convolution optimization-based SHA1 encryption method disclosed in an embodiment of the present application;
fig. 2 is a block diagram of a SHA1 encryption device based on convolution optimization according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that the SHA1 encryption method and device based on convolution optimization provided by the invention can be used in the artificial intelligence field, the blockchain field and the finance field. The foregoing is merely exemplary, and the application fields of the SHA1 encryption method and apparatus based on convolution optimization provided by the present invention are not limited.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The invention discloses a convolution optimization-based SHA1 encryption method and device, which are applied to the encryption process of a block chain based on a SHA1 algorithm, wherein the SHA1 algorithm generates a 160-bit hash value, because the hash value is shorter and is used for many years, after a large number of collision password libraries are accumulated, the possibility of violent cracking exists, and an attacker uses a special GPU, AI equipment, a supercomputer and the like, so that the hash collision operation speed can be greatly improved, and the threat of the hash collision libraries generated by the current SHA1 algorithm is increased; the SHA1 algorithm is used as an encryption algorithm which is widely used at one time, is widely used in the fields of government, finance, communication, energy institutions and the like, optimizes the existing algorithm, remarkably enhances the safety of the existing algorithm, and has relatively remarkable economic significance in adapting to the requirements of service fusion blockchain. When hash value generation is carried out on the block chain, in order to further enhance the security and the capability of resisting exhaustion and violent cracking, so as to be suitable for the service requirements of decentralization and multi-center distributed processing, the algorithm needs to be further reinforced.
Therefore, in an embodiment of the present invention, there is provided a SHA1 encryption method based on convolution optimization, where an execution flow of the method is shown in fig. 1, and the method includes the steps of:
s101, carrying out convolution processing on an original message to obtain a target bit character string;
in the embodiment of the present invention, the original information may be a character string or a file, and the specific form of the original information is not limited, and the original information needs to be converted into a bit character string, where the bit character string is 512 bits, and the original information includes at least one bit character string, and the conversion process is as follows:
and acquiring the length of the original information, wherein the length satisfies that the remainder after the modulus is taken from 512 is 448, and if the length is not satisfied, the bit and length compensation processing can be performed, and the specific processing process is as follows: a1 is added and then a 0 is added until the length satisfies the modulo 512 remainder 448. The length of the original data is complemented to the back of the message with the bit complement operation. The length of the original message is typically represented by a 64-bit data, and if the message length is not greater than 2A 64, the first word is 0 and the message is taken as a data block, wherein the data block is a bit string; if the original message length exceeds 512, it needs to be complemented by a multiple of 512. The entire message is then divided into 512-bit data blocks, each of which is processed separately.
For each data block, a convolution function is selected, and the selection process of the convolution function is not limited in the embodiment of the present invention, and a basic formula calculated based on the convolution function is as follows:
wherein x (t) and h (t) represent integrable functions, in the embodiment of the invention, x (t) represents a bit string, h (t) represents a convolution function, and y (t) represents a target bit string.
S102, converting the target bit character string into a first buffer intermediate quantity, a second buffer intermediate quantity and a third buffer intermediate quantity;
in the embodiment of the present invention, further, for the target bit string, the corresponding portions are stored in a first buffer, a second buffer, and a remaining buffer, where the first buffer and the second buffer have a capacity of 5 words of 32 bits, and the remaining buffer has a capacity of 80 buffers of 32 words. Assume that a buffer of 5 words of the first buffer is identified as a, B, C, D, E. The 5-word buffers of the second buffer are identified as H0, H1, H2, H3, H4, and the 80-word buffers of the remaining buffers are identified as W0, W1. Based on the capacities of the first buffer area and the second buffer area, storing corresponding characters in the bit character string into the corresponding buffer areas, obtaining the intermediate quantity of the first buffer area and the intermediate quantity of the second buffer area, and storing the rest corresponding characters of the bit character string into the rest buffer areas.
Further, the target bit string is divided into 16 words P0, P1, P15, where pi is a 32-bit word, i=12 …, P0, P1, P15 is taken as the third buffer intermediate.
S103, carrying out convolution processing on the intermediate quantity of the second buffer zone to obtain a second target intermediate quantity of the buffer zone;
in the embodiment of the present invention, the second buffer intermediate quantities H0, H1, H2, H3, H4 are convolved based on the formula (1) to obtain the second target buffer intermediate quantity, and it is assumed that the second buffer intermediate quantity { Hi } in the second buffer is initialized to the following value:
H0=0x67452301
H1=0xEFCDAB89
H2=0x98BADCFE
H3=0x10325476
H4=0xC3D2E1F0
and (3) carrying out convolution processing based on the formula (1) to obtain the intermediate quantity H0', H1', H2', H3', H4' of the second target buffer zone. Wherein the second buffer intermediate amount is the same length as the second target buffer intermediate amount.
S104, reassigning the first buffer intermediate quantity based on the second target buffer intermediate quantity and the third buffer intermediate quantity to obtain a first target buffer intermediate quantity;
in the embodiment of the present invention, in the case of the constants used, a series of constants K (0), K (1),. The term, K (79), if expressed in 16 scale, is as follows:
Kt=0x5A827999(0<=t<=19)
Kt=0x6ED9EBA1(20<=t<=39)
Kt=0x8F1BBCDC(40<=t<=59)
Kt=0xCA62C1D6(60<=t<=79).
in case of functions that need to be used, we need a series of functions in SHA 1. Each function ft (0 < = t < = 79) operates on 32-bit words B, C, D and produces 32-bit words as output. ft (B, C, D) may be defined as follows:
ft(B,C,D)=(B AND C)or((NOT B)AND D)(0<=t<=19)
ft(B,C,D)=B XOR C XOR D(20<=t<=39)
ft(B,C,D)=(B AND C)or(B AND D)or(C AND D)(40<=t<=59)
ft(B,C,D)=B XOR C XOR D(60<=t<=79).
assuming that the bit string is Mi, the following steps are required to process Mi
(1) Divide Mi into 16 words P0, P1,..p 15;
(2) let pt=s1 for t=16 to 79 (Pt-3 XOR Pt-8 XOR Pt-14 XOR Pt-16)
(3) Let a=h0 ', b=h1 ', c=h2 ', d=h3 ', e=h4 '
Then for t=0 to 79, the following loop is performed
Temp=s5 (a) +ft (B, C, D) +e+pt+kt, where TEMP represents a word-by-word TEMP buffer e=d; d=c; c=s30 (B); b=a; a=temp, and updating the intermediate amount of the first buffer is completed, so as to obtain the intermediate amount of the first target buffer.
S105, determining a first encryption digest based on the first target buffer intermediate quantity and the second target buffer intermediate quantity;
in the embodiment of the invention, a second target buffer intermediate corresponding to each first target buffer intermediate, i.e., H0 'corresponds to a, H1' corresponds to B, H2 'corresponds to C, H3' corresponds to D, H4 'corresponds to E, is determined, and the second target buffer intermediate corresponding to the current first target buffer intermediate is summed to obtain a first encrypted digest, i.e., h00=h0' +a, h11=h1 '+b, h22=h2' +c, h33=h3 '+d, h44=h4' +e.
S106, performing ECC elliptic curve encryption processing on the first encrypted abstract to obtain a second encrypted abstract;
in the embodiment of the invention, the processing procedure of performing ECC elliptic curve encryption on the first encrypted abstract is as follows:
the element G of Ep (a, b) is typically chosen such that the order n of G is a large prime number; the second is the order of G refers to the minimum n value that satisfies ng=o; thirdly, selecting an integer k in a secret way, calculating B=kG, and then disclosing (p, a, B, G, B), wherein B is a public key, and k is a private key in the secret way.
Encrypting the first encrypted digest: the first cryptographic digest is transformed into a point Pm in Ep (a, b), then a random number r is selected, and a ciphertext cm= (rG, pm+rp) is calculated, where Cm is the second cryptographic digest, and r is reselected if r is such that rG or rP is O (where O is an infinity point).
S107, performing shift encryption processing on the second encrypted digest to obtain a target encrypted digest, wherein the encrypted digest and the target encrypted digest have the same length.
In the embodiment of the invention, the second encryption abstract is subjected to Kaiser shift, and the shift length is firstly determined, wherein the determination process is as follows: the shift length is a result of performing modulo processing on the sum of the numbers in the second encrypted digest and a preset value, and it is assumed that a string formed by the numbers in the second encrypted digest is x= (X1, X2,..once., xn), where the preset value is 10.
Let sum=y+ (xn x 2-9) +xn-1+ (xn-1-9) +xn-3+ (x 2-9) +x1
The SUM module 10 is 0, i.e., a Y value is obtained, Y is a shift length, and if Y is an odd number, the encryption string performs a left shift, and if Y is an even number, the encryption string performs a right shift.
And carrying out shift processing on the second encrypted digest based on the shift length to obtain a target encrypted digest.
The invention discloses a convolution optimization-based SHA1 encryption method, which is applied to the fields of artificial intelligence, blockchain and finance and comprises the following steps: performing convolution processing on the original message to convert the obtained target bit character string into a first buffer area intermediate quantity, a second buffer area intermediate quantity and a third buffer area intermediate quantity; performing convolution processing on the intermediate quantity of the second buffer zone to obtain a second target intermediate quantity of the buffer zone; and re-assigning the first buffer intermediate based on the second target buffer intermediate and the third buffer intermediate, determining a first encryption digest by the obtained first target buffer intermediate and the second target buffer intermediate, performing ECC elliptic encryption processing on the first encryption digest to obtain a second encryption digest, and performing shift encryption processing on the second encryption digest to obtain a target encryption digest, wherein the lengths of the first encryption digest and the second encryption digest are the same. In the encryption process based on SHA1, convolution, ECC elliptic encryption and shift processing are adopted, so that the encryption complexity is improved and the risk of violent cracking is reduced under the condition that the lengths of the first encryption abstract and the target encryption abstract are unchanged.
In the embodiment of the invention, the convolution processing operation amount is smaller, but the password complexity is obviously increased; when the encrypted object is changed by one bit or more, at least 1/2 length value in the random value can be changed obviously, namely the avalanche effect of the algorithm, so that the password complexity is enhanced obviously, the workload of violent cracking is increased, the violent cracking is almost impossible to realize under the existing operation capability, the encryption mode of the ECC elliptic curve is not changed into the original mode of SHA1, but the complexity of the block chain ciphertext message is enhanced obviously because the hash function value is processed by convolution interference.
In the embodiment of the invention, the SHA1 processes the original message of the blockchain by using a convolution function to obtain the hash function character strings with the same length, and the encryption operation amount is small after the processing, but the deception of the password is enhanced, so that an attacker is difficult to crack along with the old case; and sequentially calculating elliptic curve points of the hash function character string obtained by convolution processing in the steps, solving to obtain a ciphertext value, and enabling the final output value to be the same as the result length of the blockchain report Wen Haxi value processed by the original SHA1 algorithm. The encryption processing has avalanche effect, and the tiny change of the encrypted message can cause the obvious change of the hash function, so that the security of the password is greatly enhanced, and the reverse cracking of an attacker is almost impossible under the calculation power and the economic investment of the existing computing equipment; after the encryption method is used for processing, the length of the encrypted abstract is unchanged, the adjustment and the change of the interface column length of a block chain user are not influenced, the existing algorithm can be well integrated, and the influence on the system performance is small.
Furthermore, under the condition of keeping the length of the ciphertext unchanged, the traditional SHA1 algorithm brute force cracking attack cracking and the password dictionary failure of an attacker are realized, and the modification is carried out on the basis of the SHA1 algorithm encryption algorithm commonly used by the current service system, so that the improvement and the use difficulty of the blockchain hash value encryption algorithm are obviously reduced, and the influence on the performance, the interface, the message format and the like of the current system is smaller.
The method adds the convolution function encryption processing of the message in the SHA1 algorithm, which is similar to the salt adding and noise interference increasing in the signal processing. Through the processing, the complexity and the anti-exhaustion performance of the password are obviously enhanced, the original password length is kept unchanged, the existing service system is better compatible, and the workload of modifying the access block chain of the service system is smaller. In addition, the improved encryption method can meet the requirements of multi-language and cross-platform programming, is also suitable for being used on products such as low-power-consumption and low-performance Internet of things platforms, intelligent home furnishings and the like, expands the blockchain application scene of financial business, and adapts to the development trend of decentralization and everything interconnection.
Based on the above-mentioned SHA1 encryption method based on convolution optimization, in the embodiment of the present invention, there is provided an SHA1 encryption device based on convolution optimization, where a structural block diagram of the encryption device is shown in fig. 2, and the encryption device includes:
a first convolution processing module 201, a conversion module 202, a second convolution processing module 203, an assignment module 204, a determination module 205, an ECC encryption module 206, and a shift processing module 207.
Wherein,
the first convolution processing module 201 is configured to perform convolution processing on an original message to obtain a target bit string;
the conversion module 202 is configured to convert the target bit string into a first buffer intermediate amount, a second buffer intermediate amount, and a third buffer intermediate amount;
the second convolution processing module 203 is configured to perform convolution processing on the second intermediate buffer volume to obtain a second target intermediate buffer volume;
the assignment module 204 is configured to reassign the first buffer intermediate amount based on the second target buffer intermediate amount and the third buffer intermediate amount, to obtain a first target buffer intermediate amount;
the determining module 205 is configured to determine a first cryptographic digest based on the first target buffer intermediate amount and the second target buffer intermediate amount;
the ECC encryption module 206 is configured to perform ECC elliptic curve encryption on the first encrypted digest to obtain a second encrypted digest;
the shift processing module 207 is configured to perform shift encryption processing on the second encrypted digest to obtain a target encrypted digest, where the encrypted digest has the same length as the target encrypted digest.
The invention discloses a convolution optimization-based SHA1 encryption device, which is applied to the fields of artificial intelligence, blockchain and finance and comprises the following components: performing convolution processing on the original message to convert the obtained target bit character string into a first buffer area intermediate quantity, a second buffer area intermediate quantity and a third buffer area intermediate quantity; performing convolution processing on the intermediate quantity of the second buffer zone to obtain a second target intermediate quantity of the buffer zone; and re-assigning the first buffer intermediate based on the second target buffer intermediate and the third buffer intermediate, determining a first encryption digest by the obtained first target buffer intermediate and the second target buffer intermediate, performing ECC elliptic encryption processing on the first encryption digest to obtain a second encryption digest, and performing shift encryption processing on the second encryption digest to obtain a target encryption digest, wherein the lengths of the first encryption digest and the second encryption digest are the same. In the encryption process based on SHA1, convolution, ECC elliptic encryption and shift processing are adopted, so that the encryption complexity is improved and the risk of violent cracking is reduced under the condition that the lengths of the first encryption abstract and the target encryption abstract are unchanged.
In an embodiment of the present invention, the first convolution processing module 201 includes:
a conversion unit 208 and a selection and determination unit 209.
Wherein,
the conversion unit 208 is configured to convert the original message into a bit string based on the SHA1 algorithm;
the selecting and determining unit 209 is configured to select a convolution function, and take a product of the convolution function and the bit string as a target bit string.
In an embodiment of the present invention, the conversion module 202 includes:
an acquisition unit 210, a storage unit 211, and a conversion unit 212.
Wherein,
the acquiring unit 210 is configured to acquire the capacities of the first buffer and the second buffer;
the storage unit 211 is configured to store the corresponding character in the bit string into the corresponding buffer according to the capacity of each buffer, so as to obtain the intermediate amount of the first buffer and the intermediate amount of the second buffer;
the conversion unit 212 is configured to convert the bit string into the third buffer intermediate amount.
In the embodiment of the present invention, the determining module 205 includes:
a determining unit 213 and a summing unit 214.
Wherein,
the determining unit 213 is configured to determine a second target buffer intermediate amount corresponding to each first target buffer intermediate amount;
the summing unit 214 is configured to sum the intermediate amounts of the second target buffers corresponding to the intermediate amounts of the current first target buffers, to obtain a first encrypted digest.
In the embodiment of the present invention, the shift processing module 207 includes:
an acquisition and summation unit 215, a modulus unit 216, and a shift processing unit 217.
Wherein,
the obtaining and summing unit 215 is configured to obtain each number in the encrypted digest, and sum the numbers to obtain a digital sum;
the modulus taking unit 216 is configured to perform modulus taking processing on the digital sum and a preset value to obtain a shift length;
the shift processing unit 217 is configured to perform shift processing on the digital digest based on the shift length, to obtain a target encrypted digest.
The encryption device comprises a processor and a memory, wherein the first convolution processing module, the conversion module, the second convolution processing module, the assignment module, the determination module, the ECC encryption module, the shift processing module and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one, so that the encryption complexity is increased and the risk of brute force cracking is reduced under the condition that the ciphertext length is unchanged.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the invention provides a storage medium, wherein a program is stored on the storage medium, and the program is executed by a processor to realize the SHA1 encryption method based on convolution optimization.
The embodiment of the invention provides a processor which is used for running a program, wherein the program runs to execute the convolution optimization-based SHA1 encryption method.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program stored in the memory and capable of running on the processor, wherein the processor realizes the following steps when executing the program:
performing convolution processing on the original message to obtain a target bit character string;
converting the target bit string into a first buffer intermediate quantity, a second buffer intermediate quantity and a third buffer intermediate quantity;
performing convolution processing on the intermediate quantity of the second buffer zone to obtain a second target intermediate quantity of the buffer zone;
reassigning the first buffer intermediate amount based on the second target buffer intermediate amount and the third buffer intermediate amount to obtain a first target buffer intermediate amount;
determining a first encrypted digest based on the first target buffer intermediate amount and the second target buffer intermediate amount;
performing ECC elliptic curve encryption processing on the first encrypted abstract to obtain a second encrypted abstract;
and performing shift encryption processing on the second encrypted digest to obtain a target encrypted digest, wherein the encrypted digest has the same length as the target encrypted digest.
The method, optionally, carries out convolution processing on the original message to obtain the target bit character string, and comprises the following steps:
converting the original message into a bit string based on the SHA1 algorithm;
and selecting a convolution function, and taking the product of the convolution function and the bit character string as a target bit character string.
The method, optionally, converting the target bit string into a first buffer intermediate amount, a second buffer intermediate amount, and a third buffer intermediate amount, includes:
acquiring the capacity of a first buffer area and a second buffer area;
storing corresponding characters in the bit character strings into corresponding buffer areas according to the capacity of each buffer area to obtain the intermediate quantity of the first buffer area and the intermediate quantity of the second buffer area;
converting the bit string to the third buffer intermediate quantity.
In the above method, optionally, the first target buffer intermediate amount and the second target buffer intermediate amount are at least one, and determining the first encrypted digest based on the first target buffer intermediate amount and the second target buffer intermediate amount includes:
determining a second target buffer intermediate amount corresponding to each first target buffer intermediate amount;
and summing the intermediate quantity of the second target buffer zone corresponding to the intermediate quantity of the current first target buffer zone to obtain a first encryption abstract.
The method, optionally, performs shift encryption processing on the encrypted digest to obtain a target encrypted digest, including:
acquiring each number in the encrypted abstract, and summing the numbers to obtain a number sum;
performing modular processing on the digital sum and a preset numerical value to obtain a shift length;
and carrying out shift processing on the digital digest based on the shift length to obtain a target encrypted digest.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other. For the apparatus class embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference is made to the description of the method embodiments for relevant points.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in the same piece or pieces of software and/or hardware when implementing the present invention.
From the above description of embodiments, it will be apparent to those skilled in the art that the present invention may be implemented in software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present invention.
The above describes in detail a convolution optimization-based SHA1 encryption method and apparatus provided by the present invention, and specific examples are applied herein to illustrate the principles and embodiments of the present invention, where the above examples are only used to help understand the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (8)

1. A convolution optimization-based SHA1 encryption method, comprising:
performing convolution processing on the original message to obtain a target bit character string;
acquiring the capacities of a first buffer area and a second buffer area, storing corresponding characters in the target bit character string into the corresponding buffer areas according to the capacity of each buffer area to obtain a first buffer area intermediate quantity and a second buffer area intermediate quantity, and converting the target bit character string into a third buffer area intermediate quantity;
performing convolution processing on the intermediate quantity of the second buffer zone to obtain a second target intermediate quantity of the buffer zone;
reassigning the first buffer intermediate amount based on the second target buffer intermediate amount and the third buffer intermediate amount to obtain a first target buffer intermediate amount;
determining a first encrypted digest based on the first target buffer intermediate amount and the second target buffer intermediate amount;
performing ECC elliptic curve encryption processing on the first encrypted abstract to obtain a second encrypted abstract;
and performing shift encryption processing on the second encrypted digest to obtain a target encrypted digest, wherein the second encrypted digest has the same length as the target encrypted digest.
2. The method of claim 1, wherein convolving the original message to obtain the target bit string comprises:
converting the original message into a bit string based on the SHA1 algorithm;
and selecting a convolution function, and taking the product of the convolution function and the bit character string as a target bit character string.
3. The method of claim 1, wherein the first target buffer intermediate amount and the second target buffer intermediate amount are at least one, and wherein determining a first cryptographic digest based on the first target buffer intermediate amount and the second target buffer intermediate amount comprises:
determining a second target buffer intermediate amount corresponding to each first target buffer intermediate amount;
and summing the intermediate quantity of the second target buffer zone corresponding to the intermediate quantity of the current first target buffer zone to obtain a first encryption abstract.
4. The method of claim 1, wherein performing shift encryption processing on the second encrypted digest to obtain a target encrypted digest comprises:
acquiring each number in the second encryption abstract, and summing the numbers to obtain a number sum;
performing modular processing on the digital sum and a preset numerical value to obtain a shift length;
and carrying out shift processing on the second encrypted digest based on the shift length to obtain a target encrypted digest.
5. A convolution optimization-based SHA1 encryption apparatus, comprising:
the first convolution processing module is used for carrying out convolution processing on the original message to obtain a target bit character string;
the conversion module is used for acquiring the capacities of the first buffer area and the second buffer area, storing the corresponding characters in the target bit character string into the corresponding buffer areas according to the capacity of each buffer area, obtaining the intermediate quantity of the first buffer area and the intermediate quantity of the second buffer area, and converting the target bit character string into the intermediate quantity of the third buffer area;
the second convolution processing module is used for carrying out convolution processing on the intermediate quantity of the second buffer zone to obtain a second target intermediate quantity of the buffer zone;
the assignment module is used for reassigning the first buffer intermediate quantity based on the second target buffer intermediate quantity and the third buffer intermediate quantity to obtain a first target buffer intermediate quantity;
the determining module is used for determining a first encryption digest based on the first target buffer intermediate quantity and the second target buffer intermediate quantity;
the ECC encryption module is used for carrying out ECC elliptic curve encryption processing on the first encryption abstract to obtain a second encryption abstract;
and the shift processing module is used for carrying out shift encryption processing on the second encryption digest to obtain a target encryption digest, wherein the second encryption digest and the target encryption digest have the same length.
6. The apparatus of claim 5, wherein the first convolution processing module comprises:
a conversion unit for converting the original message into a bit string based on the SHA1 algorithm;
and the selecting and determining unit is used for selecting a convolution function and taking the product of the convolution function and the bit character string as a target bit character string.
7. The apparatus of claim 5, wherein the first target buffer intermediate amount and the second target buffer intermediate amount are at least one, the determining module comprising:
a determining unit configured to determine a second target buffer intermediate amount corresponding to each of the first target buffer intermediate amounts;
and the summing unit is used for summing the intermediate quantity of the second target buffer zone corresponding to the intermediate quantity of the current first target buffer zone to obtain a first encrypted digest.
8. The apparatus of claim 5, wherein the shift processing module comprises:
the obtaining and summing unit is used for obtaining each number in the second encryption abstract and summing the numbers to obtain a number sum;
the module taking unit is used for carrying out module taking processing on the digital sum and a preset numerical value to obtain a shift length;
and the shift processing unit is used for carrying out shift processing on the second encryption abstract based on the shift length to obtain a target encryption abstract.
CN202111109884.0A 2021-09-18 2021-09-18 SHA1 encryption method and device based on convolution optimization Active CN113761561B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111109884.0A CN113761561B (en) 2021-09-18 2021-09-18 SHA1 encryption method and device based on convolution optimization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111109884.0A CN113761561B (en) 2021-09-18 2021-09-18 SHA1 encryption method and device based on convolution optimization

Publications (2)

Publication Number Publication Date
CN113761561A CN113761561A (en) 2021-12-07
CN113761561B true CN113761561B (en) 2024-01-30

Family

ID=78796849

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111109884.0A Active CN113761561B (en) 2021-09-18 2021-09-18 SHA1 encryption method and device based on convolution optimization

Country Status (1)

Country Link
CN (1) CN113761561B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247233A (en) * 2008-03-24 2008-08-20 北京飞天诚信科技有限公司 Method for generating message summary
CN101980557A (en) * 2010-11-29 2011-02-23 武汉大学 Method for generating random number in cognitive radio network and communication key generation method
CN107306181A (en) * 2016-04-18 2017-10-31 杭州云沣科技有限公司 Encryption, verification method and the device of right discriminating system and its authentication information
CN111859424A (en) * 2020-07-17 2020-10-30 苏州浪潮智能科技有限公司 Data encryption method, system, terminal and storage medium of physical management platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8670560B2 (en) * 2008-10-23 2014-03-11 University Of Ulster Encryption method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247233A (en) * 2008-03-24 2008-08-20 北京飞天诚信科技有限公司 Method for generating message summary
CN101980557A (en) * 2010-11-29 2011-02-23 武汉大学 Method for generating random number in cognitive radio network and communication key generation method
CN107306181A (en) * 2016-04-18 2017-10-31 杭州云沣科技有限公司 Encryption, verification method and the device of right discriminating system and its authentication information
CN111859424A (en) * 2020-07-17 2020-10-30 苏州浪潮智能科技有限公司 Data encryption method, system, terminal and storage medium of physical management platform

Also Published As

Publication number Publication date
CN113761561A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
Bellare et al. A new paradigm for collision-free hashing: Incrementality at reduced cost
Preneel The state of cryptographic hash functions
US20050147243A1 (en) Cryptographic apparatus, cryptographic method, and storage medium thereof
US8542832B2 (en) System and method for the calculation of a polynomial-based hash function and the erindale-plus hashing algorithm
CN110071794B (en) AES algorithm-based information encryption method, system and related components
US10461923B2 (en) Multivariate signature method for resisting key recovery attack
Wang et al. Bit-level image encryption algorithm based on BP neural network and gray code
Kuznetsov et al. New approach to the implementation of post-quantum digital signature scheme
US11863657B2 (en) Using cryptographic blinding for efficient use of montgomery multiplication
JP2008513811A (en) Calculation conversion method and system
CN111740821B (en) Method and device for establishing shared secret key
CN112487464A (en) Encrypted data sharing method and device based on block chain
CN113761561B (en) SHA1 encryption method and device based on convolution optimization
Chen et al. Tropical cryptography III: digital signatures
Gorbenko et al. Methods of building general parameters and keys for NTRU Prime Ukraine of 5 th–7 th levels of stability. Product form
Baek et al. IOTA: A cryptographic perspective
Hwang et al. IAR‐CTR and IAR‐CFB: integrity aware real‐time based counter and cipher feedback modes
CN113612799A (en) Block chain hash encryption method and device based on SM2 algorithm
Preneel Cryptanalysis of message authentication codes
JP4914329B2 (en) Message authenticator generation device, message authenticator verification device, message authenticator generation method, message authenticator verification method, program, and recording medium
Patarin et al. Ultra-short multivariate public key signatures
CN114117462A (en) Sha1 algorithm-based block chain hash encryption method and device
Xu et al. Attacking the Niederreiter-type cryptosystem based on rank metric
US20230017265A1 (en) Method for performing cryptographic operations in a processing device, corresponding processing device and computer program product
CN113806775A (en) Block chain message processing method and device based on convolution optimization

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant