Enhanced data encryption method and device, equipment and medium

By splitting, initial encryption, substitution and multiple rounds of cyclic encryption processing of the encrypted information, the problem of insufficient security of the existing DES encryption technology is solved, and the security of the encrypted information is significantly improved.

CN119203173AActive Publication Date: 2024-12-27GUANGDONG AIKEFENG INFORMATION TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411221680.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-12-27
Estimated Expiration
2044-09-02

AI Technical Summary

Technical Problem

The existing DES encryption technology has poor security in encrypted information and is easily cracked in a short time due to its short key length and conventional encryption processing.

Method used

By splitting the information to be encrypted into multiple information segments, initial encryption, numerical position replacement, multiple rounds of cyclic encryption and compression processing are performed separately, and two encryption operations are used to improve security and ensure the security of the encrypted information.

Benefits of technology

Through multiple rounds of cyclic encryption and compression processing, the security of encrypted information is significantly improved, preventing it from being cracked in a short time, and enhancing the information protection ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119203173A_ABST
    Figure CN119203173A_ABST
Patent Text Reader

Abstract

The invention discloses a data enhanced encryption method, device, equipment and medium, and the method comprises the steps: carrying out the segmented encryption of to-be-encrypted information through a first secret key, obtaining an initial encrypted information segment, carrying out the numerical position replacement of the initial encrypted information segment, and carrying out the equal-length splitting, and performing multi-round cyclic encryption on the split first fragment and the second fragment according to a second secret key and an encryption strategy, performing compression and numerical permutation to obtain a permutation fragment, performing addition operation on the permutation fragment and the first compression fragment, combining the addition operation with the first compression fragment, and iteratively executing the encryption operation, and obtaining final encrypted information segments corresponding to each information segment, and combining the final encrypted information segments into encrypted information. According to the method, initial encryption is carried out through the first secret key, multi-round cyclic encryption is carried out through the second secret key, then compression and numerical value replacement processing are carried out, the encryption process is forced through two encryption operations, and the security of the encrypted information obtained through encryption is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data enhancement encryption method, device, equipment and medium. Background Art

[0002] DES (Data Encryption Standard) is a symmetric encryption algorithm that encrypts 64-bit plaintext into 64-bit ciphertext. Its key length is 56 bits. It is a block cipher. Since the DES key is short and the encryption processing technology is relatively conventional, the DES encryption technology can be easily cracked in a short time, affecting the security of the encrypted information. Therefore, the encryption method in the prior art method has the problem of poor security. Summary of the invention

[0003] The embodiments of the present invention provide a data enhancement encryption method, device, equipment and medium, aiming to solve the problem of poor security of encryption methods in the prior art methods.

[0004] In a first aspect, an embodiment of the present invention provides a data enhancement encryption method, wherein the method comprises:

[0005] If the input information to be encrypted is received, the information to be encrypted is split into multiple information segments according to the preset character string length;

[0006] Initially encrypting each information segment using a preset first secret key to obtain an initial encrypted information segment corresponding to each of the information segments;

[0007] Performing numerical position substitution on each of the initial encrypted information segments according to a preset substitution table to obtain a corresponding substitution information segment;

[0008] Splitting each of the replacement information segments into a first segment and a second segment of equal length;

[0009] Perform multiple rounds of encryption on the first segment and the second segment respectively according to a preset second secret key and encryption strategy to obtain a corresponding first encrypted segment and a corresponding second encrypted segment;

[0010] Compressing the first encrypted segment and the second encrypted segment respectively according to a preset compression rule to obtain a corresponding first compressed segment and a corresponding second compressed segment;

[0011] Performing numerical substitution on the second compressed segment according to the compression rule and a preset substitution rule to obtain a corresponding substitution segment;

[0012] The first compressed segment is used as a new first segment, the added segment is used as a new second segment, and the first segment and the second segment are encrypted for multiple rounds according to a preset second secret key and encryption strategy, until the number of loop executions exceeds a preset threshold, and then the first compressed segment and the replacement segment are output as the final encrypted information segment corresponding to the replacement information segment; the added segment is a segment obtained by adding the replacement segment to the first compressed segment;

[0013] The final encrypted information segments corresponding to each information segment are combined to obtain encrypted information corresponding to the information to be encrypted.

[0014] In a second aspect, an embodiment of the present invention further provides a data enhancement encryption device, wherein the device is used to execute the data enhancement encryption method as described in the first aspect above, and the device includes:

[0015] An information splitting unit, for splitting the information to be encrypted into a plurality of information segments according to a preset character string length upon receiving the input information to be encrypted;

[0016] An initial encryption processing unit, used to perform initial encryption on each information segment using a preset first secret key to obtain an initial encrypted information segment corresponding to each of the information segments;

[0017] A numerical position replacement unit, used to perform numerical position replacement on each of the initial encrypted information segments according to a preset replacement table to obtain a corresponding replacement information segment;

[0018] A splitting unit, used for splitting each of the replacement information segments into a first segment and a second segment of equal length;

[0019] a cyclic encryption unit, configured to perform multiple rounds of cyclic encryption on the first segment and the second segment respectively according to a preset second secret key and encryption strategy to obtain a corresponding first encrypted segment and a corresponding second encrypted segment;

