Information Encryption Method and Device, Information Decryption Method and Device

By customizing the encryption level and location identification in the encryption method, the problem of not being able to customize the encryption level in the prior art is solved, and higher user information security is achieved.

CN115499215BActive Publication Date: 2025-06-10CHINA TELECOM CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211131475.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2025-06-10
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

Existing encryption methods cannot customize the encryption level of encrypted information, resulting in limited improvement in user information security.

Method used

By obtaining the security level and location of each segment information in the information to be encrypted, the sorting identifier is determined using the lowest energy principle, and added it to the information to be encrypted, and encoding it based on the preset encoding rules to obtain the target encryption information.

Benefits of technology

It realizes custom-set encryption levels, improves the security of user information, and can set different encryption levels according to the importance of different information segments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115499215B_ABST
    Figure CN115499215B_ABST
Patent Text Reader

Abstract

The present application discloses an information encryption method and apparatus, an information decryption method and apparatus. Among them, the method includes: obtaining first information to be encrypted, where the first information to be encrypted includes multiple segments of first sub-information to be encrypted; determining a sorting identifier for each segment of the first sub-information to be encrypted, where the sorting identifier is used to reflect the position information and encryption level information of each first sub-information in the first information to be encrypted; adding the sorting identifier to the first information to be encrypted to obtain second information to be encrypted; encoding the second information to be encrypted based on a preset encoding rule to obtain target encrypted information. The present application solves the technical problem that the related art cannot customize the encryption level of encrypted information and improve the security of user information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data encryption technology. Specifically, it relates to an information encryption method and device, and an information decryption method and device. Background Art

[0002] Currently, more and more users have started to commonly use the Internet to transmit and send messages through the Internet. Therefore, in users' daily use, the Internet gradually accounts for an increasing proportion. How to ensure the security of users' received and sent information has become particularly important.

[0003] Generally, in order to improve the security of received and sent messages, data generally needs to be encrypted. The existing encryption method changes the appearance of data in network transmission according to a certain algorithm using a specific scheme for the receiving party to compare. This method cannot customize the encryption level of encrypted information to improve the security of users' received and sent information.

[0004] In response to the above problems, no effective solution has been proposed yet. Summary of the Invention

[0005] Embodiments of this application provide an information encryption method and device, and an information decryption method and device to at least solve the technical problem that the related art cannot customize the encryption level of encrypted information and improve the security of user information.

[0006] According to one aspect of the embodiments of this application, an information encryption method is provided, including: obtaining first information to be encrypted, where the first information to be encrypted includes multiple segments of first sub-information to be encrypted; determining a sorting identifier for each segment of the first sub-information to be encrypted, where the sorting identifier is used to reflect the position information and encryption level information of each segment of the first sub-information to be encrypted in the first information to be encrypted; adding the sorting identifier to the first information to be encrypted to obtain second information to be encrypted; encoding the second information to be encrypted based on a preset encoding rule to obtain target encrypted information.

[0007] Optionally, determining the sorting identifier for each segment of the first sub-information to be encrypted includes: for each segment of the first sub-information to be encrypted, obtaining the security level of the first sub-information to be encrypted, and determining the encryption level identifier of the first sub-information to be encrypted according to the security level; according to the position of the first sub-information to be encrypted in the first information to be encrypted and the encryption level identifier, using the principle of the lowest energy to determine the position identifier of the first sub-information to be encrypted, where the position identifier corresponds to the principal quantum number and the encryption level identifier corresponds to the angular quantum number; determining the sorting identifier of the first sub-information to be encrypted according to the encryption level identifier and the position identifier.

[0008] Optionally, the position identifier of the first sub-information to be encrypted is determined by using the principle of the lowest energy, including: for multiple segments of the first sub-information to be encrypted with the same security level, sorting the multiple segments of the first sub-information to be encrypted according to their positions in the first information to be encrypted, so as to obtain the position identifiers of the multiple segments of the first sub-information to be encrypted.

[0009] Optionally, adding the sorting identifier to the first information to be encrypted to obtain the second information to be encrypted, including: for each segment of the first sub-information to be encrypted, splicing the sorting identifier of the first sub-information to be encrypted with the first sub-information to be encrypted to obtain the second sub-information to be encrypted; splicing each segment of the second sub-information to be encrypted to obtain the second information to be encrypted.

[0010] Optionally, splicing each segment of the second sub-information to be encrypted to obtain the second information to be encrypted, including: randomly sorting each segment of the second sub-information to be encrypted, and splicing the randomly sorted segments of the second sub-information to be encrypted to obtain the second information to be encrypted.

[0011] Optionally, splicing each segment of the second sub-information to be encrypted to obtain the second information to be encrypted, including: adding a preset segmentation identifier between each segment of the second sub-information to be encrypted; splicing each segment of the second sub-information to be encrypted and the segmentation identifier to obtain the second information to be encrypted.

