Data encryption method

By using the number of alphabetic characters in data encryption to determine the encryption process, the problem of insufficient security of data encryption in the prior art is solved, and the security and difficulty in cracking of data are improved.

CN119232432AActive Publication Date: 2024-12-31CHINA MOBILE INTERNET CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, data encryption is poor in security and it is difficult to effectively protect data from cracking.

Method used

During the data encryption process, whether to perform encryption processing is determined based on the number of alphabetical characters in the data to be encrypted, and specifically, encryption processing is performed when the number of alphabetical characters meets certain conditions to generate encrypted data; when the condition is not met, the data is viewed For non-encrypted data, improve data security.

Benefits of technology

The encryption method is determined by the number of alphabetical characters in the data itself. It is difficult to infer whether it is encrypted or original data through the processed data, which improves the security of the data and enhances the ability to protect the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232432A_ABST
    Figure CN119232432A_ABST
Patent Text Reader

Abstract

The invention discloses a data encryption method, and belongs to the field of Internet. The method comprises the following steps: acquiring to-be-encrypted first data; obtaining the number of alphabetic characters from the first data; under the condition that the number of alphabetic characters in the first data meets a first condition, encrypting the first data to obtain second data, and taking the second data as encrypted data; and under the condition that the number of the alphabetic characters in the first data meets a second condition, taking the first data as non-encrypted data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of Internet, and specifically relates to a data encryption method. Background Art

[0002] Data security is the most basic and important part of information security. Data security transmission is of great significance to protecting personal information security and safeguarding personal legitimate rights and interests. Therefore, data encryption is a common method in the process of data packet transmission.

[0003] The related technology usually adopts a fixed encryption method to encrypt all data, which has the problem of poor security of data encryption. Summary of the invention

[0004] The embodiment of the present application provides a data encryption method, which can solve the problem of poor security of data encryption existing in the related art.

[0005] In a first aspect, an embodiment of the present application provides a data encryption method, comprising:

[0006] Obtaining first data to be encrypted;

[0007] obtaining the number of alphabetical characters from the first data;

[0008] When the number of alphabetic characters in the first data satisfies a first condition, encrypting the first data to obtain second data, and using the second data as encrypted data;

[0009] In the case where the number of alphabetic characters in the first data satisfies a second condition, the first data is regarded as non-encrypted data.

[0010] In a second aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0011] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed, the steps of the method described in the first aspect are implemented.

[0012] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the method described in the first aspect.

[0013] At least one of the above technical solutions provided in the embodiments of the present application can achieve the following technical effects:

[0014] In an embodiment of the present application, the first data to be encrypted is obtained; the number of alphabetic characters is obtained from the first data; when the number of alphabetic characters in the first data satisfies the first condition, the first data is encrypted to obtain the second data, and the second data is used as the encrypted data; when the number of alphabetic characters in the first data satisfies the second condition, the first data is used as the non-encrypted data. In this way, when the first data is encrypted, the first data can be encrypted based on the number of alphabetic characters in the first data. Specifically, when the number of alphabetic characters satisfies the first condition, the first data is encrypted to obtain the second data. When the number of alphabetic characters satisfies the second condition, the first data is directly used as the non-encrypted data. This method determines whether the first data is encrypted by the number of alphabetic characters in the first data itself. It is difficult to infer whether it is the encrypted data or the original data through the processed first data, and it is less likely to be cracked, thereby improving the security of the data and solving the problem of poor security of data encryption in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0016] Figure 1 is a flow chart of a data encryption method provided in an embodiment of the present application;

[0017] Figure 2 is a flow chart of another data encryption method provided in an embodiment of the present application;

[0018] Figure 3-1 It is a schematic diagram of an example of data encryption provided by an embodiment of the present application;

[0019] Figure 3-2 is a schematic diagram of another example of data encryption provided by an embodiment of the present application;

[0020] Figure 4 is a flow chart of another data encryption method provided in an embodiment of the present application;

[0021] Figure 5 It is a schematic diagram of a data storage provided by an embodiment of the present application;

[0022] Figure 6 It is a specific flow chart of a data encryption method provided in an embodiment of the present application;

[0023] Figure 7 It is a structural block diagram of a data encryption device provided in an embodiment of the present application;

[0024] Figure 8 It is a structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are 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 are within the scope of protection of this application.

[0026] The terms "first", "second", etc. 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 interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0027] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0028] The data encryption method provided in the embodiment of the present application can be executed by a target device, wherein the target device can be one electronic device or multiple electronic devices. In other words, the data encryption method provided in the embodiment 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 laptop computer, a mobile phone, a tablet, or a server, such as an independent 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 in the embodiment of the present application is executed by multiple electronic devices, these multiple electronic devices can form a service cluster, which cooperate with each other to complete each step.

[0029] The data encryption method provided in the embodiment of the present application is applied to data encryption situations, and in particular, can be applied to situations where data is encrypted during data packet transmission. Specifically, the number of alphabetic characters in the first data to be encrypted can be obtained, and when the number of alphabetic characters meets the first condition, the first data is encrypted, and when the number of alphabetic characters meets the second condition, the first data is used as non-encrypted data.

[0030] The data encryption method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0031] See also Figure 1 , Figure 1 : is a flow chart of a data encryption method provided by an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0032] Step 110: Obtain first data to be encrypted.

[0033] In an embodiment of the present application, the first data may include multiple characters, and the multiple characters may include alphabetic characters. For example, the first data may be 0101AB1100. The first data may be profile data of the target user, wherein the profile is a collection of settings and permissions, used to indicate the operations that the user is authorized to perform. By properly configuring the profile data, user access rights can be effectively managed to avoid unauthorized user access and data leakage.

[0034] Since in actual implementation, not all the data to be processed are related to alphabetic characters, for example, if the data to be processed is binary data or octal data, only numeric characters may appear in the data to be processed. In this case, the data to be processed may be processed first to obtain first data related to alphabetic characters.