[0020] A compression processing unit, configured to compress the first encrypted segment and the second encrypted segment according to a preset compression rule to obtain a corresponding first compressed segment and a corresponding second compressed segment;

[0021] a numerical replacement unit, configured to perform numerical replacement on the second compressed segment according to the compression rule and a preset replacement rule to obtain a corresponding replacement segment;

[0022] a final encrypted segment acquisition unit, configured to use the first compressed segment as a new first segment, use the added segment as a new second segment, and return to perform multiple rounds of cyclic encryption on the first segment and the second segment respectively according to a preset second secret key and encryption strategy, until the number of cyclic executions exceeds a preset number threshold, then output the first compressed segment and the replacement segment as the final encrypted information segment corresponding to the replacement information segment; the added segment is a segment obtained by adding the replacement segment to the first compressed segment;

[0023] The final encrypted segment combining unit is used to combine the final encrypted information segments corresponding to each information segment to obtain encrypted information corresponding to the information to be encrypted.

[0024] In a third aspect, an embodiment of the present invention further provides a computer device, wherein the device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0025] Memory, used to store computer programs;

[0026] The processor is used to implement the steps of the data enhancement encryption method described in the first aspect when executing the program stored in the memory.

[0027] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the data enhancement encryption method as described in the first aspect above are implemented.

[0028] The embodiment of the present invention provides a data strengthening encryption method, device, equipment and medium, the method comprising: using a first key to perform segmented encryption on the information to be encrypted to obtain an initial encrypted information segment, performing numerical position permutation on the initial encrypted information segment and performing equal length splitting, performing multiple rounds of cyclic encryption on the split first segment and second segment according to a second key and encryption strategy, and then performing compression and numerical permutation to obtain a permuted segment, adding the permuted segment to the first compressed segment and combining it with the first compressed segment, and then iteratively performing the above encryption operation to obtain the final encrypted information segment corresponding to each information segment and then combining it into encrypted information. The above method performs initial encryption using the first key, performs multiple rounds of cyclic encryption using the second key, and then performs compression and numerical permutation processing. Through two encryption operations to strengthen the encryption process, the improved encryption processing method cannot be cracked in a short time, which greatly improves the security of the encrypted information obtained by encryption. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0030] Figure 1 A method flow chart of a data enhancement encryption method provided by an embodiment of the present invention;

[0031] Figure 2 A schematic block diagram of a data enhancement encryption device provided by an embodiment of the present invention;

[0032] Figure 3 It is a schematic block diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0034] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0035] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0036] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0037] See also Figure 1 As shown in the figure, the embodiment of the present invention provides a data strengthening encryption method, which is applied to a terminal device, which can be a laptop, desktop computer, tablet computer or mobile phone. Figure 1 As shown, the method includes steps S110 to S190.

[0038] S110: If input information to be encrypted is received, the information to be encrypted is split into multiple information segments according to a preset character string length.

[0039] If the input information to be encrypted is received, the information to be encrypted is split into multiple information segments according to the preset string length. The user can input the information to be encrypted into the terminal device, and the terminal device splits the information to be encrypted according to the preset string length to obtain multiple information segments.

[0040] In a specific embodiment, step S110 includes sub-steps: splitting the information to be encrypted into multiple information segments corresponding to the length of the string; determining whether the number of characters in the information segment at the end is equal to the length of the string; if the number of characters in the information segment at the end is not equal to the length of the string, padding the information segment to obtain a padded information segment.

[0041] Specifically, the information to be encrypted can be split into multiple information segments corresponding to the length of the string. In the process of sequentially splitting the information to be encrypted, it is necessary to determine whether the number of characters in the last information segment is equal to the length of the string. If the number of characters in the last information segment is equal to the length of the string, there is no need to pad the information segment; if the number of characters in the last information segment is not equal to the length of the string, it is necessary to pad the information segment by adding a "0" value to obtain the padded information segment. After padding the last information segment, the number of characters contained in each information segment is equal to the length of the string. For example, the string length can be set to 64, and each information segment is a binary information segment containing 64 characters.

[0042] S120. Initially encrypt each information segment using a preset first secret key to obtain an initial encrypted information segment corresponding to each of the information segments.

[0043] Each information segment is initially encrypted by using a preset first secret key to obtain an initial encrypted information segment corresponding to each information segment. Specifically, each information segment can be initially encrypted by using a first secret key based on DES encryption technology, and each information segment can be initially permuted first, that is, the position of the value contained in each information segment is replaced by using a permutation table.

[0044] The information contained in the substitution table is as follows:

[0045] 58 50 42 34 26 18 10 2 60 52 44 36 28 20 12 4 62 54 46 38 30 22 14 6 64 56 48 40 32 24 16 8 57 49 41 33 25 17 9 1 59 51 43 35 27 19 11 3 61 53 45 37 29 21 13 5 63 55 47 39 31 23 15 7