[0012] According to another aspect of the embodiments of the present application, an information decryption method is further provided, including: obtaining encrypted information, where the encrypted information includes multiple segments of encrypted sub-information; for each segment of the encrypted sub-information, decoding the encrypted sub-information based on a preset decoding rule to obtain the sub-information to be decrypted, where the sub-information to be decrypted includes: target decryption sub-information and a sorting identifier, and the sorting identifier is used to reflect the position information and encryption level information of the target decryption sub-information in the target decrypted information; sorting each segment of the target decryption sub-information according to the sorting identifier to obtain the target decrypted information.

[0013] According to another aspect of the embodiments of the present application, an information encryption device is further provided, including: an acquisition module, configured to acquire the first information to be encrypted, where the first information to be encrypted includes multiple segments of the first sub-information to be encrypted; a determination module, configured to determine the sorting identifier of each segment of the first sub-information to be encrypted, and the sorting identifier is used to reflect the position information and encryption level information of each first sub-information to be encrypted in the first information to be encrypted; an addition module, configured to add the sorting identifier to the first information to be encrypted to obtain the second information to be encrypted; an encoding module, configured to encode the second information to be encrypted based on a preset encoding rule to obtain the target encrypted information.

[0014] According to another aspect of the embodiments of the present application, there is also provided an information decryption device, including: an acquisition module, configured to acquire encrypted information, where the encrypted information includes multiple segments of encrypted sub-information; a decoding module, configured to, for each segment of encrypted sub-information, decode the encrypted sub-information based on a preset decoding rule to obtain sub-information to be decrypted, where the sub-information to be decrypted includes: target decryption sub-information and a sorting identifier, and the sorting identifier is used to reflect the position information and encryption level information of the target decryption sub-information in the target decrypted information; a sorting module, configured to sort each segment of target decryption sub-information according to the sorting identifier to obtain the target decrypted information.

[0015] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including: a memory and a processor, where a computer program is stored in the memory, and the processor is configured to execute the above information encryption method or information decryption method through the computer program.

[0016] In the embodiments of the present application, acquire first information to be encrypted, where the first information to be encrypted includes multiple segments of first sub-information to be encrypted; determine the sorting identifier of each segment of first sub-information to be encrypted, where the sorting identifier is used to reflect the position information and encryption level information of each first sub-information to be encrypted in the first information to be encrypted; add the sorting identifier to the first information to be encrypted to obtain second information to be encrypted; encode the second information to be encrypted based on a preset encoding rule to obtain target encrypted information, thereby realizing custom setting of the encryption level to obtain the sorting identifier, and further solving the technical problem that the encryption level of encrypted information cannot be custom set in the related art, and improving the security of user information. Description of the Drawings

[0017] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation to the present application. In the drawings:

[0018] Figure 1 is a flowchart of an information encryption method according to an embodiment of the present application;

[0019] Figure 2 is a schematic diagram of an optional principle of minimum energy according to an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of an optional sorting identifier based on the principle of minimum energy according to an embodiment of the present application;

[0021] Figure 4 is a flowchart of an information decryption method according to an embodiment of the present application;

[0022] Figure 5It is a schematic structural diagram of an information encryption device according to an embodiment of the present application;

[0023] Figure 6 It is a schematic structural diagram of an information decryption device according to an embodiment of the present application. Detailed implementation manners

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0025] It should be noted that the terms "first", "second", etc. in the specification, claims and drawings of the present application are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0026] To better understand the embodiments of the present application, some nouns or terms that appear in the description process of the embodiments of the present application are translated and explained as follows:

[0027] The principle of the lowest energy: That is, for a multi-electron atom in the ground state, when arranging the extranuclear electrons, they always occupy the orbit with the lowest energy as much as possible first, and then are distributed to the orbits with higher energy levels in turn according to the order of the approximate energy levels of the atomic orbits, so as to make the energy of the whole atom the lowest. Among them, the level of the energy of the atomic orbit (also called energy level) is mainly determined by the principal quantum number N and the angular quantum number L. When L is the same, the larger N is, the higher the energy of the atomic orbit. For example, E 1s <E 2s <E 3s ; when N is the same, the larger L is, the higher the energy of the atomic orbit. For example, E 1s <E 1p <E 1d; When N and L are both different, the attraction of the atomic nucleus for electrons and the repulsion between electrons must be considered simultaneously. Since the presence of other electrons often weakens the attraction of the atomic nucleus for outer electrons, the energy levels of multi-electron atoms are staggered. Therefore, an approximate energy level diagram of multi-electron atomic orbitals is proposed. Small circles are used to represent atomic orbitals, which are arranged in order of increasing energy. Orbitals with relatively close energies are placed in the same box to form an energy level group.

[0028] Example 1