[0035] Exemplarily, in one embodiment of the present application, in the process of obtaining the first data to be encrypted in the above-mentioned step 110, the following method can be referred to: obtain the data to be processed; perform multi-base conversion on the data to be processed to obtain target data of a target base, wherein the target base is a base greater than the decimal base, and the target data includes at least one of numeric characters and alphabetic characters; determine the target data as the first data to be encrypted.

[0036] In an embodiment of the present application, it is considered that alphabetic characters may appear in data with a base greater than decimal, for example, alphabetic character A may appear in undecimal data, and alphabetic characters ABCDEF may appear in hexadecimal data. The data to be processed can be converted into multiple bases by a base converter to obtain target data of a target base, where the target base is a base greater than decimal. After the multiple 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. Since the first data here is data of the target base, the first data includes at least one of numeric characters and alphabetic characters.

[0037] In combination with a specific example, the data to be processed may be octal data 777600, and the data to be processed may be converted into hexadecimal to obtain hexadecimal target data 3FF80, that is, the first data may be 3FF80. At this time, two alphabetic characters appear in the first data, and the alphabetic characters may be used to subsequently encrypt the first data.

[0038] In an embodiment of the present application, a method for naturally generating alphabetic characters is provided, and this method does not change the essential content of the data to be processed, and can be used to assist in the subsequent encryption of the first data by alphabetic characters.

[0039] In one embodiment of the present application, the data to be processed in the above embodiment is a group of data in M ​​shares of data, and the data size of each share of the M shares of data is the same.

[0040] In the embodiment of the present application, the M pieces of data are the profile data of the target user. In fact, when acquiring the profile data of the target user, the profile data of the target user may include multiple different types of data, and each type of data may include multiple groups of data. Therefore, after acquiring the profile data of the target user, the profile data may be classified according to the data type, and each category may include multiple groups of data of the same type. At the same time, the data volume of each group of data in each category may be obtained.

[0041] In an embodiment of the present application, for a group of data in a certain category, considering that the amount of data in a group of data may be large, the group of data may be segmented first. When performing data segmentation, a uniform segmentation method may be adopted. That is, according to actual needs (the number of data copies M after data segmentation can be preset), a group of data is segmented into M copies of data, and one copy of the data is selected as the data to be processed. For example, 32KB of data can be divided into 8 copies of data, and the amount of data in each copy of data is 4KB.

[0042] In the embodiment of the present application, since the data to be processed is obtained by evenly dividing the data, it can be ensured that the data amounts of the data to be processed are the same, which can facilitate subsequent data storage.

[0043] Step 120: Obtain the number of alphabetic characters from the first data.

[0044] In the embodiment of the present application, the alphabetic characters may be determined from the multiple characters included in the first data, and the number of the alphabetic characters may be obtained. For example, the first data is 0101AB1100, where the number of the alphabetic characters in the first data is 2.

[0045] Step 130: When the number of alphabetic characters in the first data satisfies a first condition, encrypt the first data to obtain second data, and use the second data as encrypted data.

[0046] In the embodiment of the present application, the first condition may be that the number of alphabetic characters is greater than a preset threshold value. That is, when the number of alphabetic characters in the first data is greater than the preset threshold value, the first data is encrypted to obtain the second data, and the second data is used as the encrypted data.

[0047] Step 140: When the number of alphabetic characters in the first data satisfies a second condition, the first data is treated as non-encrypted data.

[0048] In the embodiment of the present application, the first condition and the second condition may be mutually exclusive, that is, when the number of alphabetic characters satisfies the first condition, the second condition is not satisfied; when the number of alphabetic characters satisfies the second condition, the first condition is not satisfied. The second condition may be that the number of alphabetic characters is less than or equal to a preset threshold. That is, when the number of alphabetic characters in the first data is less than or equal to the preset threshold, the first data is not encrypted and is directly used as non-encrypted data.

[0049] Alternatively, in the process of determining whether to encrypt the first data in step 130 and step 140, it can also be determined whether to encrypt the first data by judging the parity of the number of alphabetic characters in the first data.

[0050] Exemplarily, in one embodiment of the present application, the first condition is that the number of the alphabetic characters is not 0 and is an even number, and the second condition is that the number of the alphabetic characters is 0 or an odd number.

[0051] In the embodiment of the present application, when the number of alphabetic characters in the first data is not 0 and is an even number, the first data is encrypted to obtain second data, and the second data is used as encrypted data. When the number of alphabetic characters in the first data is 0 or an odd number, the first data is not encrypted, and the first data is directly used as non-encrypted data.

[0052] In combination with a specific example, the first data is A001001101B0B01, and the number of alphabetic characters of the first data is 3, that is, the number of alphabetic characters of the first data meets the second condition, and the first data may not be encrypted, and the first data is directly marked as non-encrypted data. In another example, the first data is A001001101B0001, and the number of alphabetic characters of the first data is 2, that is, the number of alphabetic characters of the first data meets the first condition, and the first data is encrypted to obtain the second data, and the second data is marked as encrypted data.

[0053] In an embodiment of the present application, whether to encrypt the first data is determined by judging the parity of the number of alphabetic characters in the first data. Since the parity of the number of alphabetic characters in the first data is an original data characteristic of the first data rather than being manually controlled, the entire encryption process is more complicated, thereby improving the security of data encryption.

[0054] In an embodiment of the present application, the first data to be encrypted is obtained; the number of alphabetic characters is obtained from the first data; when the number of alphabetic characters in the first data satisfies the first condition, the first data is encrypted to obtain the second data, and the second data is used as the encrypted data; when the number of alphabetic characters in the first data satisfies the second condition, the first data is used as the non-encrypted data. In this way, when the first data is encrypted, the first data can be encrypted based on the number of alphabetic characters in the first data. Specifically, when the number of alphabetic characters satisfies the first condition, the first data is encrypted to obtain the second data. When the number of alphabetic characters satisfies the second condition, the first data is directly used as the non-encrypted data. This method determines whether the first data is encrypted by the number of alphabetic characters in the first data itself. It is difficult to infer whether it is the encrypted data or the original data through the processed first data, and it is less likely to be cracked, thereby improving the security of the data and solving the problem of poor security of data encryption in the related technology.

