Method, device, electronic device and storage medium for generating encrypted data

By splitting and replacing data, using common arrays to generate encrypted data, the complexity and difficulty of decryption of traditional encryption technologies are solved, and the security and efficiency of data are improved.

CN115730331BActive Publication Date: 2025-05-02CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211150058.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-21
Publication Date
2025-05-02
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

Traditional encryption technology is too complex and the decryption process is cumbersome and even impossible to decrypt, which affects the use of mobile phone number data.

Method used

By obtaining the data to be encrypted, a common array is generated, the data is split into the first data to be encrypted and the second data to be encrypted, the third data to be encrypted is determined from the common array using the first data to be encrypted, 32-bit binary data for the second data to be encrypted, and the first data to be encrypted is replaced with the first bit of the binary data to be encrypted, and the encrypted data is generated.

Benefits of technology

It improves the security of the data to be encrypted, simplifies the encryption process, avoids the problem of difficulty in decryption, and improves the efficiency of data use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115730331B_ABST
    Figure CN115730331B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention provide a method, device, electronic device and storage medium for generating encrypted data, which obtains data to be encrypted and generates a common array; splits the data to be encrypted according to a preset rule to generate first data to be encrypted and second data to be encrypted; determines third data to be encrypted corresponding to the first data to be encrypted from the common array through the first data to be encrypted; generates 32-bit binary data for the second data to be encrypted through the third data to be encrypted; replaces the first bit of the 32-bit binary data with the first data to be encrypted, and generates encrypted data; the encrypted data includes the first data to be encrypted and a 31-bit binary string, thereby improving the security of the data to be encrypted during the encryption process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data encryption technology, and in particular to an encrypted data generation method, an encrypted data generation device, an electronic device and a computer-readable storage medium. Background Art

[0002] With the popularity of mobile terminals, mobile phone numbers have become one of people's identity identifiers. Many third-party account registrations and identity bindings require mobile phone numbers. Registering and binding accounts with mobile phone numbers facilitates user use to a certain extent and improves account security.

[0003] However, the plaintext storage and transmission of mobile phone numbers is likely to lead to the abuse of user information and even serious privacy leaks. For this reason, traditional encryption technology can make the encrypted data provably secure, but traditional encryption technology is too complicated and the decryption process is cumbersome or even impossible to decrypt, which affects the subsequent use of mobile phone number data. Summary of the invention

[0004] The embodiments of the present invention provide a method, device, electronic device and computer-readable storage medium for generating encrypted data, so as to solve the problem of improving the security of the data to be encrypted during the encryption process.

[0005] An embodiment of the present invention discloses a method for generating encrypted data, which may include:

[0006] Get the data to be encrypted and generate a public array;

[0007] Splitting the data to be encrypted according to a preset rule to generate first data to be encrypted and second data to be encrypted;

[0008] Determining third data to be encrypted corresponding to the first data to be encrypted from the public array using the first data to be encrypted;

[0009] Generate 32-bit binary data for the second data to be encrypted using the third data to be encrypted;

[0010] The first data to be encrypted replaces the first bit of the 32-bit binary data, and generates encrypted data; the encrypted data includes the first data to be encrypted and a 31-bit binary string.

[0011] Optionally, the step of splitting the data to be encrypted according to a preset rule to generate first data to be encrypted and second data to be encrypted may include:

[0012] Determining a first target digit and a second target digit for the data to be encrypted;

[0013] Determining first target data from the data to be encrypted based on the first target digit, and extracting the first target data as first data to be encrypted;

[0014] Determining second target data from the data to be encrypted based on the second target digit;

[0015] The first target data and the second target data are deleted from the data to be encrypted to generate second data to be encrypted.

[0016] Optionally, the step of generating 32-bit binary data for the second data to be encrypted by using the third data to be encrypted may include:

[0017] Generate fourth data to be encrypted based on a first preset encryption algorithm using the first data to be encrypted and the second data to be encrypted;

[0018] Generate fifth data to be encrypted based on a second preset encryption algorithm using the third data to be encrypted and the fourth data to be encrypted;

[0019] Determine digital data for the public array according to a preset rule, and determine at least one target public data from the public array based on the digital data;

[0020] Generate sixth data to be encrypted based on a third preset encryption algorithm using the fifth data to be encrypted and the target public data;

[0021] The sixth data to be encrypted is converted into 32-bit binary data.

[0022] Optionally, the first preset encryption algorithm has a corresponding first preset decryption algorithm, the second preset encryption algorithm has a corresponding second preset decryption algorithm, and the third preset encryption algorithm has a corresponding third preset decryption algorithm. The method may further include:

[0023] Extracting the first to-be-encrypted data and the 31-bit binary string from the encrypted data;

[0024] Generate the sixth data to be encrypted by using the 31-bit binary string; the sixth data to be encrypted is decimal data;

[0025] Generate fifth data to be encrypted based on a third preset decryption algorithm using the sixth data to be encrypted and the public data;

[0026] Determining third data to be encrypted corresponding to the first data to be encrypted from the public array using the first data to be encrypted;

[0027] Generate fourth data to be encrypted based on the second preset decryption algorithm using the third data to be encrypted and the fifth data to be encrypted;