[0029] The related information encryption method is based on a certain algorithm and uses a specific scheme to change the appearance of important data information during network transmission, and then the receiving party compares the data information before and after the change. This method sets the same encryption level for all contents in the data information and does not consider the data segment information with different degrees of importance / sensitivity in the data information. This method greatly reduces the security of user information.

[0030] To solve the above problems, the embodiments of the present application provide an information encryption method. This method can set different encryption levels for each segment of the sub-information to be encrypted according to the security levels of each segment of the sub-information to be encrypted in the information to be encrypted, and according to the position of each segment of the sub-information to be encrypted in the information to be encrypted and the encryption level, use the principle of the lowest energy to set the sorting identifier of each segment of the sub-information to be encrypted, and add the sorting identifier to the information to be encrypted for encoding to obtain the encrypted information, so that users can set different encryption levels for each segment of the encrypted information according to their needs during actual application, improving the security of user information.

[0031] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0032] Figure 1 is a schematic flowchart of an optional information encryption method according to an embodiment of the present application. As Figure 1 shown, the method at least includes steps S102 - S108, where:

[0033] Step S102, obtain the first information to be encrypted, and the first information to be encrypted includes multiple segments of the first sub-information to be encrypted.

[0034] Among them, the first information to be encrypted can be the information to be encrypted obtained from an information library, such as: ID number information, email address information, bank card number information, etc.

[0035] For example, the first information to be encrypted is the user's mobile phone number information, such as 1*0313*7223. Each digit in the mobile phone number is split to obtain multiple segments of the first sub-information to be encrypted. Subsequently, when encrypting the information, different encryption levels are set accordingly based on the digital segment information that the user wants to protect key points.

[0036] Step S104, determine the sorting identifier for each segment of the first sub-information to be encrypted. The sorting identifier is used to reflect the position information and encryption level information of each first sub-information to be encrypted in the first information to be encrypted.

[0037] Among them, the sorting identifier can be a prefix sorting identifier or a suffix sorting identifier.

[0038] Optionally, for each segment of the first sub-information to be encrypted, obtain the security level of the first sub-information to be encrypted, and determine the encryption level identifier of the first sub-information to be encrypted according to the security level; according to the position of the first sub-information to be encrypted in the first information to be encrypted and the encryption level identifier, use the principle of the lowest energy to determine the position identifier of the first sub-information to be encrypted, where the position identifier corresponds to the principal quantum number, and the encryption level identifier corresponds to the angular quantum number; determine the sorting identifier of the first sub-information to be encrypted according to the encryption level identifier and the position identifier.

[0039] As an alternative implementation, for multiple segments of the first sub-information to be encrypted with the same security level, sort the multiple segments of the first sub-information to be encrypted according to their positions in the first information to be encrypted to obtain the position identifiers of the multiple segments of the first sub-information to be encrypted.

[0040] Generally, for Figure 2 the shown lowest energy principle diagram, when the principal quantum numbers are the same, the larger the angular quantum number, the greater the atomic energy. For example, 3s < 3p < 3f; when the angular quantum numbers are the same, the larger the principal quantum number, the greater the atomic energy. For example, 1s < 2s < 3s.

[0041] For this application, for multiple segments of the first sub-information to be encrypted with the same security level, for example, for the same encryption level identifier p, sort them according to the positions of the numbers 0, 1, 7, 3 in the user's phone number to obtain the position identifiers corresponding to each digital information, where the position identifier of the number 0 is 2, the position identifier of the number 1 is 3, the position identifier of the number 7 is 4, and the position identifier of the number 3 is 5.

[0042] Specifically, taking the user's mobile phone number 1*0313*7223 as an example, since the user's mobile phone number contains sensitive information of different security levels, different encryption level identifiers need to be set for sensitive information of different levels when encrypting. When the security level of the user's mobile phone number is medium - low, according to the four security levels preset by the system, namely s, p, d, and f, the encryption level identifiers of each digit are set. Among them, the encryption level identifiers of the first digit 1, the second digit *, the fourth digit 3, the sixth digit 3, and the ninth digit 2 are s; the encryption level identifiers of the third digit 0, the fifth digit 1, the eighth digit 7, and the eleventh digit 3 are p; the encryption level identifiers of the seventh digit * and the tenth digit 2 are d.

[0043] Next, based on the position and encryption level identifier of each digit, use the lowest - energy schematic diagram as shown in Figure 2 to determine the position identifier of each digit.

