A data encryption and decryption method based on power operation

By adopting a power-based encryption method on embedded systems with limited resources, using power-based operations and modulo-10 Fibonacci sequence operations, combined with random number segments, the operation time-consuming problem of traditional encryption algorithms on such systems is solved, and a fast and secure encryption and decryption operation is achieved.

CN112910626BActive Publication Date: 2025-06-20XIAMEN YAXON ZHILLAN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201911217496.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-03
Publication Date
2025-06-20
Estimated Expiration
2039-12-03

AI Technical Summary

Technical Problem

Traditional encryption algorithms are time-consuming to calculate on embedded systems with limited resources, and lack a simple, low resource consumption and certain security encryption algorithm.

Method used

The data encryption and decryption method based on power operation is adopted, and by generating a key composed of at least 10 numbers, power operation and modulo 10 Fibonacci sequence operation are performed, and the encryption and decryption are achieved in combination with random number segments.

Benefits of technology

It realizes fast and secure encryption and decryption operations on embedded systems with limited resources, and is suitable for fast encryption and decryption occasions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112910626B_ABST
    Figure CN112910626B_ABST
Patent Text Reader

Abstract

The present invention discloses a data encryption method based on power operation. The data encryption method includes the following processes: generating a key C composed of at least 10 digits; processing the key C to become a specific real number as the base a of the power operation; converting the information to be encrypted H (plaintext) into hexadecimal representation, establishing a unique sequential relationship K for the characters 0-9, A-F, and recording the sequential value of each plaintext hexadecimal character in K as i; encrypting each plaintext character in sequence according to corresponding rules to obtain the corresponding ciphertext, and sequentially splicing them into the final encrypted digital string. The present invention also discloses a data decryption method based on power operation for decrypting the data encrypted by the data encryption method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of encryption, and particularly relates to a data encryption and decryption method based on power operation. Background Art

[0002] Traditional encryption algorithms such as AES and ECC algorithms need to go through processes such as block operations, multiple rounds of encryption, and even non-linear curve calculations. The operations are time-consuming, and the problem is more prominent especially in some embedded systems with limited resources. Therefore, for embedded systems with limited resources, there is an urgent need for an encryption algorithm with a certain level of security, which is easier to implement and consumes less computing resources. Summary of the Invention

[0003] The present invention aims to provide a data encryption and decryption method based on power operation to solve the above problems. For this purpose, the specific technical solutions adopted by the present invention are as follows:

[0004] According to one aspect of the present invention, there is provided a data encryption method based on power operation. The data encryption method includes the following steps:

[0005] Step 1: Generate a key C = C1C2C3...C N , where N≥10;

[0006] Step 2: Process the key C to become a specific real number as the base a for power operation;

[0007] Step 3: Convert the information to be encrypted H (plaintext) into hexadecimal representation. Then the information to be encrypted can be converted into a string composed of characters in the range of 0-9, A-F. Establish a unique order relationship K for the characters 0-9, A-F, and record the order value of each plaintext hexadecimal character in K as i;

[0008] Step 4: For a string of hexadecimal plaintext characters to be encrypted, use m to represent the order of a character in the plaintext. To encrypt the mth character (starting from m = 1), take the order of the character in K, denoted as i, use a as the base for power calculation, and i as the power to calculate the transformation value:

[0009] Step 5: Represent T in scientific notation and take the first 20 significant digits, denoted as TE;

[0010] Step 6: Calculate the arithmetic sum of C1 + C2 + …… + C N and use the first two digits of this arithmetic sum as the initial values B1, B2 of the Fibonacci sequence d modulo 10F; if the arithmetic sum has only one digit, then B1 = 0, B2 = the value of the arithmetic sum; calculate the subsequent sequence values Bj = (B j-1 + Bj-2 ) mod 10;

[0011] Step 7: For numbers where Bj is less than 5, subtract them from 9 to ensure that the value of Bj is greater than 5;