[0028] Generate second data to be encrypted based on the first preset decryption algorithm using the fourth data to be encrypted and the first data to be encrypted;

[0029] The first data to be encrypted, the second target data and the second data to be encrypted are concatenated to generate the data to be encrypted.

[0030] Optionally, when the data to be encrypted is a mobile phone number, the second target data may be the first digit of the data to be encrypted, and the first data to be encrypted may be any digit of data except the first digit.

[0031] The embodiment of the present invention further discloses an encrypted data generating device, which may include:

[0032] The module for obtaining data to be encrypted is used to obtain the data to be encrypted and generate a public array;

[0033] The to-be-encrypted data splitting module is used to split the to-be-encrypted data according to a preset rule to generate first to-be-encrypted data and second to-be-encrypted data;

[0034] A third data to be encrypted determining module, configured to determine third data to be encrypted corresponding to the first data to be encrypted from the public array using the first data to be encrypted;

[0035] a 32-bit binary data generating module, configured to generate 32-bit binary data corresponding to the second data to be encrypted using the third data to be encrypted;

[0036] The encrypted data generating module is used to replace the first bit of the 32-bit binary data with the first data to be encrypted, and generate encrypted data; the encrypted data includes the first data to be encrypted and a 31-bit binary string.

[0037] Optionally, the to-be-encrypted data splitting module may further include:

[0038] A digit determination submodule, used to determine a first target digit and a second target digit for the data to be encrypted;

[0039] A first target data determination submodule, configured to determine first target data from the data to be encrypted based on the first target digit, and extract the first target data as first data to be encrypted;

[0040] A second target data determination submodule, used to determine second target data from the data to be encrypted based on the second target digit;

[0041] The second data to be encrypted generating submodule is used to delete the first target data and the second target data from the data to be encrypted to generate second data to be encrypted.

[0042] Optionally, the 32-bit binary data generation module may include:

[0043] A fourth to-be-encrypted data generating submodule, configured to generate fourth to-be-encrypted data based on a first preset encryption algorithm using the first to-be-encrypted data and the second to-be-encrypted data;

[0044] A fifth to-be-encrypted data generating submodule, configured to generate fifth to-be-encrypted data based on a second preset encryption algorithm using the third to-be-encrypted data and the fourth to-be-encrypted data;

[0045] a target public data determination submodule, configured to determine digital data for the public array according to a preset rule, and determine at least one target public data from the public array based on the digital data;

[0046] a sixth to-be-encrypted data generating submodule, configured to generate sixth to-be-encrypted data based on a third preset encryption algorithm by using the fifth to-be-encrypted data and the target public data;

[0047] The 32-bit binary data generating submodule is used to convert the sixth data to be encrypted into 32-bit binary data.

[0048] Optionally, the first preset encryption algorithm has a corresponding first preset decryption algorithm, the second preset encryption algorithm has a corresponding second preset decryption algorithm, the third preset encryption algorithm has a corresponding third preset decryption algorithm, and the device may further include:

[0049] A first to-be-encrypted data extraction submodule, used to extract the first to-be-encrypted data and the 31-bit binary string from the encrypted data;

[0050] A decimal data generation submodule, used to generate the sixth data to be encrypted by using the 31-bit binary string; the sixth data to be encrypted is decimal data;

[0051] A fifth data to be encrypted decryption submodule, configured to generate fifth data to be encrypted based on a third preset decryption algorithm using the sixth data to be encrypted and the public data;

[0052] A third to-be-encrypted data decryption submodule, configured to determine, from the public array, third to-be-encrypted data corresponding to the first to-be-encrypted data according to the first to-be-encrypted data;

[0053] a fourth data to be encrypted decryption submodule, configured to generate fourth data to be encrypted based on the second preset decryption algorithm by using the third data to be encrypted and the fifth data to be encrypted;

[0054] A second to-be-encrypted data decryption submodule, configured to generate second to-be-encrypted data based on the first preset decryption algorithm using the fourth to-be-encrypted data and the first to-be-encrypted data;

[0055] The to-be-encrypted data decryption submodule is used to concatenate the first to-be-encrypted data, the second target data and the second to-be-encrypted data to generate the to-be-encrypted data.

[0056] Optionally, when the data to be encrypted is a mobile phone number, the second target data may be the first digit of the data to be encrypted, and the first data to be encrypted may be any digit of data except the first digit.

[0057] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0058] The memory is used to store computer programs;

[0059] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.

[0060] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.

[0061] The embodiments of the present invention include the following advantages:

[0062] In an embodiment of the present invention, data to be encrypted is obtained and a common array is generated; the data to be encrypted is split according to a preset rule to generate first data to be encrypted and second data to be encrypted; third data to be encrypted corresponding to the first data to be encrypted is determined from the common array through the first data to be encrypted; 32-bit binary data for the second data to be encrypted is generated through the third data to be encrypted; the first bit of the 32-bit binary data is replaced by the first data to be encrypted, and encrypted data is generated; the encrypted data includes the first data to be encrypted and a 31-bit binary string, thereby improving the security of the data to be encrypted during the encryption process. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 is a flowchart of a method for generating encrypted data provided in an embodiment of the present invention;

[0064] Figure 2 is a common array schematic diagram provided in an embodiment of the present invention;

