Data processing method and device, non-volatile storage medium, and processor
By performing multiple-power grid replacement and Base64 encoding dual encryption on the original data, the problem of encrypted data being easily cracked in the prior art is solved, and high security and strong anti-decryption capability of data transmission are achieved.
Patent Information
- Application Number
- CN202211065720.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-01
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2042-09-01
AI Technical Summary
In the prior art, data encryption is encrypted using a one-way reversible encryption algorithm such as MD5, which is easily cracked and caused data leakage.
By obtaining the original data for encryption, the first grid diagram stores and rotates the encrypted data, determines the location information of the encrypted data, transmits the target string, preset angle and position information to the decryption end, and generates a secret key for transmission, so as to realize the multi-power grid replacement and Base64 encoding dual encryption of the data.
It effectively improves the security during data transmission, avoids the cracking of encrypted data, and achieves the technical effect of improving data security and anti-decryption capabilities.
Smart Images

Figure CN115391807B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and in particular to data encryption transmission technology, a data processing method and device, a non-volatile storage medium, and a processor. Background Art
[0002] The rapid popularization of the Internet has become a symbol of the information age. Network information transmission occupies an absolute position in the information transmission method in the information age with its openness, interactivity and rapidity of dissemination. At the same time, network security issues are increasingly valued by people, and information transmission security and interface security as part of network security are also increasingly valued. Therefore, the encryption of data and interface protection during information transmission are particularly important. The data encryption method continues to maintain innovation and rigor, which is the best means to ensure the security of data transmission. In the prior art, a one-way reversible encryption algorithm such as the MessageDigest Algorithm (MD5) is often used. However, data encrypted only with the MD5 algorithm can be cracked through collisions and rainbow tables; even if salting is used, the salt value will be obtained, resulting in leakage.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a data processing method and device, a non-volatile storage medium, and a processor, so as to at least solve the technical problem of data leakage caused by the fact that data encrypted using the existing technology is easily cracked.
[0005] According to one aspect of an embodiment of the present application, a data processing method is provided, including: obtaining original data, and encrypting the original data to obtain encrypted data; determining a first grid diagram, storing the encrypted data in the first grid diagram, and rotating the first grid diagram after storing the encrypted data at a preset angle; determining first position information of the encrypted data, wherein the first position information is position information of the encrypted data in the rotated first grid diagram; transmitting a target character string, a preset angle and the first position information to a decryption end, wherein the target character string is obtained by splicing the data of each row in the rotated first grid diagram; determining a secret key of the original data, and transmitting the secret key to the decryption end.
[0006] Optionally, encrypting the original data includes: obtaining target data, converting the target data into a character string of preset length, wherein the target data is summary data of the original data; converting each character in the character string of preset length into a printable character, representing the target data by the printable characters, and encrypting the original data.
[0007] Optionally, determining the first grid diagram includes: determining the number of grids in the first grid diagram according to the number of encrypted data, wherein the number of grids is greater than or equal to the number of encrypted data; performing a square root operation on the number value of the encrypted data to obtain a square root result; increasing the square root result by a preset value, determining the square value of the square root result after the increase by the preset value, and determining the square value as the size of each grid in the first grid diagram.
[0008] Optionally, determining the location information of the encrypted data includes: determining the coordinate axis and the origin of the coordinate axis, and determining the grid for storing the encrypted data; determining the distance between the side representing the length of the grid and the origin as the horizontal coordinate of the location information; and determining the distance between the side representing the width of the grid and the origin of the coordinate axis as the vertical coordinate of the location information.
[0009] Optionally, determining the secret key of the original data includes: obtaining the length of the encrypted data and second position information of the encrypted data, wherein the second position information is position information of the encrypted data in the first grid before rotation; generating the secret key based on the length of the encrypted data, a preset angle and the second position information of the encrypted data.
[0010] Optionally, a data processing method includes: receiving a target character string and a secret key transmitted according to the above data processing method, wherein the secret key includes: location information of encrypted data and a preset angle, and the location information of the encrypted data includes: the horizontal coordinate of the encrypted data in the first grid diagram, and the vertical coordinate of the encrypted data in the first grid diagram; using the secret key to process the target character string to obtain encrypted data.
[0011] Optionally, the target string is processed using a secret key, including: determining the horizontal coordinate with the largest value and the vertical coordinate with the largest value; creating a second grid diagram using the horizontal coordinate with the largest value and the vertical coordinate with the largest value, wherein the length of the second grid diagram is equal to the length of the first grid diagram, and the width of the second grid diagram is equal to the width of the first grid diagram; obtaining the row position of the target string in the first grid diagram, and storing the target string in the second grid diagram according to the row position of the target string in the first grid diagram.
[0012] Optionally, after storing the target string in the second grid diagram according to the row position of the target string in the first grid diagram, the data processing method also includes: obtaining third position information of the target string, wherein the third position information includes: the horizontal coordinate of the target string in the second grid diagram, and the vertical coordinate of the target string in the second grid diagram; if the third position information of the target string is consistent with the first position information of the encrypted data, rotating the second grid diagram according to a preset angle; extracting the target string from the rotated second grid diagram, and restoring the target string to obtain the encrypted data.
[0013] According to another aspect of an embodiment of the present application, a data processing device is also provided, including: an encryption module, used to obtain original data, and encrypt the original data to obtain encrypted data; a processing module, used to determine a first grid diagram, store the encrypted data in the first grid diagram, and rotate the first grid diagram after storing the encrypted data at a preset angle; a determination module, used to determine the position information of the encrypted data, wherein the position information is the position information of the encrypted data in the rotated first grid diagram; a first transmission module, used to transmit a target character string, a preset angle and the position information to a decryption end, wherein the target character string is obtained by splicing the data of each row in the rotated first grid diagram; a second transmission module, used to determine the secret key of the original data, and transmit the secret key to the decryption end.
[0014] According to another aspect of an embodiment of the present application, a non-volatile storage medium is further provided, the non-volatile storage medium including a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above data processing method.
[0015] According to another aspect of an embodiment of the present application, a processor is further provided, the processor being used to run a program stored in a memory, wherein the above data processing method is executed when the program is run.
[0016] In an embodiment of the present application, the original data is obtained and encrypted to obtain encrypted data; a first grid is determined, the encrypted data is stored in the first grid, and the first grid is rotated and stored according to a preset angle to store the encrypted data; the position information of the encrypted data is determined, wherein the position information is the position information of the encrypted data in the rotated first grid; a target character string, a preset angle and the position information are transmitted to a decryption end, wherein the target character string is obtained by splicing the data of each row in the rotated first grid; a secret key of the original data is determined and transmitted to the decryption end, a method of data encryption is provided, by converting the encrypted data into a coding format of printed characters (Base64 coding format), and performing multiple square grid permutations on the encrypted data after the conversion format, the security of the data transmission process is effectively improved, and the purpose of preventing the encrypted data from being cracked and data leakage is achieved, thereby achieving the technical effect of improving the security and anti-decryption capability of the data, and thus solving the technical problem of data leakage caused by the easy cracking of data encrypted by the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A flowchart of a data processing method according to an embodiment of the present application;
[0019] Figure 2 is a schematic diagram of encrypting original data according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of a grid diagram storing encrypted data after rotating the grid diagram according to a preset angle according to an embodiment of the present application;
[0021] Figure 4 is a flow chart of a data processing method according to some optional embodiments of the present application;
[0022] Figure 5 is a schematic diagram of storing a target character string into a rotated grid diagram according to an embodiment of the present application;
[0023] Figure 6 It is a structural diagram of a data processing device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] According to an embodiment of the present application, a method embodiment of a data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0027] Figure 1 is a flow chart of a method for processing data according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0028] Step S102, obtaining original data, and encrypting the original data to obtain encrypted data.
[0029] As an optional embodiment, in step S102, the original data to be transmitted is obtained and encrypted, wherein the encryption process includes: performing MD5 encryption operation on the original data, and converting the format of the MD5 encrypted data obtained after encryption into Base64 format.
[0030] Step S104, determining a first grid diagram, storing the encrypted data in the first grid diagram, and rotating the first grid diagram after storing the encrypted data according to a preset angle.
[0031] In step S104, a multi-square grid diagram (i.e., the first grid diagram) is determined, and the encrypted data obtained in step S102 is stored in the multi-square grid diagram. After storage, the multi-square grid diagram is rotated according to a preset angle. For example, when the preset angle is 90°, the multi-square grid diagram storing the encrypted data is rotated 90° clockwise by default. If the preset angle is -90°, the multi-square grid diagram storing the encrypted data is rotated 90° counterclockwise by default.
[0032] Step S106, determining first position information of the encrypted data, wherein the first position information is position information of the encrypted data in the rotated first grid.
[0033] In step S106, after the multi-square grid diagram storing the encrypted data is rotated by a preset angle according to the method provided in step S104, the position information of the encrypted data in the rotated multi-square grid diagram is determined; for example, when the multi-square grid diagram is determined as a coordinate axis, obtaining the position information of the encrypted data includes: obtaining the horizontal and vertical coordinates of the encrypted data.
[0034] Step S108, transmitting the target character string, the preset angle and the first position information to the decryption end, wherein the target character string is obtained by splicing the data of each row in the rotated first grid image.
[0035] In step S108, each row of data in the rotated multi-square grid diagram is horizontally spliced to obtain a target string, and the target string, the preset angle in step S104 and the (first) position information obtained in step S106 are transmitted to the decryption end.
[0036] Step S110, determine the secret key of the original data and transmit the secret key to the decryption end.
[0037] In step S110, a secret key of the original data is determined and transmitted to the decryption end, so that the decryption end can use the secret key to decrypt the original data after receiving the encrypted data.
[0038] Through the above steps, it is possible to implement secondary encryption assembly of data in a simpler and reversible encryption method that is different from the popular method, and perform multiple square grid encryption and decryption on the secondary encrypted data, thereby improving the security of the encrypted data.
[0039] According to an optional embodiment of the present application, encrypting the original data includes the following steps: obtaining target data, converting the target data into a character string of preset length, wherein the target data is summary data of the original data; converting each character in the character string of preset length into a printable character, representing the target data by the printable characters, and encrypting the original data.
[0040] This embodiment provides a preferred encryption method to achieve the purpose of encrypting the original data in step S102 to obtain encrypted data. Figure 2It is a schematic diagram of encrypting the original data. As shown in the figure, in this embodiment, the original data is encrypted using the encryption method (MD5+Base64). For example, if the original data is "123456789", the original data is first encrypted using the MD5 algorithm: that is, the original data is digested, the digest data is obtained from the original data, and the first encrypted data (i.e., the target data) "323b453885f5181f" is obtained. Then, the obtained target data "323b453885f5181f" is converted into a character string of a preset length "NDliYTU5YWJiZTU2ZTA1Nw==", and the target data is represented in Base64 format (a format of printable characters), and finally the encryption of the original data is realized. Among them, the MD5 encryption algorithm mainly uses the MD5 code to process the input information (the input information in this embodiment is the original data) in 512-bit groups, and each group is divided into 16 32-bit sub-groups. After a series of processing, a 128-bit hash value composed of 4 32-bit groups is output. When the MD5-encrypted data is converted into Base64 format, the obtained MD5 encrypted data is processed as follows: divide each three bytes into a group, each group has a total of 24 base digits, divide the 24 base digits into 4 groups, each group has 6 binary digits, add two "0"s before the base digits, and expand it into 32 base digits, that is, 4 bytes. Finally, according to the Base64 encoding table, the expanded data is converted into corresponding printable characters to complete the Base64 format conversion.
[0041] According to another optional embodiment of the present application, determining the first grid diagram can be achieved by the following method: determining the number of grids in the first grid diagram according to the number of encrypted data, wherein the number of grids is greater than or equal to the number of encrypted data; performing a square root operation on the number value of the encrypted data to obtain a square root result; increasing the square root result by a preset value, determining the square value of the square root result after increasing the preset value, and determining the square value as the size of each grid in the first grid diagram.
[0042] To implement step S104, in this embodiment, a method for determining a grid diagram is provided. The method includes the following two steps: determining the size of the empty spaces in the grid diagram, and determining the number of empty spaces in the grid diagram.
[0043] Determining the size of the empty spaces in the grid diagram includes: obtaining the number of data encrypted by the above-mentioned two encryption methods, performing a square root operation on a value representing the number to obtain a square root; adding a preset value to the obtained square root, and then calculating its square value, and the result obtained is the size of each empty space in the grid diagram storing the encrypted data; wherein the preset value can be 1.
[0044] It should be noted that when a group of encrypted data is stored in a grid diagram, the size of each grid (space) in the grid diagram is equal.
[0045] Determine the number of empty spaces in the grid diagram, including: obtaining the number of data encrypted by the above-mentioned two encryption methods, the number of empty spaces in the grid diagram should be greater than or equal to the number of the above-mentioned data, for example, if the number of data is 10, a 4*4 grid diagram is generated, because there are 16 grids in the 4*4 grid diagram, which is 6 more than the number of data, so there will be 6 more empty spaces, for these 6 empty spaces, fill "0" to fill in the empty spaces.
[0046] According to another optional embodiment of the present application, determining the location information of encrypted data includes the following steps: determining a coordinate axis and the origin of the coordinate axis, and determining a grid for storing the encrypted data; determining the distance between the side representing the length of the grid and the origin as the horizontal coordinate of the location information; and determining the distance between the side representing the width of the grid and the origin of the coordinate axis as the vertical coordinate of the location information.
[0047] According to step S104, after the encrypted data is stored in the grid diagram determined in the previous embodiment, the multiple square grid diagrams are rotated clockwise according to a preset angle to obtain a grid diagram with a changed position, and the position information of the encrypted data needs to be obtained. Figure 3 is a grid diagram after the grid diagram storing the encrypted data is rotated according to a preset angle; in this embodiment, the position information of the encrypted data is represented in the form of coordinates, for example: Figure 3 The point at the lower left corner of the first grid on the fifth row from the left in the grid diagram is determined as the origin (0, 0), and the x and y coordinate axes are arranged based on the origin, and the coordinates of each data are determined according to the length and width of the chart (that is, the size of the grid). For example, Figure 3 There are 25 data in the grid diagram shown. According to the method of the above embodiment, when the preset value is 1, the size of each grid can be determined to be 36. Assuming that the length and width of each grid are equal, it can be determined that the length and width of the grid are both 6, that is, the distance between the side representing the length of the grid and the origin is 6, and the distance between the side representing the width of the grid and the origin is 6. It can be determined that the position information of the data "Y" belonging to both the fifth row and the first column is (6, 6).
[0048] According to another optional embodiment of the present application, determining the secret key of the original data includes the following steps: obtaining the length of the encrypted data and the second position information of the encrypted data, wherein the second position information is the position information of the encrypted data in the first grid before rotation; generating the secret key based on the length of the encrypted data, a preset angle and the second position information of the encrypted data.
[0049] In this embodiment, the key of the original data is generated by the length of the string (i.e., the length of the encrypted data / the amount of encrypted data), the angle of rotation (i.e., the preset angle) and the original chart coordinates (i.e., the second position information), wherein the length of the string is used to determine the number of spaces filled with "0" in the above embodiment, and the original chart coordinates are used for subsequent identification of the original table.
[0050] Figure 4 is a flow chart of a data processing method according to some optional embodiments of the present application, such as Figure 4 As shown, the data processing method also includes the following steps:
[0051] Step S402, receiving the encrypted data and the secret key transmitted according to the above data processing method, wherein the secret key includes: the location information of the encrypted data and the preset angle, and the location information of the encrypted data includes: the horizontal coordinate of the encrypted data in the first grid diagram, and the vertical coordinate of the encrypted data in the first grid diagram;
[0052] Step S404, use the secret key to process the target character string to obtain encrypted data.
[0053] In this embodiment, the decryption end receives the target character string and the secret key, and processes the target character string using the secret key to obtain encrypted data.
[0054] According to an optional embodiment of the present application, processing the target string using a secret key includes the following steps: determining the horizontal coordinate with the largest value and the vertical coordinate with the largest value; creating a second grid diagram using the horizontal coordinate with the largest value and the vertical coordinate with the largest value, wherein the length of the second grid diagram is equal to the length of the first grid diagram, and the width of the second grid diagram is equal to the width of the first grid diagram; obtaining the row position of the target string in the first grid diagram, and storing the target string in the second grid diagram according to the row position of the target string in the first grid diagram.
[0055] In this embodiment, after the decryption end receives the secret key of the data, it first compares the coordinates (position information) of the encrypted data in the secret key, determines the maximum value of the coordinate axis based on the maximum value of the horizontal coordinate and the maximum value of the vertical coordinate, and determines the size of the chart (first grid) based on the maximum value of the coordinate axis, and generates a new blank multi-square grid (second grid) with the same length and width as the original. Next, obtain the row position information of the target string in the first grid, and store the obtained string back in the second grid according to the row position information of the target string in the first grid. Specifically, if the row position information of a character in the target string is the second grid of the first row, then the character is also stored in the second grid of the first row of the second grid.
[0056] According to another optional embodiment of the present application, after storing the target string in the second grid diagram according to the row position of the target string in the first grid diagram, the data processing method also includes: obtaining third position information of the target string, wherein the third position information includes: the horizontal coordinate of the target string in the second grid diagram, and the vertical coordinate of the target string in the second grid diagram; if the third position information of the target string is consistent with the first position information of the encrypted data, rotating the second grid diagram according to a preset angle; extracting the target string from the rotated second grid diagram, and restoring the target string to obtain the encrypted data.
[0057] In this embodiment, after the target string is stored back in the second grid diagram according to the row position information of the first grid diagram, the second grid diagram is established as the same coordinate system as the first grid diagram according to the method of the above embodiment, the position information of the target string in the second grid diagram is obtained, and the coordinates of the same data in the second grid diagram are compared with the coordinates of the first grid diagram before rotation to determine whether the insertion is correct. After confirmation, the second grid diagram is rotated in the opposite direction of the rotation direction of the first grid diagram according to the preset angle in the secret key and the target string is extracted and restored; for example, in the above embodiment, the first grid diagram is rotated 90° clockwise, and the second grid diagram should be rotated 90° counterclockwise, and the data in the second grid diagram after successful rotation is extracted in a clockwise order from outside to inside (the same as the insertion order) to obtain a complete Base64 data (i.e., the target string). The Base64 data is restored to obtain MD5 encrypted data.
[0058] Figure 5 is a schematic diagram of storing the target string into the rotated grid diagram, such as Figure 5 As shown, they will be Figure 3 The target strings "ZTU2N", "i==ZD", "JW0TL", "WN1AI" and "Y5UTY" obtained in the first grid are stored in the newly created second grid according to the row position of the target strings in the first grid. After confirming that the position information (coordinates) are consistent with the coordinates of the encrypted data, they are rotated counterclockwise according to a given angle (preset angle) and finally the data is restored to obtain the MD5 encrypted data.
[0059] Figure 6 is a structural diagram of a data processing device provided according to an embodiment of the present application, such as Figure 6As shown, the device includes: an encryption module 60, used to obtain original data, and encrypt the original data to obtain encrypted data; a processing module 62, used to determine the first grid diagram, store the encrypted data in the first grid diagram, and rotate the first grid diagram after storing the encrypted data according to a preset angle; a determination module 64, used to determine the position information of the encrypted data, wherein the position information is the position information of the encrypted data in the rotated first grid diagram; a first transmission module 66, used to transmit the target character string, the preset angle and the position information to the decryption end, wherein the target character string is obtained by splicing the data of each row in the rotated first grid diagram; a second transmission module 68, used to determine the secret key of the original data, and transmit the secret key to the decryption end.
[0060] In this embodiment, a device for implementing a data processing method is provided, the device includes a 5G message system using a new storage method, and the data processing method is implemented by the following steps:
[0061] Step 1: Perform MD5 encryption on the original data and convert the encrypted data into Base64 format.
[0062] Step 2: Store the converted data into a multi-square grid one by one in a clockwise manner. The size of the vacant space in the grid is generated by the square of the number of data + 1 after taking the power. If there are vacancies, fill them with 0.
[0063] Step 3: Rotate the multiple square grids clockwise to get a chart with a changed position. Separate the x and y coordinate axes according to the length and width of the chart. Send each data in the chart to the decryption party in the form of coordinate axis punctuation, and send the rotation angle at the same time.
[0064] Step 4: Connect the data of each row of the chart horizontally so that each row has a new string, and send the new string to the decryption party.
[0065] Step 5: Generate a secret key based on the length of the string, the rotation angle, and the coordinates of the original chart and send it to the decryption party.
[0066] Step 6: After the decryption party obtains the string, it determines the size of the chart based on the maximum value of the coordinate axis and generates a new blank multi-square grid chart with the same length and width as the original one.
[0067] Step 7: The decryption party stores the obtained string back into the table row by row, compares the coordinate axis to determine whether the insertion is correct, and after confirmation, rotates the obtained rotation angle counterclockwise.
[0068] Step 8: Extract the multiple square grid chart data after successful rotation in a clockwise order from outside to inside (the same as the insertion order) to obtain a complete Base64 data.
[0069] Step 9: Restore the Base64 data to get the original MD5 encrypted data.
[0070] Since the new data encryption method in the device includes multiple square grid permutation and MD5 to Base64 encoding dual encryption, the method can effectively improve the security of the overall system during use. Ultimately, the drawbacks of traditional encryption methods are avoided. Since the algorithm is a reversible data formatting operation based on multiple square grid permutations, permutation encryption is performed according to the characteristics of multiple square grids, and then the structure obtained after further encryption is reversible to the original data, compared with existing encryption technology, the data security is further improved, and at the same time, the encrypted data has a stronger anti-decryption ability.
[0071] An embodiment of the present application further provides a non-volatile storage medium, which includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above data processing method.
[0072] The above-mentioned non-volatile storage medium is used to store programs that perform the following functions: obtain original data, and encrypt the original data to obtain encrypted data; determine the first grid diagram, store the encrypted data in the first grid diagram, and rotate the first grid diagram after storing the encrypted data according to a preset angle; determine the position information of the encrypted data, wherein the position information is the position information of the encrypted data in the rotated first grid diagram; transmit the target character string, the preset angle and the position information to the decryption end, wherein the target character string is obtained by splicing the data of each row in the rotated first grid diagram; determine the secret key of the original data, and transmit the secret key to the decryption end.
[0073] An embodiment of the present application further provides a processor, which is used to run a program stored in a memory, wherein the above data processing method is executed when the program is run.
[0074] The above-mentioned processor is used to run a program that performs the following functions: obtain original data, and encrypt the original data to obtain encrypted data; determine the first grid diagram, store the encrypted data in the first grid diagram, and rotate the first grid diagram after storing the encrypted data according to a preset angle; determine the position information of the encrypted data, wherein the position information is the position information of the encrypted data in the rotated first grid diagram; transmit the target character string, the preset angle and the position information to the decryption end, wherein the target character string is obtained by splicing the data of each row in the rotated first grid diagram; determine the secret key of the original data, and transmit the secret key to the decryption end.
[0075] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0076] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0077] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0078] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0079] In addition, each functional unit in each embodiment of the present application 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.
[0080] 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 application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several 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 application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0081] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A data processing method, characterized in that: include: Acquire original data, and encrypt the original data to obtain encrypted data; Determine a first grid diagram, store the encrypted data in the first grid diagram, and rotate the first grid diagram after storing the encrypted data according to a preset angle, wherein determining the first grid diagram includes: determining the number of grids in the first grid diagram according to the number of the encrypted data, wherein the number of grids is greater than or equal to the number of the encrypted data; performing a square root operation on the number value of the encrypted data to obtain a square root result; increasing the square root result by a preset value, determining the square value of the square root result after the preset value is increased, and determining the square value as the size of each grid in the first grid diagram; Determine first position information of the encrypted data, wherein the first position information is position information of the encrypted data in the first grid image after rotation; Transmitting the target character string, the preset angle and the first position information to the decryption end, wherein the target character string is obtained by splicing the data of each row in the rotated first grid image; Determine the secret key of the original data and transmit the secret key to the decryption end.
2. The method according to claim 1, characterized in that Encrypting the original data includes: Acquire target data, and convert the target data into a character string of a preset length, wherein the target data is summary data of the original data; Each character in the character string of the preset length is converted into a printable character, and the target data is represented by the printable character, so as to encrypt the original data.
3. The method according to claim 1, characterized in that Determining the location information of the encrypted data includes: Determine a coordinate axis and the origin of the coordinate axis, and determine a grid for storing the encrypted data; Determine the distance between the side representing the length of the grid and the origin as the horizontal coordinate of the position information; The distance between the side representing the width of the grid and the origin of the coordinate axis is determined as the ordinate of the position information.
4. The method according to claim 1, characterized in that Determining the secret key of the original data includes: Acquire the length of the encrypted data and second position information of the encrypted data, wherein the second position information is position information of the encrypted data in the first grid before rotation; The secret key is generated according to the length of the encrypted data, the preset angle and the second position information of the encrypted data.
5. A data processing method, characterized in that: Also includes: Receiving a target character string and a secret key transmitted by the data processing method according to any one of claims 1 to 4, wherein the secret key includes: location information of the encrypted data and a preset angle, and the location information of the encrypted data includes: the horizontal coordinate of the encrypted data in the first grid diagram, and the vertical coordinate of the encrypted data in the first grid diagram; The target character string is processed using the secret key to obtain the encrypted data.
6. The method according to claim 5, characterized in that Processing the target character string using the secret key includes: Determine the abscissa with the largest value and the ordinate with the largest value; Creating a second grid diagram using the horizontal coordinate with the largest value and the vertical coordinate with the largest value, wherein the length of the second grid diagram is equal to the length of the first grid diagram, and the width of the second grid diagram is equal to the width of the first grid diagram; The row position of the target character string in the first grid diagram is obtained, and the target character string is stored in the second grid diagram according to the row position of the target character string in the first grid diagram.
7. The method according to claim 6, characterized in that After storing the target character string in the second grid diagram according to the row position of the target character string in the first grid diagram, the method further includes: Acquire third position information of the target character string, wherein the third position information includes: a horizontal coordinate of the target character string in the second grid diagram, and a vertical coordinate of the target character string in the second grid diagram; If the third position information of the target character string is consistent with the first position information of the encrypted data, rotating the second grid image according to the preset angle; The target character string is extracted from the rotated second grid image, and the target character string is restored to obtain the encrypted data.
8. A data processing device, characterized in that: include: An encryption module, used to obtain original data and encrypt the original data to obtain encrypted data; A processing module, used to determine a first grid diagram, store the encrypted data in the first grid diagram, and rotate and store the first grid diagram after the encrypted data is stored according to a preset angle, wherein determining the first grid diagram includes: determining the number of grids in the first grid diagram according to the number of the encrypted data, wherein the number of grids is greater than or equal to the number of the encrypted data; performing a square root operation on the number value of the encrypted data to obtain a square root result; increasing the square root result by a preset value, determining the square value of the square root result after the preset value is increased, and determining the square value as the size of each grid in the first grid diagram; A determination module, configured to determine position information of the encrypted data, wherein the position information is position information of the encrypted data in the first grid image after rotation; A first transmission module, used to transmit a target character string, the preset angle and the position information to a decryption end, wherein the target character string is obtained by splicing the data of each row in the rotated first grid image; The second transmission module is used to determine the secret key of the original data and transmit the secret key to the decryption end.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the data processing method according to any one of claims 1 to 7.
10. A processor, characterized in that: The processor is used to run a program stored in a memory, wherein the program executes the data processing method according to any one of claims 1 to 7 when running.
Citation Information
Patent Citations
User data encryption method and device
CN103795547A
Table information extraction method and device and storage medium
CN114463765A