[0012] Step 8: Take a random number r between 1 and 10, and take the B m*2-1 -length digital string starting from the r-th digit of TE, and denote it as the ciphertext segment;

[0013] Step 9: Take a random number of length B m*2 , and denote it as the random number segment. Concatenate the ciphertext segment and the random segment to form the encrypted data;

[0014] Step 10: Return to Step 4, m = m + 1, continue to process all plaintext characters into encrypted data, and sequentially concatenate them into the final encrypted digital string.

[0015] According to another aspect of the present invention, there is provided a data decryption method based on power operation, which is used to decrypt the data encrypted by the data encryption method as described in claim 1, and includes the following steps:

[0016] Step 1: The decryptor holds the key C = C1C2C3...C N (N≥10) and the sequential relationship K of hexadecimal characters;

[0017] Step 2: Process the key C to become a specific real number as the base a for power operation;

[0018] Step 3: For all characters from 0 to 9, A to F, corresponding to the sorting i in the sequential relationship K, use a as the base for power calculation and i as the power to calculate all transformation values:

[0019] Step 4: Represent all Ti in scientific notation and take the first 20 significant digits, denoted as TEi;

[0020] Step 5: Take the arithmetic sum of C1 + C2 + …… + CN, and use the first two digits of the arithmetic sum as the initial values B1 and B2 of the Fibonacci sequence modulo 10. If the arithmetic sum has only one digit, then B1 = 0 and B2 = the arithmetic sum, and calculate the subsequent sequence values B j =(B j-1 +B j-2 ) mod 10;

[0021] Step 6: For numbers where B j is less than 5, subtract them from 9 to ensure that B j has a value greater than 5;

[0022] Step 7: Decrypt the m-th character, and take the sum S = 1 + B1 + B2 +... + B2m-2 If 2m - 2 = 0, S = 1, take the B characters starting from the S-th position of the encrypted digital string as a single encrypted ciphertext segment, and the subsequent B 2m-1 digit strings are random numbers; 2m

[0023] Step 8: Among all Ti, search whether the ciphertext segment belongs to the subfield of Ti. If so, the ciphertext segment corresponds to the i-th character in the sequence K, and decrypt the single ciphertext;

[0024] Step 9: m = m + 1, return to Step 7 for looping until S exceeds the length of the ciphertext digital string, which means all ciphertexts have been decrypted, and the decryption is completed to obtain the decrypted plaintext.

[0025] The present invention adopts the above technical solution, and has the beneficial effect that: the encryption and decryption method of the present invention has a certain security and can be used in the application of fast encryption and decryption occasions. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] To further illustrate the embodiments, the present invention provides drawings. These drawings are part of the disclosure of the present invention, which are mainly used to illustrate the embodiments and can be combined with the relevant descriptions in the specification to explain the operation principle of the embodiments. With reference to these contents, those of ordinary skill in the art should be able to understand other possible implementation manners and the advantages of the present invention. The components in the drawings are not drawn to scale, and similar component symbols are usually used to represent similar components.

[0027] Figure 1 is the flowchart of the data encryption method of the present invention;

[0028] Figure 2 is the flowchart of the data decryption method of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0029] The present invention will be further described below in conjunction with the drawings and specific embodiments.

[0030] As Figure 1 shown, the process steps of the data encryption method of the present invention are as follows:

[0031] Step 100: Since this encryption method is a simplified encryption method, the key must be a number from 0 to 9. Generate a key C = C1C2C3...C N (N ≧ 10), and N greater than 10 is to ensure that the subsequent different power operation results have large random and non-repeating floating-point values.

[0032] ​Step 102: Process the key C to become a specific real number, which serves as the base a for the power operation. The processing procedure is to judge C1. If C1 is 0, then set C1 to 1 when transforming the base. After that, use C as the fractional part of a, and set the integer part of a to 1. The purpose of this step is to avoid a being too close to the integer 1, because any power operation result with 1 as the base is 1, so as to avoid reducing the randomness of the subsequent power operation results.