[0065] Figure 3 is a flowchart of a data encryption method provided in an embodiment of the present invention;

[0066] Figure 4 is a flowchart of a data decryption method provided in an embodiment of the present invention;

[0067] Figure 5 is a structural block diagram of an encrypted data generating device provided in an embodiment of the present invention;

[0068] Figure 6 It is a hardware structure block diagram of an electronic device provided in each embodiment of the present invention. DETAILED DESCRIPTION

[0069] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0070] With the development of science and technology, network information technology has been advancing by leaps and bounds, greatly facilitating communication between people. The Internet involves various information such as images, sounds, and texts. People can easily obtain other people's information with the help of computers and the Internet, which poses a great hidden danger to other people's personal privacy. Therefore, the protection of personal information, such as mobile phone numbers, ID card numbers and other data, has become a top priority. Most mobile phone numbers are now encrypted using AES or MD5 encryption. The first two encryptions are relatively cumbersome, especially MD5 encryption, which is not very convenient for subsequent mobile phone numbers. Therefore, a core invention of an embodiment of the present invention is to construct a method for generating encrypted data, which not only ensures that the data to be encrypted does not appear in plain text, but also prevents the encryption process from taking up too much computing power.

[0071] Reference Figure 1 , shows a flowchart of a method for generating encrypted data provided in an embodiment of the present invention, which may specifically include the following steps:

[0072] Step 101, obtaining data to be encrypted and generating a public array;

[0073] Step 102, splitting the data to be encrypted according to a preset rule to generate first data to be encrypted and second data to be encrypted;

[0074] Step 103, determining third data to be encrypted corresponding to the first data to be encrypted from the public array using the first data to be encrypted;

[0075] Step 104, generating 32-bit binary data for the second data to be encrypted using the third data to be encrypted;

[0076] Step 105, replacing the first bit of the 32-bit binary data with the first data to be encrypted, and generating encrypted data; the encrypted data includes the first data to be encrypted and a 31-bit binary string.

[0077] In a specific implementation, the embodiment of the present invention can obtain the data to be encrypted, for example, obtain the user's mobile phone number or ID card number and other data, and generate a public array, refer to Figure 2 , Figure 2 It is a schematic diagram of a common array provided in an embodiment of the present invention. The common array may be composed of 10 common data and subscripts corresponding to the common data one by one. The subscripts may be integers of 0-9, and the subscripts do not appear repeatedly.

[0078] In a specific implementation, the public array in the embodiment of the present invention may be sent to a data decryption device, and the data decryption device may decrypt the encrypted data based on the public array.

[0079] After obtaining the data to be encrypted and generating a common array, the embodiment of the present invention can split the data to be encrypted according to a preset rule to generate first data to be encrypted and second data to be encrypted. For example, the data to be encrypted can be "18894554188", and then the first digit 1 of the number is removed, and the last digit 8 of the number is intercepted, which is recorded as: A, A=8, and the remaining nine digits "889455418" are recorded as: B, where A is the first data to be encrypted and B is the second data to be encrypted.

[0080] Of course, the above examples are only for illustration, and those skilled in the art may use any other rules to split the data to be encrypted, thereby generating the first data to be encrypted and the second data to be encrypted, and the embodiments of the present invention are not limited to this.

[0081] After generating the first data to be encrypted and the second data to be encrypted, the embodiment of the present invention can determine the third data to be encrypted corresponding to the first data to be encrypted from the public array through the first data to be encrypted. For example, the data to be encrypted can be "18894554188", and then the first digit 1 of the number is removed, and the last digit 8 of the number is intercepted, which is recorded as: A, A=8, and the remaining nine digits "889455418" are recorded as: B, where A is the first data to be encrypted and B is the second data to be encrypted. Figure 2 Since the first data to be encrypted is "8", in the public array, the public data corresponding to 8 is "23", so the third data to be encrypted is generated as M=23.

[0082] After determining the third data to be encrypted corresponding to the first data to be encrypted from the public array through the first data to be encrypted, the embodiment of the present invention can generate 32-bit binary data for the data to be encrypted through the third data to be encrypted. For example, the data to be encrypted can be "18894554188", and then the first digit 1 of the number is removed, and the last digit 8 of the number is intercepted, which is recorded as: A, A=8, and the remaining nine digits "889455418" are recorded as: B, where A is the first data to be encrypted and B is the second data to be encrypted. Figure 2 , since the first data to be encrypted is "8", in the public array, the public data corresponding to 8 is "23", so the third data to be encrypted is generated as M=23, C=BA=889455418-8=889455410, D=CM, D=889455410-23=889455387, and the digital data of positions 3, 6, and 9 in the public array are recorded as: X, Y, Z, X=66, Y=33, Z=52. E=DXYZ, E=889455387-66-33-52=889455236, and E is converted into a 32-bit binary number F=00110101000001000000001010000100.

[0083] Of course, the above examples are only for illustration, and those skilled in the art may use other algorithms to generate 32-bit binary data through the third-generation encrypted data, and the embodiments of the present invention are not limited to this.

[0084] In a specific implementation, the embodiment of the present invention can replace the first bit of the 32-bit binary data with the first data to be encrypted, and generate encrypted data including the first data to be encrypted and a 31-bit binary string.