[0046] For an information segment, the data obtained from the 58th bit in the information segment can be placed in the first position, the data obtained from the 50th bit in the information segment can be placed in the second position, and so on. 0 and R 0 Two parts, each containing 32 bits of data. The first secret key is a 64-bit binary sequence, in which the encryption calculation formula can be a custom calculation formula, and the encryption calculation formula can be represented by ⊕. For example, the calculation of X⊕Y can be defined as X⊕Y=X+2Y-8. The first secret key is evenly split to obtain 4 groups of 16-bit binary strings, corresponding to 4 groups of 2-byte values ​​(each byte corresponds to 8 bits, that is, each byte corresponds to 8 bits of data). Each group of byte values ​​is inverted and combined with the original byte array to obtain a set of system parameters; the system parameters can be expressed as Fc=(F 0 , F 1 , F 2 , F 3 ), F i (i=0,1,2,3) are all 4 bytes. We can further calculate that the first round key required for each round of encryption is (K 0 , K 1 , K 2 , K 3 , K 4 , K 5 , K 6 , K 7 ), the second round key is (K 2 , K 3 , K 4 , K 5 , K 6 , K 7 , K 8 , K 9 ), the last set of round keys is (K 30 , K 31 , K 0 , K 1 , K 2 , K 3 , K 4 , K 5 ); where (K 0 , K 1 , K 2 , K 3 )=(Ck 0 ⊕F 0 , Ck 0 ⊕F 1 , Ck 1 ⊕F 2 , Ck 1 ⊕F 3 ), K i+4 =K i⊕T'(K i+1 ⊕K i+2 ⊕K i+3 ⊕Ck i ), where i = 0, 1, 2, ..., 31); fixed parameter CK = (Ck 0 , Ck 1 , Ck 2 , ..., Ck 31 ), where Ck i (i=0,1,2,……,31) are all 4 bytes (4 bytes correspond to a 32-bit binary number). The round key array composed of the keys required for each round of encryption can be calculated through the above calculation process. The round key array contains multiple round keys. Among them, T' is the inverse operation process of the reversible transformation T, and the reversible transformation T: Z 2 32 (32-bit string) → Z 2 32 (32-bit string), which is composed of nonlinear transformation τ and linear transformation L, that is, T(x) = L(τ(x)). The nonlinear transformation τ consists of 4 parallel S-boxes. The data of the S-boxes are all in hexadecimal. Suppose the input is A = (a 0 ,a 1 ,a 2 ,a 3 )∈(Z 2 8 ) 4 , the output is B = (b 0 ,b 1 ,b 2 ,b 3 )∈(Z 2 8 ) 4 , the calculation process can be expressed as (b 0 ,b 1 ,b 2 ,b 3 )=τ(A)=(Sbox(a 0 ),Sbox(a 1 ),Sbox(a 2 ),Sbox(a 3 )); The output result of the nonlinear transformation τ is used as the input of the linear transformation L. Let the input be B∈Z 2 32 , the output is C∈Z 2 32 , then C=L(B)=B⊕(B<<<2)⊕(B<<<10)⊕(B<<<18)⊕(B<<<24).

[0047] Through the first round key pair L in the above round key array 0and R 0 The encryption process can be expressed as L 1 =R 0 , R 1 =L 0 ⊕(R 0 ⊕K), K is a set of round keys used for the first encryption operation. The round keys used for each round of encryption operation are different. Then the set of values ​​obtained after 16 rounds of encryption operation is L 16 =R 15 , R 16 =L 15 ⊕(R 15 ⊕K), where K is a set of round keys used for the last encryption operation. 16 With R 16 By combining them, the initial encrypted information segment corresponding to each information segment can be obtained.

[0048] S130, performing numerical position substitution on each of the initial encrypted information segments according to a preset substitution table to obtain a corresponding substitution information segment.

[0049] According to the preset substitution table, the numerical position of each of the initial encrypted information segments is replaced to obtain the corresponding replacement information segment. After obtaining the initial encrypted information segment, the numerical position of the initial encrypted information segment can be replaced. The specific method of using the configuration table to replace the numerical position is shown in the above steps.

[0050] In a specific embodiment, step S130 includes sub-steps: obtaining the replacement position corresponding to each position in the initial encrypted information segment according to the replacement table; performing position replacement on the value of each position in the initial encrypted information segment according to the replacement position to obtain the corresponding replacement information segment.

[0051] First, the replacement position corresponding to each position in the initial encrypted information segment is obtained through the replacement table. For example, according to the above replacement table, it can be determined that the replacement position corresponding to the first bit value in the initial encrypted information segment is the fifth row and eighth column. The value of each position in the initial encrypted information segment is permuted according to the replacement position, that is, the value of each position in the initial encrypted information segment is filled into the replacement position corresponding to each position, thereby obtaining a replacement information segment. The values ​​contained in the replacement information segment are the same as the values ​​contained in the initial encrypted information segment, and only the positions between the values ​​are permuted.

[0052] S140, split each of the replacement information segments into a first segment and a second segment of equal length. Split each of the replacement information segments into a first segment and a second segment of equal length. Split the replacement information segment into two segments again, so that each replacement information segment can be split into a first segment and a second segment, and the lengths of the first segment and the second segment are equal, both of which are 32 bits.

[0053] S150. Perform multiple rounds of encryption on the first fragment and the second fragment respectively according to a preset second secret key and encryption strategy to obtain a corresponding first encrypted fragment and second encrypted fragment.