[0044] Finally, determine the sorting identifier based on the encryption level identifier and position identifier of each digit. Figure 3 Fig. shows a schematic diagram of an optional sorting identifier. Among them, the sorting identifier corresponding to the first digit 1 is 1s, the sorting identifier corresponding to the second digit * is 2s, the sorting identifier corresponding to the third digit 0 is 2p, the sorting identifier corresponding to the fourth digit 3 is 3s, the sorting identifier corresponding to the fifth digit 1 is 3p, the sorting identifier corresponding to the sixth digit 3 is 4s, the sorting identifier corresponding to the seventh digit * is 3d, the sorting identifier corresponding to the eighth digit 7 is 4p, the sorting identifier corresponding to the ninth digit 2 is 5s, the sorting identifier corresponding to the tenth digit 2 is 4d, and the sorting identifier corresponding to the eleventh digit 3 is 5p.

[0045] Step S106, add the sorting identifier to the first information to be encrypted to obtain the second information to be encrypted.

[0046] Optionally, for each segment of the first sub - information to be encrypted, splice the sorting identifier of the first sub - information to be encrypted with the first sub - information to be encrypted to obtain the second sub - information to be encrypted; splice each segment of the second sub - information to be encrypted to obtain the second information to be encrypted.

[0047] Optionally, randomly sort each segment of the second sub - information to be encrypted, and splice the randomly sorted segments of the second sub - information to be encrypted to obtain the second information to be encrypted.

[0048] Optionally, add a preset segmentation identifier between each segment of the second sub - information to be encrypted; splice each segment of the second sub - information to be encrypted and the segmentation identifier to obtain the second information to be encrypted.

[0049] Specifically, to facilitate the identification of each segment of sub-information to be encrypted, the segmentation identifier should avoid any characters that may appear in the information to be encrypted, so as to ensure distinction from other parts of the encrypted information. Therefore, the segmentation identifier can be formed by a single character or a combination of multiple characters into other strings that will never appear, such as tab characters, line break characters, number symbols, etc.

[0050] For example, continuing with the user's phone number as an example, each digit is concatenated with its corresponding suffix sorting identifier to obtain 11s, *2s, 02p, 33s, 13p, 34s, *3d, 74p, 25s, 24d, 35p. Then, the above digits are randomly sorted, such as 11s, 74p, 33s, 25s, 24d, 13p, 34s, 35p, *3d, *2s, 02p, and a segmentation identifier is added between each segment of information. Among them, no segmentation identifier needs to be concatenated after the last segment of information. Finally, the segments of information are arranged in an order other than the original order, and a segmentation identifier is added between each segment of information to obtain the second piece of information to be encrypted. When the segmentation identifier is &%&, the second piece of information to be encrypted can be 11s&%&74p&%&33s&%&25s&%&24d&%&13p&%&34s&%&35p&%&*3d&%&*2s&%&02p.

[0051] Step S108, encode the second piece of information to be encrypted based on a preset encoding rule to obtain the target encrypted information.

[0052] Optionally, the preset encoding rule can be base64 encoding, ASCII code encoding, etc. In the embodiment of the present application, base64 encoding is preferably used. Among them, base64 is a method for identifying binary data based on 64 printable characters, and is often used in occasions for processing text data, representing, transmitting, and storing some binary data, including emails or some complex data.

[0053] When the preset encoding rule selects a reversible encoding method, the preset encoding rule can be a symmetric encoding rule or an asymmetric encoding rule. Among them, when the data volume is large, the symmetric encoding rule can be selected as the preset encoding rule, and the data encoding speed of this symmetric encoding rule is relatively fast; when the security requirements for encrypted data are high, the asymmetric encoding rule can be selected as the preset encoding rule.

[0054] It should be noted that the selection of the preset encoding rule is not restricted, and a suitable reversible encoding method is specifically selected according to the actual application scenario.

[0055] Specifically, in the embodiments of the present application, the re - spliced string "11s&%&74p&%&33s&%&25s&%&24d&%&13p&%&34s&%&35p&%&*3d&%&*2s&%&02p" is encoded by the base64 encoding method. For example, "11s" can be encoded to obtain "MTFz" through base64 encoding, and "&%&" can be encoded to obtain "JTI2JTI1JTI2" through base64 encoding. Therefore, the following encrypted information can be obtained after encoding the above string: "MTFzJTI2JTI1JTI2NzRwJTI2JTI1JTI2MzNzJTI2JTI1JTI2MjVzJTI2JTI1JTI2MjRkJTI2JT I1JTI2MTNwJTI2JTI1JTI2MzRzJTI2JTI1JTI2MzVwJTI2JTI1JTI2KjNkJTI2JTI1JTI2KjJz JTI2JTI1JTI2MDJw".

[0056] After the encryption operation on the first information to be encrypted is completed, the subsequent decryption operation can directly operate on the target encrypted information without using the first information to be encrypted for operation processing.

[0057] As an optional implementation manner, after storing the target encrypted information, the first information to be encrypted can be deleted. This can not only save the storage space of the information library but also prevent the leakage of the first information to be encrypted, thereby enhancing the security of user information storage.