[0085] For example, the data to be encrypted can be "18894554188", then remove the first digit 1 of the number, cut off the last digit 8 of the number, record it as: A, A = 8, the remaining nine digits "889455418" is recorded as: B, where A is the first data to be encrypted, and B is the second data to be encrypted. Figure 2, since the first data to be encrypted is "8", in the public array, the public data corresponding to 8 is "23", so the third data to be encrypted is M=23, C=BA=889455418-8=889455410, D=CM, D=889455410-23=889455387, and the data at positions 3, 6, and 9 in the public array are recorded as: X, Y, Z, X=66, Y=33, Z=52. E=DXYZ, E=889455387-66-33-52=889455236, change E into a 32-bit binary number F=00110101000001000000001010000100, replace the leftmost sign bit of F with A, and get the final encryption result G of 80110101000001000000001010000100, and use G as the encrypted data.

[0086] In an embodiment of the present invention, data to be encrypted is obtained and a common array is generated; the data to be encrypted is split according to a preset rule to generate first data to be encrypted and second data to be encrypted; third data to be encrypted corresponding to the first data to be encrypted is determined from the common array through the first data to be encrypted; 32-bit binary data for the second data to be encrypted is generated through the third data to be encrypted; the first bit of the 32-bit binary data is replaced by the first data to be encrypted, and encrypted data is generated; the encrypted data includes the first data to be encrypted and a 31-bit binary string, thereby improving the security of the data to be encrypted during the encryption process.

[0087] Based on the above embodiment, a variant embodiment of the above embodiment is proposed. It should be noted that in order to make the description concise, only the differences from the above embodiment are described in the variant embodiment.

[0088] In an optional embodiment of the present invention, the step of splitting the data to be encrypted according to a preset rule to generate first data to be encrypted and second data to be encrypted includes:

[0089] Determining a first target digit and a second target digit for the data to be encrypted;

[0090] Determining first target data from the data to be encrypted based on the first target digit, and extracting the first target data as first data to be encrypted;

[0091] Determining second target data from the data to be encrypted based on the second target digit;

[0092] The first target data and the second target data are deleted from the data to be encrypted to generate second data to be encrypted.

[0093] In practical applications, if the original data to be encrypted is directly encrypted and the encrypted data generated is easily reverse cracked, therefore, the embodiment of the present invention can determine the first target digit and the second target digit for the data to be encrypted; determine the first target data from the data to be encrypted based on the first target digit, and extract the first target data as the first data to be encrypted, determine the second target data from the data to be encrypted based on the second target digit, delete the first target data and the second target data from the data to be encrypted, and generate the second data to be encrypted.

[0094] For example, the data to be encrypted is "18894554188", the first target digit is determined to be "the 11th digit", and the second target digit is "the 1st digit". Based on the first target digit "the 11th digit", the first target data is determined to be "8" from "18894554188", and "8" is extracted as the first data to be encrypted. Based on the second target digit "the 1st digit", the second target data is determined to be "1" from "18894554188", and the first target data "8" and the second target data "1" are deleted from the data to be encrypted "18894554188" to generate the second data to be encrypted "889455418".

[0095] Of course, the above examples are only for illustration. When the data to be encrypted is a Chinese mobile phone number, the first target digit can be any digit except the first digit, and the embodiment of the present invention does not limit this.

[0096] Optionally, the first target data may be digital data mutually agreed upon by the data encryption party and the data decryption party. For example, if the data encryption party defines the first target data as the last digit of the data to be encrypted, then the data decryption party also considers that the first target data is defined as the last digit of the data to be encrypted. Alternatively, if the data encryption party defines the first target data as the second to last digit of the data to be encrypted, then the data decryption party also considers that the first target data is defined as the second to last digit of the data to be encrypted. The second encrypted data may be common data of multiple data to be encrypted. For example, the first digit of Chinese mobile phone numbers is always "1", so the first digit may be used as the second encrypted data.

[0097] The embodiment of the present invention determines a first target digit and a second target digit for the data to be encrypted; determines first target data from the data to be encrypted based on the first target digit, and extracts the first target data as the first data to be encrypted; determines second target data from the data to be encrypted based on the second target digit; deletes the first target data and the second target data from the data to be encrypted to generate second data to be encrypted, thereby effectively preventing the encrypted data from being reverse cracked and further improving the security of confidential data.

[0098] In an optional embodiment of the present invention, the step of generating 32-bit binary data for the second data to be encrypted by using the third data to be encrypted includes:

[0099] Generate fourth data to be encrypted based on a first preset encryption algorithm using the first data to be encrypted and the second data to be encrypted;

[0100] Generate fifth data to be encrypted based on a second preset encryption algorithm using the third data to be encrypted and the fourth data to be encrypted;

[0101] Determine digital data for the public array according to a preset rule, and determine at least one target public data from the public array based on the digital data;

[0102] Generate sixth data to be encrypted based on a third preset encryption algorithm using the fifth data to be encrypted and the target public data;

[0103] The sixth data to be encrypted is converted into 32-bit binary data.

