CN107634832A - Character string encryption, verification method, device, computer-readable recording medium - Google Patents

Character string encryption, verification method, device, computer-readable recording medium Download PDF

Info

Publication number
CN107634832A
CN107634832A CN201710819973.1A CN201710819973A CN107634832A CN 107634832 A CN107634832 A CN 107634832A CN 201710819973 A CN201710819973 A CN 201710819973A CN 107634832 A CN107634832 A CN 107634832A
Authority
CN
China
Prior art keywords
string
character
random
group
encrypted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710819973.1A
Other languages
Chinese (zh)
Other versions
CN107634832B (en
Inventor
许宸杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beishuo Technology (Yunnan) Co.,Ltd.
Original Assignee
Yunnan Information Technology Co Ltd Potential Write Na
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yunnan Information Technology Co Ltd Potential Write Na filed Critical Yunnan Information Technology Co Ltd Potential Write Na
Priority to CN201710819973.1A priority Critical patent/CN107634832B/en
Publication of CN107634832A publication Critical patent/CN107634832A/en
Application granted granted Critical
Publication of CN107634832B publication Critical patent/CN107634832B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention discloses a kind of character string encryption method, including:When receiving CIPHERING REQUEST, the target string that need to be encrypted is obtained;By each character in the target string, corresponding random string is replaced with according to the first mapping relations built in advance;The random string being substituted for is spliced, generates encrypted characters string.The invention also discloses a kind of character string encryption method, device, computer-readable recording medium.This method is simple and convenient, under the premise of not increasing user and remembering difficulty, generates the encrypted characters string for protecting original character string, improves character string and is cracked difficulty.

Description

Character string encryption, verification method, device, computer-readable recording medium
Technical field
The present invention relates to field of data encryption, more particularly to character string encryption, verification method, device and computer-readable deposit Storage media.
Background technology
In current procedure site, the password of user is the number that website is stored in after being encrypted by irreversible AES According in storehouse, excessively simple AES is easily cracked, and excessively complicated AES can give the server band of website Carry out performance burden.Therefore in current most procedure sites, usually using MD5 (Message Digest Algorithm 5, Message Digest Algorithm 5) AES is encrypted for the critical data of website.The algorithm is total for different plaintexts There is unique corresponding ciphertext, and ciphertext does not repeat therewith, while the algorithm complexity is moderate, and the server of website will not be brought Performance burden.But with the enhancing of Computing ability and the development of breaking techniques, by compareing in plain text to including but not The AES progress ciphertext for being limited to MD5 cracks, and has become very simple.
In the practical application of website, typically user cipher is encrypted storage.At present, for such mode cracked General to use increase password complexity, the method for Password Length, the method encrypted in addition also by " adding salt " realizes password Encryption.It is no doubt effective to increase password complexity, the method for increase Password Length, but is not easy to user's memory;And if Password Length is increased by the form of " adding salt ", once " salt " is revealed, equally has the possibility being cracked in plain text.
The above is only used for auxiliary and understands technical scheme, does not represent and recognizes that the above is existing skill Art.
The content of the invention
It is a primary object of the present invention to provide a kind of character string encryption method, device and computer-readable recording medium, Aiming to provide one kind does not increase user's memory burden, while increase cracks the encryption method of difficulty.
To achieve the above object, the present invention provides a kind of character string encryption method, the character string encryption method include with Lower step:
When receiving CIPHERING REQUEST, the target string that need to be encrypted is obtained;
By each character in the target string, according to corresponding to replacing with the first mapping relations built in advance with Machine character string;
The random string being substituted for is spliced, generates encrypted characters string.
Preferably, it is described when receiving CIPHERING REQUEST, obtain need to encrypt target string the step of after, also wrap Include:
The random string group of this encryption is generated according to default plaintext character group;
The random string group generated is grouped according to default put in order, it is pre- to obtain string length If the random string of length;
Each character of the default plaintext character group is arranged according to default put in order;
Each character of the default plaintext character group arranged is corresponding in turn to each random string, with structure Build first mapping relations.
Preferably, the step of default plaintext character group of the basis generates the random string group of this encryption includes:
Confirm the number of characters of the default plaintext character group, and obtain the default complexity value for the character string that need to be encrypted;
The character of the default plaintext character group, the random string group of this encryption of one group of generation are selected at random;
Wherein, the number of characters that the default complexity value includes for each random string, and the length of the random character group Degree is equal to the number of characters of the default plaintext character group and the product of the default complexity value.
Preferably, it is described to be grouped the random string group generated according to default put in order, obtain word After the step of according with the random string that string length is preset length, in addition to:
Any two groups of random strings are compared, confirm whether two groups of random strings are identical;
If two groups of random strings are identical, the character for selecting the default plaintext character group at random regenerates one Group random string, and one group of random string of identical is replaced with to the random string regenerated;
The step of continuing executing with any two groups of random strings of the comparison, until all random strings are completed two-by-two Compare, and untill all random strings are different.
In addition, to achieve the above object, the present invention also provides a kind of character string encryption device, the character string encryption device Including:Memory, processor and the character string encipheror that can be run on the memory and on the processor is stored in, The character string encipheror is realized the character string encryption method described in as above any one during computing device the step of.
In addition, to achieve the above object, the present invention also provides a kind of character string verification method, the character string encryption method Comprise the following steps:
After checking request is received, the encrypted characters string stored is extracted;Wherein, the encrypted characters string is according to pre- If the character string that cipher mode generates after target string is encrypted;
Encrypted characters string to be verified is changed according to the predetermined encryption mode, generates encrypted characters string to be verified;
The encrypted characters string to be verified is compared with the encrypted characters string, if the encrypted characters string to be verified and institute It is consistent to state encrypted characters string, then confirms that the encrypted characters string to be verified is identical with the target string.
Preferably, it is described after checking request is received, extract stored encrypted characters string the step of before, also wrap Include:
The encrypted characters string generated is decrypted according to the second mapping relations, restores the target string;
After the target string is encrypted according to predetermined encryption mode again, new encrypted characters string is generated;
Wherein, second mapping relations are the random string according to default plaintext character group generation and default plaintext word The corresponding relation of each character of symbol group;The encrypted characters string is that the random string is spliced.
Preferably, it is described after checking request is received, extract stored encrypted characters string the step of before, also wrap Include:
According to predetermined encryption strategy, the encrypted characters string generated is encrypted again, generates new encrypted characters string.
In addition, to achieve the above object, the present invention also provides a kind of character string checking device, the character string encryption device Including:Memory, processor and the character string proving program that can be run on the memory and on the processor is stored in, The character string encipheror is realized the character string verification method described in as above any one during computing device the step of.
In addition, to achieve the above object, the present invention also provides a kind of computer-readable recording medium, described computer-readable Character string encipheror and character string proving program are stored with storage medium, the character string encipheror is executed by processor The step of Shi Shixian character string encryption methods as described above, realized as above when the character string proving program is executed by processor The step of described character string verification method.
The embodiment of the present invention by will need the target string encrypted according to corresponding to replacing with the first mapping relations with Machine character string, and the random string being substituted for is spliced, generate encrypted characters string.And receiving checking request Afterwards, the encrypted characters string stored is extracted, encrypted characters string to be verified is changed according to the predetermined encryption mode, is generated Encrypted characters string to be verified;The encrypted characters string to be verified is compared with the encrypted characters string, if the encryption to be verified Character string is consistent with the encrypted characters string, then confirms that the encrypted characters string to be verified is identical with the target string.This Method is simple and convenient, under the premise of not increasing user and remembering difficulty, generates the encrypted characters string for protecting target string, carries High character string is cracked difficulty.
Brief description of the drawings
Fig. 1 is the terminal structure schematic diagram for the hardware running environment that scheme of the embodiment of the present invention is related to;
Fig. 2 is a kind of schematic flow sheet of character string encryption method first embodiment of the present invention;
Fig. 3 is a kind of schematic flow sheet of character string encryption method second embodiment of the present invention;
Fig. 4 is a kind of schematic flow sheet of character string encryption method 3rd embodiment of the present invention;
Fig. 5 is a kind of schematic flow sheet of character string encryption method fourth embodiment of the present invention;
Fig. 6 is a kind of schematic flow sheet of the embodiment of character string encryption method the 5th of the present invention;
Fig. 7 is a kind of schematic flow sheet of character string encryption method sixth embodiment of the present invention.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The primary solutions of the embodiment of the present invention are:When receiving CIPHERING REQUEST, the target character that need to be encrypted is obtained String;By each character in the target string, corresponding random string is replaced with according to the first mapping relations;It will replace The random string changed into is spliced, and generates encrypted characters string.
Using increase password complexity, Password Length during due to character string being encrypted, user's memory is not easy to;Adopt The method encrypted with " adding salt " also has the possibility being cracked.Therefore, the present invention provides a solution, it is desirable to provide a kind of Do not increase user and remember burden, while increase cracks the encryption method of difficulty.
As shown in figure 1, Fig. 1 is the apparatus structure schematic diagram for the hardware running environment that scheme of the embodiment of the present invention is related to.
The present embodiments relate to character string encryption device, character string checking plant running terminal can be PC, Can be smart mobile phone, tablet personal computer, E-book reader, MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio aspect 3) player, MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard audio aspect 3) player, pocket computer etc. have it is aobvious Show the packaged type terminal device of function.
As shown in figure 1, the terminal can include:Processor 1001, such as CPU, network interface 1004, user interface 1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is used to realize the connection communication between these components. User interface 1003 can include display screen (Display), input block such as keyboard (Keyboard), optional user interface 1003 can also include wireline interface, the wave point of standard.Network interface 1004 can optionally connect including the wired of standard Mouth, wave point (such as WI-FI interfaces).Memory 1005 can be high-speed RAM memory or stable memory (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor 1001 storage device.
Alternatively, terminal can also include camera, RF (Radio Frequency, radio frequency) circuit, sensor, audio Circuit, WiFi module etc..Wherein, sensor ratio such as optical sensor, motion sensor and other sensors.Art technology Personnel are appreciated that the restriction of the terminal structure shown in Fig. 1 not structure paired terminal, can include more more or less than illustrating Part, either combine some parts or different parts arrangement.
As shown in figure 1, it can lead to as in a kind of memory 1005 of computer-readable storage medium including operating system, network Believe module, Subscriber Interface Module SIM and character string encipheror, character string proving program.
In the terminal shown in Fig. 1, network interface 1004 is mainly used in connecting background server, is carried out with background server Data communicate;User interface 1003 is mainly used in connecting client (user terminal), enters row data communication with client;And processor 1001 can be used for calling the character string encipheror stored in memory 1005, and perform following operate:
When receiving CIPHERING REQUEST, the target string that need to be encrypted is obtained;
By each character in the target string, according to corresponding to replacing with the first mapping relations built in advance with Machine character string;
The random string being substituted for is spliced, generates encrypted characters string.
Further, processor 1001 can call the character string encipheror stored in memory 1005, also perform with Lower operation:
The random string group of this encryption is generated according to default plaintext character group;
The random string group generated is grouped according to default put in order, it is pre- to obtain string length If the random string of length;
Each character of the default plaintext character group is arranged according to default put in order;
Each character of the default plaintext character group arranged is corresponding in turn to each random string, with structure Build first mapping relations.
Further, processor 1001 can call the character string encipheror stored in memory 1005, also perform with Lower operation:
Confirm the number of characters of the default plaintext character group, and obtain the default complexity value for the character string that need to be encrypted;
The character of the default plaintext character group, the random string group of this encryption of one group of generation are selected at random;
Wherein, the number of characters that the default complexity value includes for each random string, and the length of the random character group Degree is equal to the number of characters of the default plaintext character group and the product of the default complexity value.
Further, processor 1001 can call the character string encipheror stored in memory 1005, also perform with Lower operation:
Any two groups of random strings are compared, confirm whether two groups of random strings are identical;
If two groups of random strings are identical, the character for selecting the default plaintext character group at random regenerates one Group random string, and one group of random string of identical is replaced with to the random string regenerated;
The step of continuing executing with any two groups of random strings of the comparison, until all random strings are completed two-by-two Compare, and untill all random strings are different.
Processor 1006 can be used for calling the character string proving program stored in memory 1005, and perform following grasp Make:
After checking request is received, the encrypted characters string stored is extracted;Wherein, the encrypted characters string is according to pre- If the character string that cipher mode generates after target string is encrypted;
Encrypted characters string to be verified is changed according to the predetermined encryption mode, generates encrypted characters string to be verified;
The encrypted characters string to be verified is compared with the encrypted characters string, if the encrypted characters string to be verified and institute It is consistent to state encrypted characters string, then confirms that the encrypted characters string to be verified is identical with the target string.
Further, processor 1006 can call the character string encipheror stored in memory 1005, also perform with Lower operation:
The encrypted characters string generated is decrypted according to the second mapping relations, restores the target string;
After the target string is encrypted according to predetermined encryption mode again, new encrypted characters string is generated;
Wherein, second mapping relations are the random string according to default plaintext character group generation and default plaintext word The corresponding relation of each character of symbol group;The encrypted characters string is that the random string is spliced.
Further, processor 1006 can call the character string encipheror stored in memory 1005, also perform with Lower operation:
According to predetermined encryption strategy, the encrypted characters string generated is encrypted again, generates new encrypted characters string.
Reference picture 2, first embodiment of the invention provide a kind of character string encryption method, the character string encryption method bag Include:
Step S10, when receiving CIPHERING REQUEST, obtain the target string that need to be encrypted;
Specifically, after step S10, in addition to:The random string of this encryption is generated according to default plaintext character group; The random string generated is grouped, obtains the random string that string length is preset length.Wherein, it is described pre- If such as a-z, A-Z, 0-9 ,@#~* %+ character can be used in plaintext character group.It should be noted that default plaintext character group Character should include character in the target string that need to be encrypted.
Step S20, each character in the target string replaces with according to the first mapping relations built in advance Corresponding random string;
Further, also include before step S20:The random string of this encryption is generated according to default plaintext character group Group;The random string group generated is grouped according to default put in order, obtains string length as default length The random string of degree;Each character of the default plaintext character group is arranged according to default put in order;Will Each character of the default plaintext character group arranged is corresponding in turn to each random string, to build described first Mapping relations.
Step S30, the random string being substituted for is spliced, generate encrypted characters string.
For example, it is desired to when the login password to website user is encrypted, the login password of user is obtained, and will log in close After each character in code is substituted for corresponding random string respectively, obtained random string is arranged in order and connected, i.e., Login password after being encrypted.
It is further illustrated:Assuming that the target string for needing to encrypt in the present embodiment is " Xiaoming123 ", institute State in default plaintext character group and add up to 68 plaintext characters containing a-z, A-Z, 0-9 ,@#~* %+;I.e.
“abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@# ~* %+ " generate a random string group at random, as follows:
3lEH+E*dTn708JTo1N4BgLxEPQqv91K2BXf2htbY8Mr~ Zfs3oZj9yMQr1ch4V6BsHsZsObvZummlsA%9%WVwH+H6z~E*BWPmt5ZFFACkrOM+eiuvM4C P ~u36AAEX+b%6gNTP0#0PGGxoRmf3FSr1LB+mnVDCwlPhkIPcw9yEuid19+B+Nl55RQu~zygHw+ VhOksZ9XP#mDMaHWKc+951hBn1RkhKOD3QrmcYBd Cv%W2xYZ6_#zZAT3J#%rC#B~zispP~ 8%7f7~xd+MXA
By random string component group, multigroup random string is obtained, and obtains the character and root of default plaintext character group It is random as corresponding to character " a " according to the corresponding relation of the random string of default plaintext character group generation, i.e. the first mapping relations Character string is " 3lEH ", and random string corresponding to character " b " is "+E*d ", by that analogy.By " Xiaoming123 " according to upper State the first mapping relations and replace with corresponding random string, it is as shown in the table that corresponding random string can be obtained:
The random string being substituted for is spliced, the encrypted characters string of generation is:
“9XP#BXf23lEH1ch4oZj9BXf2yMQrPQqv+951hBn1RkhK”
The present embodiment is by by each character in the target string, according to corresponding to replacing with the first mapping relations Random string, and the random string being substituted for is spliced, encrypted characters string is generated, so as to complete adding for character string It is close.This method is simple and convenient, under the premise of not increasing user and remembering difficulty, generates the encrypted characters for protecting target string String, while improve character string Cipher Strength.
Reference picture 3, second embodiment of the invention provides a kind of character string encryption method, described to receive CIPHERING REQUEST When, obtain need to encrypt target string the step of after, in addition to:
Step S40, the random string group of this encryption is generated according to default plaintext character group;
The character included in default plaintext character group can include but is not limited to:A-z, A-Z, 0-9, #~* %+, can be with According to being actually needed, using above-mentioned one or more plaintext character, can also need to increase other plaintext characters.Need to note Meaning, the character of default plaintext character group should include the character in the target string that need to be encrypted.Add receiving every time During close request, using plaintext character random combine, one group of random string group is generated.
Further, step S40 is specifically included:
Step a, confirms the number of characters of the default plaintext character group, and obtains the default complexity for the character string that need to be encrypted Value;
Step b, the character of the default plaintext character group, the random string of this encryption of one group of generation are selected at random Group;Wherein, the default complexity value is the number of characters that each random string includes, and the length of the random character group is equal to The number of characters of the default plaintext character group and the product of the default complexity value.Specifically, the default plaintext character group In character it is different.The complexity value represents the number of character in random string corresponding to each plaintext character, can It is configured according to being actually needed, line translation can also be entered in each encryption, to improve the randomness of encryption;For example, it is assumed that Complexity value is 5, contains 5 characters in corresponding random string after any plaintext character encryption.It should be noted that every time When character string is encrypted, the character in the default plaintext character group used can be identical with character used in last time encryption It is or different.
Step S50, the random string group generated is grouped according to default put in order, obtains character string Length is the random string of preset length;
Contain a number of character wherein in each group random string;Every group of random character string length can be according to actual need Set, be preferably above-mentioned complexity value in the present embodiment, be i.e. preset length is preferably equal to complexity value.It is for example, it is assumed that multiple Miscellaneous angle value is 4, then the string length of random string is equal to 4.
As an example it is assumed that complexity number is 4, add up in default plaintext character group containing a-z, A-Z, 0-9 ,@#~* %+ The plaintext character of 68 characters, i.e.,
“abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@# ~* %+ ", the random string that length is (68*4=272) can be generated at random, it is as follows:
3lEH+E*dTn708JTo1N4BgLxEPQqv91K2BXf2htbY8Mr~ Zfs3oZj9yMQr1ch4V6BsHsZsObvZummlsA%9%WVwH+H6z~E*BWPmt5ZFFACkrOM+eiuvM4C P ~u36AAEX+b%6gNTP0#0PGGxoRmf3FSr1LB+mnVDCwlPhkIPcw9yEuid19+B+Nl55RQu~zygHw+ VhOksZ9XP#mDMaHWKc+951hBn1RkhKOD3QrmcYBd Cv%W2xYZ6~#zZAT3J#%rC#B~zispP~ 8%7f7~xd+MXA
According to 4 characters are contained in every group, above-mentioned generation random string is grouped, obtains multigroup random character String, such as 3lEH ,+E*d, Tn70.
Step S60, each character of the default plaintext character group is arranged according to default put in order;
Step S70, by each character of the default plaintext character group arranged and each random string successively It is corresponding, to build first mapping relations.
Wherein, preset order can include but is not limited to:Positive sequence, backward, the present embodiment are preferably positive sequence.Default plaintext word After symbol sequence, you can be corresponding in turn to each group random string.
Quote the example above further explanation:
“abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@# ~* %+ " add up to the plaintext character of 68 characters, generate a random string at random, as follows:
3lEH+E*dTn708JTo1N4BgLxEPQqv91K2BXf2htbY8Mr~ Zfs3oZj9yMQr1ch4V6BsHsZsObvZummlsA%9%WVwH+H6z~E*BWPmt5ZFFACkrOM+eiuvM4C P ~u36AAEX+b%6gNTP0#0PGGxoRmf3FSr1LB+mnVDCwlPhkIPcw9yEuid19+B+Nl55RQu~zygHw+ VhOksZ9XP#mDMaHWKc+951hBn1RkhKOD3QrmcYBd Cv%W2xYZ6_#zZAT3J#%rC#B~zispP~ 8%7f7~xd+MXA
And the random string of generation is divided into multigroup random string, wherein the number of characters of every group of random string is equal to Default complexity value.4 characters are included i.e. in each group random string.Each character in the default plaintext character group used is pressed After permutation with positive order, you can the first mapping relations of default plaintext character and random string structure are obtained, it is as shown in the table:
The present embodiment generates the random string group of this encryption by the character of the default plaintext character group of basis at random, and Random string component group is obtained into random string, and builds the first mapping relations, to be held to the target string of input Row subsequently replaces with corresponding random string, further obtains the encrypting step of encrypted characters string.
Reference picture 4, third embodiment of the invention provides a kind of character string encryption method, described described random by what is generated Character string be grouped, obtain string length be preset length random string the step of after, in addition to:
Step S80, any two groups of random strings are compared, confirm whether two groups of random strings are identical;
Step S90, if two groups of random strings are identical, the character weight of the default plaintext character group is selected at random Newly-generated one group of random string, and one group of random string of identical is replaced with to the random string regenerated;
Step S100, described the step of comparing any two groups of random strings is continued executing with, until all random characters Untill string is completed to compare two-by-two, and all random strings are different.
This way it is possible to avoid random string repeats, so as to ensure to need each character pair of target string encrypted Unique encrypted characters string is answered, avoids encryption errors.
Reference picture 5, a kind of character string verification method of fourth embodiment of the invention offer, a kind of character string encryption method, its It is characterised by, the character string verification method comprises the following steps:
Step S110, after checking request is received, extract the encrypted characters string stored;Wherein, the encrypted characters The character string gone here and there to generate after target string is encrypted according to predetermined encryption mode;
Step S120, encrypted characters string to be verified is changed according to the predetermined encryption mode, generation is to be verified to be added Close character string;
Step S130, the encrypted characters string to be verified is compared with the encrypted characters string, if the encryption to be verified Character string is consistent with the encrypted characters string, then confirms that the encrypted characters string to be verified is identical with the target string.
Illustrated with the example of website log scene:When website user logs at website end, the user name of input is " xiaoming ", the password of input is " Xiaoming123 ".Now, website end need to verify whether the password of input is that user sets The proper password put.Website end can trigger checking request according to the input operation of user, extract the user stored and set just Encrypted characters string corresponding to true password.Then the identical predetermined encryption mode according to used in the password encryption set with user, will Conversion is encrypted in the password " Xiaoming123 " of user's input, generates an encrypted characters string to be verified.And by encryption to be verified Character string is compared with the encrypted characters string stored, if the two is consistent, confirms that the password of user's input is set for user Proper password, that is, the password inputted is correct.If the two is inconsistent, illustrate the password bad of user's input.
It should be noted that character string when verifying needs that the accounts information of user is identified, the information of identification includes But it is not limited to following one kind therein:The ID that user name, cell-phone number, website end are distributed to website user.Add so as to improve password Close security.
The present embodiment generates encrypted characters string to be verified, and add to be verified by the way that the character string of input is encrypted into conversion Close character string and original character serially add it is dense into character string compare, when the two is consistent, confirm the character string to be verified of input For target string, that is, confirm that the encrypted characters string to be verified is identical with the target string.It is in this manner it is possible to really real Now to the protection of target string, the leakage of target string is avoided;The checking to inputting character string to be verified is realized simultaneously.
Reference picture 6, fifth embodiment of the invention provides a kind of character string encryption method, described to receive checking request Afterwards, before the step of encrypted characters string that extraction has stored, in addition to:
Step S140, the encrypted characters string generated is decrypted according to the second mapping relations, restores the target Character string;
Wherein, second mapping relations are the random string according to default plaintext character group generation and default plaintext word The corresponding relation of each character of symbol group;The encrypted characters string is that the random string is spliced.
Thus, it is readily obtained:Second mapping relations are the inverse mappings of the first mapping relations described in first embodiment.
For example, the citing in first embodiment is quoted, the encrypted characters string that will have been generated
" 9XP#BXf23lEH1ch4oZj9BXf2yMQrPQqv+951hBn1RkhK " can arrive according to the second mapping relations The character of corresponding target string.Wherein, the second mapping relations are as shown in the table:
Therefore, it is " Xiaoming123 " that can derive original character string corresponding to encrypted characters string.
Step S150, after the target string is encrypted according to predetermined encryption mode again, generate new encrypted word Symbol string;
For example, the cycle of settable re-encrypted, such as 1 month, after this generation encrypted characters string, every one month certainly The dynamic dynamic encryption renewal for carrying out original character string.
This way it is possible to realize the dynamic renewal of encrypted characters string.This method is convenient, flexible, can effectively reduce encrypted characters The possibility that string is cracked.
Reference picture 7, sixth embodiment of the invention provides a kind of character string encryption method, described to receive checking request Afterwards, before the step of encrypted characters string that extraction has stored, in addition to:
Step S160, according to predetermined encryption strategy, the encrypted characters string generated is encrypted again, generate new encryption Character string.
Specifically, the AES of selection is actually needed according to the predetermined encryption strategy, is preferably used in this example Irreversible encryption algorithm, such as MD5 algorithms, SHS (Secure Hash Standard, safe gibberish standard) standard.
In the present embodiment, by carrying out irreversible encryption to encrypted characters string, even if generating first needed for encrypted characters string Random string group, the encrypted characters string that generates after random string and irreversible encryption be stolen, can not also restore Target string, realize the safeguard protection to target string.
In addition, the embodiment of the present invention also proposes a kind of computer-readable recording medium, the computer-readable recording medium On be stored with character string encipheror and character string proving program, when the character string encipheror is executed by processor realize such as Lower operation:
When receiving CIPHERING REQUEST, the target string that need to be encrypted is obtained;
By each character in the target string, according to corresponding to replacing with the first mapping relations built in advance with Machine character string;
The random string being substituted for is spliced, generates encrypted characters string.
Further, following operation is also realized when the character string encipheror is executed by processor:
The random string group of this encryption is generated according to default plaintext character group;
The random string group generated is grouped according to default put in order, it is pre- to obtain string length If the random string of length;
Each character of the default plaintext character group is arranged according to default put in order;
Each character of the default plaintext character group arranged is corresponding in turn to each random string, with structure Build first mapping relations.
Further, following operation is also realized when the character string encipheror is executed by processor:
Confirm the number of characters of the default plaintext character group, and obtain the default complexity value for the character string that need to be encrypted;
The character of the default plaintext character group, the random string group of this encryption of one group of generation are selected at random;
Wherein, the number of characters that the default complexity value includes for each random string, and the length of the random character group Degree is equal to the number of characters of the default plaintext character group and the product of the default complexity value.
Further, following operation is also realized when the character string encipheror is executed by processor:
Any two groups of random strings are compared, confirm whether two groups of random strings are identical;
If two groups of random strings are identical, the character for selecting the default plaintext character group at random regenerates one Group random string, and one group of random string of identical is replaced with to the random string regenerated;
The step of continuing executing with any two groups of random strings of the comparison, until all random strings are completed two-by-two Compare, and untill all random strings are different.
Further, following operation is also realized when the character string proving program is executed by processor:
After checking request is received, the encrypted characters string stored is extracted;Wherein, the encrypted characters string is according to pre- If the character string that cipher mode generates after target string is encrypted;
Encrypted characters string to be verified is changed according to the predetermined encryption mode, generates encrypted characters string to be verified;
The encrypted characters string to be verified is compared with the encrypted characters string, if the encrypted characters string to be verified and institute It is consistent to state encrypted characters string, then confirms that the encrypted characters string to be verified is identical with the target string.
Further, following operation is also realized when the character string proving program is executed by processor:
After checking request is received, extract stored encrypted characters string the step of before, according to the second mapping relations The encrypted characters string generated is decrypted, restores the target string;
After the target string is encrypted according to predetermined encryption mode again, new encrypted characters string is generated;
Wherein, second mapping relations are the random string according to default plaintext character group generation and default plaintext word The corresponding relation of each character of symbol group;The encrypted characters string is that the random string is spliced.
Further, following operation is also realized when the character string proving program is executed by processor:
After checking request is received, before the step of extracting the encrypted characters string stored, according to predetermined encryption strategy, The encrypted characters string generated is encrypted again, generates new encrypted characters string.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row His property includes, so that process, method, article or system including a series of elements not only include those key elements, and And also include the other element being not expressly set out, or also include for this process, method, article or system institute inherently Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this Other identical element also be present in the process of key element, method, article or system.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on such understanding, technical scheme is substantially done to prior art in other words Going out the part of contribution can be embodied in the form of software product, and the computer software product is stored in one as described above In storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions to cause a station terminal equipment (can be mobile phone, Computer, server, air conditioner, or network equipment etc.) perform method described in each embodiment of the present invention.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hair The equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of character string encryption method, it is characterised in that the character string encryption method comprises the following steps:
When receiving CIPHERING REQUEST, the target string that need to be encrypted is obtained;
By each character in the target string, corresponding random words are replaced with according to the first mapping relations built in advance Symbol string;
The random string being substituted for is spliced, generates encrypted characters string.
2. character string encryption method as claimed in claim 1, it is characterised in that it is described when receiving CIPHERING REQUEST, obtain After the step of target string that need to be encrypted, in addition to:
The random string group of this encryption is generated according to default plaintext character group;
The random string group generated is grouped according to default put in order, obtains string length as default length The random string of degree;
Each character of the default plaintext character group is arranged according to default put in order;
Each character of the default plaintext character group arranged is corresponding in turn to each random string, to build State the first mapping relations.
3. character string encryption method as claimed in claim 2, it is characterised in that the basis presets the generation of plaintext character group originally The step of random string group of secondary encryption, includes:
Confirm the number of characters of the default plaintext character group, and obtain the default complexity value for the character string that need to be encrypted;
The character of the default plaintext character group, the random string group of this encryption of one group of generation are selected at random;
Wherein, the number of characters that the default complexity value includes for each random string, and length of the random character group etc. In the number of characters and the product of the default complexity value of the default plaintext character group.
4. character string encryption method as claimed in claim 2, it is characterised in that the random string that will have been generated Group is grouped according to default put in order, after the step of obtaining the random string that string length is preset length, also Including:
Any two groups of random strings are compared, confirm whether two groups of random strings are identical;
If two groups of random strings are identical, select at random the default plaintext character group character regenerate one group with Machine character string, and one group of random string of identical is replaced with to the random string regenerated;
The step of continuing executing with any two groups of random strings of the comparison, until all random strings are completed to compare two-by-two Untill right and all random string is different.
5. a kind of character string verification method, it is characterised in that the character string verification method comprises the following steps:
After checking request is received, the encrypted characters string stored is extracted;Wherein, the encrypted characters string is to be added according to default The character string that close mode generates after target string is encrypted;
Encrypted characters string to be verified is changed according to the predetermined encryption mode, generates encrypted characters string to be verified;
The encrypted characters string to be verified is compared with the encrypted characters string, if the encrypted characters string to be verified adds with described Close character string is consistent, then confirms that the encrypted characters string to be verified is identical with the target string.
6. character string verification method as claimed in claim 5, it is characterised in that described after checking request is received, extraction Before the step of encrypted characters string stored, in addition to:
The encrypted characters string generated is decrypted according to the second mapping relations, restores the target string;
After the target string is encrypted according to predetermined encryption mode again, new encrypted characters string is generated;
Wherein, second mapping relations are the random string according to default plaintext character group generation and default plaintext character group Each character corresponding relation;The encrypted characters string is that the random string is spliced.
7. character string verification method as claimed in claim 5, it is characterised in that described after checking request is received, extraction Before the step of encrypted characters string stored, in addition to:
According to predetermined encryption strategy, the encrypted characters string generated is encrypted again, generates new encrypted characters string.
8. a kind of character string encryption device, it is characterised in that the character string encryption device includes:Memory, processor and deposit The character string encipheror that can be run on the memory and on the processor is stored up, the character string encipheror is by institute The step of character string method as any one of Claims 1-4 being realized when stating computing device.
9. a kind of character string verifies device, it is characterised in that the character string checking device includes:Memory, processor and deposit The character string proving program that can be run on the memory and on the processor is stored up, the character string proving program is by institute The step of character string verification method as any one of claim 5 to 7 being realized when stating computing device.
10. a kind of computer-readable recording medium, it is characterised in that be stored with character string on the computer-readable recording medium Encipheror and character string proving program, realized when the character string encipheror is executed by processor as in Claims 1-4 The step of character string encryption method described in any one, realize that right such as will when the character string proving program is executed by processor The step of seeking the character string verification method any one of 5 to 7.
CN201710819973.1A 2017-09-12 2017-09-12 Character string encryption, verification method, device, computer readable storage medium Active CN107634832B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710819973.1A CN107634832B (en) 2017-09-12 2017-09-12 Character string encryption, verification method, device, computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710819973.1A CN107634832B (en) 2017-09-12 2017-09-12 Character string encryption, verification method, device, computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107634832A true CN107634832A (en) 2018-01-26
CN107634832B CN107634832B (en) 2018-11-09

Family

ID=61101712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710819973.1A Active CN107634832B (en) 2017-09-12 2017-09-12 Character string encryption, verification method, device, computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107634832B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110086603A (en) * 2019-04-30 2019-08-02 中国联合网络通信集团有限公司 Encryption and decryption approaches, device, product identification and the manufacturing method of character string
CN110266682A (en) * 2019-06-18 2019-09-20 杭州情咖网络技术有限公司 Data ciphering method, device, mobile terminal and decryption method
CN111062456A (en) * 2019-12-25 2020-04-24 李蕴光 Two-dimensional code encryption algorithm
CN111984989A (en) * 2020-09-01 2020-11-24 上海梅斯医药科技有限公司 Method, device, system and medium for verifying, issuing and accessing URL (uniform resource locator)
CN112084511A (en) * 2020-08-27 2020-12-15 欧菲微电子技术有限公司 Encryption method and device of service life information, storage medium and electronic equipment
CN112232816A (en) * 2020-10-15 2021-01-15 北京新创智链科技有限公司 Payment transaction data processing method, device, equipment and storage medium
CN112784292A (en) * 2019-11-07 2021-05-11 大唐移动通信设备有限公司 Configuration file processing method and device
CN113076554A (en) * 2021-03-12 2021-07-06 广西东信易联科技有限公司 Physical examination data safe storage method based on block chain
CN113722742A (en) * 2021-09-13 2021-11-30 青岛海信宽带多媒体技术有限公司 Terminal and method for encrypting and storing firmware file of optical module MCU (microprogrammed control Unit) by terminal
CN115686380A (en) * 2022-12-16 2023-02-03 深圳市东信时代信息技术有限公司 File storage method and device, computer equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075866A (en) * 2006-12-26 2007-11-21 腾讯科技(深圳)有限公司 Method and system for loading message on Internet
CN101465735A (en) * 2008-12-19 2009-06-24 北京大学 Network user identification verification method, server and client terminal
CN102904712A (en) * 2011-07-25 2013-01-30 深圳市金溢科技有限公司 Information encrypting method
CN103853985A (en) * 2012-12-05 2014-06-11 中国移动通信集团黑龙江有限公司 Data encryption method, decryption method and decryption device
CN103873250A (en) * 2012-12-18 2014-06-18 中国移动通信集团河南有限公司 Ciphertext generation method, ciphertext decryption method and encryption/ decryption device
CN104113552A (en) * 2014-07-28 2014-10-22 百度在线网络技术(北京)有限公司 Platform authorization method, platform server side, application client side and system
CN106161006A (en) * 2015-04-06 2016-11-23 汪风珍 A kind of digital encryption algorithm
CN106682534A (en) * 2017-01-23 2017-05-17 郑州云海信息技术有限公司 Method and device for verifying data integrity in data migration process

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075866A (en) * 2006-12-26 2007-11-21 腾讯科技(深圳)有限公司 Method and system for loading message on Internet
CN101465735A (en) * 2008-12-19 2009-06-24 北京大学 Network user identification verification method, server and client terminal
CN102904712A (en) * 2011-07-25 2013-01-30 深圳市金溢科技有限公司 Information encrypting method
CN103853985A (en) * 2012-12-05 2014-06-11 中国移动通信集团黑龙江有限公司 Data encryption method, decryption method and decryption device
CN103873250A (en) * 2012-12-18 2014-06-18 中国移动通信集团河南有限公司 Ciphertext generation method, ciphertext decryption method and encryption/ decryption device
CN104113552A (en) * 2014-07-28 2014-10-22 百度在线网络技术(北京)有限公司 Platform authorization method, platform server side, application client side and system
CN106161006A (en) * 2015-04-06 2016-11-23 汪风珍 A kind of digital encryption algorithm
CN106682534A (en) * 2017-01-23 2017-05-17 郑州云海信息技术有限公司 Method and device for verifying data integrity in data migration process

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110086603A (en) * 2019-04-30 2019-08-02 中国联合网络通信集团有限公司 Encryption and decryption approaches, device, product identification and the manufacturing method of character string
CN110266682B (en) * 2019-06-18 2021-11-02 杭州情咖网络技术有限公司 Data encryption method and device, mobile terminal and decryption method
CN110266682A (en) * 2019-06-18 2019-09-20 杭州情咖网络技术有限公司 Data ciphering method, device, mobile terminal and decryption method
CN112784292B (en) * 2019-11-07 2024-01-30 大唐移动通信设备有限公司 Configuration file processing method and device
CN112784292A (en) * 2019-11-07 2021-05-11 大唐移动通信设备有限公司 Configuration file processing method and device
CN111062456A (en) * 2019-12-25 2020-04-24 李蕴光 Two-dimensional code encryption algorithm
CN112084511A (en) * 2020-08-27 2020-12-15 欧菲微电子技术有限公司 Encryption method and device of service life information, storage medium and electronic equipment
CN111984989A (en) * 2020-09-01 2020-11-24 上海梅斯医药科技有限公司 Method, device, system and medium for verifying, issuing and accessing URL (uniform resource locator)
CN111984989B (en) * 2020-09-01 2024-04-12 上海梅斯医药科技有限公司 Method, device, system and medium for self-checking publishing and accessing URL
CN112232816A (en) * 2020-10-15 2021-01-15 北京新创智链科技有限公司 Payment transaction data processing method, device, equipment and storage medium
CN113076554A (en) * 2021-03-12 2021-07-06 广西东信易联科技有限公司 Physical examination data safe storage method based on block chain
CN113076554B (en) * 2021-03-12 2022-10-11 广西东信易联科技有限公司 Physical examination data safe storage method based on block chain
CN113722742A (en) * 2021-09-13 2021-11-30 青岛海信宽带多媒体技术有限公司 Terminal and method for encrypting and storing firmware file of optical module MCU (microprogrammed control Unit) by terminal
CN113722742B (en) * 2021-09-13 2024-04-16 青岛海信宽带多媒体技术有限公司 Terminal and firmware file encryption storage method of optical module MCU (micro control Unit) by terminal
CN115686380A (en) * 2022-12-16 2023-02-03 深圳市东信时代信息技术有限公司 File storage method and device, computer equipment and storage medium
CN115686380B (en) * 2022-12-16 2024-04-19 深圳市东信时代信息技术有限公司 File storage method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN107634832B (en) 2018-11-09

Similar Documents

Publication Publication Date Title
CN107634832B (en) Character string encryption, verification method, device, computer readable storage medium
CN104184740B (en) Trusted transmission method, trusted third party and credible delivery system
CN101964789B (en) Method and system for safely accessing protected resources
US20170272251A1 (en) Method of performing keyed-hash message authentication code (hmac) using multi-party computation without boolean gates
CN106357701A (en) Integrity verification method for data in cloud storage
CN105812332A (en) Data protection method
CN204360381U (en) mobile device
CN105320891B (en) A kind of method and device of computer security loading system mirror image
CN102684877A (en) Method and device for carrying out user information processing
CN112035827B (en) Cipher data processing method, device, equipment and readable storage medium
CN107241184B (en) Personal password generation and management method based on improved AES
CN106817346A (en) Data transmission method and device and electronic equipment
CN106209793A (en) A kind of auth method and checking system
CN107563211A (en) Safe encryption method and system
CN106790243A (en) A kind of password remapping method of safe U disc
CA2981202C (en) Hashed data retrieval method
CN106549756A (en) A kind of method and device of encryption
CN109495500A (en) A kind of double factor authentication method based on smart phone
CN102594562A (en) Human authentication method
CN107204959B (en) Verification method, device and system of verification code
CN104504309A (en) Data encryption method and terminal for application program
CN108964899B (en) Method and device for timing encryption of dynamic formula and multiple synchronous dynamic passwords
CN108615155B (en) Method for identifying integrity of transaction information
Elganzoury et al. A new secure one-time password algorithm for mobile applications
CN115766244A (en) Internet of vehicles information encryption method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 650000 room 1501, 15 / F, building 5, phase I, qicaijunyuan, extension line of Baita Road, Panlong District, Kunming City, Yunnan Province

Patentee after: Beishuo Technology (Yunnan) Co.,Ltd.

Address before: 650000 room 1501, 15 / F, building 5, phase I, qicaijunyuan, extension line of Baita Road, Panlong District, Kunming City, Yunnan Province

Patentee before: YUNNAN SKIMMING POTENTIAL INFORMATION TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder