Card number and password fusion encryption method, terminal device and storage medium
Generating dynamic secret keys and ciphertext data through the fusion of card numbers and passwords solves the problem of low security of fixed-length password encryption keys in the existing technology, realizes a card number and password encryption method with high security and dynamic adjustment capabilities, and saves money. storage space.
Patent Information
- Application Number
- CN202210313411.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-03-28
AI Technical Summary
In the existing technology, fixed-length password encryption keys result in lower password security and reduced cracking difficulty.
Adopting an encryption method that fuses the card number and password, an initial string is formed by combining the card number and the original password, a dynamically changing secret key is generated based on the initial string, and ciphertext data is generated through position exchange operations. The length of the secret key and ciphertext data is determined by The length of the card number and password is determined, and it has the ability to dynamically adjust without increasing the data length.
It improves the security of card numbers and passwords, and realizes that each card number and original password corresponds to a secret key, which has extremely high security and dynamic adjustment capabilities, while saving storage space.
Smart Images

Figure CN114726516B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of password security, and in particular to an encryption method, terminal device and storage medium for integrating a card number and a password. Background Art
[0002] With the rapid development and widespread application of data communication technology, society is increasingly relying on the secure storage, processing and transmission of information, and the issue of information security protection has become more important.
[0003] Currently, many fields use card swiping to obtain card information. For security reasons, the card password needs to be encrypted. Generally speaking, various encryption methods require the generation of a fixed-length, same-type encryption key, which can be used to encrypt and decrypt the password.
[0004] Regarding the above-mentioned related technologies, the inventor believes that since the number of bits of the same type of passwords is the same, the number of bits of the secret key used to encrypt the passwords is also fixed. Therefore, when the password is cracked, the difficulty of cracking is reduced, resulting in lower security of the password. Summary of the invention
[0005] In order to improve the security of password encryption, the present application provides an encryption method, system, terminal device and storage medium that integrates card number and password.
[0006] In the first aspect, the present application provides a method for encrypting a card number and a password, using the following technical solution:
[0007] An encryption method for integrating a card number and a password comprises the following steps:
[0008] Obtaining a card number and an original password, and combining the card number and the original password to form an initial character string;
[0009] Obtaining a secret key based on the initial character string and a preset secret key generation rule;
[0010] Performing a position exchange operation on the initial character string based on the secret key to obtain ciphertext data;
[0011] The secret key and the ciphertext data are stored as encrypted information.
[0012] By adopting the above technical solution, the card number and password are combined to form an initial character string, and the secret key is obtained according to the initial character string, so that each card number and original password corresponds to a secret key, thereby improving the security of the card number and password in the system; the initial character string is subjected to a position exchange operation through the secret key to obtain ciphertext data, and the length of the secret key and the ciphertext data is determined by the length of the card number and the password. Compared with the prior art, the secret key and the ciphertext data change dynamically with the change of the card number and the password, and can be changed at any time according to user needs, with strong dynamic adjustment capabilities. At the same time, the encrypted secret key and ciphertext data do not increase the data length, thereby saving storage space.
[0013] Optionally, the obtaining of the key based on the initial character string and a preset key generation rule comprises the following steps:
[0014] Determining the key length based on the length of the initial string;
[0015] The key is determined based on a preset key generation rule and the key length.
[0016] By adopting the above technical solution, the length of the secret key is determined according to the length of the initial string, and the secret key changes dynamically with the initial string. Compared with the existing technology, a set of card numbers and original passwords can correspond to one secret key, which has extremely high security.
[0017] Optionally, performing a position exchange operation on the initial character string based on the secret key to obtain ciphertext data comprises the following steps:
[0018] Determining the character exchange position and the number of character exchange times of the initial character string based on the secret key;
[0019] A position exchange operation is performed on the initial character string based on the character exchange position and the character exchange number to obtain ciphertext data.
[0020] By adopting the above technical solution, the characters of the initial character string are adjusted in position to obtain ciphertext data, and the obtained ciphertext data has the same length as the initial character string, does not increase the data length, and saves storage space.
[0021] Optionally, storing the secret key and the ciphertext data as encrypted information comprises the following steps:
[0022] Associating the ciphertext data with the secret key to form encrypted information of the card number and the original password;
[0023] The encrypted information is stored.
[0024] By adopting the above technical solution, the ciphertext data and the secret key are associated, making it convenient for users to retrieve the corresponding secret key to decrypt the ciphertext data.
[0025] In the second aspect, the present application provides a system for encrypting card numbers and passwords, which adopts the following technical solutions:
[0026] An encryption system integrating card number and password, comprising a preprocessing module, a secret key generation module, a ciphertext generation module and an encryption storage module, wherein the secret key generation module is connected to the preprocessing module, the ciphertext generation module is connected to the secret key generation module, and the encryption storage module is connected to the ciphertext generation module and the secret key generation module;
[0027] The pre-processing module is used to obtain the card number and the original password, and combine the card number and the original password to form an initial character string;
[0028] The key generation module is used to obtain a key based on the initial character string and a preset key generation rule;
[0029] The ciphertext generation module is used to perform a position exchange operation on the initial character string based on the secret key to obtain ciphertext data;
[0030] The encryption storage module is used to store the secret key and the ciphertext data as encryption information.
[0031] By adopting the above technical solution, the preprocessing module combines the card number and the password to form an initial character string, and the key generation module obtains the key according to the initial character string, so that each card number and the original password corresponds to a key, thereby improving the security of the card number and password in the system; the ciphertext generation module uses the key to perform a position exchange operation on the initial character string to obtain the ciphertext data. The length of the key and the ciphertext data is determined by the length of the card number and the password. Compared with the prior art, the key and the ciphertext data change dynamically with the change of the card number and the password, and can be changed at any time according to user needs, with strong dynamic adjustment capabilities. At the same time, the encrypted key and ciphertext data do not increase the data length, thereby saving storage space.
[0032] Optionally, the key generation module includes a key information unit and a key generation unit, and the key generation unit is connected to the key information unit;
[0033] The key information unit is used to determine the key length based on the length of the initial character string;
[0034] The key generation unit is used to determine the key based on a preset key generation rule and the key length.
[0035] By adopting the above technical solution, the key information unit determines the key length according to the length of the initial character string, and the key generated by the key generation unit changes dynamically with the initial character string. Compared with the existing technology, a set of card numbers and original passwords can correspond to one key, which has extremely high security.
[0036] Optionally, the ciphertext generation module includes a ciphertext information unit and a ciphertext generation unit, and the ciphertext generation unit is connected to the ciphertext information unit respectively;
[0037] The ciphertext information unit is used to determine the character exchange position and the number of character exchange times of the initial character string based on the secret key;
[0038] The ciphertext generating unit is used to perform a position exchange operation on the initial character string based on the character exchange position and the character exchange number to obtain ciphertext data.
[0039] By adopting the above technical solution, the ciphertext generation unit adjusts the positions of the characters of the initial character string to obtain ciphertext data. The obtained ciphertext data has the same length as the initial character string, does not increase the data length, and saves storage space.
[0040] Optionally, the encryption storage module includes an association unit and a storage unit, and the storage unit is connected to the association unit;
[0041] The association unit is used to associate the ciphertext data with the secret key to form encrypted information of the card number and the original password;
[0042] The storage unit is used to store the encrypted information.
[0043] By adopting the above technical solution, the ciphertext data and the secret key of the association unit are associated, which makes it convenient for the user to retrieve the corresponding secret key from the storage unit to decrypt the ciphertext data.
[0044] In a third aspect, the present application provides a terminal device, which adopts the following technical solution:
[0045] A terminal device includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor loads and executes the computer program, the above-mentioned card number and password encryption method is adopted.
[0046] By adopting the above technical solution, a computer program is generated by the above card number and password encryption method, and stored in a memory so as to be loaded and executed by a processor, thereby making a terminal device based on the memory and the processor for easy use.
[0047] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:
[0048] A computer-readable storage medium stores a computer program, and when the computer program is loaded and executed by a processor, the above-mentioned card number and password encryption method is adopted.
[0049] By adopting the above technical solution, a computer program is generated by the above card number and password encryption method, and stored in a computer-readable storage medium so that it can be loaded and executed by a processor. The computer-readable storage medium facilitates the reading and storage of the computer program. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a schematic diagram of the overall process of an encryption method for integrating a card number and a password according to an embodiment of the present application.
[0051] Figure 2 It is a flowchart of steps S201 to S202 in an encryption method for integrating a card number and a password according to an embodiment of the present application.
[0052] Figure 3 It is a flowchart of steps S301 to S302 in an encryption method for integrating a card number and a password according to an embodiment of the present application.
[0053] Figure 4 It is a flowchart of steps S401 to S402 in an encryption method for integrating a card number and a password according to an embodiment of the present application.
[0054] Figure 5 It is a schematic diagram of the overall module connection of an encryption system that integrates a card number and a password according to an embodiment of the present application.
[0055] Description of reference numerals:
[0056] 1. Preprocessing module; 2. Secret key generation module; 21. Secret key information unit; 22. Secret key generation unit; 3. Ciphertext generation module; 31. Ciphertext information unit; 32. Ciphertext generation unit; 4. Encryption storage module; 41. Association unit; 42. Storage unit. DETAILED DESCRIPTION
[0057] The present application is further described in detail below in conjunction with the accompanying drawings.
[0058] The present application embodiment discloses an encryption method for integrating a card number and a password, referring to Figure 1 , including the following steps:
[0059] S101, obtaining the card number and the original password, and combining the card number and the original password to form an initial character string;
[0060] S102, obtaining a secret key based on an initial character string and a preset secret key generation rule;
[0061] S103, performing a position exchange operation on the initial character string based on the secret key to obtain ciphertext data;
[0062] S104: Store the secret key and the ciphertext data as encrypted information.
[0063] Among them, step S101, first obtain the user's card number and original password, and preliminarily combine the card number and the original password to form an initial string. In this embodiment, the length of the initial string after the card number and the original password are combined is preferably greater than or equal to 6 digits. For example, if the card number is 123 and the original password is abc, the initial string obtained after the card number and the original password are preliminarily combined is 123abc.
[0064] In step S102, after obtaining the initial string, a secret key corresponding to the initial string is obtained according to the initial string, so as to encrypt the initial string. Figure 2 , obtaining the secret key specifically includes the following steps:
[0065] S201, determining the key length based on the initial character string length;
[0066] S202: Determine a secret key based on a preset secret key generation rule and a secret key length.
[0067] In step S201, it can be seen from the above example that the card number is 123 and the original password is abc, and the length of the initial string formed is 6. In this embodiment, the key length is determined according to the length of the initial string. Specifically, a number that is greater than or equal to one-fourth of the length of the initial string and rounded up is used as the key length. For example, the initial string is 123abc, and the key length is 6 / 4=1.5, and 1.5 is rounded up to 2, so it can be seen that the key length of the initial string is 2.
[0068] In step S202, the preset key generation rule of this embodiment is: randomly select N numbers from an integer between 1 and half of the length of the initial string, where N is the key length. For the above example, a 2-digit (key length) number is randomly selected from an integer in the range of 1 to 6 / 2=3 as the key, for example, (1, 3) is selected as the key. By setting it in this way, different keys are obtained for different card numbers and original passwords, and the key can also be modified. For example, (1, 3) is selected as the key this time. If modification is required, (1, 2) or (2, 3) can also be selected as the key, which is convenient for adjustment at any time.
[0069] In step S103, after the secret key of the initial string is determined, the initial string can be encrypted according to the secret key. Figure 3 , specifically including the following steps:
[0070] S301, determining the character exchange position and the number of character exchange times of the initial character string based on the secret key;
[0071] S302: Perform a position exchange operation on the initial character string based on the character exchange position and the number of character exchange times to obtain ciphertext data.
[0072] Specifically, after obtaining the secret key, the characters of the initial string can be adjusted according to the secret key to form ciphertext data. In this embodiment, the exchange rule is set as follows: the two characters to be exchanged are the position of each digit in the secret key in the initial string and an integer of half the length of the initial string plus the position of the secret key digit.
[0073] For example, the initial string is 123abc and the secret key is (1,3). It can be seen that the characters that need to be swapped for the first time are "the first position of the initial string (the first digit of the secret key) and the 6 / 2+1=4th position (an integer of half the length of the initial string + the first digit of the secret key)". Therefore, for the secret key (1,3), the result after the first character swap is a231bc.
[0074] The number of character swaps is determined based on the length of the secret key. As above, the secret key (1, 3) has a length of 2, so two character swaps are required for a231bc. The second character swap position is "the 3rd and 6th / 2+3=6th positions of the initial string", and the result after the second character swap is a2c1b3. After the two character swaps are completed, the result is a2c1b3, which is used as the ciphertext data.
[0075] In step S104, after the ciphertext data is obtained, the ciphertext data and the secret key are stored, thereby achieving the purpose of encrypting the card number and password. Figure 4 , specifically including the following steps:
[0076] S401, associating the ciphertext data with the secret key to form encrypted information of the card number and the original password;
[0077] S402: Store the encrypted information.
[0078] Specifically, the secret key and ciphertext data are obtained, and the ciphertext data and the secret key are associated to form encrypted information, which is then stored. This arrangement enables timely acquisition of the secret key corresponding to the ciphertext data, thereby facilitating decryption.
[0079] Specifically, when decryption is required, the encrypted information is obtained, the secret key and ciphertext data are matched from the encrypted information, and the ciphertext data can be restored to the plaintext card number and original password by exchanging the order of the character strings in the ciphertext data.
[0080] The implementation principle of a card number and password encryption method in an embodiment of the present application is as follows: the card number and password are combined to form an initial character string, and a secret key is obtained based on the initial character string, so that each card number and original password corresponds to a secret key, thereby improving the security of the card number and password in the system; the initial character string is subjected to a position exchange operation through the secret key to obtain ciphertext data, and the length of the secret key and the ciphertext data is determined by the length of the card number and the password. Compared with the prior art, the secret key and the ciphertext data change dynamically with the change of the card number and the password, and can be changed at any time according to user needs, with strong dynamic adjustment capabilities. At the same time, the encrypted secret key and ciphertext data do not increase the data length, thereby saving storage space.
[0081] The present application also discloses an encryption system that integrates the card number and the password, referring to Figure 5 , including a preprocessing module 1, a key generation module 2, a ciphertext generation module 3 and an encryption storage module 4, wherein the key generation module 2 is connected to the preprocessing module 1, the ciphertext generation module 3 is connected to the key generation module 2, and the encryption storage module 4 is connected to the ciphertext generation module 3 and the key generation module 2. The preprocessing module 1 is used to obtain the card number and the original password, and combine the card number and the original password to form an initial string; the key generation module 2 is used to obtain the key based on the initial string and the preset key generation rule; the ciphertext generation module 3 is used to perform a position exchange operation on the initial string based on the key to obtain the ciphertext data; the encryption storage module 4 is used to store the key and the ciphertext data as encrypted information.
[0082] Among them, the preprocessing module 1 first obtains the user's card number and original password, and preliminarily combines the card number and the original password to form an initial string. In this embodiment, the length of the initial string after the card number and the original password are combined is preferably greater than or equal to 6 digits. For example, if the card number is 123 and the original password is abc, the preprocessing module 1 preliminarily combines the card number and the original password to obtain an initial string of 123abc.
[0083] Among them, the key generation module 2 includes a key information unit 21 and a key generation unit 22, the key generation unit 22 and the key information unit 21 are connected, the key generation unit 22 is used to determine the key length based on the length of the initial character string, and the key generation unit 22 is used to determine the key based on the preset key generation rules and key length.
[0084] Specifically, after obtaining the initial string, the key information unit 21 determines the key length according to the length of the initial string. From the above example, it can be seen that the length of the initial string formed by the card number being 123 and the original password being abc is 6. In this embodiment, a number that is greater than or equal to one-fourth of the length of the initial string and rounded up is used as the key length. For example, the initial string is 123abc, and the key length is 6 / 4=1.5, and 1.5 is rounded up to 2, so it can be seen that the key length of the initial string is 2.
[0085] Specifically, the preset key generation rule of this embodiment is: randomly select N numbers from an integer between 1 and half of the length of the initial string, where N is the key length. For the above example, the key generation unit 22 randomly selects 2 digits (key length) from integers in the range of 1 to 6 / 2=3 as the key, for example, (1, 3) is selected as the key. By setting it in this way, different keys are obtained for different card numbers and original passwords, and the key can also be modified. For example, (1, 3) is selected as the key this time. If modification is required, (1, 2) or (2, 3) can also be selected as the key, which is convenient for adjustment at any time.
[0086] Among them, the ciphertext generation module 3 includes a ciphertext information unit 31 and a ciphertext generation unit 32. The ciphertext generation unit 32 is connected to the ciphertext information unit 31. The ciphertext information unit 31 is used to determine the character exchange position and the number of character exchanges of the initial character string based on the secret key. The ciphertext generation unit 32 is used to perform position exchange operations on the initial character string based on the character exchange position and the number of character exchanges to obtain ciphertext data.
[0087] Specifically, after obtaining the secret key, the characters of the initial string can be adjusted according to the secret key to form ciphertext data. In this embodiment, the exchange rule is set as follows: the two characters to be exchanged are the position in the initial string corresponding to each digit in the secret key and an integer of half the length of the initial string plus the position of the secret key digit. The ciphertext information unit 31 determines the character exchange position according to the exchange rule.
[0088] For example, the initial character string is 123abc, and the secret key is (1,3). The ciphertext information unit 31 can determine that the character exchange positions for the first exchange are "the first position of the initial character string (the first digit of the secret key) and the 6 / 2+1=4th position (an integer of half the length of the initial character string + the first digit of the secret key)". Therefore, for the secret key (1,3), the result after the first character exchange is a231bc.
[0089] At the same time, the ciphertext information unit 31 also determines the number of character exchanges according to the length of the secret key. As above, the secret key length of the secret key (1, 3) is 2, so it is necessary to exchange the characters of a231bc twice. The ciphertext information unit 31 determines that the character exchange position of the second exchange is "the 3rd position and the 6th / 2+3=6th position of the initial string". After the second character exchange, the result is a2c1b3. After the two character exchanges are completed, the result is a2c1b3, and the ciphertext generation unit 32 outputs a2c1b3 as ciphertext data.
[0090] Among them, the encryption storage module 4 includes an association unit 41 and a storage unit 42. The storage unit 42 is connected to the association unit 41. The association unit 41 is used to associate the ciphertext data with the secret key to form encrypted information of the card number and the original password. The storage unit 42 is used to store the encrypted information.
[0091] Specifically, the association unit 41 obtains the secret key and ciphertext data, and associates the ciphertext data and the secret key to form encrypted information, which is stored in the storage unit 42. This arrangement enables the secret key corresponding to the ciphertext data to be obtained from the storage unit 42 in a timely manner, thereby facilitating decryption.
[0092] Specifically, when decryption is required, the encrypted information is obtained from the storage unit 42, the secret key and ciphertext data are matched from the encrypted information, and the ciphertext data can be restored to the plaintext card number and original password by exchanging the order of the character strings in the ciphertext data.
[0093] The implementation principle of an encryption system that integrates a card number and a password in an embodiment of the present application is as follows: a preprocessing module 1 combines the card number and the password to form an initial character string, and a key generation module 2 obtains a key based on the initial character string, so that each card number and the original password corresponds to a key, thereby improving the security of the card number and password in the system; a ciphertext generation module 3 uses the key to perform a position exchange operation on the initial character string to obtain ciphertext data, and the length of the key and the ciphertext data is determined by the length of the card number and the password. Compared with the prior art, the key and the ciphertext data change dynamically with the change of the card number and the password, and can be changed at any time according to user needs, with a strong dynamic adjustment capability. At the same time, the encrypted key and ciphertext data do not increase the data length, thereby saving storage space.
[0094] The embodiment of the present application also discloses a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein when the processor executes the computer program, the card number and password encryption method in the above embodiment is adopted.
[0095] The terminal device may be a computer device such as a desktop computer, a laptop computer or a cloud server, and the terminal device includes but is not limited to a processor and a memory. For example, the terminal device may also include input and output devices, a network access device and a bus.
[0096] Among them, the processor can adopt a central processing unit (CPU). Of course, according to actual usage, other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc., and this application does not impose any restrictions on this.
[0097] Among them, the memory can be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device, or it can be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital card (SD) or a flash memory card (FC) equipped on the terminal device, and the memory can also be a combination of an internal storage unit and an external storage device of the terminal device. The memory is used to store computer programs and other programs and data required by the terminal device. The memory can also be used to temporarily store data that has been output or is to be output, and this application does not impose any restrictions on this.
[0098] Among them, through this terminal device, the card number and password encryption method in the above embodiment is stored in the memory of the terminal device, and is loaded and executed on the processor of the terminal device for easy use.
[0099] The embodiment of the present application further discloses a computer-readable storage medium, and the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the card number and password encryption method in the above embodiment is adopted.
[0100] Among them, the computer program can be stored in a computer-readable medium, the computer program includes computer program code, the computer program code can be in the form of source code, object code, executable file or certain middleware, etc. The computer-readable medium includes any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the computer-readable medium includes but is not limited to the above-mentioned components.
[0101] Among them, through this computer-readable storage medium, the card number and password encryption method in the above embodiment is stored in a computer-readable storage medium, and is loaded and executed on a processor to facilitate the storage and application of the above method.
[0102] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. An encryption method for integrating card number and password, characterized in that: An encryption system combining card number and password is adopted, and the method includes the following steps: Obtaining a card number and an original password, and combining the card number and the original password to form an initial string, wherein the length of the initial string after the combination of the card number and the original password is greater than or equal to six digits; Obtaining a secret key based on the initial character string and a preset secret key generation rule; Performing a position exchange operation on the initial character string based on the secret key to obtain ciphertext data; storing the secret key and the ciphertext data as encrypted information; The step of obtaining the key based on the initial character string and a preset key generation rule comprises the following steps: Determining the key length based on the length of the initial string; Determine the secret key based on a preset secret key generation rule and the secret key length; The number that is greater than or equal to one quarter of the length of the initial string and is rounded up to the nearest integer is used as the key length; The key generation rule is to randomly select N numbers from an integer between 1 and half the length of the initial string, where N is the key length; The step of performing a position exchange operation on the initial character string based on the secret key to obtain ciphertext data comprises the following steps: Based on the secret key, determine the character exchange position and the number of character exchanges of the initial string, determine the character exchange position of the initial string as the two characters to be exchanged are the position of each digit in the secret key corresponding to the initial string and the position of the nearest integer greater than or equal to half of the length of the initial string plus the secret key digit, wherein the position of each digit in the initial string corresponding to the initial string refers to the number of digits in the initial string, and determine the number of character exchanges of the initial string as the number of character exchanges determined according to the length of the secret key; Performing a position exchange operation on the initial character string based on the character exchange position and the character exchange number to obtain ciphertext data; The step of storing the secret key and the ciphertext data as encrypted information comprises the following steps: Associating the ciphertext data with the secret key to form encrypted information of the card number and the original password; Storing the encrypted information; When decryption is required, the encrypted information is obtained, and the secret key and ciphertext data are matched from the encrypted information. The ciphertext data can be restored to the plaintext card number and original password according to the order of the character strings in the ciphertext data; The card number and password fusion encryption system comprises a preprocessing module (1), a secret key generation module (2), a ciphertext generation module (3) and an encryption storage module (4), wherein the secret key generation module (2) is connected to the preprocessing module (1), the ciphertext generation module (3) is connected to the secret key generation module (2), and the encryption storage module (4) is connected to the ciphertext generation module (3) and the secret key generation module (2); The pre-processing module (1) is used to obtain the card number and the original password, and combine the card number and the original password to form an initial character string; The secret key generation module (2) is used to obtain a secret key based on the initial character string and a preset secret key generation rule; The ciphertext generation module (3) is used to perform a position exchange operation on the initial character string based on the secret key to obtain ciphertext data; The encryption storage module (4) is used to store the secret key and the ciphertext data as encryption information; The key generation module (2) comprises a key information unit (21) and a key generation unit (22), wherein the key generation unit (22) is connected to the key information unit (21); The key information unit (21) is used to determine the key length based on the length of the initial character string; The key generation unit (22) is used to determine the key based on a preset key generation rule and the key length; The ciphertext generation module (3) comprises a ciphertext information unit (31) and a ciphertext generation unit (32), wherein the ciphertext generation unit (32) is respectively connected to the ciphertext information unit (31); The ciphertext information unit (31) is used to determine the character exchange position and the number of character exchanges of the initial character string based on the secret key, and the character exchange position of the initial character string is determined as the two characters to be exchanged are the position of each digit in the secret key corresponding to the initial character string and the position of the nearest integer greater than or equal to half of the length of the initial character string plus the position of the secret key digit, wherein the position of each digit in the initial character string corresponding to the initial character string refers to the number of digits in the initial character string, and the number of character exchanges of the initial character string is determined as the number of character exchanges determined according to the length of the secret key; The ciphertext generation unit (32) is used to perform a position exchange operation on the initial character string based on the character exchange position and the character exchange number to obtain ciphertext data; The encryption storage module (4) comprises an association unit (41) and a storage unit (42), wherein the storage unit (42) is connected to the association unit (41); The association unit (41) is used to associate the ciphertext data with the secret key to form encrypted information of the card number and the original password; The storage unit (42) is used to store the encrypted information.
2. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor loads and executes the computer program, the processor performs the method according to claim 1.
3. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, characterized in that: When the computer program is loaded and executed by a processor, the method according to claim 1 is performed.
Citation Information
Patent Citations
Password processing method, terminal equipment and computer readable storage medium
CN107895105A