[0104] In practical applications, single-layer encryption is easily reverse cracked. Therefore, the embodiment of the present invention can determine the third data to be encrypted and generate 32-bit binary data for the data to be encrypted through the third data to be encrypted, and then use the digital data for the public array in combination with multiple preset encryption algorithms to generate encrypted data, so as to further improve the security of the encrypted data. Specifically, the embodiment of the present invention can use the first data to be encrypted and the second data to be encrypted to generate the fourth data to be encrypted based on the first preset encryption algorithm, use the third data to be encrypted and the fourth data to be encrypted to generate the fifth data to be encrypted based on the second preset encryption algorithm, determine the digital data for the public array according to preset rules, and determine at least one target public data from the public array based on the digital data, use the fifth data to be encrypted and the target public data to generate the sixth data to be encrypted based on the third preset encryption algorithm, and convert the sixth data to be encrypted into 32-bit binary data.

[0105] For example, the data to be encrypted is "18894554188", where the first data to be encrypted A = 8, the second data to be encrypted B = 889455418, and the fourth data to be encrypted by the first preset encryption algorithm is C = BA = 889455418-8 = 889455410. Since the first data to be encrypted is "8", refer to Figure 2, in the public array, the public data corresponding to 8 is "23", so the third data to be encrypted is M=23, and the fifth data to be encrypted "889455387" is generated by the second preset encryption algorithm D=CM=889455410-23=889455387. Assuming that the preset rule is to take the digital data in the public array as 3, 6, 9", it can be determined that the target public data X=66, Y=33, Z=52, and through the third preset encryption algorithm E=DXYZ=889455387-66-33-52=889455236, the sixth data to be encrypted is generated as "889455236", and then the sixth data to be encrypted "889455236" is converted into 32-bit binary to generate 32-bit binary data F=00110101000001000000001010000100.

[0106] Of course, the above examples are only for illustration. Those skilled in the art may adopt other algorithms as the first preset encryption algorithm to generate the fourth data to be encrypted, may adopt other algorithms as the second preset encryption algorithm to generate the fifth data to be encrypted, and may adopt other algorithms as the third preset encryption algorithm to generate the sixth data to be encrypted. In addition, the preset rules for obtaining public data are not limited in the present invention. The preset rules may be the public data corresponding to any at least one digital data in the public array. The embodiments of the present invention do not impose any restrictions on this.

[0107] In an optional embodiment of the present invention, the first preset encryption algorithm has a corresponding first preset decryption algorithm, the second preset encryption algorithm has a corresponding second preset decryption algorithm, the third preset encryption algorithm has a corresponding third preset decryption algorithm, and the method further includes:

[0108] Extracting the first to-be-encrypted data and the 31-bit binary string from the encrypted data;

[0109] Generate the sixth data to be encrypted by using the 31-bit binary string; the sixth data to be encrypted is decimal data;

[0110] Generate fifth data to be encrypted based on a third preset decryption algorithm using the sixth data to be encrypted and the public data;

[0111] Determining third data to be encrypted corresponding to the first data to be encrypted from the public array using the first data to be encrypted;

[0112] Generate fourth data to be encrypted based on the second preset decryption algorithm using the third data to be encrypted and the fifth data to be encrypted;

[0113] Generate second data to be encrypted based on the first preset decryption algorithm using the fourth data to be encrypted and the first data to be encrypted;

[0114] The first data to be encrypted, the second target data and the second data to be encrypted are concatenated to generate the data to be encrypted.

[0115] In practical applications, the encrypted data needs to be decrypted during use. For example, a telephone number is encrypted for data transmission. After the recipient receives the encrypted data, the encrypted data (ciphertext) needs to be decrypted and restored to the original data to be encrypted (plaintext). Therefore, an embodiment of the present invention can extract the first data to be encrypted and a 31-bit binary string from the encrypted data, and generate the sixth data to be encrypted through the 31-bit binary string; the sixth data to be encrypted is decimal data, and the sixth data to be encrypted and public data are used to generate the fifth data to be encrypted based on the third preset decryption algorithm. The third data to be encrypted corresponding to the first data to be encrypted is determined from the public array through the first data to be encrypted, and the third data to be encrypted and the fifth data to be encrypted are used to generate the fourth data to be encrypted based on the second preset decryption algorithm. The fourth data to be encrypted and the first data to be encrypted are used to generate the second data to be encrypted based on the first preset decryption algorithm. The first data to be encrypted, the second target data, and the second data to be encrypted are concatenated to generate the data to be encrypted.

