Data encryption method
By judging the number and positional characteristics of letter characters during the data encryption process and adopting flexible encryption methods, the problem of insufficient data encryption security in existing technologies is solved, achieving higher data security and a more difficult-to-crack effect.
Patent Information
- Application Number
- CN202411256805.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-09-09
AI Technical Summary
Existing technologies for data encryption are not secure enough and cannot effectively protect the integrity and privacy of data.
By determining the number of letter characters in the data to be encrypted, encryption or non-encryption is performed based on different conditions. Complex encryption methods are used to generate encrypted data that is difficult to crack by utilizing the number and position characteristics of letter characters.
It improves the security of data encryption, making it difficult to infer whether the processed data is encrypted or the original data, thus enhancing data protection capabilities.
Smart Images

Figure CN119232432B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of Internet, and particularly relates to a data encryption method. BACKGROUND
[0002] Data security is the most basic and important part of information security, and data security transmission is of great significance to the protection of personal information security and the maintenance of personal legal rights and interests. Therefore, encrypting data is a common method in the data packet transmission process.
[0003] The related art usually encrypts all data by using a fixed encryption method, and has the problem of poor security of data encryption. SUMMARY
[0004] The embodiments of the application provide a data encryption method, which can solve the problem of poor security of data encryption in the related art.
[0005] In a first aspect, the embodiments of the application provide a data encryption method, comprising:
[0006] obtaining first data to be encrypted;
[0007] obtaining the number of letter characters from the first data;
[0008] in a case where the number of letter characters in the first data meets a first condition, performing encryption processing on the first data to obtain second data, and taking the second data as encrypted data;
[0009] in a case where the number of letter characters in the first data meets a second condition, taking the first data as non-encrypted data.
[0010] In a second aspect, the embodiments of the application provide an electronic device, which comprises a processor and a memory, the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the method according to the first aspect.
[0011] In a third aspect, the embodiments of the application provide a computer readable storage medium, which stores programs or instructions, and the programs or instructions are executed to implement the steps of the method according to the first aspect.
[0012] In a fourth aspect, the embodiments of the application provide a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the method according to the first aspect.
[0013] The above at least one technical solution provided by the embodiments of the application can achieve the following technical effects:
[0014] In the embodiment of the present application, the first data to be encrypted is acquired; the number of letter characters in the first data is acquired; in the case where the number of letter characters in the first data meets a first condition, the first data is encrypted to obtain second data, and the second data is taken as encrypted data; in the case where the number of letter characters in the first data meets a second condition, the first data is taken as non-encrypted data. In this way, when the first data is encrypted, the first data can be encrypted based on the number of letter characters in the first data. Specifically, in the case where the number of letter characters meets the first condition, the first data is encrypted to obtain the second data, and in the case where the number of letter characters meets the second condition, the first data is directly taken as non-encrypted data. This way determines whether the first data is encrypted or not through the number of letter characters in the first data itself, and it is difficult to infer whether the processed first data is encrypted data or original data, and it is even more difficult to be cracked, thereby improving the security of the data and solving the problem of poor security of data encryption in the related art. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced as follows. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0016] Figure 1 is a flowchart of a data encryption method provided by an embodiment of the present application;
[0017] Figure 2 is a flowchart of another data encryption method provided by an embodiment of the present application;
[0018] Figure 3-1 is a schematic diagram of an example of a data encryption provided by an embodiment of the present application;
[0019] Figure 3-2 is a schematic diagram of another example of a data encryption provided by an embodiment of the present application;
[0020] Figure 4 is a flowchart of another data encryption method provided by an embodiment of the present application;
[0021] Figure 5 is a schematic diagram of a data storage provided by an embodiment of the present application;
[0022] Figure 6 is a specific flowchart of a data encryption method provided by an embodiment of the present application;
[0023] Figure 7 is a structural block diagram of a data encryption device provided by an embodiment of the present application;
[0024] Figure 8 is a structural block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of them. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0026] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually a category and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the front and rear associated objects are in an "or" relationship.
[0027] Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0028] The data encryption method provided by the embodiments of the present application can be executed by a target device, wherein the target device can be an electronic device or multiple electronic devices. That is, the data encryption method provided by the embodiments of the present application can be executed by an electronic device, wherein the electronic device can be an embedded single-chip microcomputer, or a terminal device such as a desktop computer, a notebook computer, a mobile phone, a tablet computer, or a server such as a physical server, a server cluster composed of multiple servers, and a cloud server capable of cloud computing. In the case where the data encryption method provided by the embodiments of the present application is executed by multiple electronic devices, the multiple electronic devices can form a service cluster, and they cooperate with each other to complete each step.
[0029] The data encryption method provided in the embodiments of the present application is applied to a data encryption scenario, in particular, to a scenario of encrypting data when data packets are transmitted. Specifically, the number of letter characters in first data to be encrypted is obtained, the first data is encrypted when the number of letter characters meets a first condition, and the first data is taken as non-encrypted data when the number of letter characters meets a second condition.
[0030] The data encryption method provided in the embodiments of the present application will be described in detail below with reference to specific embodiments and application scenarios.
[0031] Please refer to Figure 1 , Figure 1 is a flowchart of a data encryption method provided in the embodiments of the present application. As shown in Figure 1 , the method comprises the following steps:
[0032] Step 110: Obtain first data to be encrypted.
[0033] In the embodiments of the present application, the first data can comprise a plurality of characters, and the plurality of characters can comprise letter characters, for example, the first data can be 0101AB1100. The first data can be profile data of a target user, wherein a profile is a set of settings and permissions, used to indicate operations that a user is authorized to perform. By reasonably configuring the profile data, the user access permission can be effectively managed, and unauthorized user access and data leakage can be avoided.
[0034] Since in actual implementation processes, the data to be processed is not necessarily related to letter characters, for example, if the data to be processed is binary data or octal data, only numerical characters can appear in the data to be processed. For this scenario, the data to be processed can be processed first to obtain the first data related to letter characters.
[0035] Exemplarily, in one embodiment of the present application, in the process of obtaining the first data to be encrypted in step 110, the following manner can be referred to: obtain data to be processed; perform multi-ary conversion on the data to be processed to obtain target data in a target base, the target base being a base greater than the decimal base, the target data comprising at least one of numerical characters and letter characters; and determine the target data as the first data to be encrypted.
[0036] In the embodiment of the present application, considering that there may be letter characters in data of a base greater than 10, for example, letter character A may appear in data of base 11, and letter characters ABCDEF may appear in data of base 16, the base converter can be used to convert the data to be processed into target data of a target base greater than 10. After the multi-base conversion, not only data but also letters may be generated in the data to be processed. The target data is determined as the first data to be encrypted, and since the first data is data of the target base, the first data includes at least one of a numeric character and a letter character.
[0037] In combination with a specific example, the data to be processed can be octal data 777600, and the data to be processed can be converted into hexadecimal target data 3FF80, that is, the first data can be 3FF80. At this time, two letter characters appear in the first data, and the letter characters can be used for subsequent encryption of the first data.
[0038] In the embodiment of the present application, a natural way of generating letter characters is provided, and the way does not change the essential content of the data to be processed, and can be used to assist subsequent encryption of the first data by using letter characters.
[0039] In an embodiment of the present application, the data to be processed in the above embodiment is a group of data in M pieces of data, and the data amount of each piece of data in the M pieces of data is the same.
[0040] In the embodiment of the present application, the M pieces of data are profile data of a target user. In fact, when the profile data of the target user is obtained, the profile data of the target user can include a plurality of different types of data, and each type of data can include a plurality of groups of data. Therefore, after the profile data of the target user is obtained, the profile data can be classified according to data types, and each type can include a plurality of groups of data of the same type. At the same time, the data amount of each group of data in each type can be obtained.
[0041] In the embodiment of the present application, for a group of data in a type, considering that the data amount of a group of data can be large, the group of data can be segmented first. When the data is segmented, a uniform segmentation method can be used. That is, according to actual requirements (the data amount of each piece of data after data segmentation can be preset), a group of data is divided into M pieces of data, and one piece of data is selected as the data to be processed. For example, 32 KB of data can be divided into 8 pieces of data, and the data amount of each piece of data is 4 KB.
[0042] In the embodiment of the present application, since the to-be-processed data is obtained by uniform segmentation, the data amount of the to-be-processed data is guaranteed to be the same, and subsequent data storage can be facilitated.
[0043] Step 120: obtaining the number of letter characters from the first data.
[0044] In the embodiment of the present application, the letter characters can be determined from the plurality of characters contained in the first data, and the number of letter characters is obtained. For example, the first data is 0101AB1100, and the number of letter characters in the first data is 2.
[0045] Step 130: in the case where the number of letter characters in the first data satisfies a first condition, performing encryption processing on the first data to obtain second data, and taking the second data as encrypted data.
[0046] In the embodiment of the present application, the first condition can be that the number of letter characters is greater than a preset threshold. That is, in the case where the number of letter characters in the first data is greater than the preset threshold, the first data is subjected to encryption processing to obtain second data, and the second data is taken as encrypted data.
[0047] Step 140: in the case where the number of letter characters in the first data satisfies a second condition, taking the first data as non-encrypted data.
[0048] In the embodiment of the present application, the first condition and the second condition can be mutually exclusive, that is, in the case where the number of letter characters satisfies the first condition, the second condition is not satisfied; in the case where the number of letter characters satisfies the second condition, the first condition is not satisfied. The second condition can be that the number of letter characters is less than or equal to a preset threshold. That is, in the case where the number of letter characters in the first data is less than or equal to the preset threshold, the first data is not subjected to encryption, and the first data is directly taken as non-encrypted data.
[0049] Alternatively, in the process of determining whether to encrypt the first data in step 130 and step 140, the parity of the number of letter characters in the first data can also be determined to determine whether to encrypt the first data.
[0050] Exemplarily, in one embodiment of the present application, the first condition is that the number of letter characters is not 0 and is even, and the second condition is that the number of letter characters is 0 or odd.
[0051] In the embodiment of the present application, if the number of letter characters in the first data is not 0 and is even, the first data is encrypted to obtain second data, and the second data is taken as encrypted data. If the number of letter characters in the first data is 0 or odd, the first data is not encrypted, and the first data is taken as non-encrypted data.
[0052] Taking specific examples, the first data is A001001101B0B01, the number of letter characters in the first data is 3, that is, the number of letter characters in the first data satisfies the second condition, the first data can not be encrypted, and the first data is directly marked as non-encrypted data. In another example, the first data is A001001101B0001, the number of letter characters in the first data is 2, that is, the number of letter characters in the first data satisfies the first condition, the first data is encrypted to obtain second data, and the second data is marked as encrypted data.
[0053] In the embodiment of the present application, whether the first data is encrypted is determined by judging the parity of the number of letter characters in the first data. Since the parity of the number of letter characters in the first data is the original data characteristic of the first data, rather than artificially controlled, the entire encryption process is more complex, and the security of data encryption is improved.
[0054] In the embodiment of the present application, the first data to be encrypted is obtained, the number of letter characters in the first data is obtained, the first data is encrypted to obtain second data in a case where the number of letter characters in the first data satisfies the first condition, and the second data is taken as encrypted data. In a case where the number of letter characters in the first data satisfies the second condition, the first data is taken as non-encrypted data. In this way, when the first data is encrypted, the first data can be encrypted based on the number of letter characters in the first data. Specifically, in a case where the number of letter characters satisfies the first condition, the first data is encrypted to obtain second data, and in a case where the number of letter characters satisfies the second condition, the first data is directly taken as non-encrypted data. This way determines whether the first data is encrypted by the number of letter characters in the first data itself, it is difficult to infer from the processed first data whether it is encrypted data or original data, and it is even more difficult to be cracked, improving the security of data and solving the problem of poor security of data encryption in the related art.
[0055] The embodiment of the present application provides a method for encrypting first data by letter characters in the first data. Please refer to Figure 2 , Figure 2 is a flowchart of another data encryption method provided by the embodiment of the present application. As Figure 2As shown, the method comprises the following steps:
[0056] Step 210: obtaining first data to be encrypted, the first data comprising N characters.
[0057] For example, the first data is A001001101B0B01, which comprises 15 characters.
[0058] Step 220: obtaining the number of alphabetical characters from the first data.
[0059] Step 230: obtaining a first position number in the case that the number of alphabetical characters in the first data satisfies a first condition, the first position number being the position number of the first alphabetical character in the N characters, the first condition comprising that the number of alphabetical characters in the first data is not 0.
[0060] In the embodiments of the present application, the N characters of the first data can be numbered in advance, for example, in the manner of 1, 2, 3, …, n. Since the number of alphabetical characters in the first data is not 0, there is an alphabetical character in the N characters, the first alphabetical character in the N characters can be determined from left to right, and the position number of the alphabetical character can be obtained.
[0061] In combination with a specific example, the first data is A001001101B0B01, and the 15 characters of the first data are numbered in order from left to right (1-15), the position number of the first alphabetical character in the first data being 1.
[0062] Step 240: performing reverse processing on the N characters of the first data to obtain second data in the case that the first position number is a specified number value.
[0063] In the embodiments of the present application, the specified number value can be the position number of the first character in the N characters. Specifically, when the N characters are numbered in order (1, 2, 3, …), the specified number can be 1. In the case that the first position number is the specified number value, that is, the first character in the N characters is an alphabetical character, the N characters of the first data are processed in reverse to obtain second data, and the second data is taken as encrypted data.
[0064] In combination with an example, the first data is A001001101B0B01, and the specified number value is 1. The first position number of the first alphabetical character determined from the first data is 1, that is, the first position number is the specified number, and all 15 characters of the first data are processed in reverse to obtain second data, the second data being 10B0B101100100A.
[0065] Step 250: in the case that the first position number is not the designated number value, performing encryption processing on the first data based on the parity of the first position number to obtain second data, and taking the second data as the encrypted data.
[0066] In the embodiments of the present application, in the case that the first position number is not the designated number value, that is, the first character in the N characters is not an alphabetical character, the parity of the first position number can be further determined, and the first data can be encrypted based on the parity of the first position number.
[0067] For example, in the case that the first position number is an odd number, all alphabetical characters with odd position numbers in the N characters can be processed in reverse order to obtain second data, and the second data can be taken as the encrypted data; in the case that the first position number is an even number, all alphabetical characters with even position numbers in the N characters can be processed in reverse order to obtain second data, and the second data can be taken as the encrypted data.
[0068] Alternatively, the following method can also be used. For example, in the case that the first position number is not the designated number value in step 250, the following method can also be used in the process of performing encryption processing on the first data based on the parity of the first position number: in the case that the first position number is a first number value, a target character is obtained, the target character being all designated characters in the N characters with position numbers before the first position number; the target character is processed in reverse order; in the case that the first position number is a second number value, a second position number is obtained, the second position number being the position number at which the last alphabetical character is located in the N characters; all designated characters in the N characters with position numbers between the first position number and the second position number are processed in reverse order; wherein the first number value is one of odd and even, and the second number value is the other of odd and even.
[0069] In the embodiments of the present application, in the case that the first number value is odd, the second number value is even. In the case that the first number value is even, the first number value is odd. The first case (the first number value is odd and the second number value is even) will be taken as an example for detailed description.
[0070] In the embodiment of the present application, when the first position number is odd, all specified characters before the first position number in the N characters are obtained, the specified characters can include at least one of a numeric character, a letter character and other characters, the other characters are characters in the N characters except the numeric character and the letter character, and the specified characters are processed in reverse order to obtain the second data.
[0071] Referring to Figure 3-1 , Figure 3-1 is a schematic diagram of one example of data encryption provided by the embodiment of the present application. As shown in the example of Figure 3-1 , the first data is 0100A0B00C11A, the specified character is a numeric character, the first position number of the first letter in the first data is 5, that is, the condition that the first position number is odd is met, all numeric characters before the first letter, that is, 0100, are obtained, and after the specified characters are processed in reverse order, 0010 is obtained, so that the second data is 0010A0B00C11A.
[0072] When the first position number is even, the second position number of the last letter character in the N characters is obtained, and all specific characters between the first position number and the second position number in the first data can be determined, the specific characters can include at least one of a numeric character, a letter character and other characters, and the specified characters are processed in reverse order to obtain the second data. The specific characters can be the same as or different from the specified characters, for example, the specific characters can include a numeric character and other characters, and the specified characters can include a numeric character.
[0073] Referring to Figure 3-2 , Figure 3-2 is a schematic diagram of another example of data encryption provided by the embodiment of the present application. As shown in Figure 3-2 , the first data is 010A01100B10, the specific characters include a numeric character and other characters, the first position number of the first letter in the first data is 4, that is, the condition that the first position number is even is met, the second position number of the last letter in the first data is obtained, the second position number is 10, and all numeric characters and other characters between 4 and 10 in the first data, that is, 01100, are obtained, and after the specific characters are processed in reverse order, 00110 is obtained, so that the second data is 010A00110B10.
[0074] It should be noted that the above examples introduce the specified character as a numeric character and the specific character as other characters. In fact, the specified character can also be a letter character, or the specified character can also be other characters (such as +, -, and the like), or the specified character can also be a letter character and a numeric character, and the like, which is not limited here. The specific character can also be a letter character, or the specific character can also be other characters (such as +, -, and the like), or the specific character can also be a letter character and other characters, and the like, which is not limited here.
[0075] In the embodiment of the present application, a specific implementation manner of encrypting the first data based on the parity of the first position number is provided, which improves the complexity of data encryption, and the parity of the first position number is a data feature of the first data itself, that is, the entire encryption process is determined according to the content of the first data, and as the content of the first data changes, the encryption manner will also change, which is more difficult to be cracked and has better data security.
[0076] In the embodiment of the present application, in the process of encrypting the first data to obtain encrypted data, a decryption template corresponding to the encrypted data can be generated and stored, so that when a user accesses the first data later, the encrypted data can be decrypted according to the decryption template to realize access to the first data.
[0077] Step 260: In the case where the number of letter characters in the first data meets a second condition, the first data is taken as non-encrypted data.
[0078] In the embodiment of the present application, in the case where it is determined that the number of letter characters in the first data is not 0 and is even, the first data is encrypted by further determining whether the first position number of the first letter is the specified number value, which completely depends on the data content of the first data itself, and as the content of the first data changes, the encryption manner will also change, which is not fixed and is difficult to be cracked, and has better data security.
[0079] Since the data is processed and then stored, the embodiment of the present application provides a method for storing the processed data, please refer to Figure 4 . Figure 4 is a flowchart of another data encryption method provided by the embodiment of the present application. As shown in Figure 4 , the method comprises the following steps:
[0080] Step 410: Obtain first data to be encrypted.
[0081] In the embodiment of the present application, the first data can be data obtained by performing a multi-ary conversion on to-be-processed data, and the to-be-processed data can be data obtained by uniformly dividing a group of data in a user profile data of a specified type.
[0082] Step 420: obtaining the number of alphabetic characters from the first data.
[0083] Step 430: in the case that the number of alphabetic characters in the first data satisfies a first condition, performing an encryption process on the first data to obtain second data, and taking the second data as encrypted data.
[0084] Step 440: in the case that the number of alphabetic characters in the first data satisfies a second condition, taking the first data as non-encrypted data.
[0085] Step 450: storing the encrypted data to a first storage space.
[0086] In the embodiment of the present application, when storing the encrypted data, the storage can be performed respectively for different types of user profile data. Specifically, when storing user profile data of a specified type, since the user profile data of the specified type can have multiple groups, and each group of data can include M pieces of data obtained by uniform division, the storage can be performed once for user profile data of one type after encryption, and considering that the user profile data of one type includes a large amount of data, the data can be classified first.
[0087] Specifically, the multiple groups of data of the specified type are classified according to the parity of the data amount, into odd capacity data and even capacity data, and the odd capacity data and the even capacity data are stored respectively. Since the storage manners of the odd capacity data and the even capacity data are the same, the storage of the odd capacity data will be introduced below, and the storage manner of the even capacity data can refer to the storage manner of the odd capacity data, and the encrypted data in the even capacity data is also stored to the first storage space, and the non-encrypted data is stored to the second storage space, which will not be described herein.
[0088] Here, the data amount and the capacity are the same concept, for example, the data of 4 kb has a capacity and a data amount of 4 kb. The data amount size and the capacity value are used to describe the specific numerical size, for example, the data amount size and the capacity value of the data of 4 kb are both 4. The odd capacity data is data with an odd data amount size, and the even capacity data is data with an even data amount size.
[0089] Reference can be made to Figure 5 , Figure 5 is a schematic diagram of data storage provided by the embodiment of the present application. As shown in Figure 5As shown, for odd capacity data, odd encrypted data packet a1 can be stored to the first storage space, and odd non-encrypted data packet a2 can be stored to the second storage space. For even capacity data, even encrypted data packet b1 can be stored to the first storage space, and even non-encrypted data packet b2 can be stored to the second storage space.
[0090] It should be noted that since data encryption processing can cause data capacity to change, the above process of classifying multiple groups of data can be performed before encryption processing, and the storage process can be performed after encryption processing.
[0091] In an embodiment of the present application, in the process of storing the encrypted data to the first storage space in step 450, the following storage method can be used: obtaining the total number of the encrypted data; in the case that the total number of the encrypted data is odd, storing a first number of the encrypted data as a group to the first storage space; in the case that the total number of the encrypted data is even, storing a second number of the encrypted data as a group to the first storage space.
[0092] In an embodiment of the present application, the storage of odd capacity data is described, all odd capacity data in multiple groups of data of a specified type can be obtained, and all encrypted data and the total number of the encrypted data can be obtained therefrom.
[0093] After obtaining the total number of the encrypted data, the parity of the total number of the encrypted data is determined. In the case that the total number of the encrypted data is odd, a first number of encrypted data (for example, 2 encrypted data) can be selected from the encrypted data as a group to obtain multiple groups of results containing the first number of encrypted data, and each of the multiple groups of results can be stored to the first storage space. Here, the first number of encrypted data as a group means that the first number of encrypted data is stored in a bundle, and the bundled data is stored to the first storage space.
[0094] In the case that the total number of the encrypted data is even, a second number of encrypted data can be selected from the encrypted data as a group to obtain multiple groups of results containing the second number of encrypted data, and each of the multiple groups of results can be stored to the first storage space. It should be noted that the quantity relationship between the first number and the second number is not limited, the first number can be equal to the second number, the first number can be less than the second number, and the first number can be greater than the second number.
[0095] In actual implementation, multiple encrypted data can be numbered first, for example, numbered in the manner of 1, 2, 3,..., n. In subsequent grouping, a first number of encrypted data can be obtained from the multiple data in the order of numbering.
[0096] In combination with a specific example, the preset first number is 3, and the preset second number is 2. If the total number of encrypted data is 13, that is, the total number of encrypted data is odd, the encrypted data numbered 1, 2 and 3 is a group, and the encrypted data numbered 4, 5 and 6 is a group, so that the 13 encrypted data is stored in groups. If the total number of encrypted data is 14, that is, the total number of encrypted data is even, the encrypted data numbered 1 and 2 is a group, and the encrypted data numbered 3 and 4 is a group, so that the 14 encrypted data is stored in groups.
[0097] In the embodiment of the present application, by means of data grouping storage, when actually accessing data, multiple data can be read at a time, so as to reduce the number of times of reading data from the storage space and the reading time.
[0098] Step 460: storing the non-encrypted data into the second storage space.
[0099] In the embodiment of the present application, the storage space can be divided to obtain the first storage space and the second storage space. For encrypted data and non-encrypted data, the encrypted data and the non-encrypted data can be stored separately, that is, the encrypted data is stored in the first storage space, and the non-encrypted data is stored in the second storage space.
[0100] In an embodiment of the present application, in the process of storing the non-encrypted data into the second storage space in step 460, the following storage method can be used: obtaining the total number of the non-encrypted data; obtaining the value of the unit digit in the data size value of the non-encrypted data; in the case that the value of the unit digit is greater than or equal to the total number of the non-encrypted data, the non-encrypted data of a third number is stored as a group in the second storage space; wherein the third number is less than or equal to the total number of the non-encrypted data; in the case that the value of the unit digit is less than the total number of the non-encrypted data, the non-encrypted data numbered odd from all the non-encrypted data is stored as a group in the second storage space, and the non-encrypted data numbered even is stored as a group in the second storage space.
[0101] In the embodiment of the present application, all odd capacity data in multiple groups of data of a specified type can be obtained, and all non-encrypted data can be obtained therefrom. Since the non-encrypted data comes from multiple groups of data, each group of data in the multiple groups of data can be stored. Specifically, all non-encrypted data in a group of data and the total number of non-encrypted data are obtained. All non-encrypted data are numbered, for example, numbered in the manner of 1, 2, 3,..., n.
[0102] Meanwhile, a capacity value (a data size value) of all the non-encrypted data in the group of data is obtained. Since all the non-encrypted data comes from the group of data, and all the non-encrypted data is obtained by equal division, the capacity value of all the non-encrypted data is the same.
[0103] Based on the capacity value of all the non-encrypted data, a unit value of the capacity value is obtained. In a case where the unit value is greater than or equal to the total number of the non-encrypted data, the third number can be equal to the total number of the non-encrypted data, that is, all the non-encrypted data is stored together. The third number can also be less than the total number of the non-encrypted data, for example, the total number of the non-encrypted data is 6, and the third number can be 3, that is, the 6 pieces of non-encrypted data can be stored in groups according to the manner of 1, 2, 3 as a group, and 4, 5, 6 as a group.
[0104] In a case where the unit value is less than the total number of the non-encrypted data, all the non-encrypted data can be stored in groups according to the parity of the number of the non-encrypted data. Specifically, all the non-encrypted data with odd number of the number is taken as a group, and all the non-encrypted data with even number of the number is taken as a group, and the two groups are stored in the second storage space.
[0105] In combination with examples, the unit value is 5, and the total number of the non-encrypted data is 10 (the numbers are 1-10), at this time, since the unit value is less than the total number of the non-encrypted data, the 10 pieces of non-encrypted data can be stored in groups according to the manner of 1, 3, 5, 7, 9 as a group, and 2, 4, 6, 8, 10 as a group. In another example, the unit value is 8, the total number of the non-encrypted data is 4, and the preset third number is 4, then the 4 pieces of non-encrypted data are stored together in the second storage space.
[0106] In an embodiment of the present application, the first storage space in the above-mentioned step 450 and step 460 is located on a first physical node, the second storage space is located on a second physical node, and the first physical node and the second physical node are different.
[0107] In an embodiment of the present application, the first storage space and the second storage space are located on different physical nodes. By storing the data separately on two different storage nodes, it is possible to prevent all data from being inaccessible due to failure of a storage node, and it is possible to avoid the problem of data loss or access delay caused by single point failure.
[0108] In an embodiment of the present application, after the storage of all the profile data of the user is completed, the profile data can be used for subsequent access by the user. When the user accesses the profile data, the user can be authenticated. The specific authentication manner is as follows:
[0109] Identity information of the access user is acquired and verified, wherein the identity information includes an account and a password. In a case where the identity information of the access user is verified, the access user is further subjected to verification of a verification code, which is a combination code of letters and numbers. In the process of verifying the verification code of the access user, the verification code can be sent to a user terminal of the access user, and the access user can input the verification code received by the user terminal for secondary verification.
[0110] In a case where the identity information of the access user is not verified, the access of the access user is prohibited, and the access user can have multiple (for example, three) opportunities for identity verification. In a case where the access user still has an opportunity for identity verification, the access user can check whether the identity information is incorrect and modify the access information. Once the multiple opportunities for identity verification of the access user are all failed, the access user cannot access again within a set time (30 minutes). If the access user still wants to access, the access user can consider modifying the password through a mobile phone number bound to the account and then performing identity verification.
[0111] In a case where the secondary verification of the access user is passed, access permission of the access user and an access level of access data are acquired to determine whether the access user has permission to access and modify the access data. Specifically, the access permission of the user can be divided into three levels, and the access permission decreases from the first level to the third level. The access level of the access data can also be divided into three levels, and the access level decreases from the first level to the third level. Whether the access user has permission to access and modify the access data can be determined by the access permission of the access user and the access level of the access data.
[0112] In combination with examples, if the access level of the access user is the first level and the access level of the access data is the second level, the access user has permission to access the access data. If the access level of the access user is the third level and the access level of the access data is the second level, the access user does not have permission to access the access data.
[0113] In the embodiment of the present application, the encrypted data and the non-encrypted data are stored separately, the encrypted data is stored in the first storage space, and the non-encrypted data is stored in the second storage space. The processed first data can be stored in different storage spaces, and the encrypted data and the non-encrypted data can be managed separately.
[0114] The following specific embodiments are provided in the embodiment of the present application to further describe the data encryption method. The embodiment includes the following steps.
[0115] Step one: obtain the profile data of the user, and obtain the corresponding data type and data capacity. The profile data of the user is classified by data type, and each group of data in each type of data is labeled as i, i.e. i = 1, 2, …, j, and the data capacity corresponding to each group of data is recorded as R i .
[0116] Step two: for each group of data, the data is divided into M parts according to the capacity R i , and M parts of data segmentation package (i.e. the M parts of data mentioned above) are obtained, and then the M parts of data segmentation package are converted by a binary converter. After 16-bit conversion, not only numbers but also letters will be generated in the data.
[0117] Step three: take one of the M parts of data segmentation package as an example for analysis, and record it as the target data package k. Then obtain the number of alphabetic characters and the number of numeric characters after the multi-bit conversion of the target data package k, and record them as L1 and L2 respectively.
[0118] Step four: then, according to the number of alphabetic characters L1 and the number of numeric characters L2 of the target data package k, the encryption processing is carried out, and the specific encryption processing method is as follows:
[0119] Compare and judge the number of alphabetic characters L1 and the number of numeric characters L2, and select the alphabetic character as the standard state, and judge the parity of the number of standard states.
[0120] When the number of standard states corresponding to the target data package k is odd, it is not encrypted, and is recorded as non-encrypted data package. When the number of standard states corresponding to the target data package k is even, it is encrypted, and is recorded as encrypted data package. The specific encryption method is: obtain the first standard state in the encrypted data package, judge the position label of the first standard state, if the position label of the first standard state is 1, the whole reverse processing is carried out on the encrypted data package, if the position label of the first standard state is not 1, the parity of the position label of the first standard state needs to be further judged.
[0121] Combined with examples for analysis, a encrypted data package is A001001101B0B01, and the position of the first standard state is the first position. The encrypted data package after whole reverse processing is 10B0B101100100A.
[0122] If the position number of the first standard state is odd, that is, 3, 5, 7, …, the first standard state is taken as the end point, and all the digital characters before the first standard state are processed in reverse order to generate a new encrypted data packet; if the position number of the first standard state is even, that is, 2, 4, 6, …, the digital characters between the first standard state and the last standard state are processed in reverse order, and an encrypted data packet is generated.
[0123] In combination with actual analysis, one of the data packets to be encrypted is 0100A0B00C11A, and the position number of the first standard state is 5, that is, odd, so that after the reverse processing, 0010A0B00C11A is generated; if the data packet to be encrypted is 010A01100BA0, and the position number of the first standard state is 4, that is, even, then after the reverse processing, 010A00110BA0 is generated.
[0124] The same processing is performed on all data i to obtain the corresponding encrypted data packet. For the obtained encrypted data packet, a corresponding decryption template is generated according to the encryption process, and the system can decrypt the encrypted data packet according to the decryption template when restoring it in the future.
[0125] Step five: store the obtained data. The specific way of storing the data is as follows:
[0126] All data i are classified and processed according to the data capacity to obtain odd capacity data a and even capacity data b, where a = 1, 2, …, x, b = 1, 2, …, v, and a + b = i. Here, the classification according to the capacity means classifying the data i before encryption, and the subsequent storage is for the encrypted data packet formed after encryption. In addition, the storage space can be classified into a first storage space and a second storage space.
[0127] All odd capacity data a are obtained, and the number of all encrypted data packets and the number of unencrypted data packets are obtained, which are denoted as a1 and a2, and a1 = 1, 2, …, f, a2 = 1, 2, …, g, where the number also represents the order of the corresponding encrypted data packet and unencrypted data packet.
[0128] Then, all encrypted data packets a1 are stored in the first storage space. The specific storage method is as follows: it is judged whether the number of encrypted data packets f is odd or even. If it is odd, all encrypted data packets are bundled in groups of three according to the order, and then the bundled data packets are stored in the first storage space; if it is even, all encrypted data packets are bundled in groups of two according to the order, and then the bundled data packets are stored in the first storage space.
[0129] With examples, if the number of encrypted data packets is 13, the number value is odd, then the encrypted data packets are bundled in groups of three in the order of 1, 2, 3, and then stored in the first storage space; if the number of encrypted data packets is 14, the number value is even, then the encrypted data packets are bundled in groups of two in the manner of 1 and 2, and then stored in the first storage space.
[0130] Then all the non-encrypted data packets a2 are stored in the second storage space, and the specific storage manner is: the capacity value corresponding to the non-encrypted data packet is obtained, and the tail value (i.e. the unit value described above) corresponding to the capacity value is obtained. Then the tail value is compared with g, if the tail value is greater than g, all the non-encrypted data packets a2 are bundled and stored in the second storage space; if the tail value is less than a2, all the non-encrypted data packets are grouped and bundled according to the odd and even labels, and stored in the second storage space.
[0131] The storage manner of the even capacity data b is the same, and the encrypted data packets b1 in the even capacity data b are stored in the first storage space, and the non-encrypted data packets b2 are stored in the second storage space.
[0132] With examples, the capacity values of the non-encrypted data packets are all the same, and the capacity values of the single data packets formed by the division are integers. If the tail value of the capacity value is 5 and the number of non-encrypted data packets is 10, the odd label non-encrypted data packets and the even non-encrypted data packets are bundled separately and then stored in the second storage space; if the tail value of the capacity value is 8 and the number of non-encrypted data packets is 4, the 4 non-encrypted data packets are bundled as a whole and then stored in the second storage space.
[0133] After the above data packet encryption and storage are completed, the access user can access the storage space (including the first storage space and the second storage space). When the access user accesses the data, the access user can be identity verified, and the specific manner of identity verification is as follows:
[0134] The identity information of the access user is obtained, and the identity information includes: account, password. If the identity information of the access user is verified successfully, the subsequent verification code verification is performed. If the identity information verification is not successful, the access is prohibited, and the access user has three opportunities for identity verification, when all the three verification opportunities fail, the access user is prohibited from accessing again within 30 minutes, if the user still needs to access, the password can be modified through the bound mobile phone number to perform identity verification.
[0135] When the access user is performing the verification code verification, a verification code can be sent to the access user's bound mobile phone, the verification code being a combination of letters and numbers sent to the user's bound mobile phone, and the access user performing secondary verification by inputting the received verification code.
[0136] After the access user performs the secondary verification and passes, the access right of the access user can be checked to determine whether the access user has the right to access and modify the data. Whether the access user has the right to access the user access data can be determined according to the access level of the access user and the access level of the access user accessing the data. Specifically, the access right of the user and the access level of the access data both include three levels, and the access right or the access level decreases in turn from the first level to the third level. For example, if the access level of the data is two, and the level of the access user is one, the access can be performed, and conversely, if the level of the access user is three, the access cannot be performed.
[0137] Please refer to Figure 6 , Figure 6 is a specific flowchart of a data encryption method provided by the embodiment of the application. As shown in Figure 6 , the method comprises the following steps:
[0138] Step 610: obtaining the to-be-processed data.
[0139] In the embodiment of the application, the to-be-processed data is one of M pieces of data, and the data amount of each piece of data in the M pieces of data is the same.
[0140] Step 620: performing a multi-ary conversion on the to-be-processed data to obtain target data in a target base, the target base being a base greater than the decimal base, and the target data comprising at least one of a numeric character and a letter character.
[0141] Step 630: determining the target data as first data to be encrypted, the first data comprising N characters.
[0142] Step 640: obtaining the number of letter characters from the first data.
[0143] In the embodiment of the application, after obtaining the number of letter characters, it is determined whether the number of letter characters satisfies a first condition or a second condition, the first condition being that the number of letter characters in the first data is not 0 and is even, and the second condition being that the number of letter characters in the first data is 0 or odd. In the case where the number of letter characters satisfies the first condition, the following step 650 is performed, and in the case where the number of letter characters satisfies the second condition, the following step 680 is performed.
[0144] Step 650: obtaining a first position number in a case where the number of letter characters in the first data satisfies a first condition, the first position number being a position number of a first letter character in the N characters, the first condition being that the number of letter characters in the first data is not 0 and is even.
[0145] In the embodiment of the present application, after the first position number is obtained, it is determined whether the first position number is a specified number value, and in a case where the first position number is the specified number value, step 660 is performed, and in a case where the first position number is not the specified number value, step 670 is performed.
[0146] Step 660: performing reverse processing on the N characters of the first data to obtain second data in a case where the first position number is the specified number value.
[0147] Step 670: performing encryption processing on the first data based on the parity of the first position number to obtain second data in a case where the first position number is not the specified number value.
[0148] In the embodiment of the present application, in the process of performing the encryption processing on the first data based on the parity of the first position number in step 670, the following method can be used: in a case where the first position number is a first numerical value, obtaining a target character, the target character being all specified characters in the N characters whose position numbers are before the first position number; performing reverse processing on the target character; in a case where the first position number is a second numerical value, obtaining a second position number, the second position number being a position number of a last letter character in the N characters; performing reverse processing on all specified characters in the N characters whose position numbers are between the first position number and the second position number; wherein the first numerical value is one of odd and even, and the second numerical value is the other of odd and even.
[0149] Step 680: regarding the first data as non-encrypted data in a case where the number of letter characters in the first data satisfies a second condition, the second condition being that the number of letter characters is 0 or odd.
[0150] Step 690: storing the encrypted data to a first storage space and storing the non-encrypted data to a second storage space.
[0151] In the embodiment of the present application, the first storage space is located on a first physical node, the second storage space is located on a second physical node, and the first physical node and the second physical node are different.
[0152] When the encrypted data is stored into the first storage space, the following method can be used: obtaining the total number of the encrypted data; in the case that the total number of the encrypted data is odd, storing a first number of the encrypted data as a group into the first storage space; in the case that the total number of the encrypted data is even, storing a second number of the encrypted data as a group into the first storage space.
[0153] When the non-encrypted data is stored into the second storage space, the following method can be used: obtaining the total number of the non-encrypted data; obtaining the value of the unit digit in the data size value of the non-encrypted data; in the case that the value of the unit digit is greater than or equal to the total number of the non-encrypted data, storing a third number of the non-encrypted data as a group into the second storage space; wherein the third number is less than or equal to the total number of the non-encrypted data; in the case that the value of the unit digit is less than the total number of the non-encrypted data, storing the non-encrypted data with odd number of the total number of the non-encrypted data as a group into the second storage space, and storing the non-encrypted data with even number of the total number of the non-encrypted data as a group into the second storage space.
[0154] In the embodiments of the present application, the first data to be encrypted is obtained; the number of letter characters in the first data is obtained; in the case that the number of letter characters in the first data satisfies a first condition, the first data is encrypted to obtain second data, and the second data is taken as encrypted data; in the case that the number of letter characters in the first data satisfies a second condition, the first data is taken as non-encrypted data. In this way, when the first data is encrypted, the number of letter characters in the first data can be used to encrypt the first data, specifically, in the case that the number of letter characters satisfies the first condition, the first data is encrypted to obtain second data, and in the case that the number of letter characters satisfies the second condition, the first data is taken as non-encrypted data. This way determines whether to encrypt the first data by the number of letter characters in the first data itself, and it is difficult to infer from the processed first data whether it is encrypted data or original data, and it is even more difficult to be cracked, thereby improving the security of the data and solving the problem of poor security of data encryption in the related art.
[0155] It should be understood that, Figures 1 to 6 the explanations of the respective same or corresponding steps in the Figure 1 may be mutually referred to. For example, Figure 2 the explanations of the steps 110 and 120 in the may be applied to the steps 210 and 220 in the
[0156] Meanwhile, it is to be understood that the data encryption method provided by the embodiments of the present application can have the following beneficial effects: first, the present application improves the complexity of data encryption by using diversified encryption methods, further ensures the security of data, and improves the overall security of data. Second, the data is stored in a multi-physical node manner, which can avoid data loss or access delay caused by single point failure. The encrypted data and the non-encrypted data are stored separately during storage, and different ways of bundled storage are performed for different data shares. Targeted storage can facilitate data reading. Third, when the user accesses the data, the user is authenticated, which can protect the user's privacy and prevent data leakage.
[0157] Please refer to Figure 7 , Figure 7 is a structural block diagram of a data encryption device provided by the embodiments of the present application. As Figure 7 shown, the data encryption device 700 provided by the embodiments of the present application includes an acquisition module 710 and an encryption module 720.
[0158] The acquisition module 710 is configured to acquire first data to be encrypted, and acquire the number of letter characters from the first data.
[0159] The encryption module 720 is configured to, in a case where the number of letter characters in the first data meets a first condition, perform encryption processing on the first data to obtain second data, and take the second data as encrypted data; and in a case where the number of letter characters in the first data meets a second condition, take the first data as non-encrypted data.
[0160] In the embodiments of the present application, the first data to be encrypted is acquired, and the number of letter characters in the first data is acquired. In a case where the number of letter characters in the first data meets a first condition, the first data is encrypted to obtain second data, and the second data is taken as encrypted data. In a case where the number of letter characters in the first data meets a second condition, the first data is taken as non-encrypted data. In this way, when the first data is encrypted, the first data can be encrypted based on the number of letter characters in the first data. Specifically, in a case where the number of letter characters meets the first condition, the first data is encrypted to obtain the second data. In a case where the number of letter characters meets the second condition, the first data is directly taken as non-encrypted data. This way determines whether to encrypt the first data by the number of letter characters in the first data itself, which is difficult to infer whether the processed first data is encrypted data or original data, and is even more difficult to be cracked, thereby improving the security of data and solving the problem of poor data encryption security in the related art.
[0161] The data encryption apparatus provided by the embodiments of the present application can implement the various processes implemented by the method embodiments described above. To avoid repetition, the details are not described herein.
[0162] As shown in Figure 8 The electronic device 800 includes a processor 810 and a memory 820. The memory 820 stores programs or instructions, which, when executed by the processor 810, implement the steps of any of the methods described above. For example, when the programs are executed by the processor 810, the following processes are implemented: obtaining first data to be encrypted; obtaining the number of letter characters from the first data; in a case where the number of letter characters in the first data satisfies a first condition, performing encryption processing on the first data to obtain second data, and taking the second data as encrypted data; and in a case where the number of letter characters in the first data satisfies a second condition, taking the first data as non-encrypted data. In this way, when the first data is encrypted, the first data can be encrypted based on the number of letter characters in the first data. Specifically, in a case where the number of letter characters satisfies the first condition, the first data is encrypted to obtain the second data, and in a case where the number of letter characters satisfies the second condition, the first data is taken as non-encrypted data. This way, whether the first data is encrypted or not is determined based on the number of letter characters in the first data itself, it is difficult to infer from the processed first data whether the data is encrypted or not, and it is even more difficult to crack, thereby improving the security of the data and solving the problem of poor security of data encryption in the related art.
[0163] The embodiments of the present application also provide a readable storage medium, which stores programs or instructions. The programs or instructions, when executed by a processor, implement the steps of the various embodiments of the data encryption method and achieve the same technical effects. To avoid repetition, the details are not described herein.
[0164] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0165] The embodiments of the present application further provide a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to execute programs or instructions to implement the various processes of the above method embodiments and achieve the same technical effects. To avoid repetition, the details are not described herein.
[0166] The embodiment of the present application provides a computer program product, the program product is stored in a storage medium, the program product is executed by at least one processor to realize the various processes of the above method embodiment, and the same technical effects can be achieved, and here is not repeated to avoid repetition.
[0167] It should be noted that in this paper, the term "including", "containing" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the sentence "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to the order of the functions shown or discussed, and can also include the functions performed in a substantially simultaneous manner or in the opposite order according to the functions involved, for example, the described method can be performed in an order different from the described order, and various steps can also be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.
[0168] From the above description of the embodiments, those skilled in the art can clearly understand that the above embodiment method can be realized by software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, or network equipment, etc.) execute the method described in each embodiment of the present application.
[0169] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above specific embodiments, and the above specific embodiments are only illustrative, not limiting, and those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the protection scope of the claims.
Claims
1. A data encryption method characterized by, The method comprises: obtaining first data to be encrypted; obtaining the number of letter characters from the first data; in the case where the number of letter characters in the first data meets a first condition, performing encryption processing on the first data to obtain second data, and taking the second data as encrypted data; the first data comprises N characters, and the first condition comprises: the number of letter characters in the first data is not 0; in the case where the number of letter characters in the first data meets a second condition, taking the first data as non-encrypted data; wherein, in the case where the number of letter characters in the first data meets the first condition, performing encryption processing on the first data to obtain second data comprises: obtaining a first position number, the first position number being the position number of the first letter character in the N characters; in the case where the first position number is a specified number value, performing reverse processing on the N characters of the first data to obtain second data; in the case where the first position number is not the specified number value, performing encryption processing on the first data based on the parity of the first position number to obtain second data.
2. The method of claim 1, wherein, The method comprises: obtaining first data to be encrypted; obtaining the number of letter characters from the first data; in the case where the number of letter characters in the first data meets a first condition, performing encryption processing on the first data to obtain second data, and taking the second data as encrypted data; 3. The method of claim 2, wherein, the first data comprises N characters, and the first condition comprises: the number of letter characters in the first data is not 0; 4. The method of claim 1, wherein, in the case where the number of letter characters in the first data meets a second condition, taking the first data as non-encrypted data; 5. The method of claim 1, wherein, wherein, in the case where the number of letter characters in the first data meets the first condition, performing encryption processing on the first data to obtain second data comprises: obtaining a first position number, the first position number being the position number of the first letter character in the N characters; in the case where the first position number is a specified number value, performing reverse processing on the N characters of the first data to obtain second data; in the case where the first position number is not the specified number value, performing encryption processing on the first data based on the parity of the first position number to obtain second data. The method comprises: obtaining first data to be encrypted; obtaining the number of letter characters from the first data; 6. The method according to any one of claims 1 to 5, characterized in that, in the case where the number of letter characters in the first data meets a first condition, performing encryption processing on the first data to obtain second data, and taking the second data as encrypted data; the first data comprises N characters, and the first condition comprises: the number of letter characters in the first data is not 0; in the case where the number of letter characters in the first data meets a second condition, taking the first data as non-encrypted data; 7. The method of claim 6, wherein, wherein, in the case where the number of letter characters in the first data meets the first condition, performing encryption processing on the first data to obtain second data comprises: obtaining a first position number, the first position number being the position number of the first letter character in the N characters; in the case where the first position number is a specified number value, performing reverse processing on the N characters of the first data to obtain second data; in the case where the first position number is not the specified number value, performing encryption processing on the first data based on the parity of the first position number to obtain second data.
8. The method of claim 6, wherein, The method further comprises: storing the encrypted data to a first storage space; storing the non-encrypted data to a second storage space. The first storage space is located on a first physical node, and the second storage space is located on a second physical node; the first physical node and the second physical node are different. The method further comprises: obtaining the total number of shares of the encrypted data; In a case that the total number of the encrypted data is odd, a first number of the encrypted data is stored as a group into the first storage space; In a case that the total number of the encrypted data is even, a second number of the encrypted data is stored as a group into the first storage space.
9. The method of claim 6, wherein, The storing of the non-encrypted data into the second storage space comprises: acquiring a total number of the non-encrypted data; acquiring a value of a unit digit in a data size value of the non-encrypted data; in a case that the value of the unit digit is greater than or equal to the total number of the non-encrypted data, a third number of the non-encrypted data is stored as a group into the second storage space, wherein the third number is less than or equal to the total number of the non-encrypted data; in a case that the value of the unit digit is less than the total number of the non-encrypted data, a number of the non-encrypted data with odd number of the total number of the non-encrypted data is stored as a group into the second storage space, and a number of the non-encrypted data with even number of the total number of the non-encrypted data is stored as a group into the second storage space.
Citation Information
Patent Citations
Data encryption method, data decryption method, terminal and storage medium
CN112311740A
Data storage method and system based on image recognition
CN114329012A