[0033] Step 104: Convert the information to be encrypted H (plaintext) into hexadecimal representation. Then the information to be encrypted can be converted into a string composed of characters in the range of 0-9, A-F. Establish a unique order relationship K for the characters 0-9, A-F. The order value of each plaintext hexadecimal character in K is denoted as i, and the individual encryption of each plaintext character starts from Step 106.

[0034] Step 106: For a string of hexadecimal plaintext characters to be encrypted, use m to represent the order of a character in the plaintext, and n to represent the length of the plaintext characters. To encrypt the m-th character (starting from m = 1), take the order of the character in K, denoted as i. Using a as the base for the power calculation and i as the power, calculate the transformation value:

[0035] Step 108: Represent T in scientific notation and take the first 20 significant digits, denoted as TE.

[0036] Step 110: Calculate the arithmetic sum of C1 + C2 + …… + C N Take the first two digits of the arithmetic sum as the initial values B1, B2 of the Fibonacci sequence modulo 10 (if the arithmetic sum has only one digit, then B1 = 0, B2 = the value of the arithmetic sum). Calculate the subsequent sequence values Bj = (B j-1 + B j-2 ) mod 10

[0037] Step 112: For the numbers where Bj is less than 5, subtract them from 9 to ensure that the value of Bj is greater than 5. This is to ensure that the length of the subsequent digital string is greater than 5, so as to better ensure the uniqueness and non-repetitiveness of the subsequent digital string.

[0038] Step 114: Take a random number r between 1 and 10, and take the digital string starting from the r-th digit of TE with a length of B m*2-1 , denoted as the ciphertext segment.

[0039] Step 116: Take a random number with a length of B m*2 , denoted as the random number segment, and splice the ciphertext segment and the random segment together to form the encrypted data.

[0040] Step 118: Determine whether m is equal to n. If not, return to Step 106, increment m by 1 and continue to process all plaintext characters into encrypted data. If so, concatenate the encrypted data of all plaintext characters in order to form the final encrypted digital string.

[0041] The following uses an example to illustrate this data encryption method:

[0042] Randomly generate a key consisting of at least 10 digits, assumed to be C = C1C2C3...C N= 0123456789.

[0043] Generate the base for the power operation, process the key C. Since C1 is 0, set C1 to 1 when changing the base. Use C as the fractional part and set the integer part to 1. Therefore, the base for the power operation is a = 1.1123456789.