[0116] For example, the data to be encrypted is "18894554188", the first target digit is determined to be "the 11th digit", the second target digit is determined to be "the 1st digit", the first target data is determined to be "8" from "18894554188" based on the first target digit "the 11th digit", and "8" is extracted as the first data to be encrypted, and the second target data is determined to be "1" from "18894554188" based on the second target digit "the 1st digit", and the first target data "8" and the second target data "1" are deleted from the data to be encrypted "18894554188" to generate the second data to be encrypted "889455418", since the first data to be encrypted A = 8, the second data to be encrypted B = 889455418, the fourth data to be encrypted through the first preset encryption algorithm is C = BA = 889455418-8 = 889455410, since the first data to be encrypted is "8", refer to Figure 2In the public array, the public data corresponding to 8 is "23", so the third data to be encrypted is M=23. The fifth data to be encrypted "889455387" is generated by the second preset encryption algorithm D=CM=889455410-23=889455387. Assuming that the preset rule is to take the public data with digital data of 3, 6, and 9 in the public array", the target public data X=66, the target public data Y=33, and the target public data Z=52 can be determined. The sixth data to be encrypted is "889455236" generated by the third preset encryption algorithm E=DXYZ=889455387-66-33-52=889455236. Then, the sixth data to be encrypted "889455236" is converted into 32-bit binary to generate 32-bit binary data F=00110101000001 000000001010000100, replace the leftmost sign bit of F with the first data to be encrypted A, and get the final encryption result G is 80110101000001000000001010000100, and use G as the encrypted data. Since the encrypted data is "800110101000001000000001010000100", the first data to be encrypted "8" and the 31-bit binary string "00110101 000001000000001010000100", then "0011010100000100000001010000100" is converted into decimal to generate the sixth encrypted data E=889455236. It is known that the public data X=66, Y=33, Z=52. The sixth encrypted data E=889455236 is used based on the third preset decryption algorithm D=E+X+Y+Z=889455236+66+33+52=889 455387, and obtain the fifth data to be encrypted D=889455387. The first data to be encrypted A=8 is known, and the corresponding public data in the public array is "23", so the third data to be encrypted M=23. The third data to be encrypted M=23 and the fifth data to be encrypted D=889455387 are used to generate the fourth data to be encrypted C=D+M=889455387+23=889455410 based on the second preset decryption algorithm. Then, the fourth data to be encrypted C=889455410 and the first data to be encrypted A=8 are used to generate the second data to be encrypted B=889455418 based on the first preset decryption algorithm B=C+A=889455418. The second target data "1", the first data to be encrypted "8" and the second data to be encrypted "889455418" are concatenated to obtain "18894554188" to generate encrypted data.

[0117] In practical applications, the concatenation rule for concatenating the second target data, the first data to be encrypted and the second data to be encrypted to generate encrypted data may be based on the first target digit and the second target digit corresponding to the first data to be encrypted and the second target data.

[0118] In an optional embodiment of the present invention, when the data to be encrypted is a mobile phone number, the second target data is the first digit of the data to be encrypted, and the first data to be encrypted is any digit of data except the first digit.

[0119] Optionally, an embodiment of the present invention can first determine whether the data to be encrypted is a mobile phone number. For example, it can determine whether the data to be encrypted is an 11-digit pure number starting with 13, 14, 15, 16, 17, 18, or 19; if so, it is determined that the data to be encrypted is a mobile phone number, and when it is determined that the data to be encrypted is a mobile phone number, the second target data is the first digit of the data to be encrypted, and the first data to be encrypted is any digit of data except the first digit.

[0120] For example: the data to be encrypted is "18894554188" and meets the conditions of "11 pure digits" and "starting with 18". In this case, the data to be encrypted is a mobile phone number, the second target data is the first digit "1" of "18894554188", and the first data to be encrypted is the 11th digit "8" except the first digit.

[0121] The above examples are only for illustration, and those skilled in the art may determine whether it is a mobile phone number in other ways, and the embodiments of the present invention are not limited to this.

[0122] In order to enable those skilled in the art to better understand the embodiments of the present invention, a complete example is used below to illustrate the embodiments of the present invention.

[0123] refer to Figure 3 , Figure 3 It is a step flow chart of a data encryption method provided in an embodiment of the present invention.

[0124] Step 1: Get the mobile phone number 18894554188 and encrypt and decrypt the public array reference Figure 2 .

[0125] Step 2: Determine whether the mobile phone number meets the encryption conditions: 11 pure digits, Chinese mobile phone numbers starting with 13, 14, 15, 16, 17, 18, 19. The mobile phone number starting with 18 meets the conditions.

[0126] Step 3: Encryption, remove the first digit 1 of the mobile phone number, and take the last digit 8 of the mobile phone number, recorded as: A, A=8, and the remaining nine digits are recorded as: B, B=889455418, C=BA, C=889455418-8=889455410. According to A, get M=23, D=CM, D=889455410-23=889455387 from the public array, and take the data at the subscripts 3, 6, and 9 in the public array as: X, Y, Z, X=66, Y=33, Z=52. E=DXYZ,E=889455387-66-33-52=889455236,Change E into a 32-bit binary number F,F=00110101000001000000001010000100,Replace the leftmost sign bit of F with A,The final encryption result G is: 80110101000001000000001010000100

[0127] refer to Figure 4 , Figure 4 It is a step flow chart of a data decryption method provided in an embodiment of the present invention.

[0128] Step 4: Decryption. The result of encryption is: 80110101000001000000001010000100. Split the encrypted data, take out the leftmost 8, A=8, and convert the remaining 31 binary digits into decimal E: 889455236. In the public array, take the data at positions 3, 6, and 9 and record them as: X, Y, and Z. X=66, Y=33, and Z=52. D=E+X+YZ=889455236+66+33+52=889455387. According to A, get the value in the public array: M=23. C=D+M=889455387+23=889455410. B=C+A=889455410+8=889455418. Add a 1 to the left side of B and A to the right side of B, and the final output is the mobile phone number: S=18894554188.

[0129] Through the above method, it is possible to avoid using methods such as MD5 that require large computing power to encrypt the encrypted data. While ensuring the security of the encrypted data, it also improves the efficiency of the data encryption and decryption process.