[0058] In the embodiments of the present application, the first information to be encrypted is obtained, and the first information to be encrypted includes multiple segments of first sub - information to be encrypted; the sorting identifier of each segment of the first sub - information to be encrypted is determined, and the sorting identifier is used to reflect the position information and encryption level information of each first sub - information to be encrypted in the first information to be encrypted; the sorting identifier is added to the first information to be encrypted to obtain the second information to be encrypted; the second information to be encrypted is encoded based on a preset encoding rule to obtain the target encrypted information, thereby realizing custom - setting the encryption level to obtain the sorting identifier, and further solving the technical problem that the encryption level of the encrypted information cannot be custom - set in the related art and improving the security of user information.

[0059] Embodiment 2

[0060] The embodiments of the present application provide an information decryption method. After decrypting the encrypted information through a preset decoding rule, the final target decrypted information can be obtained according to the sorting identifier of each sub - information to be decrypted.

[0061] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0062] Figure 4 It is a schematic flowchart of an optional information encryption method according to an embodiment of the present application. As Figure 4 shown, the method at least includes steps S402 - S406, where:

[0063] Step S402, obtain encrypted information, where the encrypted information includes multiple segments of encrypted sub-information.

[0064] Step S404, for each segment of encrypted sub-information, decode the encrypted sub-information based on a preset decoding rule to obtain sub-information to be decrypted. Among them, the sub-information to be decrypted includes: target decryption sub-information and a sorting identifier, and the sorting identifier is used to reflect the position information and encryption level information of the target decryption sub-information in the target decryption information;

[0065] Step S406, sort each segment of target decryption sub-information according to the sorting identifier to obtain the target decryption information.

[0066] Optionally, the preset decoding rule can be base64 decoding, ASCII code decoding, etc. In the embodiment of the present application, base64 decoding is preferably used.

[0067] It should be noted that the selection of the preset decoding rule is not limited, and a suitable reversible decoding method is specifically selected according to the actual application scenario.

[0068] For example, first obtain the target encrypted information obtained by the information encryption method. The content of the encrypted information is MTFzJTI2JTI1JTI2NzRwJTI2JTI1JTI2MzNzJTI2JTI1JTI2MjVzJTI2JTI1JTI2MjRkJTI2JTI1JTI2MTNwJTI2JTI1JTI2MzRzJTI2JTI1JTI2MzVwJTI2JTI1JTI2KjNkJTI2JTI1JTI2KjJzJTI2JTI1JTI2MDJw. Among them, the encrypted information includes multiple segments of encrypted sub-information, such as MTFzJTI2JTI1JTI2, NzRwJTI2JTI1JTI2, MzNzJTI2JTI1JTI2, MjVzJTI2JTI1JTI2, MjRkJTI2JTI1JTI2, MTNwJTI2JTI1JTI2, MzRzJTI2JTI1JTI2, MzVwJTI2JTI1JTI2, KjNkJTI2JTI1JTI2, KjJzJTI2JTI1JTI2, MDJw; then decode each segment of the above information through base64 decoding to obtain the following data information: {"11s","74p","33s","25s","24d","13p","34s","35p","*3d","*2s","02p"}, where each segment of decoded data information includes: the target sub-information to be decrypted and the sorting identifier; finally, sort each segment of data information according to the sorting identifier to obtain the target decrypted information, that is, the user's mobile phone number 1*0313*7223.

[0069] Embodiment 3

[0070] According to the embodiments of the present application, there is also provided an information encryption device for implementing the above information encryption method, as Figure 5 shown. The information encryption device at least includes an acquisition module 51, a determination module 52, an addition model 53, and an encoding module 54, where:

[0071] The acquisition module 51 is configured to acquire the first information to be encrypted, and the first information to be encrypted contains multiple segments of the first sub-information to be encrypted.

[0072] Among them, the first information to be encrypted may be the information to be encrypted obtained from the information library, such as: ID card number information, email address information, bank card number information, etc.

[0073] The determination module 52 is configured to determine the sorting identifier of each segment of the first sub-information to be encrypted, and the sorting identifier is used to reflect the position information and encryption level information of each first sub-information to be encrypted in the first information to be encrypted.

[0074] Among them, the sorting identifier can be a prefix sorting identifier or a suffix sorting identifier.

[0075] Optionally, for each first sub-information to be encrypted, obtain the security level of the first sub-information to be encrypted, and determine the encryption level identifier of the first sub-information to be encrypted according to the security level; according to the position of the first sub-information to be encrypted in the first information to be encrypted and the encryption level identifier, use the principle of the lowest energy to determine the position identifier of the first sub-information to be encrypted, where the position identifier corresponds to the principal quantum number, and the encryption level identifier corresponds to the angular quantum number; determine the sorting identifier of the first sub-information to be encrypted according to the encryption level identifier and the position identifier.