[0055] The present application embodiment provides a method for encrypting first data using alphabetic characters in the first data. Figure 2 , Figure 2 is a flow chart of another data encryption method provided by an embodiment of the present application. Figure 2As shown, the method comprises the following steps:

[0056] Step 210: Obtain first data to be encrypted, where the first data includes N characters.

[0057] For example, if the first data is A001001101B0B01, the first data includes 15 characters.

[0058] Step 220: Obtain the number of alphabetic characters from the first data.

[0059] Step 230: When the number of alphabetic characters in the first data satisfies a first condition, obtain a first position number, the first position number being the position number of the first alphabetic character in the N characters, the first condition including: the number of alphabetic characters in the first data is not 0.

[0060] In an embodiment of the present application, the N characters of the first data may be numbered in advance, for example, in the form of 1, 2, 3, ..., n. Since the number of alphabetic characters in the first data is not 0, there are alphabetic characters in the N characters, and the first alphabetic character in the N characters may be determined from the left to the right from the N characters, and the position number of the alphabetic character may be obtained.

[0061] For example, the first data is A001001101B0B01, and the 15 characters of the first data are numbered in sequence from left to right (1 to 15), then the position of the first alphabetical character in the first data is numbered 1.

[0062] Step 240: When the first position number is a designated number value, the N characters of the first data are processed in reverse order to obtain second data.

[0063] In an embodiment of the present application, the designated number value may be the position number of the first character in the N characters. Specifically, when the N characters are numbered in sequence (1, 2, 3, ...), the designated number may be 1. When the first position number is the designated number value, that is, when the first character in the N characters is an alphabetic character, the N characters of the first data are processed in reverse order to obtain the second data, and the second data is used as the encrypted data.

[0064] Taking an example, the first data is A001001101B0B01, and the designated number value is 1. It can be determined from the first data that the first position number of the first alphabetical character is 1, that is, the first position number is the designated number. All 15 characters of the first data can be processed in reverse order to obtain the second data, and the second data is 10B0B101100100A.

[0065] Step 250: When the first position number is not a specified number value, encrypt the first data based on the parity of the first position number to obtain second data, and use the second data as encrypted data.

[0066] In an embodiment of the present application, when the first position number is not a specified number value, that is, when the first character among the N characters is not an alphabetic character, the parity of the first position number can be further determined, and based on the parity of the first position number, the first data can be encrypted.

[0067] For example, when the first position number is an odd number, all the alphabetical characters with odd position numbers in the N characters may be reversed to obtain second data, and the second data may be used as encrypted data; when the first position number is an even number, all the alphabetical characters with even position numbers in the N characters may be reversed to obtain second data, and the second data may be used as encrypted data.

[0068] Alternatively, the following method may also be adopted. Exemplarily, in one embodiment of the present application, in step 250, when the first position number is not a specified number value, based on the parity of the first position number, in the process of encrypting the first data, the following method may also be used: when the first position number is a first numerical value, a target character is obtained, and the target character is all specified characters whose position numbers are before the first position number in the N characters; the target character is processed in reverse order; when the first position number is a second numerical value, a second position number is obtained, and the second position number is the position number of the last alphabetical character in the N characters; all specific characters whose position numbers are between the first position number and the second position number in the N characters are processed in reverse order; wherein the first numerical value is one of an odd number and an even number, and the second numerical value is the other of an odd number and an even number.

[0069] In the embodiment of the present application, when the first value is an odd number, the second value is an even number. When the first value is an even number, the first value is an odd number. The first situation (the first value is an odd number and the second value is an even number) will be taken as an example for specific introduction.

[0070] In an embodiment of the present application, when the first position number is an odd number, all designated characters whose position numbers are before the first position number among the N characters are obtained, and the designated characters may include at least one of numeric characters, alphabetic characters, and other characters, and the other characters are characters other than numeric characters and alphabetic characters among the N characters, and the designated characters are reversed to obtain second data.

[0071] Please refer to Figure 3-1 , Figure 3-1 FIG. 1 is a schematic diagram of an example of data encryption provided by an embodiment of the present application. Figure 3-1 As shown in the example, the first data is 0100A0B00C11A, the specified character is a numeric character, and the first position number of the first letter in the first data is 5, which satisfies the condition that the first position number is an odd number. All numeric characters before the first letter can be obtained, that is, 0100. After reversing the specified character, 0010 is obtained to obtain the second data 0010A0B00C11A.

[0072] When the first position number is an even number, the second position number of the last alphabetical character in the N characters is obtained, and all specific characters between the first position number and the second position number can be determined from the first data, and the specific characters can include at least one of numeric characters, alphabetical characters and other characters, and the designated characters are reversed to obtain the second data. The specific characters can be the same as or different from the designated characters, for example, the specific characters can include numeric characters and other characters, and the designated characters can include numeric characters.

[0073] Please refer to Figure 3-2 , Figure 3-2 FIG. 1 is a schematic diagram of another example of data encryption provided by an embodiment of the present application. Figure 3-2 As shown, the first data is 010A01100B10, and the specific characters include numeric characters and other characters. The first position number of the first letter in the first data is 4, which satisfies the condition that the first position number is an even number. The second position number of the last letter in the first data is obtained, and the second position number is 10. Then, all numeric characters and other characters between 4 and 10 in the first data are obtained, that is, 01100. After reversing the specific characters, 00110 is obtained, so that the second data is 010A00110B10.