[0130] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0131] Reference Figure 5 , shows a structural block diagram of an encrypted data generating device provided in an embodiment of the present invention, which may specifically include the following modules:

[0132] The to-be-encrypted data acquisition module 501 is used to acquire the to-be-encrypted data and generate a public array;

[0133] The to-be-encrypted data splitting module 502 is used to split the to-be-encrypted data according to a preset rule to generate first to-be-encrypted data and second to-be-encrypted data;

[0134] A third data to be encrypted determining module 503, configured to determine third data to be encrypted corresponding to the first data to be encrypted from the public array using the first data to be encrypted;

[0135] A 32-bit binary data generating module 504, configured to generate 32-bit binary data corresponding to the second data to be encrypted using the third data to be encrypted;

[0136] The encrypted data generating module 505 is used to replace the first bit of the 32-bit binary data with the first data to be encrypted, and generate encrypted data; the encrypted data includes the first data to be encrypted and a 31-bit binary string.

[0137] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0138] In addition, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned encryption data generation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0139] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned encrypted data generation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0140] Figure 6 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.

[0141] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and a power supply 611. Those skilled in the art will appreciate that Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.

[0142] It should be understood that in the embodiment of the present invention, the radio frequency unit 601 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 610 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 601 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 601 can also communicate with the network and other devices through a wireless communication system.

[0143] The electronic device provides users with wireless broadband Internet access through the network module 602, such as helping users to send and receive emails, browse web pages, and access streaming media.

[0144] The audio output unit 603 can convert the audio data received by the RF unit 601 or the network module 602 or stored in the memory 609 into an audio signal and output it as sound. Moreover, the audio output unit 603 can also provide audio output related to a specific function performed by the electronic device 600 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 603 includes a speaker, a buzzer, a receiver, etc.

[0145] The input unit 604 is used to receive audio or video signals. The input unit 604 may include a graphics processor (GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 606. The image frame processed by the graphics processor 6041 can be stored in the memory 609 (or other storage medium) or sent via the radio frequency unit 601 or the network module 602. The microphone 6042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 601 in the case of a telephone call mode.

[0146] The electronic device 600 also includes at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 6061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 6061 and / or the backlight when the electronic device 600 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 605 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.

[0147] The display unit 606 is used to display information input by the user or information provided to the user. The display unit 606 may include a display panel 6061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0148] The user input unit 607 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 607 includes a touch panel 6071 and other input devices 6072. The touch panel 6071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 6071 or near the touch panel 6071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 6071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 610, receives the command sent by the processor 610 and executes it. In addition, the touch panel 6071 can be implemented in various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 6071, the user input unit 607 may also include other input devices 6072. Specifically, other input devices 6072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.

[0149] Further, the touch panel 6071 may be covered on the display panel 6061. When the touch panel 6071 detects a touch operation on or near it, it is transmitted to the processor 610 to determine the type of touch event. Then, the processor 610 provides corresponding visual output on the display panel 6061 according to the type of touch event. Figure 6 In the figure, the touch panel 6071 and the display panel 6061 are used as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 6071 and the display panel 6061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.

[0150] The interface unit 608 is an interface for connecting an external device to the electronic device 600. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 608 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 600 or may be used to transmit data between the electronic device 600 and an external device.

[0151] The memory 609 can be used to store software programs and various data. The memory 609 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 609 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0152] The processor 610 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 609 and calling data stored in the memory 609, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 610 may include one or more processing units; preferably, the processor 610 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 610.

[0153] The electronic device 600 may also include a power supply 611 (such as a battery) for supplying power to each component. Preferably, the power supply 611 may be logically connected to the processor 610 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.

[0154] In addition, the electronic device 600 includes some functional modules not shown, which will not be described in detail here.

[0155] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0156] 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 invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

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

[0158] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0159] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0160] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0161] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0162] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0163] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0164] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for generating encrypted data, characterized in that: The method comprises: Get the data to be encrypted and generate a public array; Splitting the data to be encrypted according to a preset rule to generate first data to be encrypted and second data to be encrypted; Determine third data to be encrypted corresponding to the first data to be encrypted from the public array using the first data to be encrypted; Generate 32-bit binary data for the second data to be encrypted using the third data to be encrypted; The first data to be encrypted replaces the first bit of the 32-bit binary data, and generates encrypted data; the encrypted data includes the first data to be encrypted and a 31-bit binary string; The step of generating 32-bit binary data for the second data to be encrypted by using the third data to be encrypted comprises: Generate fourth data to be encrypted based on a first preset encryption algorithm using the first data to be encrypted and the second data to be encrypted; Generate fifth data to be encrypted based on a second preset encryption algorithm using the third data to be encrypted and the fourth data to be encrypted; Determine digital data for the public array according to a preset rule, and determine at least one target public data from the public array based on the digital data; Generate sixth data to be encrypted based on a third preset encryption algorithm using the fifth data to be encrypted and the target public data; The sixth data to be encrypted is converted into 32-bit binary data.

2. The method according to claim 1, characterized in that The step of splitting the data to be encrypted according to a preset rule to generate first data to be encrypted and second data to be encrypted comprises: Determining a first target digit and a second target digit for the data to be encrypted; Determining first target data from the data to be encrypted based on the first target digit, and extracting the first target data as first data to be encrypted; Determining second target data from the data to be encrypted based on the second target digit; The first target data and the second target data are deleted from the data to be encrypted to generate second data to be encrypted.