[0076] As an optional implementation manner, for multiple segments of the first sub-information to be encrypted with the same security level, sort the multiple segments of the first sub-information to be encrypted according to the positions of the multiple segments of the first sub-information to be encrypted in the first information to be encrypted, and obtain the position identifiers of the multiple segments of the first sub-information to be encrypted.

[0077] Add a model 53 for adding the sorting identifier to the first information to be encrypted to obtain the second information to be encrypted.

[0078] Optionally, for each segment of the first sub-information to be encrypted, splice the sorting identifier of the first sub-information to be encrypted with the first sub-information to be encrypted to obtain the second sub-information to be encrypted; splice each segment of the second sub-information to be encrypted to obtain the second information to be encrypted.

[0079] Optionally, randomly sort each segment of the second sub-information to be encrypted, and splice the randomly sorted segments of the second sub-information to be encrypted to obtain the second information to be encrypted.

[0080] Optionally, add a preset segmentation identifier between each segment of the second sub-information to be encrypted; splice each segment of the second sub-information to be encrypted and the segmentation identifier to obtain the second information to be encrypted.

[0081] An encoding module 54 is used to encode the second information to be encrypted based on a preset encoding rule to obtain the target encrypted information.

[0082] Optionally, the preset encoding rule can be base64 encoding, ASCII code encoding, etc. In the embodiments of the present application, base64 encoding is preferably used. Among them, base64 is a method for identifying binary data based on 64 printable characters, and is often used in occasions for processing text data, representing, transmitting, and storing some binary data, including emails or some complex data.

[0083] When the preset encoding rule selects a reversible encoding method, the preset encoding rule can be a symmetric encoding rule or an asymmetric encoding rule. Among them, when the data volume is large, the symmetric encoding rule can be selected as the preset encoding rule, and the data encoding speed of this symmetric encoding rule is relatively fast; when the security requirement for encrypted data is high, the asymmetric encoding rule can be selected as the preset encoding rule.

[0084] It should be noted that there is no restriction on the selection of the preset encoding rule, and a suitable reversible encoding method is specifically selected according to the actual application scenario.

[0085] After the encryption operation on the first information to be encrypted is completed, the subsequent decryption operation can directly operate on the target encrypted information without using the first information to be encrypted for operation.

[0086] As an optional implementation manner, after storing the target encrypted information, the first information to be encrypted can be deleted. This can not only save the storage space of the information library but also prevent the leakage of the first information to be encrypted, thereby enhancing the security of user information storage.

[0087] It should be noted that each module in the information encryption device in the embodiments of the present application corresponds to each implementation step of the information encryption method in Embodiment 1. Since detailed descriptions have been made in Embodiment 1, some details not shown in this embodiment can be referred to Embodiment 1 and will not be elaborated here.

[0088] Embodiment 4

[0089] According to the embodiments of the present application, there is also provided an information decryption device for implementing the above information decryption method, as Figure 6 shown. The information decryption device at least includes an acquisition module 61, a decoding module 62, and a sorting model 63, where:

[0090] The acquisition module 61 is used to acquire encrypted information, and the encrypted information includes multiple encrypted sub-information segments;

[0091] The decoding module 62 is used to, for each encrypted sub-information segment, decode the encrypted sub-information based on a preset decoding rule to obtain sub-information to be decrypted, where the sub-information to be decrypted includes: target decryption sub-information and a sorting identifier, and the sorting identifier is used to reflect the position information and encryption level information of the target decryption sub-information in the target decrypted information;

[0092] The sorting module 63 is used to sort each segment of target decryption sub-information according to the sorting identifier to obtain the target decrypted information.

[0093] Optionally, the preset decoding rule can be base64 decoding, ASCII code decoding, etc. In the embodiments of the present application, base64 decoding is preferably used.

[0094] It should be noted that there is no restriction on the selection of the preset decoding rule, and a suitable reversible decoding method is specifically selected according to the actual application scenario.

[0095] For example, first, the encryption information is obtained through the acquisition module 61. Among them, the content of the encryption information can be MTFzJTI2JTI1JTI2NzRwJTI2JTI1JTI2MzNzJTI2JTI1JTI2MjVzJTI2JTI1JTI2MjRkJTI2JTI1JTI2MTNwJTI2JTI1JTI2MzRzJTI2JTI1JTI2MzVwJTI2JTI1JTI2KjNkJTI2JTI1JTI2KjJzJTI2JTI1JTI2MDJw. Among them, the encryption information includes multiple segments of encrypted sub-information, such as MTFzJTI2JTI1JTI2, NzRwJTI2JTI1JTI2, MzNzJTI2JTI1JTI2, MjVzJTI2JTI1JTI2, MjRkJTI2JTI1JTI2, MTNwJTI2JTI1JTI2, MzRzJTI2JTI1JTI2, MzVwJTI2JTI1JTI2, KjNkJTI2JTI1JTI2, KjJzJTI2JTI1JTI2, MDJw.

