Digital string encryption method, decryption method, electronic device and storage medium
By encoding and changing preset rules on the digital string, interfering ciphertext data is generated, and target encryption results are obtained by combining it, which solves the problem of poor encryption and decryption algorithms in the prior art, and achieves higher security and complexity.
Patent Information
- Application Number
- CN202210914942.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-07-29
AI Technical Summary
In the prior art, the digital string encryption and decryption algorithm has poor effect, is easy to be cracked, and it is difficult to ensure information security.
By obtaining the string corresponding to the number string to be encrypted, encode and preset rules are changed, interfering ciphertext data is generated, and the target encryption results are combined to improve the complexity and security of the encryption results.
It significantly improves the complexity and security of the encryption results of digital strings, increases the difficulty of cracking, and ensures the security of digital strings in transmission.
Smart Images

Figure CN115442073B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and in particular to an encryption method, a decryption method, an electronic device and a storage medium for a digital string. Background Art
[0002] In today's digital society, all types of electronic assets need to be encoded in the form of digital strings for easy retrieval and archiving. At the same time, electronic assets are inevitably faced with information security issues, so protecting the secure transmission of digital strings has become a key part of information transmission.
[0003] In the prior art, many algorithms for encrypting and decrypting digital strings have been proposed, such as loop calculation, numerical modulus, array conversion, base conversion, numerical concatenation, etc. However, these algorithms simply encrypt the digital string directly, and the encryption effect is poor and can be easily cracked. Summary of the invention
[0004] The main technical problem solved by the present application is to provide an encryption method, a decryption method, an electronic device and a storage medium for a digital string, which can improve the security of the target encryption result.
[0005] To solve the above technical problems, the first aspect of the present application provides a method for encrypting a digital string, the method comprising: obtaining a character string corresponding to the digital string to be encrypted; encoding the character string corresponding to the digital string to be encrypted to obtain an initial encoding result; changing the target characters in the initial encoding result according to preset rules to obtain a target encoding result; and obtaining a target encryption result based on the target encoding result.
[0006] Wherein, based on the target coding result, a target encryption result is obtained, including: using the target coding result to obtain interference ciphertext data; combining the interference ciphertext data and the target coding result to obtain the target encryption result; or, using the target coding result as the target encryption result.
[0007] The target encoding result includes a first number of target elements; and obtaining interference ciphertext data using the target encoding result includes: performing base conversion on the first number of target elements to obtain interference ciphertext data.
[0008] The target encryption result also includes a target number; combining the interference ciphertext data and the target coding result to obtain the target encryption result includes: using the target number to connect the target coding result and the interference ciphertext data to obtain the target encryption result.
[0009] Among them, the target encryption result includes a target number of elements, and the interference ciphertext data includes a second number of interference elements; when the sum of the first number and the second number is equal to the difference between the target number and a preset value, the step of converting the first number of target elements into a base is stopped.
[0010] Among them, obtaining the character string corresponding to the digital string to be encrypted includes: dividing the digital string to be encrypted by a preset constant to obtain at least one target remainder; obtaining a target character corresponding to the at least one target remainder; and connecting the target characters corresponding to the at least one target remainder to obtain the character string.
[0011] In order to solve the above technical problems, the second aspect of the present application provides a decryption method, which includes: obtaining a target encryption result; obtaining a target coding result based on the target encryption result; restoring the target coding result according to a preset rule to obtain an initial coding result; decoding the initial coding result to obtain a character string corresponding to the digital string to be encrypted; obtaining the digital string to be encrypted based on the character string corresponding to the digital string to be encrypted. The target encryption result is obtained by encrypting the digital string using the encryption method of the digital string provided in the first aspect.
[0012] Among them, the target encryption result includes a target coding result and interference ciphertext data; before restoring the target coding result according to a preset rule, the method also includes: performing base conversion on the target coding result to obtain a base conversion result; judging whether the base conversion result is the same as the interference ciphertext data; if they are the same, executing the step of restoring the target coding result according to the preset rule; if they are not the same, not executing the step of restoring the target coding result according to the preset rule.
[0013] To solve the above technical problems, the third aspect of the present application provides an electronic device, which includes a memory and a processor coupled to each other, the memory storing program instructions; the processor is used to execute the program instructions stored in the memory to implement the methods described in the first and second aspects above.
[0014] In order to solve the above technical problems, the fourth aspect of the present application provides a computer-readable storage medium, which is used to store program instructions, and the program instructions can be executed to implement the methods described in the first and second aspects above.
[0015] The beneficial effects of the present application are as follows: Different from the prior art, the present application obtains a character string corresponding to the digital string to be encrypted; encodes the character string corresponding to the digital string to be encrypted to obtain an initial encoding result; different from the prior art that directly encodes the digital string to be encrypted, the complexity of the initial encoding result can be increased, thereby increasing the complexity of the target encryption result. Further, the target characters in the initial encoding result are changed according to preset rules to obtain a target encoding result; based on the target encoding result, a target encryption result is obtained. By changing the target characters in the initial encoding result, other users cannot guess the target encoding result based on inherent logic, which can improve the security of the target encryption result and increase the difficulty of cracking the target encryption result. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flowchart of an implementation method of a digital string encryption method provided by the present application;
[0017] Figure 2 It is a flowchart of another implementation method of the digital string encryption method provided by the present application;
[0018] Figure 3 It is a flowchart of an implementation method of a decryption method provided by the present application;
[0019] Figure 4 It is a schematic diagram of the framework structure of an embodiment of an electronic device provided by the present application;
[0020] Figure 5 It is a schematic diagram of a framework of an implementation scheme of a computer-readable storage medium provided in the present application. DETAILED DESCRIPTION
[0021] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0022] It should be noted that in the embodiments of the present application, there are descriptions involving "first", "second", etc., which are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0023] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0024] See also Figure 1 , Figure 1 1 is a flow chart of an implementation method of a digital string encryption method provided by the present application, the method comprising:
[0025] S110: Obtain a character string corresponding to the digital string to be encrypted.
[0026] In one embodiment, the digital string to be encrypted can be divided by a preset constant to obtain at least one target remainder. Specifically, the digital string to be encrypted is divided by a preset constant, and the remainder obtained after each integer division is obtained as the target remainder, until the integer division result is 0, the operation is terminated. Then, the target character corresponding to at least one target remainder is obtained, and the target characters corresponding to at least one target remainder are connected to obtain a character string. Among them, the preset constant can be set as needed. In a specific embodiment, the target character is a character in the American Standard Code for Information Interchange (i.e., the ASCII code table), and the target character can also be called an ASCII character. Since the ASCII code table contains 256 ASCII characters, the preset constant is set to 256, so that the target remainder can take any ASCII character in the ASCII code table. It can be understood that the preset constant can also be other values.
[0027] To facilitate understanding of the method of obtaining a character string, an example is given below: for example, if the digital string to be encrypted is 518520, 518520 is divided by 256, the first quotient is 2025, and the remainder is 120; the second time 2025 is divided by 256, the quotient is 7, and the remainder is 233; the third time 7 is divided by 256, the quotient is 0, and the remainder is 7. The remainders 120, 233, and 7 are used as target remainders, and the ASCII characters corresponding to the target remainders 120, 233, and 7 are obtained respectively, and then concatenated to obtain a character string.
[0028] S120: Encode the character string corresponding to the digital string to be encrypted to obtain an initial encoding result.
[0029] In one embodiment, the character string corresponding to the digital string to be encrypted may be encoded using base32 encoding (a coding method), and base32 encoding includes 32 ASCII characters. In other embodiments, other coding methods may be used to encode the character string corresponding to the digital string to be encrypted, such as base64. It is understandable that the initial encoding result may include numbers, letters, special characters, etc.
[0030] S130: Changing the target characters in the initial encoding result according to a preset rule to obtain a target encoding result.
[0031] The target characters may be numbers, letters, special characters, etc. The preset rules are pre-set by the user as needed. The preset rules may be to change specific letters in the initial encoding result to specific numbers, such as changing letters j, g, and y to numbers 1, 8, and 9 respectively; or to change specific numbers in the initial encoding result to specific letters, such as changing numbers 2 and 3 to letters n and m; or to change special symbols to letters or numbers. The preset rules are set by the user as needed, and the specific setting rules are not limited.
[0032] In a specific implementation, when the target character in the initial encoding result is letter j, it is changed to number 1; when the target character is letter g, it is changed to number 8; when the target character is letter y, it is changed to number 9. No change is made to other target characters in the initial encoding result. The result after the target character in the initial encoding result is changed is used as the target encoding result.
[0033] S140: Based on the target encoding result, a target encryption result is obtained.
[0034] In one implementation, the target encoding result may be used as the target encryption result.
[0035] In another embodiment, the target encoding result can be used to obtain interference ciphertext data; the interference ciphertext data and the target encoding result are combined to obtain the target encryption result. The interference ciphertext data and the target encoding result can be combined by directly splicing the interference ciphertext data and the target encoding result, or by using a target number to connect the target encoding result and the interference ciphertext data, and the target number can be one or more. It can be understood that in other embodiments, the target encoding result and the interference ciphertext data can also be connected by using a target character, a target letter, etc. to obtain the target encryption result.
[0036] In this embodiment, a character string corresponding to the digital string to be encrypted is obtained; the character string corresponding to the digital string to be encrypted is encoded to obtain an initial encoding result; different from the prior art of directly encoding the digital string to be encrypted, the complexity of the initial encoding result can be increased, thereby increasing the complexity of the target encryption result. Further, the target characters in the initial encoding result are changed according to a preset rule to obtain a target encoding result; based on the target encoding result, a target encryption result is obtained. Changing the target characters in the initial encoding result can improve the security of the target encryption result and increase the difficulty of cracking the target encryption result.
[0037] See also Figure 2 , Figure 2 It is a flow chart of another implementation method of the digital string encryption method provided by the present application; the method comprises:
[0038] S210: Obtain a character string corresponding to the digital string to be encrypted.
[0039] S220: Encode the character string corresponding to the digital string to be encrypted to obtain an initial encoding result. S230: Change the target character in the initial encoding result according to a preset rule to obtain a target encoding result.
[0040] Among them, steps S210-S230 please refer to steps S110-S130 in the first implementation of the digital string encryption method, and will not be repeated here.
[0041] S240: Obtain interference ciphertext data using the target encoding result.
[0042] In one embodiment, the target coding result can be converted into a base to obtain interference ciphertext data. For example, the target coding result contains a first number of target elements, and each target element is converted into a base respectively, and the converted results are spliced to obtain interference ciphertext data. Among them, the interference ciphertext data contains a second number of interference elements. It can be understood that after the base conversion of each target element, one interference element or multiple interference elements can be obtained. Therefore, if all target elements contained in the target coding result are converted into a base, the second number is greater than or equal to the first number, that is, the second number of interference elements contained in the interference ciphertext data is greater than or equal to the first number of target elements contained in the target coding result.
[0043] In a specific embodiment, the following base conversion is performed on each target element, including: for each target element included in the target encoding result, obtaining its corresponding ASCII value, amplifying the ASCII value, using the amplified value as an octal value, converting the octal value into a decimal value, multiplying the decimal value by the ASCII value corresponding to the target element and converting it into a hexadecimal value, and using the hexadecimal value as the interference element contained in the interference ciphertext data.
[0044] Specifically, after obtaining the ASCII value corresponding to the target element, the ASCII value can be added to the first numerical value, and the first numerical value can be 1, 2, 3, etc. Since the ASCII value corresponding to the target element may be 0, it is added to the first numerical value so that the second numerical value after addition is not 0. The second numerical value is then amplified, for example, the second numerical value is multiplied by the third numerical value and then squared to obtain a fourth numerical value, wherein the third numerical value can be 10, 20, etc. It can be understood that the second numerical value can also be multiplied by the third numerical value and then cubed, fourthly, etc. to obtain a fourth numerical value. The fourth numerical value is regarded as an octal value, and the fourth numerical value is converted to decimal to obtain a fifth numerical value. The fifth numerical value is multiplied by the ASCII value corresponding to the target element to obtain a sixth numerical value, and the sixth numerical value is converted to hexadecimal to obtain the interference element contained in the interference ciphertext data.
[0045] In this implementation, the ASCII value corresponding to the target element can be added with 2 and multiplied by 10, and then squared to obtain an octal value, the octal value is converted to a decimal value, the decimal value is multiplied by the ASCII value corresponding to the target element and converted to hexadecimal to obtain the interference element.
[0046] It can be understood that the above mentioned target elements included in the target encoding result are all converted into bases, and some of the target elements may also be converted into bases.
[0047] S250: Combine the interference ciphertext data and the target encoding result to obtain the target encryption result.
[0048] In one embodiment, the target encoding result and the interference ciphertext data can be directly spliced to obtain the target encryption result. If the user does not set the number of elements contained in the target encryption result, the number of elements contained in the target encryption result is the number of target elements contained in the target encoding result and the number of interference elements contained in the interference ciphertext data. If the user sets the number of elements contained in the target encryption result, for example, the user sets the target encryption result to contain a target number of elements, then the target encoding result and the interference element data can be spliced, and the target number of elements can be taken. Among them, the target encryption result must contain all target elements in the target encoding result and at least one interference element in the interference ciphertext data. For example, the target encoding result contains 6 target elements, and 7 interference elements are obtained after all target elements are converted to binary system. If the target ciphertext data contains 10 elements, 4 interference elements can be selected from the 7 interference elements, and the 6 target elements and 4 interference elements are spliced to obtain the target ciphertext data. When selecting 4 interference elements, the interference element generated first can be selected as the element in the target encryption result according to the generation order of the interference elements.
[0049] In a specific implementation, the user sets the target encryption result to include a target number of elements, and it is known that the target encoding result includes a first number of target elements, then the target number and the first number can be subtracted to obtain a second number, and the second number is the number of interference elements included in the interference ciphertext data. For example, when performing base conversion on the target elements included in the target encoding result, the target elements can be divided into an array, and the target elements in the array are traversed to obtain the interference ciphertext data. When the interference ciphertext in the interference ciphertext data reaches the second number, the step of performing base conversion on the target element is stopped.
[0050] In another embodiment, the target encryption result also includes a target number, and the target number is used to connect the target encoding result and the interference ciphertext data to obtain the target ciphertext data. The target number can be any number, and the preset value is determined according to the number of digits occupied by the target number. If the target number is a single digit, the preset value is 1; if the target number is a ten digit, the preset value is 2. In a specific embodiment, the target number is 0, and the target number is used to connect the target encoding result and the interference ciphertext data. For example, if the target encoding result is a7uxq and the interference ciphertext data is 18c01524, the target encryption result obtained is a7uxq018c01524.
[0051] In a specific implementation, if the user does not set the number of elements included in the target encryption result, the target elements included in the target encoding result can be converted to obtain interference ciphertext data, and the target encoding result and the interference ciphertext data are connected using the target number.
[0052] In another specific implementation, if the user sets the target encryption result to contain a target number of elements, the target elements contained in the target encoding result can be converted into base 1, and a second number of interference elements are taken from the obtained interference ciphertext data, and the target encoding result and the second number of interference elements are connected using the target number, wherein the second number is the target number-the first number-the preset value, the first number is the number of target elements contained in the target encoding result, and the preset value is the number of digits of the target number. For example, if the target number is 0, the target encoding result is a7uxq, the interference ciphertext data is 18c01524, the first number is 5, and the target number is 10, then the second number is 4, that is, 4 interference elements are selected from the interference ciphertext data, and the 4 interference elements can be 1, 8, c, and 0, and the target encryption result obtained is a7uxq018c0.
[0053] In other specific implementations, if the user sets the target encryption result to contain a target number of elements, the base conversion of some target elements contained in the target encoding result can be performed so that the number of interference elements in the obtained interference ciphertext data is equal to or slightly greater than the second number, wherein the second number is equal to the target number - the first number - the preset value, that is, when the sum of the first number and the second number is equal to or slightly greater than the difference between the target number and the preset value, the base conversion of the first number of targets is stopped. In this way, the amount of calculation of the device can be reduced.
[0054] The above implementation can be executed by the server, that is, the server takes out the digital string to be encrypted from the database, obtains the character string corresponding to the digital string to be encrypted, encodes the character string corresponding to the digital string to be encrypted, and obtains the initial encoding result; changes the target character in the initial encoding result according to the preset rule to obtain the target encoding result; obtains the target encryption result based on the target encoding result. After the server obtains the target decryption result, it can transmit the target encryption result to the client. The client uses the target encryption result to communicate with the server. After receiving the target encryption result, the server can decrypt it to obtain the digital string to be encrypted, and query the corresponding data and return it to the client.
[0055] The encryption method of the digital string provided by the present application mainly includes operations such as addition, division, remainder, and power of numbers. The steps are simple and the complexity is low, and the consumption of computer CPU performance is extremely low. The security of the target decryption result is relatively high. The target characters in the initial encoding result are changed according to preset rules, so that other users cannot crack the target encryption result according to conventional logic, thereby ensuring the security of the digital string in network transmission. Furthermore, the present application can set the number of elements contained in the target encryption result, and when the target encryption result is stored in a database, the storage space can also be reduced.
[0056] See also Figure 3 , Figure 3 : is a flowchart of an implementation method of a decryption method provided by the present application, the method comprising:
[0057] S310: Obtain target encryption result.
[0058] The target encryption result is obtained by encrypting the digital string to be encrypted using any of the above digital string encryption methods.
[0059] S320: Based on the target encryption result, a target encoding result is obtained.
[0060] In one implementation, the target encryption result may be used as the target encoding result.
[0061] In another embodiment, the target encryption result includes a target coding result and interference ciphertext data, and the target encryption result is split into a target coding result and interference ciphertext data. For example, the target encryption result is a7uxq18c0, wherein a7uxq is the target coding result and 18c0 is the interference ciphertext data.
[0062] In other embodiments, the target encryption result includes the target coding result, the interference ciphertext data and the target number, wherein the target number connects the target coding result and the interference ciphertext data, such as the target encryption result is a7uxq018c0, a7uxq is the target coding result, 18c0 is the interference ciphertext data, and 0 is the target number. When setting the target number, the first target number in the target encryption result can be detected, and the target encryption result located on the left side of the target number is used as the target coding result, and the target encryption result located on the left and right sides of the target number is used as the interference ciphertext data.
[0063] S330: Restoring the target encoding result according to a preset rule to obtain an initial encoding result.
[0064] In one embodiment, the target encryption result is the target coding result, and the target coding result is restored according to the preset rule. For example, when encrypting, the preset rule is to change the letters j, g, and y in the initial coding result to the numbers 1, 8, and 9, respectively. When decrypting, the preset rule is to restore the numbers 1, 8, and 9 in the target coding result to the letters j, g, and y to obtain the initial coding result. It can be understood that the step of restoring the target coding result according to the preset rule is the inverse process of changing the target characters in the initial coding result according to the preset rule in step S130 of the above-mentioned method for encrypting a digital string.
[0065] In another embodiment, the target encryption result includes the target coding result and the interference ciphertext data, then the target coding result can be first converted to a base conversion to obtain a base conversion result; determine whether the base conversion result is the same as the interference ciphertext data; if they are the same, perform the step of restoring the target coding result according to the preset rules; if they are not the same, do not perform the step of restoring the target coding result according to the preset rules. Among them, the process of converting the base of the target coding result to obtain the base conversion result during the decryption process is the same as the process of converting the base of the target coding result to obtain the interference ciphertext data during the encryption process, and will not be repeated here. It can be understood that the target coding result can only be decrypted when the base conversion result is the same as the interference ciphertext data.
[0066] S340: Decode the initial encoding result to obtain a character string corresponding to the digital string to be encrypted.
[0067] In one embodiment, the character string corresponding to the digital string to be encrypted is encoded using the base32 method to obtain an initial encoding result. When the initial encoding result is decoded, the reverse process of the encoding is used to decode, and the character string corresponding to the digital string to be encrypted can be obtained.
[0068] S350: Obtain the digital string to be encrypted based on the character string corresponding to the digital string to be encrypted.
[0069] In one embodiment, the reverse process of obtaining the character string corresponding to the digital string to be encrypted is performed to obtain the digital string to be encrypted. In a specific embodiment, the character string corresponding to the digital string to be encrypted and the ASCII code table are used to obtain the target remainder; the digital string to be encrypted is obtained using the target remainder and a preset constant.
[0070] In the above method, the interference ciphertext data is first verified. If the verification is passed, the target encoding result can be decrypted, which increases the decryption difficulty and ensures the security of the target encryption result.
[0071] See also Figure 4 , Figure 4 It is a schematic diagram of the framework structure of an embodiment of an electronic device provided in the present application.
[0072] The electronic device 40 includes a memory 41 and a processor 42 coupled to each other, the memory 41 stores program instructions, and the processor 42 is used to execute the program instructions stored in the memory 41 to implement the steps of any of the above method implementations. In a specific implementation scenario, the electronic device 40 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 40 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0073] Specifically, the processor 42 is used to control itself and the memory 41 to implement the steps of any of the above-mentioned method implementation methods. The processor 42 can also be called a CPU (Central Processing Unit). The processor 42 may be an integrated circuit chip with signal processing capabilities. The processor 42 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 42 can be implemented by an integrated circuit chip.
[0074] See also Figure 5 , Figure 5 It is a schematic diagram of a framework of an implementation scheme of a computer-readable storage medium provided in the present application.
[0075] The computer-readable storage medium 50 stores program instructions 51 , and when the program instructions 51 are executed by a processor, they are used to implement the steps in any of the above method embodiments.
[0076] The computer-readable storage medium 50 may specifically be a medium that can store computer programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or may be a server that stores the computer program. The server may send the stored computer program to other devices for execution, or may also execute the stored computer program itself.
[0077] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
[0078] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for encrypting a digital string, characterized in that: The method comprises: Get the character string corresponding to the digital string to be encrypted; Encoding the character string corresponding to the digital string to be encrypted to obtain an initial encoding result; Changing the target characters in the initial encoding result according to a preset rule to obtain a target encoding result, wherein the target encoding result includes a first number of target elements; Performing base conversion on the first number of target elements to obtain interference ciphertext data; Connecting the interference ciphertext data and the target encoding result using a target number to obtain a target encryption result; The base conversion process of each target element includes: Obtain the ASCII value corresponding to the target element, amplify the ASCII value, use the amplified ASCII value as an octal value, convert the octal value into a decimal value, multiply the decimal value by the ASCII value corresponding to the target element, and then convert it into a hexadecimal value to obtain the interference ciphertext data corresponding to the target element.
2. The method according to claim 1, characterized in that The target encryption result includes a target number of elements, and the interference ciphertext data includes a second number of interference elements; When the sum of the first number and the second number is equal to the difference between the target number and a preset value, the step of converting the first number of target elements into a base is stopped.
3. The method according to claim 1, characterized in that The step of obtaining a character string corresponding to the digital string to be encrypted includes: Dividing the digital string to be encrypted by a preset constant to obtain at least one target remainder; Obtaining the target character corresponding to the at least one target remainder; The target characters corresponding to the at least one target remainder are connected to obtain the character string.
4. A decryption method, characterized in that: The decryption method is used to decrypt the target encryption result described in any one of claims 1 to 3; The decryption method comprises: Obtaining the target encryption result; wherein the target encryption result includes a target number, a target encoding result and interference ciphertext data; Based on the target encryption result, obtaining the target encoding result; Performing base conversion on the target encoding result to obtain a base conversion result; Determine whether the base conversion result is the same as the interference ciphertext data; If they are the same, restoring the target encoding result according to the preset rule to obtain the initial encoding result; Decoding the initial encoding result to obtain a character string corresponding to the digital string to be encrypted; Based on the character string corresponding to the digital string to be encrypted, obtaining the digital string to be encrypted; The target encoding result is converted into a base, and the base conversion result is obtained, including: For each target element in the target encoding result, obtain the ASCII value corresponding to the target element, amplify the ASCII value, use the amplified ASCII value as an octal value, convert the octal value into a decimal value, and then multiply the decimal value by the ASCII value corresponding to the target element and convert it into a hexadecimal value to obtain a base conversion result corresponding to the target element; Based on the base conversion results corresponding to the target elements, the base conversion results are obtained.
5. The method according to claim 4, characterized in that After determining whether the base conversion result is the same as the interference ciphertext data, the method further includes: If they are not the same, the step of restoring the target encoding result according to the preset rule will not be performed.
6. An electronic device, characterized in that: The electronic device includes a memory and a processor coupled to each other, The memory stores program instructions; The processor is used to execute the program instructions stored in the memory to implement the method according to any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program instructions, and the program instructions can be executed to implement the method according to any one of claims 1 to 5.