[0054] The first segment and the second segment are encrypted for multiple rounds according to the preset second key and encryption strategy to obtain the corresponding first encrypted segment and second encrypted segment. Further, the first segment and the second segment are encrypted for multiple rounds according to the second key and encryption strategy to obtain the first encrypted segment after multiple rounds of encryption and obtain the second encrypted segment after multiple rounds of encryption.

[0055] In a specific embodiment, step S150 includes sub-steps: obtaining an initial key from the second key as a front key to perform an XOR operation on the first fragment and the second fragment respectively, to obtain a corresponding first XOR operation fragment and a second XOR operation fragment; performing character replacement on the first XOR operation fragment and the second XOR operation fragment respectively according to the sandbox configured in the encryption strategy to obtain a first replacement fragment and a second replacement fragment; performing an obfuscation operation on the first replacement fragment and the second replacement fragment respectively according to the obfuscation operation rule in the encryption strategy to obtain a corresponding first obfuscated fragment and a second obfuscated fragment; obtaining a rear key in the second key according to the sequence to perform an XOR operation on the first obfuscated fragment; The obfuscated fragment and the second obfuscated fragment are respectively subjected to a round of key XOR operation to obtain the corresponding first operation fragment and second operation fragment; the latter key is a key after the former key; the first operation fragment and the second operation fragment are respectively used as the first XOR operation fragment and the second XOR operation fragment, the current latter key is used as the former key and the step of performing character replacement on the first XOR operation fragment and the second XOR operation fragment according to the sandbox configured in the encryption policy is returned until the latter key cannot be obtained from the second key, then the currently obtained first operation fragment and the second operation fragment are output as the first encrypted fragment and the second encrypted fragment.

[0056] The initial key (first key) can be obtained from the second key as the front key, and the first segment and the second segment are XORed by the front key to obtain the corresponding first XOR segment and second XOR segment. If the second key is a 128-bit key, the characters of 0-15 bits are obtained as the front key.

[0057] Character replacement is performed for the first XOR operation fragment and the second XOR operation fragment respectively according to the sandbox configured in the encryption policy. Specifically, the sandbox (such as the S box) contains two 16x16 two-dimensional constant arrays, and the position of each value in the XOR operation fragment (the first XOR operation fragment or the second XOR operation fragment) is determined according to the first two-dimensional constant array. For example, when the position of one of the values ​​is determined to be a 2,2 , the XOR operation fragment is 32 bits, and gets the value of position a in another two-dimensional constant array 2,2 The value at the corresponding position replaces the original value, thereby achieving character replacement for each XOR operation fragment. For example, the corresponding position in another two-dimensional constant array is b 2,2 , position b 2,2 If the corresponding character is "1", the value at the original position will be replaced by "1".

[0058] According to the obfuscation operation rules, the first replacement fragment and the second replacement fragment are respectively subjected to obfuscation operation, and the first obfuscated fragment and the second obfuscated fragment obtained after the obfuscation operation are respectively subjected to round-key XOR operation, where the encryption uses the back-end key in the second key. If the front-end key is 0-15 bits, the back-end key is 16-31 bits. Specifically, the back-end key can be reversed and combined with the original back-end key to obtain a set of 4-byte keys for use, and the obtained keys are used to perform XOR operations on the first obfuscated fragment and the second obfuscated fragment, and the XOR operation results are subjected to multiple rounds of XOR operations using the keys, and the corresponding first operation fragment and second operation fragment are obtained after 10 cycles.

[0059] If another subsequent secret key can be obtained from the second secret key in sequence, the first operation fragment is used as the first XOR operation fragment, the second operation fragment is used as the second XOR operation fragment, the current subsequent secret key is used as the previous secret key, and after obtaining a new subsequent secret key, the above steps of character replacement are returned to be executed, that is, the above steps need to be executed 7 times in a loop. When the subsequent secret key can no longer be obtained in sequence from the second secret key, the newly obtained first operation fragment and second operation fragment are output as the first encryption fragment and the second encryption fragment.

[0060] In a specific embodiment, the performing obfuscation operation on the first replacement fragment and the second replacement fragment respectively according to the obfuscation operation rule in the encryption strategy to obtain the corresponding first obfuscated fragment and the second obfuscated fragment includes: performing row shift processing on the first replacement fragment and the second replacement fragment respectively according to the displacement value in the obfuscation operation rule to obtain the corresponding first row shift fragment and the second row shift fragment; performing matrix multiplication on the first row shift fragment and the second row shift fragment respectively according to the fixed matrix in the obfuscation operation rule to obtain the corresponding first state matrix and the second state matrix; performing byte mapping on the elements in the first state matrix and the elements in the second state matrix respectively according to the mapping table in the obfuscation operation rule to obtain the corresponding first obfuscated fragment and the second obfuscated fragment.

[0061] Specifically, the first replacement fragment and the second replacement fragment are both 32 bits, and can also be converted into an 8×4 two-dimensional array. The obfuscation operation includes: performing row shifts on the first replacement fragment and the second replacement fragment respectively according to the displacement value in the obfuscation operation rule, that is, shifting the data of each row in the 16×16 two-dimensional array corresponding to the replacement fragment. For example, if a 2-bit shift is performed to the right, the data of the first bit of each row will reach the third bit of the row after the shift, the data of the 15th bit of each row will reach the first bit of the row after the shift, and the data of the 16th bit of each row will reach the second bit of the row after the shift.