[0044] Assume the hexadecimal representation of the information to be encrypted is 0xA6, and the sequential relationship K of hexadecimal characters is K = {A, B, C, D, E, F, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. For the character A to be encrypted, its order in the sequential relationship K is i = 1. Therefore, calculate the transformation value with a as the base of the power operation and 1 as the power:

[0045]

[0046] Express T1 in scientific notation and take the first 20 significant digits, denoted as TE1 = 25002719357763596673.

[0047] Take the arithmetic sum of C1 + C2 + …… CN, 1 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 46. Use the first two digits of the arithmetic sum as the initial values of the Fibonacci sequence modulo 10, B1 = 4, B2 = 6. Calculate the subsequent sequence values: B3 = (B2 + B1) mod 10 = 0; B4 = (B3 + B2) mod 10 = 6; B5 = (B4 + B3) mod 10 = 6; B6 = (B5 + B4) mod 10 = 2, and so on.

[0048] For B j For numbers less than 5, subtract them from 9 to ensure that B j has a value greater than 5. Then the new Fibonacci sequence values are B1 = 5, B2 = 6, B3 = 9, B4 = 6, B5 = 6, B6 = 7, …….

[0049] Take an arbitrary random number r between 1 and 10, assume r = 9. Take the digit string starting from the 9th digit of TE1 and with a length of B1 = 5 as the ciphertext segment of the processing result, which is 35776.

[0050] Randomly generate a random number segment B2 with a length of 6 digits. Assume it is 987487. Combine the password segment with the random number segment to form the final encrypted result as 35776987487.

[0051] Continue to encrypt the next character 6. Its order in the sequential relationship K is i = 13, and it is the second character m = 1 for encryption.

[0052] Calculate the transformation value:

[0053]

[0054] Represent it in scientific notation and take the first 20 significant digits, denoted as TE 13 = 89714886258396854164.

[0055] Take an arbitrary random number r between 1 and 10. Assume r = 3. Take the number string starting from the 3rd digit of TE, B 2*m-1 = B3 = 9 - length number string as the encrypted text segment result of the transformation, which is 714886258.

[0056] Randomly generate B 2*m = B4 = 6 - digit length random number segment. Assume it is 159876. Combine it to form the final encrypted result as 714886258159876.

[0057] Concatenate the encrypted results in sequence. Therefore, the final ciphertext for encrypting the plaintext 0xA6 is 35776987487714886258159876.

[0058] As Figure 2 shown, the process steps of the data decryption method of the present invention are as follows:

[0059] Step 200: The decrypting party holds the key C = C1C2C3...C N (N≥10), and the sequential relationship K of hexadecimal characters. Denote the ciphertext length as L.

[0060] Step 202: Process the key C to become a specific real number as the base a for the power operation. The processing process is to judge C1. If C1 is 0, then set C1 to 1 when transforming the base. Then, use C as the fractional part of a, and set the integer part of a to 1. The purpose of this step is to avoid a being too close to the integer 1 to avoid reducing the randomness of the subsequent power operation results.

[0061] Step 204: For all characters from 0 to 9, A to F, corresponding to their sorting i in the sequential relationship K. Calculate all transformation values with a as the base for the power calculation and i as the power:

[0062] Step 206: Represent all Ti in scientific notation, take the first 20 significant digits, and denote them as TEi.

[0063] Step 208: Take the arithmetic sum of C1 + C2 + …… CN. Use the first two digits of the arithmetic sum as the initial values B1 and B2 of the modulo 10 Fibonacci sequence (if the arithmetic sum has only one digit, then B1 = 0 and B2 = the arithmetic sum). Calculate the subsequent sequence values B j =(B j-1 +B j-2 ) mod 10.

[0064] Step 210: For numbers in B j less than 5, subtract them by 9 to ensure that B j has a value greater than 5. This is to ensure that the length of the subsequent digital string is greater than 5, guaranteeing uniqueness and non-repetitiveness.

[0065] Step 212: Decrypt the m-th character. Take the sum S = 1 + B1 + B2 +... + B 2m-2 (if 2m - 2 = 0, S = 1). Take the characters starting from the S-th position of the encrypted digital string with a length of B 2m-1 as a single encrypted ciphertext segment, and the subsequent B 2m digital strings are random numbers.

[0066] Step 214: In all Ti, search whether the ciphertext segment belongs to the sub-field of Ti. If so, this ciphertext segment corresponds to the i-th character in the sequence K, and thus a single ciphertext is solved.

[0067] Step 216: Judge whether S is greater than L. If not, m = m + 1, then return to Step 212. If so, it means that all ciphertexts have been solved, and the decryption is completed to obtain the decrypted plaintext.

[0068] The following uses an example to illustrate this data decryption method:

[0069] For the ciphertext ciphertext 35776987487714886258159876, its length L is 26. According to the decryption party holding the key C as C = C1C2C3...C N= 0123456789 and the character sequence K as K = {A, B, C, D, E, F, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, calculate all characters' to get

[0070] T1 = 2.500271935776359667311159723011E - 2,

[0071] T2 = 2.781166683835771992705810099639E - 2,

[0072] T3 = 3.093618743065363453331950183258E-2,

[0073] T4 = 3.441173441012806377571776593657E-2,

[0074] T5 = 3.827774407456039213654327568551E-2,

[0075] T6 = 4.257808321937733161017345149162E-2,

[0076] T7 = 4.73615468849189755651888180462E-2,

[0077] T8 = 5.26824120234593780465524670163E-2,

[0078] T9 = 5.860105336832444459976415972771E-2,

[0079] T10 = 6.518462849324398608379010303221E-2,

[0080] T11 = 7.250783983516176576371565444246E-2,

[0081] T12 = 8.065378232701547842976306662736E-2,

[0082] T13 = 8.971488625839685416476310431376E-2,

[0083] T14 = 9.979396606253272957152770772555E-2,

[0084] T15 = 0.11100538692995152892871109416014,

[0085] T16 = 0.12347636248615412019030013173553.

[0086] Expressing all Ti in scientific notation and taking the first 20 significant figures, we get:

[0087] TE1 = 25002719357763596673,

[0088] TE2 = 27811666838357719927,

[0089] TE3 = 30936187430653634533,

[0090] TE4 = 34411734410128063775,

[0091] TE5 = 38277744074560392136,

[0092] TE6 = 42578083219377331610,

[0093] TE7 = 47361546884918975565,

[0094] TE8 = 52682412023459378046,

[0095] TE9 = 58601053368324444599,

[0096] TE10 = 65184628493243986083,

[0097] TE11 = 72507839835161765763,

[0098] TE12 = 80653782327015478429,

[0099] TE13 = 89714886258396854164,

[0100] TE14 = 99793966062532729571,

[0101] TE15 = 11100538692995152892,

[0102] TE16 = 12347636248615412019.

[0103] According to the key C, as described in the encryption step, calculate B1 = 5, B2 = 6, B3 = 9, B4 = 6, B5 = 6, B6 = 7,....

[0104] Decrypt starting from the m = 1st character of the ciphertext 35776987487714886258159876, S = B 2m-2= 1. Thus, from the encrypted string, a string of length B1 = 5 starting from the 1st position is taken out, that is, the ciphertext segment of the first character is 35776. Search for 35776 in TE1 to TE16, and it is found that the string 35776 exists in TE1, indicating that the first character corresponds to TE1, that is, it corresponds to the first position in the sequence K. Looking up the sequence K = {A, B, C, D, E, F, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, the serial number 1 is A, that is, the first character is decrypted to A.

[0105] Similarly, to decrypt the m = 2nd character, S = 1 + B1 + B2 = 1 + 5 + 6 = 12. Thus, from the encrypted string, a string of length B3 = 9 starting from the 12th position is taken out, that is, the ciphertext segment corresponding to the 2nd character is 714886258. Search for 714886258 in TE1 to TE16, and it is found that the string 714886258 exists in TE13, indicating that the 2nd character corresponds to TE13, that is, it corresponds to the 13th position in the sequence K. Looking up the sequence K = {A, B, C, D, E, F, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, the 13th character is 6, that is, the 2nd encrypted character is decrypted to 6.

[0106] To decrypt the m = 3rd character, S = S = 1 + B1 + B2 + B3 + B4 = 1 + 5 + 6 + 9 + 6 = 27. It is found that S has exceeded the ciphertext length L = 26, indicating that the ciphertext has been completely decrypted, and the decryption ends. The plaintext is 0xA6.

[0107] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, those skilled in the art should understand that various changes can be made to the present invention in terms of form and details without departing from the spirit and scope of the present invention defined by the appended claims, and all of them fall within the protection scope of the present invention.

Claims

1. A data encryption method based on power operation, characterized in that, The data encryption method includes the following steps: Step 1: Generate a key C = C1C2C3...C composed of at least 10 digits N , where N ≥ 10; Step 2: Process the key C to become a specific real number, which is used as the base a for the power operation; Step 3: Convert the plaintext H of the information to be encrypted into hexadecimal representation. Then the information to be encrypted can be converted into a string composed of characters in the range of 0-9, A-F. Establish the order relationship K of the characters 0-9, A-F, and record the order value of each plaintext hexadecimal character in K as i; Step 4: For a string of hexadecimal plaintext characters to be encrypted, let m represent the order of a character in the plaintext. To encrypt the m-th character, starting from m = 1, take the order of the character in K, denoted as i, and calculate the transformation value with a as the base and i as the exponent: Step 5: Represent T in scientific notation and take the first 20 significant digits, denoted as TE; Step 6: Calculate the arithmetic sum of C1 + C2 + …… + C N , and use the first two digits of this arithmetic sum as the initial values B1 and B2 of the modulo 10 Fibonacci sequence; if the arithmetic sum has only one digit, then B1 = 0 and B2 = the arithmetic sum; calculate the subsequent sequence values Bj = (B j-1 + B j-2 ) mod 10; Step 7: For the numbers where Bj is less than 5, subtract them from 9 to ensure that the value of Bj is greater than 5; Step 8: Obtain a random number r between 1 and 10, and take the digital string starting from the r-th digit of TE, B m*2-1 with a length of, which is denoted as the ciphertext segment; Step Nine: Take B m*2 A long random number, denoted as a random number segment, splice the ciphertext segment and the random segment to form encrypted data; Step 10: Return to Step 4, m = m + 1, and continue to process all plaintext characters into encrypted data and sequentially splice them into the final encrypted digital string.

2. The data encryption method based on power operation according to claim 1, characterized in that, The specific process of Step 2 is as follows: First, judge C1. If C1 is 0, then set C1 to 1. After that, use C as the fractional part of a, and set the integer part of a to 1.

3. A data decryption method based on power operation, characterized in that, The data decryption method is used to decrypt the data encrypted by the data encryption method as described in Claim 1, and includes the following steps: Step 1: The decrypting party holds the key C = C1C2C3...C N and the order relationship K of hexadecimal characters, where N ≥ 10; Step 2: Process the key C to become a specific real number, which is used as the base a for the power operation; Step 3: For all characters from 0 to 9 and A to F, corresponding to the sorting i in the sequential relationship K, calculate all transformation values with a as the base and i as the exponent: Step 4: Represent all Ti in scientific notation and take the first 20 significant digits, denoted as TEi; Step 5: Take the arithmetic sum of C1 + C2 + …… CN, and use the first two digits of the arithmetic sum as the initial values B1 and B2 of the modulo 10 Fibonacci sequence. If the arithmetic sum has only one digit, then B1 = 0 and B2 = the arithmetic sum, and calculate the subsequent sequence values B j = (B j-1 + B j-2 ) mod 10; Step 6: For B j For a number less than 5, subtract it from 9 to ensure that B j takes a value greater than 5; Step 7: Decrypt the m-th character, and take the sum S = 1 + B1 + B2 +... + B 2m-2 , if 2m - 2 = 0, S = 1, take the characters starting from the S-th position of the encrypted digital string as a single encrypted ciphertext segment, and the subsequent B 2m-1 characters long as the digital string is a random number; 2m ​ Step 8: In all Ti, search whether the ciphertext segment belongs to the sub-field of Ti. If so, then the ciphertext segment corresponds to the i-th character in the order K, and decrypt a single ciphertext; Step 9: m = m + 1, return to Step 7 for looping until S exceeds the length of the ciphertext digital string, which means that all ciphertexts have been decrypted, and the decryption is completed to obtain the decrypted plaintext.

4. The data decryption method based on power operation according to claim 3, characterized in that, The specific process of Step 2 is as follows: First, judge C1. If C1 is 0, then set C1 to 1. After that, use C as the fractional part of a, and set the integer part of a to 1.

Citation Information

Patent Citations

  • Safe multicast key management method based on MIPv6 (Mobile Internet Protocol version 6)

    CN102413465A

  • Self-authorized CP-ABE system and method

    CN104144056A