[0096] Then, through the decoding module 62, base64 decoding is used to decode each of the above segments of information, and the following data information is obtained: {"11s","74p","33s","25s","24d","13p","34s","35p","*3d","*2s","02p"}, where each segment of decoded data information includes: the target sub-information to be decrypted and the sorting identifier.

[0097] Finally, through the sorting module 63, the segments of data information are sorted according to the sorting identifier, and the target decryption information can be obtained, that is, the user's mobile phone number 1*0313*7223.

[0098] It should be noted that each module in the information decryption device in the embodiments of the present application corresponds one by one to each implementation step of the information decryption method in Embodiment 2. Since Embodiment 2 has been described in detail, some details not shown in this embodiment can be referred to Embodiment 2 and will not be elaborated here.

[0099] Embodiment 5

[0100] According to an embodiment of the present application, an electronic device is further provided. The electronic device includes: a memory and a processor. Among them, a computer program is stored in the memory, and the processor is configured to execute the information encryption method in Embodiment 1 and the information decryption method in Embodiment 2 through the computer program.

[0101] Optionally, the processor is configured to execute the following steps through the computer program: obtain first information to be encrypted, where the first information to be encrypted includes multiple segments of first sub-information to be encrypted; determine the sorting identifier of each segment of the first sub-information to be encrypted, and the sorting identifier is used to reflect the position information and encryption level information of each first sub-information to be encrypted in the first information to be encrypted; add the sorting identifier to the first information to be encrypted to obtain second information to be encrypted; encode the second information to be encrypted based on a preset coding rule to obtain target encrypted information.

[0102] Optionally, for each segment of the first sub-information to be encrypted, obtain the security level of the first sub-information to be encrypted, and determine the encryption level identifier of the first sub-information to be encrypted according to the security level; according to the position of the first sub-information to be encrypted in the first information to be encrypted and the encryption level identifier, use the principle of the lowest energy to determine the position identifier of the first sub-information to be encrypted, where the position identifier corresponds to the principal quantum number, and the encryption level identifier corresponds to the angular quantum number; determine the sorting identifier of the first sub-information to be encrypted according to the encryption level identifier and the position identifier.

[0103] Optionally, for multiple segments of the first sub-information to be encrypted with the same security level, sort the multiple segments of the first sub-information to be encrypted according to the positions of the multiple segments of the first sub-information to be encrypted in the first information to be encrypted to obtain the position identifiers of the multiple segments of the first sub-information to be encrypted.

[0104] Optionally, obtain encrypted information, where the encrypted information includes multiple segments of encrypted sub-information; for each segment of the encrypted sub-information, decode the encrypted sub-information based on a preset decoding rule to obtain sub-information to be decrypted, where the sub-information to be decrypted includes: target decryption sub-information and a sorting identifier, and the sorting identifier is used to reflect the position information and encryption level information of the target decryption sub-information in the target decrypted information; sort the segments of the target decryption sub-information according to the sorting identifier to obtain the target decrypted information.

[0105] The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages and disadvantages of the embodiments.

[0106] In the above embodiments of the present application, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0107] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings or direct couplings or communication connections shown or discussed with each other can be through some interfaces. The indirect couplings or communication connections of units or modules can be in electrical or other forms.

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

[0109] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0110] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present application. The aforementioned storage medium includes: various media such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs that can store program codes.

[0111] The above is only the preferred embodiment of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. An information encryption method, characterized in that, it includes: Obtain the first information to be encrypted, where the first information to be encrypted includes multiple segments of first sub-information to be encrypted; Determine the sorting identifier of each segment of the first sub-information to be encrypted, where the sorting identifier is used to reflect the position information and encryption level information of each segment of the first sub-information in the first information to be encrypted; Add the sorting identifier to the first information to be encrypted to obtain the second information to be encrypted; Encode the second information to be encrypted based on a preset encoding rule to obtain the target encrypted information; Among them, determining the sorting identifier of each segment of the first sub-information to be encrypted includes: for each segment of the first sub-information to be encrypted, obtain the security level of the first sub-information to be encrypted, and determine the encryption level identifier of the first sub-information to be encrypted according to the security level; according to the position of the first sub-information to be encrypted in the first information to be encrypted and the encryption level identifier, use the principle of the lowest energy to determine the position identifier of the first sub-information to be encrypted, where the position identifier corresponds to the principal quantum number, and the encryption level identifier corresponds to the angular quantum number; determine the sorting identifier of the first sub-information to be encrypted according to the encryption level identifier and the position identifier.