[0062] The first row displacement fragment and the row displacement fragment obtained by row displacement are matrix multiplied, for example, a fixed matrix two-dimensional constant array is used as a fixed matrix, and matrix multiplication operations are performed on the two-dimensional values ​​corresponding to each row displacement fragment, so as to obtain the corresponding first state matrix and second state matrix. According to the mapping table in the confusion operation rule, the elements in the first state matrix and the elements in the second state matrix are byte mapped, that is, the elements in each state matrix are remapped to a new byte according to the mapping table, and each state matrix can obtain a confusion fragment after mapping, and the first state matrix corresponds to the first confusion fragment, and the second state matrix corresponds to the second confusion fragment.

[0063] S160. Compress the first encrypted segment and the second encrypted segment respectively according to a preset compression rule to obtain a corresponding first compressed segment and a corresponding second compressed segment.

[0064] The first encrypted segment and the second encrypted segment are compressed according to a preset compression rule to obtain a corresponding first compressed segment and a corresponding second compressed segment. Further, the first encrypted segment and the second encrypted segment are compressed according to the compression rule to obtain a first compressed segment and a second compressed segment respectively.

[0065] In a specific embodiment, step S160 includes sub-steps: splitting the first encrypted fragment and the second encrypted fragment into corresponding fragment arrays respectively; expanding each fragment array respectively by using the expansion operation formula configured in the compression rule to replace and obtain the corresponding replacement array; obtaining a positioning array from each row of information in each replacement array; obtaining a conversion character corresponding to each positioning array in each replacement array from the character table configured in the compression rule; combining the conversion characters of the fragment array corresponding to the first encrypted fragment and the conversion characters of the fragment array corresponding to the second encrypted fragment respectively to obtain the corresponding first compressed fragment and second compressed fragment.

[0066] The first encrypted fragment and the second encrypted fragment are both 128-bit data. First, the first encrypted fragment and the second encrypted fragment are respectively split into four 32-bit data to obtain the corresponding fragment arrays. Each fragment array is expanded by an extended operation formula. The 32-bit fragment array can be divided into 8 rows and 4 columns. The first two bits of data in each row are calculated by an extended operation formula to obtain a new data added to the head of the row. The last two bits of data in each row are calculated by an extended operation formula to obtain a new data added to the tail of the row, thereby expanding to obtain a replacement array of 8 rows and 6 columns. The extended operation formula can be addition, multiplication, XOR and other operations.

[0067] Further, a positioning array is obtained from each row of information in each permutation array. Specifically, the first and last digits of each row are obtained and combined as the row number. The middle four digits of each row are combined as the column number. The row number and the column number are combined into a positioning array. The conversion character corresponding to the position of each positioning array is obtained from the character table. Each conversion character is a binary number, so each fragment array can be converted to an 8-bit array, and each encrypted fragment can be compressed into a 32-bit string as the obtained compressed fragment. The first encrypted fragment is compressed to obtain a first compressed fragment of a 32-bit string, and the second encrypted fragment is compressed to obtain a second compressed fragment of a 32-bit string.

[0068] S170: Perform numerical substitution on the second compressed segment according to the compression rule and a preset substitution rule to obtain a corresponding substitution segment.

[0069] The second compressed segment is numerically permuted according to the compression rule and the preset permutation rule to obtain a corresponding permutation segment. The second compressed segment is numerically permuted according to the compression rule and the permutation rule to obtain a permutation segment corresponding to the second compressed segment.

[0070] In a specific embodiment, step S170 includes sub-steps: expanding the fragment array corresponding to the second compressed fragment according to the expansion operation formula to obtain a corresponding extended array by substitution; permuting the extended array once through the first sandbox configured in the substitution rule to obtain a corresponding initial substitution fragment; permuting the initial substitution fragment again through the second sandbox configured in the substitution rule to obtain a corresponding substitution fragment.

[0071] Specifically, the expansion operation formula in the above compression rule can also be used to expand the fragment array corresponding to the second compression fragment, so as to obtain an extended array, and the specific processing process is the same as the above steps. Further, the extended array is permuted once by the first sandbox configured in the permutation rule, for example, the extended value can be permuted once by the S-box permutation operation to obtain an initial permuted fragment; further, the initial permuted fragment is permuted again by the second sandbox configured in the permutation rule, for example, the initial permuted fragment can be permuted again by the P-box permutation operation to obtain a corresponding permuted fragment.

[0072] S180, use the first compressed segment as a new first segment, use the added segment as a new second segment and return to execute multiple rounds of cyclic encryption on the first segment and the second segment respectively according to the preset second secret key and encryption strategy, until the number of cyclic executions is greater than the preset threshold number, then output the first compressed segment and the replacement segment as the final encrypted information segment corresponding to the replacement information segment.