3. The method according to claim 2, characterized in that The first preset encryption algorithm has a corresponding first preset decryption algorithm, the second preset encryption algorithm has a corresponding second preset decryption algorithm, the third preset encryption algorithm has a corresponding third preset decryption algorithm, and the method further includes: Extracting the first to-be-encrypted data and the 31-bit binary string from the encrypted data; Generate the sixth data to be encrypted by using the 31-bit binary string; the sixth data to be encrypted is decimal data; Generate fifth data to be encrypted based on a third preset decryption algorithm using the sixth data to be encrypted and the public data; Determine third data to be encrypted corresponding to the first data to be encrypted from the public array using the first data to be encrypted; Generate fourth data to be encrypted based on the second preset decryption algorithm using the third data to be encrypted and the fifth data to be encrypted; Generate second data to be encrypted based on the first preset decryption algorithm using the fourth data to be encrypted and the first data to be encrypted; The first data to be encrypted, the second target data and the second data to be encrypted are concatenated to generate the data to be encrypted.

4. The method according to claim 2, characterized in that: When the data to be encrypted is a mobile phone number, the second target data is the first digit of the data to be encrypted, and the first data to be encrypted is any digit of data except the first digit.

5. An encrypted data generating device, characterized in that: include: The module for obtaining data to be encrypted is used to obtain the data to be encrypted and generate a public array; The to-be-encrypted data splitting module is used to split the to-be-encrypted data according to a preset rule to generate first to-be-encrypted data and second to-be-encrypted data; A third data to be encrypted determining module, configured to determine third data to be encrypted corresponding to the first data to be encrypted from the public array using the first data to be encrypted; a 32-bit binary data generating module, configured to generate 32-bit binary data corresponding to the second data to be encrypted using the third data to be encrypted; An encrypted data generation module, used to replace the first bit of the 32-bit binary data with the first data to be encrypted, and generate encrypted data; the encrypted data includes the first data to be encrypted and a 31-bit binary string; The 32-bit binary data generation module includes: A fourth to-be-encrypted data generating submodule, configured to generate fourth to-be-encrypted data based on a first preset encryption algorithm using the first to-be-encrypted data and the second to-be-encrypted data; A fifth to-be-encrypted data generating submodule, configured to generate fifth to-be-encrypted data based on a second preset encryption algorithm using the third to-be-encrypted data and the fourth to-be-encrypted data; a target public data determination submodule, configured to determine digital data for the public array according to a preset rule, and determine at least one target public data from the public array based on the digital data; a sixth to-be-encrypted data generating submodule, configured to generate sixth to-be-encrypted data based on a third preset encryption algorithm by using the fifth to-be-encrypted data and the target public data; The 32-bit binary data generating submodule is used to convert the sixth data to be encrypted into 32-bit binary data.

6. The device according to claim 5, characterized in that The to-be-encrypted data splitting module also includes: A digit determination submodule, used to determine a first target digit and a second target digit for the data to be encrypted; A first target data determination submodule, configured to determine first target data from the data to be encrypted based on the first target digit, and extract the first target data as first data to be encrypted; A second target data determination submodule, used to determine second target data from the data to be encrypted based on the second target digit; The second data to be encrypted generating submodule is used to delete the first target data and the second target data from the data to be encrypted to generate second data to be encrypted.

7. The device according to claim 6, characterized in that The first preset encryption algorithm has a corresponding first preset decryption algorithm, the second preset encryption algorithm has a corresponding second preset decryption algorithm, the third preset encryption algorithm has a corresponding third preset decryption algorithm, and the device further includes: A first to-be-encrypted data extraction submodule, used to extract the first to-be-encrypted data and the 31-bit binary string from the encrypted data; A decimal data generation submodule, used to generate the sixth data to be encrypted by using the 31-bit binary string; the sixth data to be encrypted is decimal data; A fifth data to be encrypted decryption submodule, configured to generate fifth data to be encrypted based on a third preset decryption algorithm using the sixth data to be encrypted and the public data; A third to-be-encrypted data decryption submodule, configured to determine, from the public array, third to-be-encrypted data corresponding to the first to-be-encrypted data according to the first to-be-encrypted data; a fourth data to be encrypted decryption submodule, configured to generate fourth data to be encrypted based on the second preset decryption algorithm by using the third data to be encrypted and the fifth data to be encrypted; A second to-be-encrypted data decryption submodule, configured to generate second to-be-encrypted data based on the first preset decryption algorithm using the fourth to-be-encrypted data and the first to-be-encrypted data; The to-be-encrypted data decryption submodule is used to concatenate the first to-be-encrypted data, the second target data and the second to-be-encrypted data to generate the to-be-encrypted data.

8. The device according to claim 6, characterized in that When the data to be encrypted is a mobile phone number, the second target data is the first digit of the data to be encrypted, and the first data to be encrypted is any digit of data except the first digit.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 4 when executing the program stored in the memory.

10. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Data encryption and decryption method and device

    CN113055184A

  • Data encryption method and device, electronic equipment and storage medium

    CN115001746A