2. The method according to claim 1, characterized in that, using the principle of the lowest energy to determine the position identifier of the first sub-information to be encrypted includes: For multiple segments of the first sub-information to be encrypted with the same security level, sort the multiple segments of the first sub-information to be encrypted according to the positions of the multiple segments of the first sub-information to be encrypted in the first information to be encrypted to obtain the position identifiers of the multiple segments of the first sub-information to be encrypted.

3. The method according to claim 1, characterized in that, Adding the sorting identifier to the first information to be encrypted to obtain the second information to be encrypted includes: For each segment of the first sub-information to be encrypted, splice the sorting identifier of the first sub-information to be encrypted with the first sub-information to be encrypted to obtain the second sub-information to be encrypted; Splice each segment of the second sub-information to be encrypted to obtain the second information to be encrypted.

4. The method according to claim 3, characterized in that, Splicing each segment of the second sub-information to be encrypted to obtain the second information to be encrypted includes: Randomly sort each segment of the second sub-information to be encrypted, and splice the randomly sorted segments of the second sub-information to be encrypted to obtain the second information to be encrypted.

5. The method according to claim 3, characterized in that, Splicing each segment of the second sub-information to be encrypted to obtain the second information to be encrypted includes: Add a preset segmentation identifier between each segment of the second sub-information to be encrypted; Splice each segment of the second sub-information to be encrypted and the segmentation identifier to obtain the second information to be encrypted.

6. An information decryption method, characterized in that, it includes: Obtain the encrypted information, where the encrypted information includes multiple segments of encrypted sub-information; For each piece of the encrypted sub-information, decode the encrypted sub-information based on a preset decoding rule to obtain the sub-information to be decrypted, where the sub-information to be decrypted includes: target decryption sub-information and a sorting identifier, and the sorting identifier is used to reflect the position information and encryption level information of the target decryption sub-information in the target decryption information; Sort the target decryption sub-information of each segment according to the sorting identifier to obtain the target decryption information; Among them, the determination process of the sorting identifier includes: for each piece of the encrypted sub-information, obtain the security level of the encrypted sub-information, and determine the encryption level identifier of the encrypted sub-information according to the security level; according to the position of the encrypted sub-information in the encrypted information and the encryption level identifier, use the principle of the lowest energy to determine the position identifier of the encrypted sub-information, where the position identifier corresponds to the principal quantum number, and the encryption level identifier corresponds to the angular quantum number; determine the sorting identifier of the encrypted sub-information according to the encryption level identifier and the position identifier.

7. An information encryption device, characterized in that, it includes: an acquisition module, configured to acquire a first piece of information to be encrypted, where the first piece of information to be encrypted includes multiple segments of first sub-information to be encrypted; a determination module, configured to determine the sorting identifier of each segment of the first sub-information to be encrypted, including: for each segment of the first sub-information to be encrypted, obtain the security level of the first sub-information to be encrypted, and determine the encryption level identifier of the first sub-information to be encrypted according to the security level; according to the position of the first sub-information to be encrypted in the first piece of information to be encrypted and the encryption level identifier, use the principle of the lowest energy to determine the position identifier of the first sub-information to be encrypted, where the position identifier corresponds to the principal quantum number, and the encryption level identifier corresponds to the angular quantum number; determine the sorting identifier of the first sub-information to be encrypted according to the encryption level identifier and the position identifier; an addition module, configured to add the sorting identifier to the first piece of information to be encrypted to obtain a second piece of information to be encrypted; an encoding module, configured to encode the second piece of information to be encrypted based on a preset encoding rule to obtain the target encrypted information.

8. An information decryption device, characterized in that, it includes: an acquisition module, configured to acquire encrypted information, where the encrypted information includes multiple segments of encrypted sub-information; A decoding module, which is configured to decode each piece of the encrypted sub-information based on a preset decoding rule to obtain sub-information to be decrypted, wherein the sub-information to be decrypted includes: target decryption sub-information and a sorting identifier, and the sorting identifier is used to reflect the position information and encryption level information of the target decryption sub-information in the target decryption information. The determination process of the sorting identifier includes: for each piece of the encrypted sub-information, obtaining the security level of the encrypted sub-information, and determining an encryption level identifier of the encrypted sub-information according to the security level; according to the position of the encrypted sub-information in the encrypted information and the encryption level identifier, determining a position identifier of the encrypted sub-information by using the principle of the lowest energy, wherein the position identifier corresponds to the principal quantum number, and the encryption level identifier corresponds to the angular quantum number; determining the sorting identifier of the encrypted sub-information according to the encryption level identifier and the position identifier; A sorting module, which is configured to sort each piece of the target decryption sub-information according to the sorting identifier to obtain the target decryption information.

9. An electronic device, characterized in that, it includes: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the information encryption method according to any one of claims 1 to 5 or the information decryption method according to claim 6 through the computer program.

Citation Information

Patent Citations

  • Selective encryption apparatus and method for efficient secure data transmission in internet of things

    KR101521616B1