Microprocessor data disorder encryption and decryption method
By generating unordered encryption and decryption tables, the problem of resource waste and insufficient security of microprocessors when processing complex encryption algorithms is solved, achieving high-security and low-complexity data encryption and decryption.
Patent Information
- Application Number
- CN202111351222.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-16
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2041-11-16
AI Technical Summary
Existing microprocessors suffer from high time and space complexity and high resource consumption when processing complex encryption algorithms, while low-complexity encryption algorithms are easily cracked, resulting in insufficient security.
The method employs an unordered encryption table and a decryption table. The encryption table contains unordered and non-repeating data from 0 to 255. The decryption table generates a one-to-one correspondence in sequence, resulting in 256!-1 combinations. Cracking the decryption requires obtaining all the information.
It improves data security, reduces time and space complexity, and saves microprocessor resources.
Smart Images

Figure CN114036543B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of encryption and decryption of microprocessor data, and more specifically to a method for unordered encryption and decryption of microprocessor data. Background Technology
[0002] Due to limitations in capacity and processing speed, microprocessors often struggle with complex encryption algorithms, resulting in high time and space complexity, making them unsuitable for microprocessor use. Conversely, using low-complexity encryption algorithms makes them vulnerable to cracking. The solution employed is a data-disordered encryption / decryption method that achieves high encryption complexity while reducing time and space complexity, thus conserving microprocessor resources. Summary of the Invention
[0003] Therefore, to address the aforementioned shortcomings, this invention provides a method for encrypting and decrypting unordered microprocessor data. It mainly consists of two parts: an encryption table and a decryption table, with the decryption table generated from the encryption table. The encryption table contains unordered and non-repeating numbers from 0 to 255, and the decryption table is generated sequentially from the encryption table to create a one-to-one correspondence. The encryption table has 256!-1 possible combinations. To crack the encrypted information, all information in the encryption table must be obtained. Due to the large number of data combinations, the security of the encrypted data is highly guaranteed.
[0004] This invention is implemented as follows: a method for encrypting and decrypting unordered data in a microprocessor is constructed, characterized in that the method mainly includes the generation of an encryption table and a decryption table, as well as data encryption and decryption; wherein, the encryption table should be generated by one end and shared by both ends, and the decryption table is generated from the encryption table.
[0005] According to the microprocessor data disordered encryption and decryption method of the present invention, the characteristic is that the generation process of the encryption table is as follows:
[0006] Step 1: Generate a sequential list Tab of length 256;
[0007] Step 2: Generate two random numbers N and M between 0 and 255;
[0008] Step 3: Determine if N and M are equal; if so, return to step 2.
[0009] Step 4: Swap the Nth and Mth values of Tab;
[0010] Step 5: Determine if the number of swaps is greater than 255; otherwise, return to step 2.
[0011] Step 6: The generated unordered encrypted sheet SheetEnc is now complete.
[0012] The microprocessor data disorder encryption and decryption method according to the present invention is characterized in that;
[0013] The process of generating the decryption table is as follows:
[0014] Step 1: Generate an empty table DecCode of length 256;
[0015] Step 2: Find the Nth value in the SheetEnc encrypted table that is P;
[0016] Step 3: Write N into the P-th position of DecCode.
[0017] Step 4: Determine if the number of generated items N is less than 256. If it is, increment the number of generated items N by 1 and return to step 2.
[0018] Step 5: Generate the decryption table DecCode, then the process ends.
[0019] According to the microprocessor data disorder encryption and decryption method of the present invention, the data encryption process is as follows:
[0020] Step 1: Determine the plaintext data Userlnfo and the ciphertext data Enclnfo;
[0021] Step 2, use Char*ptr to point to Userlnfo;
[0022] Step 3, obtain the value N from the ptr pointer;
[0023] Step 4: Find the Nth number in the unordered encryption table SheetEnc and fill it into the ciphertext data Enclnfo;
[0024] Step 5: Determine if the encrypted number is less than the plaintext data length. If so, increment the pointer ptr address by 1 and return to step 3.
[0025] Step 6: Generate encrypted information Enclnfo, end.
[0026] According to the microprocessor data disorder encryption and decryption method of the present invention, the data decryption process is as follows:
[0027] Step 1: Determine the encrypted data Enclnfo and the plaintext data Userlnfo;
[0028] Step 2, use Char*ptr to point to Enclnfo;
[0029] Step 3, obtain the value N from the ptr pointer;
[0030] Step 4: Find the Nth number in the decryption table DecCode and fill it into the plaintext data Enclnfo;
[0031] Step 5: Determine if the decryption count is less than the length of the ciphertext data. If so, increment the pointer ptr by 1 and return to step 3.
[0032] Step 6: Decrypt the message from Enclnfo, end.
[0033] This invention has the following advantages: It provides a method for encrypting and decrypting unordered data, mainly composed of an encryption table and a decryption table, wherein the decryption table is generated from the encryption table. The encryption table contains unordered and non-repeating numbers from 0 to 255, and the decryption table is generated sequentially from the encryption table to create a one-to-one correspondence. The encryption table has 256!-1 combinations. To crack the encrypted information, all information in the encryption table must be obtained. Due to the large number of data combinations, the security of the encrypted data is highly guaranteed. Attached Figure Description
[0034] Figure 1 This is a flowchart of the encryption table generation process of the present invention;
[0035] Figure 2 This is a flowchart of the decryption table generation process of the present invention;
[0036] Figure 3 This is a diagram illustrating the data encryption process of this invention;
[0037] Figure 4 This is a diagram illustrating the data decryption process of this invention;
[0038] Figure 5 This is a schematic diagram of data transmission according to the present invention. Detailed Implementation
[0039] The following will be combined with the appendix Figures 1-5 This invention will be described in detail, and the technical solutions in the embodiments of this invention will be clearly and completely described. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0040] This invention provides an improved method for encrypting and decrypting unordered data in a microprocessor, characterized in that the method mainly includes the generation of an encryption table and a decryption table, as well as data encryption and decryption; wherein the encryption table should be generated by one end and shared by both ends, and the decryption table is generated from the encryption table.
[0041] The process of generating the encryption table is as follows:
[0042] Step 1: Generate a sequential list Tab of length 256;
[0043] Step 2: Generate two random numbers N and M between 0 and 255;
[0044] Step 3: Determine if N and M are equal; if so, return to step 2.
[0045] Step 4: Swap the Nth and Mth values of Tab;
[0046] Step 5: Determine if the number of swaps is greater than 255; otherwise, return to step 2.
[0047] Step 6: The generated unordered encrypted sheet SheetEnc is now complete.
[0048] The process of generating the decryption table is as follows:
[0049] Step 1: Generate an empty table DecCode of length 256;
[0050] Step 2: Find the Nth value in the SheetEnc encrypted table that is P;
[0051] Step 3: Write N into the P-th position of DecCode.
[0052] Step 4: Determine if the number of generated items N is less than 256. If it is, increment the number of generated items N by 1 and return to step 2.
[0053] Step 5: Generate the decryption table DecCode, then the process ends.
[0054] The data encryption process is as follows:
[0055] Step 1: Determine the plaintext data Userlnfo and the ciphertext data Enclnfo;
[0056] Step 2, use Char*ptr to point to Userlnfo;
[0057] Step 3, obtain the value N from the ptr pointer;
[0058] Step 4: Find the Nth number in the unordered encryption table SheetEnc and fill it into the ciphertext data Enclnfo;
[0059] Step 5: Determine if the encrypted number is less than the plaintext data length. If so, increment the pointer ptr address by 1 and return to step 3.
[0060] Step 6: Generate encrypted information Enclnfo, end.
[0061] The data decryption process is as follows:
[0062] Step 1: Determine the encrypted data Enclnfo and the plaintext data Userlnfo;
[0063] Step 2, use Char*ptr to point to Enclnfo;
[0064] Step 3, obtain the value N from the ptr pointer;
[0065] Step 4: Find the Nth number in the decryption table DecCode and fill it into the plaintext data Enclnfo;
[0066] Step 5: Determine if the decryption count is less than the length of the ciphertext data. If so, increment the pointer ptr by 1 and return to step 3.
[0067] Step 6: Decrypt the message from Enclnfo, end.
[0068] This invention provides a method for encrypting and decrypting unordered data, mainly composed of an encryption table and a decryption table, wherein the decryption table is generated from the encryption table. The encryption table contains unordered and non-repeating numbers from 0 to 255, and the decryption table is generated sequentially from the encryption table to create a one-to-one correspondence. The encryption table has 256!-1 possible combinations. To crack the encrypted information, all information in the encryption table must be obtained. Due to the large number of data combinations, the security of the encrypted data is highly guaranteed.
[0069] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for encrypting and decrypting unordered data in a microprocessor, characterized in that; The data unordered encryption and decryption method mainly includes the generation of two parts: an encryption table and a decryption table, as well as data encryption and decryption; the encryption table should be generated by one end and shared by both ends, and the decryption table is generated from the encryption table; The process of generating the encryption table is as follows: Step 1: Generate a sequential list Tab of length 256; Step 2: Generate two random numbers N and M between 0 and 255; Step 3: Determine if N and M are equal; if so, return to step 2. Step 4: Swap the Nth and Mth values of Tab; Step 5: Determine if the number of swaps is greater than 255; otherwise, return to step 2. Step 6: The generated unordered encrypted sheet SheetEnc is now complete. The process of generating the decryption table is as follows: Step 1: Generate an empty table DecCode of length 256; Step 2: Find the Nth value in the SheetEnc encrypted table that is P; Step 3: Write N into the P-th position of DecCode. Step 4: Determine if the number of generated items N is less than 256. If it is, increment the number of generated items N by 1 and return to step 2. Step 5: Generate the decryption table DecCode, end; The data encryption process is as follows: Step 1: Determine the plaintext data Userlnfo and the ciphertext data Enclnfo; Step 2, use Char*ptr to point to Userlnfo; Step 3, obtain the value N from the ptr pointer; Step 4: Find the Nth number in the unordered encryption table SheetEnc and fill it into the ciphertext data Enclnfo; Step 5: Determine if the encrypted number is less than the plaintext data length. If so, increment the pointer ptr address by 1 and return to step 3. Step 6: Generate encrypted information Enclnfo, end; The data decryption process is as follows: Step 1: Determine the encrypted data Enclnfo and the plaintext data Userlnfo; Step 2, use Char*ptr to point to Enclnfo; Step 3, obtain the value N from the ptr pointer; Step 4: Find the Nth number in the decryption table DecCode and fill it into the plaintext data Enclnfo; Step 5: Determine if the decryption count is less than the length of the ciphertext data. If so, increment the pointer ptr by 1 and return to step 3. Step 6: Decrypt the message Enclnfo, then finish.
Citation Information
Patent Citations
Encryption and decryption method and device
CN106487773A