[0074] It should be noted that in the above examples, numeric characters are used as designated characters, and numeric characters and other characters are introduced as specific characters. In fact, the designated characters may also be alphabetic characters, or the designated characters may also be other characters (such as +, -, etc.), or the designated characters may also be alphabetic characters and numeric characters, etc., without limitation here. The specific characters may also be alphabetic characters, or the specific characters may also be other characters (such as +, -, etc.), or the specific characters may also be alphabetic characters and other characters, etc., without limitation here.

[0075] In an embodiment of the present application, a specific implementation method for 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. As the content of the first data changes, the encryption method will also change accordingly. This method is less likely to be cracked and has better data security.

[0076] In an embodiment of the present application, in the process of encrypting the first data to obtain encrypted data, a decryption template for the encrypted data can be generated and stored, so that when a user subsequently accesses the first data, the encrypted data can be decrypted according to the decryption template to achieve access to the first data.

[0077] Step 260: When the number of alphabetic characters in the first data satisfies a second condition, the first data is treated as non-encrypted data.

[0078] In an embodiment of the present application, when it is determined that the number of alphabetic characters in the first data is not 0 and is an even number, the first data is encrypted by further determining whether the first position number of the first letter is a specified number value. This encryption method is completely dependent on the data content of the first data itself, and as the content of the first data changes, the encryption method will also change accordingly. This encryption method is not fixed, is not easy to crack, and has better data security.

[0079] Since the data will be stored after processing, the present application embodiment provides a method for storing the processed data. Figure 4 . Figure 4 is a flow chart of another data encryption method provided by an embodiment of the present application. Figure 4 As shown, the method comprises the following steps:

[0080] Step 410: Obtain first data to be encrypted.

[0081] In an embodiment of the present application, the first data may be data obtained after performing multi-base conversion on the data to be processed, and the data to be processed may be a piece of data obtained by evenly dividing a group of data in user profile data of a specified type.

[0082] Step 420: Obtain the number of alphabetic characters from the first data.

[0083] Step 430: When the number of alphabetic characters in the first data satisfies a first condition, encrypt the first data to obtain second data, and use the second data as encrypted data.

[0084] Step 440: When the number of alphabetic characters in the first data satisfies a second condition, the first data is treated as non-encrypted data.

[0085] Step 450: Store the encrypted data in a first storage space.

[0086] In the embodiment of the present application, when storing encrypted data, different types of user profile data may be stored separately. Specifically, when storing a specified type of user profile data, since there may be multiple groups of user profile data of the specified type, and each group of data may include M portions of data obtained after uniform division. One type of encrypted user profile data may be stored at a time, and considering that there are more user profile data in one type, classification may be performed first.

[0087] Specifically, multiple groups of data of a specified type are classified according to the parity of the data size into odd-capacity data and even-capacity data, and the odd-capacity data and the even-capacity data are stored respectively. Since the storage methods for odd-capacity data and even-capacity data are the same, the storage of odd-capacity data will be introduced below, and the storage method of even-capacity data can refer to the storage method of odd-capacity data. Similarly, the encrypted data in the even-capacity data is stored in the first storage space, and the non-encrypted data is stored in the second storage space, which will not be described in detail here.

[0088] The data volume and capacity mentioned here are the same concept. For example, for 4kb of data, the capacity and data volume are both 4kb. The data volume size and capacity value are used to describe the specific numerical value. For example, the data volume size and capacity value of 4kb of data are both 4. Odd capacity data refers to data with an odd data volume size, and even capacity data refers to data with an even data volume size.

[0089] Please refer to Figure 5 , Figure 5 Schematic diagram of a data storage provided by an embodiment of the present application. Figure 5As shown, for odd-capacity data, odd-numbered encrypted data packets a1 can be stored in the first storage space, and odd-numbered non-encrypted data packets a2 can be stored in the second storage space. For even-numbered data, even-numbered encrypted data packets b1 can be stored in the first storage space, and even-numbered non-encrypted data packets b2 can be stored in the second storage space.

[0090] It should be noted that, since data encryption may cause a change in data capacity, the above process of classifying multiple groups of data can be performed before the encryption process, and the storage process can be performed after the encryption process.

[0091] In one embodiment of the present application, in the process of storing the encrypted data in the first storage space in step 450, the storage can be performed in the following manner: obtaining the total number of copies of the encrypted data; when the total number of copies of the encrypted data is an odd number, storing the first number of the encrypted data as a group in the first storage space; when the total number of copies of the encrypted data is an even number, storing the second number of the encrypted data as a group in the first storage space.

[0092] In the embodiment of the present application, the storage of odd-capacity data is described, and 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 copies of all encrypted data can be obtained therefrom.

[0093] After obtaining the total number of encrypted data, the parity of the total number of encrypted data is determined. In the case where the total number of encrypted data is an odd number, a first number of encrypted data (e.g., 2 encrypted data) may be selected from the encrypted data as a group to obtain multiple groups of results including the first number of encrypted data, and each group of results in the multiple groups of results is stored in the first storage space. Here, taking the first number of encrypted data as a group means bundling the first number of encrypted data for storage, and storing the bundled data in the first storage space.

[0094] In the case where the total number of encrypted data is an even number, a second number of encrypted data may be selected from the encrypted data as a group to obtain multiple groups of results including the second number of encrypted data, and each group of results in the multiple groups of results is stored in the first storage space. It should be noted that there is no restriction on the quantitative relationship between the first number and the second number, and the first number may be equal to the second number, the first number may be less than the second number, or the first number may be greater than the second number.

[0095] In actual implementation, the plurality of encrypted data may be numbered first, for example, in the manner of 1, 2, 3, ..., n. In subsequent grouping, the first number of encrypted data may be obtained from the plurality of data in the order of numbers.

[0096] In conjunction with a specific example, the first number is preset to be 3, and the second number is preset to be 2. If the total number of encrypted data is 13, that is, the total number of encrypted data is an odd number, the 13 encrypted data can be grouped and stored in such a way that the encrypted data numbered 1, 2, and 3 are grouped together, and the encrypted data numbered 4, 5, and 6 are grouped together. If the total number of encrypted data is 14, that is, the total number of encrypted data is an even number, the 14 encrypted data can be grouped and stored in such a way that the encrypted data numbered 1 and 2 are grouped together, and the encrypted data numbered 3 and 4 are grouped together.