[0073] The first compressed segment is used as a new first segment, the added segment is used as a new second segment, and the first segment and the second segment are encrypted for multiple rounds according to the preset second secret key and encryption strategy, until the number of loop executions exceeds the preset number threshold, and the first compressed segment and the replacement segment are output as the final encrypted information segment corresponding to the replacement information segment. The added segment is a segment obtained by adding the replacement segment to the first compressed segment.

[0074] It is determined whether the number of executions of the loop from S150 to S170 is greater than a preset number threshold. If so, the process does not return to step S150. If not, the first compressed segment is used as a new first segment, and the added segment obtained by adding the replacement segment to the first compressed segment is used as a new second segment, and the process returns to step S150. If the process does not return to step S150, the first compressed segment is combined with the replacement segment to obtain a final encrypted information segment.

[0075] S190. Combine the final encrypted information segments corresponding to each information segment to obtain encrypted information corresponding to the information to be encrypted.

[0076] The final encrypted information segments corresponding to each information segment are sequentially combined, that is, the combination order of the final encrypted information segments is the same as the arrangement order of each information segment, and after the combination, the encrypted information corresponding to the information to be encrypted can be obtained. The process of decrypting the encrypted information is the reverse process of the above steps.

[0077] In the data strengthening encryption method disclosed in the above embodiment, the method includes: using the first secret key to perform segmented encryption on the information to be encrypted to obtain an initial encrypted information segment, performing numerical position permutation on the initial encrypted information segment and performing equal length splitting, performing multiple rounds of cyclic encryption on the split first segment and the second segment according to the second secret key and encryption strategy, and then performing compression and numerical permutation to obtain a permuted segment, adding the permuted segment to the first compressed segment and combining it with the first compressed segment, and then iteratively performing the above encryption operation to obtain the final encrypted information segment corresponding to each information segment and then combining it into encrypted information. The above method performs initial encryption using the first secret key, performs multiple rounds of cyclic encryption using the second secret key, and then performs compression and numerical permutation processing. Through two encryption operations to enforce the encryption process, the improved encryption processing method cannot be cracked in a short time, which greatly improves the security of the encrypted information obtained by encryption.

[0078] The embodiment of the present invention also provides a data enhancement encryption device, which can be configured in a terminal device and is used to execute any embodiment of the aforementioned data enhancement encryption method. Figure 2 , Figure 2 A schematic block diagram of a data enhancement encryption device provided in an embodiment of the present invention.

[0079] like Figure 2 As shown, the data enhancement encryption device 100 includes an information splitting unit 110, an initial encryption processing unit 120, a numerical position replacement unit 130, a splitting unit 140, a cyclic encryption unit 150, a compression processing unit 160, a numerical replacement unit 170, a final encryption fragment acquisition unit 180 and a final encryption fragment combination unit 190.

[0080] The information splitting unit 110 is used to split the information to be encrypted into multiple information segments according to a preset character string length when receiving the input information to be encrypted;

[0081] The initial encryption processing unit 120 is used to perform initial encryption on each information segment using a preset first secret key to obtain an initial encrypted information segment corresponding to each information segment;

[0082] The numerical position replacement unit 130 is used to perform numerical position replacement on each of the initial encrypted information segments according to a preset replacement table to obtain a corresponding replacement information segment;

[0083] A splitting unit 140, configured to split each of the replacement information segments into a first segment and a second segment of equal length;

[0084] The cyclic encryption unit 150 is used to perform multiple rounds of cyclic encryption on the first segment and the second segment according to a preset second secret key and encryption strategy to obtain a corresponding first encrypted segment and a corresponding second encrypted segment;

[0085] A compression processing unit 160, configured to compress the first encrypted segment and the second encrypted segment according to a preset compression rule to obtain a corresponding first compressed segment and a corresponding second compressed segment;

[0086] A numerical replacement unit 170, configured to perform numerical replacement on the second compressed segment according to the compression rule and a preset replacement rule to obtain a corresponding replacement segment;

[0087] The final encrypted segment acquisition unit 180 is used to use the first compressed segment as a new first segment, use the added segment as a new second segment, and return to perform multiple rounds of cyclic encryption on the first segment and the second segment respectively according to the preset second secret key and encryption strategy, until the number of cyclic executions exceeds a preset number threshold, then output the first compressed segment and the replacement segment as the final encrypted information segment corresponding to the replacement information segment; the added segment is a segment obtained by adding the replacement segment to the first compressed segment;

[0088] The final encrypted segment combining unit 190 is used to combine the final encrypted information segments corresponding to each information segment to obtain encrypted information corresponding to the information to be encrypted.

[0089] The data enhancement encryption device provided in the embodiment of the present invention applies the above data enhancement encryption method, uses the first key to perform segmented encryption on the information to be encrypted to obtain the initial encrypted information segment, performs numerical position permutation on the initial encrypted information segment and performs equal length splitting, performs multiple rounds of cyclic encryption on the split first segment and the second segment according to the second key and encryption strategy, and then performs compression and numerical permutation to obtain the permuted segment, adds the permuted segment to the first compressed segment and combines it with the first compressed segment, and then iterates to perform the above encryption operation, obtains the final encrypted information segment corresponding to each information segment, and then combines it into encrypted information. The above method performs initial encryption with the first key, performs multiple rounds of cyclic encryption with the second key, and then performs compression and numerical permutation processing. Through two encryption operations to enforce the encryption process, the improved encryption processing method cannot be cracked in a short time, which greatly improves the security of the encrypted information obtained by encryption.