[0097] In the embodiment of the present application, by storing data in groups, multiple copies of data can be read at one time when data is actually accessed, thereby reducing the number of times and time of reading data from the storage space.

[0098] Step 460: Store the non-encrypted data in a second storage space.

[0099] In the embodiment of the present application, the storage space can be divided into a first storage space and a 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 one embodiment of the present application, in the process of storing the non-encrypted data in the second storage space in step 460, the storage can be performed in the following manner: obtaining the total number of copies of the non-encrypted data; obtaining the value of the unit digit in the data size value of the non-encrypted data; when the value of the unit digit is greater than or equal to the total number of copies of the non-encrypted data, storing a third number of the non-encrypted data as a group in the second storage space; wherein the third number is less than or equal to the total number of copies of the non-encrypted data; when the value of the unit digit is less than the total number of copies of the non-encrypted data, storing the non-encrypted data with odd copies from all copies of the non-encrypted data as a group in the second storage space, and storing the non-encrypted data with even copies as a group in the second storage space.

[0101] In the embodiment of the present application, all odd-numbered data in multiple sets 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 sets of data, each set of data in the multiple sets of data can be stored. Specifically, all non-encrypted data in a set of data and the total number of copies of non-encrypted data are obtained. All non-encrypted data are numbered, for example, all non-encrypted data are numbered in the manner of 1, 2, 3, ..., n.

[0102] At the same time, the capacity value (data size value) of all non-encrypted data in a set of data is obtained. Since all non-encrypted data comes from a set of data, and all non-encrypted data is obtained by equal division, that is, the capacity value of all non-encrypted data is the same.

[0103] Based on the capacity value of all non-encrypted data, the unit digit value of the capacity value is obtained. When the unit digit value is greater than or equal to the total number of the non-encrypted data, all the non-encrypted data can be grouped and stored by a third number. The third number can be equal to the total number of the non-encrypted data, that is, all the non-encrypted data are stored together. The third number can also be less than the total number of the non-encrypted data. For example, if the total number of non-encrypted data is 6, the third number can be 3, that is, 6 non-encrypted data can be grouped and stored in a manner of 1, 2, 3 as a group and 4, 5, 6 as a group.

[0104] In the case where the value of the unit digit is less than the total number of copies of the non-encrypted data, all the non-encrypted data may be grouped and stored according to the parity of the copy number of the non-encrypted data. Specifically, all the non-encrypted data with odd copy numbers are grouped as one group, and all the non-encrypted data with even copy numbers are grouped as one group, and the two groups are stored in the second storage space respectively.

[0105] In conjunction with an example, the unit digit is 5, and the total number of non-encrypted data is 10 (numbered 1 to 10). At this time, since the unit digit is smaller than the total number of non-encrypted data, the 10 non-encrypted data can be grouped and stored in groups numbered 1, 3, 5, 7, 9 as a group, and 2, 4, 6, 8, 10 as a group. In another example, the unit digit is 8, the total number of non-encrypted data is 4, and the preset third number is 4, then the 4 non-encrypted data packets are stored together in the second storage space.

[0106] In one embodiment of the present application, in the above steps 450 and 460, 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.

[0107] In the embodiment of the present application, the first storage space and the second storage space are located in different physical nodes. By storing data separately on two different storage nodes, it is possible to prevent all data from being inaccessible due to a storage node failure, thereby avoiding data loss or access delay caused by a single point of failure.

[0108] In the 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 user access. When the accessing user accesses the profile data, the accessing user can be authenticated. The specific authentication method is as follows:

[0109] The identity information of the accessing user is obtained and verified, wherein the identity information includes an account number and a password. If the identity information of the accessing user is verified, the accessing user is further verified by a verification code, wherein the verification code is a combination of letters and numbers. In the process of verifying the verification code of the accessing user, a verification code may be sent to the user terminal of the accessing user, and the accessing user may input the verification code for secondary verification upon receiving the verification code.

[0110] If the identity verification of the accessing user fails, the access of the accessing user will be prohibited. The accessing user can have multiple (for example, 3) identity verification opportunities. If the accessing user still has the opportunity to verify the identity, the accessing user can check whether the identity information is correct and modify the access information. If the accessing user fails multiple identity verification opportunities, the accessing user cannot access again within the set time (30 minutes). If the accessing user still wants to access, he can consider changing the password through the mobile phone number bound to the account and then verify the identity.

[0111] If the access user passes the secondary verification, the access user's access rights and the level of the access user's access data are obtained to determine whether the access user has the right to access and modify the access data. Specifically, the user's access rights can be divided into three levels, from level one to level three, the access rights decrease in sequence. The level of access data can also be divided into three levels accordingly, from level one to level three, the access level decreases in sequence. Whether the access user has the right to access and modify the access data can be determined by the access user's access rights and the level of the access data.

[0112] To illustrate with an example, if the access user's level is level one and the access data's level is level two, the access user has the right to access the access data. If the access user's level is level three and the access data's level is level two, the access user has no right to access the access data.

[0113] In an embodiment of the present application, encrypted data and unencrypted data are stored separately, the encrypted data is stored in a first storage space, and the unencrypted data is stored in a second storage space. The processed first data can be stored in different storage spaces to achieve separate management of encrypted data and unencrypted data.

[0114] The present application provides the following specific example to further describe the data encryption method. The example includes the following steps.

[0115] Step 1: Obtain the user's profile data, and obtain its corresponding data type and data capacity. Classify the user's profile data by data type, and label each group of data contained in each type of data as i, that is, i = 1, 2, ..., j, and record the data capacity corresponding to each group of data as R i .