[0090] The above-mentioned data strengthening encryption device can be implemented in the form of a computer program. The computer program can be Figure 3 Runs on the computer device shown.

[0091] See also Figure 3 , Figure 3 1 is a schematic block diagram of a computer device provided by an embodiment of the present invention. The computer device may be a terminal device for executing a data enhancement encryption method to implement encryption processing on information to be encrypted.

[0092] See also Figure 3 The computer device 500 includes a processor 502 , a memory and a communication interface 505 connected via a communication bus 501 , wherein the memory may include a storage medium 503 and an internal memory 504 .

[0093] The storage medium 503 may store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 may execute a data enhancement encryption method, wherein the storage medium 503 may be a volatile storage medium or a non-volatile storage medium.

[0094] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0095] The internal memory 504 provides an environment for the operation of the computer program 5032 in the storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute the data enhancement encryption method.

[0096] The communication interface 505 is used for network communication, such as providing data information transmission, etc. Those skilled in the art will appreciate that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 500 to which the solution of the present invention is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0097] The processor 502 is used to run the computer program 5032 stored in the memory to implement the corresponding functions in the above-mentioned data enhancement encryption method.

[0098] Those skilled in the art will understand that Figure 3 The embodiments of the computer device shown in the figure do not constitute a limitation on the specific composition of the computer device. In other embodiments, the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, in some embodiments, the computer device may only include a memory and a processor. In such embodiments, the structure and function of the memory and the processor are the same as those of the embodiment of the present invention. Figure 3The embodiments shown are consistent and will not be described again here.

[0099] It should be understood that in the embodiment of the present invention, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0100] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps included in the above-mentioned data enhancement encryption method are implemented.

[0101] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment, devices and units can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0102] In the several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. Units with the same function may also be combined into one unit. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be an electrical, mechanical or other form of connection.

[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0104] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0105] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a computer-readable storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned computer-readable storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a magnetic disk or an optical disk.

[0106] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A data strengthening encryption method, characterized in that: The method comprises: If the input information to be encrypted is received, the information to be encrypted is split into multiple information segments according to the preset character string length; Initially encrypting each information segment using a preset first secret key to obtain an initial encrypted information segment corresponding to each of the information segments; Performing numerical position substitution on each of the initial encrypted information segments according to a preset substitution table to obtain a corresponding substitution information segment; Splitting each of the replacement information segments into a first segment and a second segment of equal length; Perform multiple rounds of encryption on the first segment and the second segment respectively according to a preset second secret key and encryption strategy to obtain a corresponding first encrypted segment and a corresponding second encrypted segment; Compressing the first encrypted segment and the second encrypted segment respectively according to a preset compression rule to obtain a corresponding first compressed segment and a corresponding second compressed segment; Performing numerical substitution on the second compressed segment according to the compression rule and a preset substitution rule to obtain a corresponding substitution segment; The first compressed segment is used as a new first segment, the added segment is used as a new second segment, and the first segment and the second segment are encrypted for multiple rounds according to a preset second secret key and encryption strategy, until the number of loop executions exceeds a preset threshold, and then the first compressed segment and the replacement segment are output as the final encrypted information segment corresponding to the replacement information segment; the added segment is a segment obtained by adding the replacement segment to the first compressed segment; The final encrypted information segments corresponding to each information segment are combined to obtain encrypted information corresponding to the information to be encrypted.

2. The data strengthening encryption method according to claim 1, characterized in that: The step of splitting the information to be encrypted into multiple information segments according to a preset character string length includes: Splitting the information to be encrypted into multiple information segments corresponding to the length of the character string; Determine whether the number of characters in the information segment at the end is equal to the length of the character string; If the number of characters in the information segment at the end is not equal to the length of the character string, the information segment is padded to obtain a padded information segment.

3. The data strengthening encryption method according to claim 1, characterized in that: The step of performing numerical position substitution on each of the initial encrypted information segments according to a preset substitution table to obtain a corresponding substitution information segment comprises: Obtaining the replacement position corresponding to each position in the initial encrypted information segment according to the replacement table; The value of each position in the initial encrypted information segment is permuted according to the permuted position to obtain a corresponding permuted information segment.

4. The data strengthening encryption method according to claim 1, characterized in that: The step of performing multiple rounds of encryption on the first segment and the second segment respectively according to the preset second secret key and encryption strategy to obtain the corresponding first encrypted segment and second encrypted segment includes: Obtaining an initial key from the second key as a front key, performing an XOR operation on the first segment and the second segment, respectively, to obtain a corresponding first XOR operation segment and a second XOR operation segment; Replacing characters of the first XOR operation fragment and the second XOR operation fragment respectively according to the sandbox configured in the encryption policy to obtain a first replacement fragment and a second replacement fragment; Perform obfuscation operations on the first replacement segment and the second replacement segment respectively according to the obfuscation operation rules in the encryption strategy to obtain corresponding first obfuscated segments and second obfuscated segments; Obtaining the latter secret key in the second secret key in sequence, performing round-key XOR operations on the first obfuscated fragment and the second obfuscated fragment respectively, to obtain corresponding first operation fragments and second operation fragments; the latter secret key is a secret key after the former secret key; The first operation fragment and the second operation fragment are respectively used as the first XOR operation fragment and the second XOR operation fragment, and the current back-end key is used as the front-end key, and the step of performing character replacement on the first XOR operation fragment and the second XOR operation fragment respectively according to the sandbox configured in the encryption policy is returned to execute, until the back-end key cannot be obtained from the second key, and the currently obtained first operation fragment and second operation fragment are output as the first encrypted fragment and the second encrypted fragment.