[0116] Step 2: For each set of data, divide the data into i M data segments are obtained by equally dividing the data into M parts (i.e. the M data parts mentioned above), and then the M data segments are converted into hexadecimal through a base converter. After the hexadecimal conversion, not only numbers but also letters are generated in the data.

[0117] Step 3: Obtain any profile data, analyze one of the M data segmentation packages as an example, and record it as the target data packet and record it as k. Then obtain the number of alphabetic characters and the number of digital characters after multi-base conversion of the target data packet k, and record them as L1 and L2 respectively.

[0118] Step 4: Then, encrypt the target data packet k according to the number of alphabetic characters L1 and the number of numeric characters L2. The specific encryption method is as follows:

[0119] The number L1 of alphabetic characters and the number L2 of digital characters are compared and judged, and the alphabetic characters are selected as the standard state to judge the parity of the number of the standard state.

[0120] When the number of standard states corresponding to the target data packet k is an odd number, it will not be encrypted and will be recorded as a non-encrypted data packet. When the number of standard states corresponding to the target data packet k is an even number, it will be encrypted and recorded as a data packet to be encrypted. The specific encryption method is: obtain the first standard state in the data packet to be encrypted, determine the position number of the first standard state, if the position number of the first standard state is 1, then the data packet to be encrypted is processed in reverse order as a whole, if the position number of the first standard state is not 1, it is necessary to further determine the parity of the position number of the first standard state.

[0121] Based on the example, a data packet to be encrypted is A001001101B0B01, where the first standard state is located at the first position. Then the overall data packet to be encrypted after reverse order is 10B0B101100100A.

[0122] If the position number of the first standard state is an odd number, that is, 3, 5, 7, ..., then take the first standard state as the end point, reverse all the digital characters before the first standard state, and generate a new encrypted data packet; if the position number of the first standard state is an even number, that is, 2, 4, 6, ..., then reverse the digital characters between the first standard state and the last standard state, and generate an encrypted data packet.

[0123] Combined with actual analysis, one of the data packets to be encrypted is 0100A0B00C11A, and the position number of the first standard state is 5, which is an odd number, then 0010A0B00C11A is generated after reverse processing; if the data packet to be encrypted is 010A01100BA0, and the position number of the first standard state is 4, which is an even number, then 010A00110BA0 is generated after reverse processing.

[0124] Subsequently, all data i are processed in the same way to obtain their corresponding encrypted data packets. For the obtained encrypted data packets, a corresponding decryption template will be generated according to the encryption process. When the system restores it later, it can decrypt the encrypted data packets according to the decryption template.

[0125] Step 5: Store the obtained data. The specific method of storing the data is as follows:

[0126] All data i are classified according to 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. Classification by capacity here refers to the classification of data i before encryption, and subsequent storage refers to the encrypted data packets formed after encryption. In addition, the storage space can be classified to obtain the first storage space and the second storage space.

[0127] All odd-capacity data a are obtained, and at the same time, all the encrypted data packet numbers and unencrypted data packet numbers are obtained, which are denoted as a1 and a2 respectively, and a1=1, 2, ..., f, a2=1, 2, ..., g, where the number also represents the label order of the corresponding encrypted data packet and unencrypted data packet.

[0128] Next, all encrypted data packets a1 are stored in the first storage space. The specific storage method is: determine whether the number of encrypted data packets f is an odd number or an even number. If it is an odd number, all encrypted data packets are bundled into groups of three in sequence, and then the bundled data packets are stored in the first storage space; if it is an even number, all encrypted data packets are bundled into groups of two in sequence, and then the bundled data packets are stored in the first storage space.

[0129] Based on the analysis of the example, if the number of encrypted data packets is 13, the number value is an odd number, and the encrypted data packets are bundled into groups of three in the order of 1, 2, and 3, and then stored in the first storage space; if the number of encrypted data packets is 14, the number value is an even number, and the encrypted data packets are bundled into groups of two in the order of 1 and 2, and then stored in the first storage space.

[0130] Then, all non-encrypted data packets a2 are stored in the second storage space. The specific storage method is: obtain the capacity value corresponding to the non-encrypted data packet, and obtain the mantissa value corresponding to the capacity value (i.e., the unit digit value mentioned above). Then compare the mantissa value with g. If the mantissa value is greater than g, all non-encrypted data packets a2 are bundled and stored in the second storage space at the same time; if the mantissa value is less than a2, all non-encrypted data packets are grouped and bundled according to odd and even numbers, and stored in the second storage space.

[0131] The storage method for the even-capacity data b is the same, that is, the encrypted data packet b1 in the even-capacity data b is stored in the first storage space, and the unencrypted data packet b2 is stored in the second storage space.

[0132] Combined with the example, the capacity values ​​of the non-encrypted data packets are all the same, and the capacity values ​​of the individual data packets formed by segmentation are integers. If the capacity value ends with a value of 5 and the number of non-encrypted data packets is 10, the odd-numbered non-encrypted data packets and the even-numbered non-encrypted data packets are bundled separately and then stored in the second storage space; if the capacity value ends with a value of 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 completing the encryption and storage of the above data packets, the accessing user can access the storage space (including the first storage space and the second storage space). When the accessing user accesses the data, the identity of the accessing user can be verified. The specific method of identity verification is as follows:

[0134] The identity information of the accessing user is obtained, and the identity information includes: account number and password. If the identity information of the accessing user is successfully verified, the subsequent verification code verification is performed. If the identity information verification fails, access is prohibited, and the accessing user has three opportunities for identity verification. If all three verification opportunities fail, the accessing user is prohibited from accessing again within 30 minutes. If the user still needs to access, he can modify the password through the bound mobile phone number to authenticate the identity.

[0135] When the visiting user performs verification code verification, a verification code can be sent to the visiting user's bound mobile phone. The verification code is a combination of letters and numbers sent to the user's bound mobile phone. The visiting user performs secondary verification by entering the received verification code.

[0136] After the access user passes the secondary verification, the access user's access rights 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 based on the access level of the access user and the level of the access user's access data. Specifically, the user's access rights and the level of access data both include three levels, and the access rights or access levels decrease from level one to level three. For example, if the level of access data is level two and the level of the access user is level one, access is allowed. On the contrary, if the level of the access user is level three, access is not allowed.

[0137] See also Figure 6 , Figure 6 This is a specific flow chart of a data encryption method provided by an embodiment of the present application. Figure 6 As shown, the method comprises the following steps:

[0138] Step 610: Obtain data to be processed.

[0139] In the embodiment of the present application, the data to be processed is one piece of data among 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: Perform multi-base conversion on the data to be processed to obtain target data in a target base, wherein the target base is a base greater than the decimal base, and the target data includes at least one of numeric characters and alphabetic characters.

[0141] Step 630: Determine the target data as first data to be encrypted, where the first data includes N characters.

[0142] Step 640: Obtain the number of alphabetic characters from the first data.

[0143] In the embodiment of the present application, after obtaining the number of alphabetic characters, it is determined whether the number of alphabetic characters meets the first condition or the second condition, the first condition being that the number of alphabetic characters in the first data is not 0 and is an even number, and the second condition being that the number of alphabetic characters in the first data is 0 or an odd number. If the number of alphabetic characters meets the first condition, the following step 650 is executed, and if the number of alphabetic characters meets the second condition, the following step 680 is executed.

[0144] Step 650: When the number of alphabetic characters in the first data satisfies a first condition, obtain a first position number, where the first position number is the position number of the first alphabetic character in the N characters, and the first condition is that the number of alphabetic characters in the first data is not 0 and is an even number.

[0145] In an embodiment of the present application, after obtaining the first position number, it is determined whether the first position number is a specified number value. If the first position number is a specified number value, the following step 660 is executed; if the first position number is not a specified number value, the following step 670 is executed.

[0146] Step 660: When the first position number is a specified number value, the N characters of the first data are processed in reverse order to obtain second data.

[0147] Step 670: When the first position number is not a specified number value, encrypt the first data based on the parity of the first position number to obtain second data.

[0148] In an embodiment of the present application, in the process of encrypting the first data based on the parity of the first position number as described in the above step 670, the following method can be used: when the first position number is a first numerical value, obtaining a target character, the target character is all specified characters in the N characters whose position numbers are before the first position number; reversing the target character; when the first position number is a second numerical value, obtaining a second position number, the second position number is the position number of the last alphabetical character in the N characters; reversing all specific 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 an odd number and an even number, and the second numerical value is the other of an odd number and an even number.

[0149] Step 680: When the number of alphabetic characters in the first data satisfies a second condition that the number of alphabetic characters is 0 or an odd number, the first data is treated as non-encrypted data.

[0150] Step 690: Store the encrypted data in a first storage space, and store the unencrypted data in a second storage space.

[0151] In an 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 storing the encrypted data in the first storage space, the following method may be used: obtaining the total number of the encrypted data; when the total number of the encrypted data is an odd number, storing the first number of the encrypted data as a group in the first storage space; when the total number of the encrypted data is an even number, storing the second number of the encrypted data as a group in the first storage space.

[0153] When storing the non-encrypted data in the second storage space, the following method can be used: obtain the total number of copies of the non-encrypted data; obtain the value of the unit digit in the data size value of the non-encrypted data; when the value of the unit digit is greater than or equal to the total number of copies of the non-encrypted data, store a third number of the non-encrypted data as a group in the second storage space; wherein the third number is less than or equal to the total number of copies of the non-encrypted data; when the value of the unit digit is less than the total number of copies of the non-encrypted data, from all copies of the non-encrypted data, store the non-encrypted data with odd numbers as a group in the second storage space, and store the non-encrypted data with even numbers as a group in the second storage space.

[0154] In an embodiment of the present application, the first data to be encrypted is obtained; the number of alphabetic characters is obtained from the first data; when the number of alphabetic characters in the first data satisfies the first condition, the first data is encrypted to obtain the second data, and the second data is used as the encrypted data; when the number of alphabetic characters in the first data satisfies the second condition, the first data is used as the non-encrypted data. In this way, when the first data is encrypted, the first data can be encrypted based on the number of alphabetic characters in the first data. Specifically, when the number of alphabetic characters satisfies the first condition, the first data is encrypted to obtain the second data. When the number of alphabetic characters satisfies the second condition, the first data is directly used as the non-encrypted data. This method determines whether the first data is encrypted by the number of alphabetic characters in the first data itself. It is difficult to infer whether it is the encrypted data or the original data through the processed first data, and it is less likely to be cracked, thereby improving the security of the data and solving the problem of poor security of data encryption in the related technology.

[0155] It is important to understand that Figures 1 to 6 The explanations of the same or corresponding steps in the above may refer to each other. For example, Figure 1 The explanation of step 110 and step 120 in Figure 2 Step 210 and step 220 in .

[0156] At the same time, it should be understood that a data encryption method provided by an embodiment of the present application can have the following beneficial effects: First, the present application improves the complexity of data encryption through diversified encryption methods, further ensures data security, and improves the overall security of data. Second, the use of multiple physical nodes to store data can avoid data loss or access delay problems caused by single point failures. During the storage process, encrypted data and non-encrypted data are stored separately, and different methods of bundling and storage are performed according to the number of data copies. Targeted storage can facilitate data reading. Third, when a user accesses data, the user's identity is authenticated to protect user privacy and prevent data leakage.

[0157] See also Figure 7 , Figure 7 is a structural block diagram of a data encryption device provided in an embodiment of the present application. Figure 7 As shown, an embodiment of the present application provides a data encryption device 700 , and the data encryption device 700 includes: an acquisition module 710 and an encryption module 720 .

[0158] The acquisition module 710 is used to acquire first data to be encrypted; and acquire the number of alphabetical characters from the first data;