5. The data strengthening encryption method according to claim 4, characterized in that: The performing obfuscation operations on the first replacement segment and the second replacement segment respectively according to the obfuscation operation rules in the encryption strategy to obtain the corresponding first obfuscated segment and second obfuscated segment includes: Performing row shift processing on the first replacement segment and the second replacement segment respectively according to the shift value in the obfuscation operation rule to obtain a corresponding first row shift segment and a corresponding second row shift segment; According to the fixed matrix in the confusion operation rule, matrix multiplication is performed on the first row displacement fragment and the second row displacement fragment respectively to obtain a corresponding first state matrix and a second state matrix; According to the mapping table in the obfuscation operation rule, byte mapping is performed on the elements in the first state matrix and the elements in the second state matrix respectively to obtain corresponding first obfuscated segments and second obfuscated segments.

6. The data strengthening encryption method according to claim 1, characterized in that: The compressing the first encrypted segment and the second encrypted segment according to a preset compression rule to obtain a corresponding first compressed segment and a corresponding second compressed segment includes: Splitting the first encrypted segment and the second encrypted segment into corresponding segment arrays respectively; Each fragment array is expanded respectively by using the expansion operation formula configured in the compression rule to obtain a corresponding permutation array by permutation; Obtaining a positioning array from each row of information in each of the permutation arrays; Obtaining, from the character table configured in the compression rule, the conversion characters respectively corresponding to each positioning array in each of the replacement arrays; The conversion characters of the fragment array corresponding to the first encrypted fragment and the conversion characters of the fragment array corresponding to the second encrypted fragment are respectively combined to obtain the corresponding first compressed fragment and second compressed fragment.

7. The data strengthening encryption method according to claim 6, characterized in that: The performing numerical substitution on the second compressed segment according to the compression rule and the preset substitution rule to obtain a corresponding substitution segment includes: Expanding the fragment array corresponding to the second compressed fragment according to the expansion operation expression to obtain a corresponding expansion array through replacement; The extended array is permuted once by using the first sandbox configured in the permutation rule to obtain a corresponding initial permutation fragment; The initial replacement segment is replaced again by the second sandbox configured in the replacement rule to obtain a corresponding replacement segment.

8. A data enhancement encryption device, characterized in that: The data enhancement encryption device is used to execute the data enhancement encryption method according to any one of claims 1 to 7, and the device includes: An information splitting unit, for splitting the information to be encrypted into a plurality of information segments according to a preset character string length upon receiving the input information to be encrypted; An initial encryption processing unit, used to perform initial encryption on each information segment using a preset first secret key to obtain an initial encrypted information segment corresponding to each of the information segments; A numerical position replacement unit, used to perform numerical position replacement on each of the initial encrypted information segments according to a preset replacement table to obtain a corresponding replacement information segment; A splitting unit, used for splitting each of the replacement information segments into a first segment and a second segment of equal length; a cyclic encryption unit, configured to perform multiple rounds of cyclic encryption on the first segment and the second segment respectively according to a preset second secret key and encryption strategy to obtain a corresponding first encrypted segment and a corresponding second encrypted segment; A compression processing unit, configured to compress the first encrypted segment and the second encrypted segment according to a preset compression rule to obtain a corresponding first compressed segment and a corresponding second compressed segment; a numerical replacement unit, configured to perform numerical replacement on the second compressed segment according to the compression rule and a preset replacement rule to obtain a corresponding replacement segment; a final encrypted segment acquisition unit, configured to use the first compressed segment as a new first segment, use the added segment as a new second segment, and return to perform multiple rounds of cyclic encryption on the first segment and the second segment respectively according to a preset second secret key and encryption strategy, until the number of cyclic executions exceeds a preset number threshold, then output the first compressed segment and the replacement segment as the final encrypted information segment corresponding to the replacement information segment; the added segment is a segment obtained by adding the replacement segment to the first compressed segment; The final encrypted segment combining unit is used to combine the final encrypted information segments corresponding to each information segment to obtain encrypted information corresponding to the information to be encrypted.

9. A computer device, characterized in that: The device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor is used to implement the steps of the data enhancement encryption method described in any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data enhancement encryption method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Data information encryption sending method and device, computer equipment and storage medium

    CN111866018A

  • Data processing method and device based on encryption algorithm, equipment and medium

    CN114528574A

  • Data encryption method and device, terminal equipment and computer readable storage medium

    CN115941304A

  • Information transmission method and device based on fragment encrypted storage, equipment and medium

    CN116346508A

  • Cryptographic transformation method and device for its implementation

    RU2738321C1