[0159] The encryption module 720 is used to encrypt the first data to obtain second data when the number of alphabetic characters in the first data meets a first condition, and use the second data as encrypted data; when the number of alphabetic characters in the first data meets a second condition, use the first data as non-encrypted data.

[0160] In an embodiment of the present application, the first data to be encrypted is obtained; the number of alphabetic characters is obtained from the first data; when the number of alphabetic characters in the first data satisfies the first condition, the first data is encrypted to obtain the second data, and the second data is used as the encrypted data; when the number of alphabetic characters in the first data satisfies the second condition, the first data is used as the non-encrypted data. In this way, when the first data is encrypted, the first data can be encrypted based on the number of alphabetic characters in the first data. Specifically, when the number of alphabetic characters satisfies the first condition, the first data is encrypted to obtain the second data. When the number of alphabetic characters satisfies the second condition, the first data is directly used as the non-encrypted data. This method determines whether the first data is encrypted by the number of alphabetic characters in the first data itself. It is difficult to infer whether it is the encrypted data or the original data through the processed first data, and it is less likely to be cracked, thereby improving the security of the data and solving the problem of poor security of data encryption in the related technology.

[0161] The data encryption device provided in the embodiment of the present application can implement each process implemented in the above method embodiment. To avoid repetition, it will not be described again here.

[0162] like Figure 8 As shown, an embodiment of the present application also provides an electronic device 800. The electronic device 800 includes: a processor 810 and a memory 820, and the memory 820 stores a program or instruction, and when the program or instruction is executed by the processor 810, the steps of any of the methods described above are implemented. For example, when the program is executed by the processor 810, the following process is implemented: obtaining first data to be encrypted; obtaining the number of alphabetic characters from the first data; when the number of alphabetic characters in the first data meets the first condition, encrypting the first data to obtain second data, and using the second data as encrypted data; when the number of alphabetic characters in the first data meets the second condition, using the first data as non-encrypted data. In this way, when encrypting the first data, the first data can be encrypted based on the number of alphabetic characters in the first data. Specifically, when the number of alphabetic characters satisfies the first condition, the first data is encrypted to obtain the second data. When the number of alphabetic characters satisfies the second condition, the first data is directly used as unencrypted data. This method determines whether to encrypt the first data by the number of alphabetic characters in the first data itself. It is difficult to infer whether it is encrypted data or original data through the processed first data, and it is less likely to be cracked, which improves the security of the data and solves the problem of poor security of data encryption in related technologies.

[0163] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of each embodiment of the data encryption method are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0164] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0165] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0166] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0167] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do 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 methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0168] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0169] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A data encryption method, characterized in that: include: Obtaining first data to be encrypted; obtaining the number of alphabetical characters from the first data; When the number of alphabetic characters in the first data satisfies a first condition, encrypting the first data to obtain second data, and using the second data as encrypted data; In the case where the number of alphabetic characters in the first data satisfies a second condition, the first data is regarded as non-encrypted data.

2. The method according to claim 1, characterized in that: The obtaining of the first data to be encrypted comprises: Get the data to be processed; Performing multi-base conversion on the data to be processed to obtain target data of a target base, wherein the target base is a base greater than the decimal base, and the target data includes at least one of a numeric character and an alphabetic character; The target data is determined as first data to be encrypted.

3. The method according to claim 2, characterized in that The data to be processed is one piece of data among M pieces of data, and the data amount of each piece of data in the M pieces of data is the same.

4. The method according to claim 1, characterized in that: The first condition is that the number of the alphabetic characters is not 0 and is an even number; the second condition is that the number of the alphabetic characters is 0 or an odd number.

5. The method according to claim 1, characterized in that The first data includes N characters, the first condition includes: the number of alphabetic characters in the first data is not 0; when the number of alphabetic characters in the first data satisfies the first condition, encrypting the first data to obtain second data includes: Obtain a first position number, where the first position number is the position number of the first alphabetical character in the N characters; When the first position number is a specified number value, the N characters of the first data are processed in reverse order to obtain second data; When the first position number is not a designated number value, the first data is encrypted based on the parity of the first position number to obtain second data.

6. The method according to claim 5, characterized in that The encrypting the first data based on the parity of the first position number includes: When the first position number is a first value, obtaining target characters, the target characters being all designated characters whose position numbers are before the first position number among the N characters; and performing reverse processing on the target characters; When the first position number is a second numerical value, obtaining a second position number, where the second position number is the position number of the last alphabetical character in the N characters; performing reverse processing on all specific characters in the N characters whose position numbers are between the first position number and the second position number; The first value is one of an odd number and an even number, and the second value is the other of an odd number and an even number.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: storing the encrypted data in a first storage space; The non-encrypted data is stored in a second storage space.

8. The method according to claim 7, characterized in that 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.

9. The method according to claim 7, characterized in that: The storing the encrypted data into the first storage space comprises: Obtaining the total number of copies of the encrypted data; When the total number of the encrypted data is an odd number, storing the first number of the encrypted data as a group in a first storage space; When the total number of the encrypted data is an even number, a second number of the encrypted data is taken as a group and stored in the first storage space.

10. The method according to claim 7, characterized in that The storing the non-encrypted data into the second storage space comprises: Obtaining the total number of copies of the non-encrypted data; Obtain the value of the unit digit in the data size value of the non-encrypted data; When 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 taken as a group and stored 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 where the value of the unit digit is less than the total number of the non-encrypted data, the non-encrypted data with odd numbers among all the non-encrypted data are stored as a group in the second storage space, and the non-encrypted data with even numbers are stored as a group in the second storage space.

Citation Information

Patent Citations

  • Public URL encryption coding method for preventing illegal access on internet

    CN105282090A

  • Data encryption method, data decryption method, terminal and storage medium

    CN112311740A

  • Data storage method and system based on image recognition

    CN114329012A

  • Data retrieval method and device based on encrypted data, storage medium and equipment

    CN114579602A

  • System and method for data encryption

    US20120106733A1