CN115567318A - Password encryption and decryption method and terminal - Google Patents

Password encryption and decryption method and terminal Download PDF

Info

Publication number
CN115567318A
CN115567318A CN202211393736.0A CN202211393736A CN115567318A CN 115567318 A CN115567318 A CN 115567318A CN 202211393736 A CN202211393736 A CN 202211393736A CN 115567318 A CN115567318 A CN 115567318A
Authority
CN
China
Prior art keywords
ciphertext
encryption
value
dictionary
password
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
CN202211393736.0A
Other languages
Chinese (zh)
Other versions
CN115567318B (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.)
Guangzhou Baolun Electronics Co Ltd
Original Assignee
Guangzhou Baolun Electronics Co Ltd
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 Guangzhou Baolun Electronics Co Ltd filed Critical Guangzhou Baolun Electronics Co Ltd
Priority to CN202211393736.0A priority Critical patent/CN115567318B/en
Publication of CN115567318A publication Critical patent/CN115567318A/en
Application granted granted Critical
Publication of CN115567318B publication Critical patent/CN115567318B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds

Abstract

The invention discloses a password encryption and decryption method and a terminal, the method comprises the steps of arranging element characters according to a preset sequence to form key values of an array A, then carrying out N times of random sequencing on the element characters to form value values of N arrays A, combining the key values and the value values to generate N arrays A, further forming an encryption dictionary and a decryption dictionary, setting corresponding subscript N, randomly selecting one encryption dictionary and one decryption dictionary for encryption and decryption every time when the password is input, carrying out encryption again by using an md5 algorithm, splicing code values on the encrypted numerical values, and finally carrying out verification by using a verification function password _ verify () of a php, thereby realizing that the encryption can be completed at a web end, improving the security of the password, and avoiding the situation that the exposure risk is synchronously increased after the password is used for many times.

Description

Password encryption and decryption method and terminal
Technical Field
The invention relates to the technical field of encryption and decryption, in particular to a password encryption and decryption method and a terminal.
Background
At present, three general ways of password transmission between a web end and a server are available: the first way is to transmit the password directly to the server in the form of plaintext on the web side; the second mode is that the password is firstly encrypted by md5 at the web end and then transmitted to the server; the third mode is that the short message authentication code of the mobile phone is directly used as the password; the first mode is too simple to use the plaintext, so that the password can be easily captured by a packet capturing tool, and the password is leaked; for the second mode, md5 encryption is used first and then transmission is carried out, although plaintext transmission is not carried out, the encryption dictionary is unique, and even after md5 encryption is carried out, the user password can be easily cracked by inquiring the encryption dictionary; for the third mode, the method basically prevents others from cracking the password, but the cost is higher, and most companies or individuals cannot accept the mode because the short message is charged according to the item.
Disclosure of Invention
In order to overcome the defects of the prior art, an object of the present invention is to provide a method for encrypting and decrypting a password, which can solve the problems that the existing encryption method is easy to be cracked and the encryption cost is high.
The second objective of the present invention is to provide a cryptographic encryption and decryption terminal, which can solve the problems of easy decryption and high encryption cost of the existing encryption method.
In order to achieve one of the above purposes, the technical scheme adopted by the invention is as follows:
a cryptographic encryption and decryption method, comprising the steps of:
s1: arranging the meta characters according to a preset sequence to form a key value of an array A, then randomly sequencing the meta characters for N times to form value values of N arrays A, and respectively generating N arrays A from the key value of the array A and the value values of N arrays A, wherein N is larger than 1;
s2: associating the array A with a subscript n, storing all the arrays A into an encryption dictionary, exchanging the positions of the key value and the value of the array A to form a decryption dictionary, storing the encryption dictionary to the front end, and storing the decryption dictionary to a server, wherein n is an arbitrary value;
s3: acquiring an instruction input by a display interface, generating a random number m into a hidden domain, calling an encryption dictionary associated with a subscript n corresponding to the random number m to encrypt a password character string in the instruction, generating a first ciphertext, and sending an account number, the random number m and the first ciphertext to a server, wherein the instruction comprises a login instruction or a registration instruction;
s4: and driving the server to call a decryption dictionary associated with the subscript n to decrypt the first ciphertext to obtain a first plaintext, encrypting the first plaintext by adopting an md5 algorithm to obtain a second ciphertext, splicing a code value at the tail end of the second ciphertext, and verifying through a verification function password _ verify () of the php.
Preferably, the S1 is specifically realized by the following steps:
s11: at a preset moment, arranging the meta characters according to a preset sequence to form a key value of the array A, and then randomly sequencing the meta characters for N times to generate value values of N arrays B;
s12: and assigning the value of the array B to the value of the array A to generate N arrays A.
Preferably, the meta characters include one or more of upper and lower case letters, numbers and special characters.
Preferably, the S2 body is realized by the following steps:
associating the array A to a subscript n, storing all the arrays A into an encryption dictionary, exchanging the positions of the key value and the value of the array A to form a decryption dictionary, storing the encryption dictionary to a root directory of a web front end or a directory configured at the front end, and storing the decryption dictionary to a configuration file of php, wherein n is any value;
preferably, the S3 body is realized by the following steps:
the method comprises the steps of obtaining an instruction input by a display interface, generating a random number m into a hidden field, obtaining a password character string and an account number of the instruction, calling an encryption dictionary associated with a subscript n corresponding to the random number m to encrypt the input password character string one by one, generating a first ciphertext, and sending the account number, the first ciphertext and the random number m to a server.
Preferably, the random number m is equal to the subscript n.
Preferably, after the random number m is generated, the method further includes the following steps:
and encrypting the random number m, storing the random number m in the hidden domain, sending the random number m to the server, and driving the server to decrypt the encrypted random number m to obtain the random number m.
Preferably, the S4 body is realized by the following steps:
s41: the server is driven to call a decryption dictionary related to the subscript n corresponding to the random number m to decrypt the first ciphertext to obtain a first plaintext;
s42: judging whether the instruction input by the display interface is a login instruction, if not, executing S43, and if so, executing S44;
s43: self-defining to generate a code value associated with the account, storing the code value in a database, encrypting a first plaintext by adopting an md5 algorithm to obtain a second ciphertext, splicing the code value at the tail end of the second ciphertext to obtain a third ciphertext, encrypting the third ciphertext by using a password hash algorithm function password _ hash of php to generate a fourth ciphertext, and storing the fourth ciphertext in a password field of the database;
s44: and encrypting the first plaintext by adopting an md5 algorithm to obtain a second ciphertext, splicing a code value at the tail end of the second ciphertext to obtain a third ciphertext, and verifying the third ciphertext and a fourth ciphertext stored in a password field of the database by using a verification function password _ verify () of php.
In order to achieve the second purpose, the technical scheme adopted by the invention is as follows:
a password encryption and decryption terminal comprises a storage and a processor;
a memory for storing program instructions;
and the processor is used for operating the program instructions to execute the password encryption and decryption method.
Compared with the prior art, the invention has the beneficial effects that: the key values of the array A are formed by arranging the key values according to a preset sequence, N times of random sequencing are carried out on the element characters to form value values of the N arrays A, the N arrays A are generated by combining the key values and the value values to further form an encryption dictionary and a decryption dictionary, corresponding subscript N is set, the encryption dictionary and the decryption dictionary are randomly selected for encryption and decryption every time when the password is input, the md5 algorithm is used for carrying out encryption again, the code values are spliced on the encrypted values, and finally verification is carried out through a verification function passcode _ verify () of the php, so that encryption can be completed at a web end, the encryption dictionaries encrypted every time are different, the security of the password is improved, and the situation that the exposure risk is synchronously increased after the password is used for multiple times is avoided.
Drawings
Fig. 1 is a flowchart of a cryptographic encryption and decryption method of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it should be understood that they are presented herein only to illustrate and explain the present invention and not to limit the present invention.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
The invention is further described with reference to the following drawings and detailed description:
in the present invention, the front end is preferably vue +, and the server preferably uses PHP, and the meta characters include one or more of upper and lower case letters, numbers, and special characters.
The first embodiment is as follows:
as shown in fig. 1, a cryptographic encryption and decryption method includes the following steps:
s1: arranging the meta characters according to a preset sequence to form a key value of an array A, then randomly sequencing the meta characters for N times to form value values of N arrays A, and respectively generating N arrays A from the key value of the array A and the value values of N arrays A, wherein N is larger than 1;
specifically, each array key value corresponds to a value, preferably, the N arrays a have the same key value, but each key value may have a different value, for example, [ a ] = > 3, [ a ] = > 7, [ a ] = > h, and so on, in this embodiment, the S1 is implemented by the following steps:
s11: at a preset moment, arranging the meta characters according to a preset sequence to form a key value of an array A, and then randomly sequencing the meta characters for N times to generate value values of N arrays B;
specifically, the updating time of the encryption dictionary is preset, after each updating, the old encryption dictionary and decryption dictionary are invalidated, the new encryption dictionary and decryption dictionary are started, preferably, the meta-characters are arranged according to a preset sequence, such as abc123@ #, then the key values of each array A are a, b, c, 1, 2, 3, @, #, $, and the like, and the meta-characters are randomly ordered, such as: 3B @1c2$ # a, then the value values of array B are 3, B, @, 1, c, 2, $, #, a in that order, starting with 0, and then sequentially incrementing +1 for the key value of array B, that is, [0] = > 3, [1] = > B, [2] = > @, [3] = > 1, [4] = > c, [5] = > 2, [6] = > $, [7] = > = #, [8] = > a; by analogy, after the meta characters are randomly ordered, the value of the array B can be the meta characters arranged randomly, and then from 0, the value is sequentially increased by +1 and is respectively set as the key value of the array B.
S12: and assigning the value of the array B to the value of the array A to generate N arrays A.
Specifically, the value values of the array B are sequentially assigned to the value values of the array a, for example, the array B has a shape of [0] = > 3, [1] = > B, [2] = > @, [3] = > 1, [4] = > c, [5] = > 2, [6] = > $, [7] = > # and [8] = > a; <xnotran> A key a, b, c, 1, 2, 3, @, #, $, B value A value , A [ a ] = > 3, [ b ] = > b, [ c ] = > @, [1] = > 1, [2] = > c, [3] = > 2, [ @ ] = > $, [ # ] = > #, [ $ ] = > a, , B value N , N A. </xnotran>
S2: associating the array A with a subscript n, storing all the arrays A into an encryption dictionary, exchanging the positions of the key value and the value of the array A to form a decryption dictionary, storing the encryption dictionary to the front end, and storing the decryption dictionary to a server, wherein n is any value;
specifically, an arbitrary value n is used to associate with the array a, for example, when n =3, the associated array a is: [a] = > 3, [ b ] = > b, [ c ] = > =, [1] = > 1, [2] = > c, [3] = > 2, [ @ ] = >, [ # ] = >, [ $ ] = > a;
when n =7, the associated array a is: [a] = 2, [ b ] = > 1, [ c ] = > @, [1] = > 3, [2] = > c, [3] = > b, [ @ ] = > $, [ # ] = > ", [ # ] = > #, [ $ ] = > a
N sets of array a are stored as an encryption dictionary, the positions of key and value values of array a are swapped to form a decryption dictionary, then when N =3, the decryption dictionary corresponds to the array of [3] = > a, [ b ] = > b, [ @ ] = > c, [1] = > 1, [ c ] = > 2, [2] = > 3, [ $ ] = > @, [ # ] = >, [ a ] = > $, and in this embodiment, the S2 body is implemented by the following steps:
associating the array A to a subscript n, storing all the arrays A into an encryption dictionary, exchanging the positions of the key value and the value of the array A to form a decryption dictionary, storing the encryption dictionary to a root directory of a web front end or a directory configured at the front end, and storing the decryption dictionary to a configuration file of php, wherein n is any value; the hidden field is a term of html (front end), and the hidden field is an invisible element used to collect or send information, and is invisible to the visitor of the web page. When the 'login' or 'registration' is clicked, the hidden domain sends information to the server by using a name and a value defined when the hidden domain is set by a user, the encryption dictionary is stored to a root directory of a web front end or a directory configured by the front end, and the decryption dictionary is stored to a configuration file of the php, so that when the password string is encrypted, the root directory of the web front end or the encryption dictionary for placing the directory configured by the front end can be directly called, and after the encryption is finished, the encryption dictionary is sent to the server, and the server decrypts by using the decryption dictionary in the configuration file of the php, so that no interaction is generated in the encryption and decryption processes, and the risk of disclosure is reduced.
S3: acquiring an instruction input by a display interface, generating a random number m into a hidden domain, calling an encryption dictionary associated with a subscript n corresponding to the random number m to encrypt a password character string in the instruction, generating a first ciphertext, and sending an account number, the random number m and the first ciphertext to a server, wherein the instruction comprises a login instruction or a registration instruction;
specifically, when a user inputs a login instruction or a registration instruction through a display interface, an encryption dictionary of a root directory of a web front end or a directory configured by a placement front end is called to encrypt password strings in the instruction one by one, and in this embodiment, the S3 body is implemented by the following steps:
the method comprises the steps of obtaining an instruction input by a display interface, generating a random number m into a hidden field, obtaining a password string and an account number of the instruction, calling an encryption dictionary associated with a subscript n equal to the random number m to encrypt the input password string one by one, generating a first ciphertext, and sending the account number, the random number m and the first ciphertext to a server.
For example, when m is 3, an encryption dictionary with n being 3 is called (for example, [ a ] = > 3, [ b ] = > b, [ c ] = > @, [1] = > 1, [2] = > c, [3] = > 2, [ @ ] = >, [ # ] = > # ], [ $ ] = > a) is called to encrypt the password string one by one, the password string is encrypted into a first ciphertext, and then the account and the first ciphertext are transmitted to the server.
Preferably, after the random number m is generated, the method further includes the following steps:
and encrypting the random number m, storing the random number m in the hidden domain, sending the random number m to the server, and driving the server to decrypt the encrypted random number m to obtain the random number m. The means in which the server encrypts the random number m may be: performing formula calculation by using the random number m as a factor, wherein the obtained calculation result is n, for example, n = k ^ m +3 and the like; or the random number m is a number segment (for example, 123456), the Kth number (for example, the 5 th number), namely n =5 and the like is selected, and the encryption dictionary associated with the subscript n is called to encrypt the input password strings one by one
S4: and driving the server to call a decryption dictionary associated with a subscript n corresponding to the random number m to decrypt the first ciphertext to obtain a first plaintext, encrypting the first plaintext by adopting an md5 algorithm to obtain a second ciphertext, splicing a code value at the tail end of the second ciphertext, and verifying through a verification function password _ verify () of the php.
Specifically, after obtaining the account number and the first ciphertext, the server invokes the decryption dictionary associated with the subscript n to decrypt the first ciphertext, and in this embodiment, the S4 entity is implemented by the following steps:
s41: the server is driven to call a decryption dictionary related to the subscript n corresponding to the random number m to decrypt the first ciphertext to obtain a first plaintext;
after obtaining the account number and the first ciphertext, the server calls a decryption dictionary associated with a subscript n corresponding to the random number m to decrypt the first ciphertext, for example, when m is 3, calls the decryption dictionary associated with n as 3: [3] and = > a, [ b ] = > b, [ = ] = > c, [1] = > 1, [ c ] = > 2, [2] = > 3, [ $ ] = >, [ # ] = >, [ a ] = > $, and the first ciphertext is decrypted to obtain the original text of the cipher character string (i.e., the first plaintext).
S42: judging whether the instruction input by the display interface is a login instruction, if not, executing S43, and if so, executing S44;
preferably, if the instruction input by the display interface is a registration instruction, that is, a new user is created, the strength and length of the password string can be verified, and S43 is executed again;
s43: generating a code value associated with an account number in a user-defined mode, storing the code value in a database, encrypting a first plaintext by adopting an md5 algorithm to obtain a second ciphertext, splicing the code value at the tail end of the second ciphertext to obtain a third ciphertext, encrypting the third ciphertext by using a password hash algorithm function password _ hash of php to generate a fourth ciphertext, and storing the fourth ciphertext in a password field of the database;
specifically, after the strength and length of the password string are verified, a code value (a salt value code, for example, K3j9b 8)) associated with the account is generated by self-defining and stored in the database of the server, an md5 algorithm is simultaneously used for encrypting the first plaintext, for example, the first plaintext is 23z $ y @, after the md5 algorithm is used for encryption, the value of the second ciphertext is 0b7ca7a1d7f57288734673013eab78d4, then the code value is spliced at the end of the second ciphertext, the third ciphertext is 0b7ca7a1d7f57288734673013eab78d4K3j9b8, the third ciphertext is encrypted through a password hash algorithm function passsweyd _ hash carried by the php, the obtained fourth ciphertext is $2y $ 10K $ kzekazeslashdap0.
S44: and encrypting the first plaintext by adopting an md5 algorithm to obtain a second ciphertext, splicing a code value at the tail end of the second ciphertext to obtain a third ciphertext, and verifying the third ciphertext and a fourth ciphertext stored in a password field of the database by using a verification function password _ verify () of php.
Specifically, when the instruction input by the display interface is a login instruction, the first plaintext is encrypted by using an md5 algorithm, for example, the first plaintext is 23z $ y @, after the instruction is encrypted by using an md5 algorithm, the value of the second ciphertext is 0b7ca7a1d7f57288734673013eab78d4, the code value associated with the account is spliced at the end of the second ciphertext, the account can be used for querying the database to obtain the data record of the account, so as to obtain the code value associated with the account, the third ciphertext is 0b7ca7a1d7f57288734673013eab78d4K3j9b8, and the password can be verified by verifying a password _ verify () of a php verification function password _ verify the third ciphertext and a fourth ciphertext stored in a password field of the database.
The second embodiment:
a password encryption and decryption terminal comprises a storage and a processor;
a memory for storing program instructions;
the processor is configured to execute the program instructions to perform the method for encrypting and decrypting the password according to the first embodiment.
Various other modifications and changes may occur to those skilled in the art based on the foregoing teachings and concepts, and all such modifications and changes are intended to be included within the scope of the appended claims.

Claims (9)

1. A method for encrypting and decrypting a password, comprising the steps of:
s1: arranging the meta characters according to a preset sequence to form a key value of an array A, then randomly sequencing the meta characters for N times to form value values of N arrays A, and respectively generating N arrays A from the key value of the array A and the value values of N arrays A, wherein N is larger than 1;
s2: associating the array A with a subscript n, storing all the arrays A into an encryption dictionary, exchanging the positions of the key value and the value of the array A to form a decryption dictionary, storing the encryption dictionary to the front end, and storing the decryption dictionary to a server, wherein n is any value;
s3: acquiring an instruction input by a display interface, generating a random number m into a hidden field, calling an encryption dictionary associated with a subscript n corresponding to the random number m to encrypt a password string in the instruction, generating a first ciphertext, and sending an account number, the random number m and the first ciphertext to a server, wherein the instruction comprises a login instruction or a registration instruction;
s4: and driving the server to call a decryption dictionary associated with the subscript n to decrypt the first ciphertext to obtain a first plaintext, encrypting the first plaintext by adopting an md5 algorithm to obtain a second ciphertext, splicing a code value at the tail end of the second ciphertext, and verifying through a verification function password _ verify () of the php.
2. The cryptographic encryption and decryption method of claim 1, wherein S1 is specifically implemented by the steps of:
s11: at a preset moment, arranging the meta characters according to a preset sequence to form a key value of the array A, and then randomly sequencing the meta characters for N times to generate value values of N arrays B;
s12: and assigning the value of the array B to the value of the array A to generate N arrays A.
3. The cryptographic encryption and decryption method of claim 2, wherein the meta characters comprise one or more of upper and lower case letters, numbers and special characters.
4. The cryptographic encryption and decryption method of claim 1, wherein S2 is implemented by:
associating the array A to a subscript n, storing all the arrays A into an encryption dictionary, exchanging the positions of the key value and the value of the array A to form a decryption dictionary, storing the encryption dictionary to a root directory of a web front end or a directory configured at the front end, and storing the decryption dictionary to a configuration file of php, wherein n is any value.
5. The cryptographic encryption and decryption method of claim 1, wherein S3 is implemented by:
the method comprises the steps of obtaining an instruction input by a display interface, generating a random number m into a hidden field, obtaining a password string and an account of the instruction, calling an encryption dictionary related to a subscript n corresponding to the random number m to encrypt the input password string one by one, generating a first ciphertext, and sending the account, the random number m and the first ciphertext to a server.
6. The cryptographic encryption and decryption method of claim 5, wherein: the random number m is equal to the subscript n.
7. The cryptographic encryption and decryption method of claim 5, wherein after generating the random number m, further comprising the steps of:
and encrypting the random number m, storing the random number m in the hidden domain, sending the random number m to the server, and driving the server to decrypt the encrypted random number m to obtain the random number m.
8. The cryptographic encryption and decryption method of claim 1, wherein S4 is specifically implemented by:
s41: the server is driven to call a decryption dictionary associated with the subscript n corresponding to the random number m to decrypt the first ciphertext to obtain a first plaintext;
s42: judging whether the instruction input by the display interface is a login instruction, if not, executing S43, and if so, executing S44;
s43: generating a code value associated with an account number in a user-defined mode, storing the code value in a database, encrypting a first plaintext by adopting an md5 algorithm to obtain a second ciphertext, splicing the code value at the tail end of the second ciphertext to obtain a third ciphertext, encrypting the third ciphertext by using a password hash algorithm function password _ hash of php to generate a fourth ciphertext, and storing the fourth ciphertext in a password field of the database;
s44: and encrypting the first plaintext by adopting an md5 algorithm to obtain a second ciphertext, splicing a code value at the tail end of the second ciphertext to obtain a third ciphertext, and verifying the third ciphertext and a fourth ciphertext stored in a password field of the database by using a verification function password _ verify () of php.
9. A cryptographic encryption and decryption terminal, comprising: comprises a storage and a processor;
a memory for storing program instructions;
a processor for executing said program instructions to perform the cryptographic encryption and decryption method of any one of claims 1 to 8.
CN202211393736.0A 2022-11-08 2022-11-08 Password encryption and decryption method and terminal Active CN115567318B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211393736.0A CN115567318B (en) 2022-11-08 2022-11-08 Password encryption and decryption method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211393736.0A CN115567318B (en) 2022-11-08 2022-11-08 Password encryption and decryption method and terminal

Publications (2)

Publication Number Publication Date
CN115567318A true CN115567318A (en) 2023-01-03
CN115567318B CN115567318B (en) 2023-05-16

Family

ID=84768390

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211393736.0A Active CN115567318B (en) 2022-11-08 2022-11-08 Password encryption and decryption method and terminal

Country Status (1)

Country Link
CN (1) CN115567318B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117424752A (en) * 2023-12-07 2024-01-19 佛山市顺德弘金电器科技有限公司 Communication encryption and decryption method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130232341A1 (en) * 2012-03-01 2013-09-05 Salesforce.Com, Inc. System and method for initializing tokens in a dictionary encryption scheme
CN106357608A (en) * 2016-08-19 2017-01-25 银江股份有限公司 Method for encrypting and decrypting private data for personal healthcare data
CN107395620A (en) * 2017-08-17 2017-11-24 无锡清华信息科学与技术国家实验室物联网技术中心 A kind of network transmission encrypting and decrypting method based on random bytes mapping
CN108075888A (en) * 2016-11-15 2018-05-25 北京京东尚科信息技术有限公司 Dynamic URL generation methods and device
CN108734024A (en) * 2018-05-11 2018-11-02 四川长虹电器股份有限公司 A kind of efficient database encryption method based on dictionary mapping
CN113360930A (en) * 2021-06-28 2021-09-07 广州市保伦电子有限公司 Encryption method for realizing front-end and back-end character dissimilarity and processing terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130232341A1 (en) * 2012-03-01 2013-09-05 Salesforce.Com, Inc. System and method for initializing tokens in a dictionary encryption scheme
CN106357608A (en) * 2016-08-19 2017-01-25 银江股份有限公司 Method for encrypting and decrypting private data for personal healthcare data
CN108075888A (en) * 2016-11-15 2018-05-25 北京京东尚科信息技术有限公司 Dynamic URL generation methods and device
CN107395620A (en) * 2017-08-17 2017-11-24 无锡清华信息科学与技术国家实验室物联网技术中心 A kind of network transmission encrypting and decrypting method based on random bytes mapping
CN108734024A (en) * 2018-05-11 2018-11-02 四川长虹电器股份有限公司 A kind of efficient database encryption method based on dictionary mapping
CN113360930A (en) * 2021-06-28 2021-09-07 广州市保伦电子有限公司 Encryption method for realizing front-end and back-end character dissimilarity and processing terminal

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
罗江华;: "基于MD5与Base64的混合加密算法", 计算机应用 *
陈庄;齐锋;叶成荫;: "一种基于国密算法的云数据加密方案研究", 信息安全研究 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117424752A (en) * 2023-12-07 2024-01-19 佛山市顺德弘金电器科技有限公司 Communication encryption and decryption method and device
CN117424752B (en) * 2023-12-07 2024-03-15 佛山市顺德弘金电器科技有限公司 Communication encryption and decryption method and device

Also Published As

Publication number Publication date
CN115567318B (en) 2023-05-16

Similar Documents

Publication Publication Date Title
CN110493261B (en) Verification code obtaining method based on block chain, client, server and storage medium
CN105553951B (en) Data transmission method and device
CN110380852B (en) Bidirectional authentication method and communication system
CN103546289B (en) USB (universal serial bus) Key based secure data transmission method and system
JP4866863B2 (en) Security code generation method and user device
CN109495445A (en) Identity identifying method, device, terminal, server and medium based on Internet of Things
CA2518032A1 (en) Methods and software program product for mutual authentication in a communications network
CN113132099B (en) Method and device for encrypting and decrypting transmission file based on hardware password equipment
CN108347419A (en) Data transmission method and device
CN108243176B (en) Data transmission method and device
CN107579972B (en) Cipher management method, electronic equipment, computer storage medium
CN1910882A (en) Method and system for protecting data, related communication network and computer programme product
CN105553654A (en) Key information query processing method and device and key information management system
CN110535641A (en) Key management method and device, computer equipment and storage medium
CN109818747A (en) Digital signature method and device
CN105281902A (en) Web system safety login method based on mobile terminal
CN115396121A (en) Security authentication method for security chip OTA data packet and security chip device
US10397217B2 (en) Authentication methods and authentication apparatuses
CN114362946B (en) Key agreement method and system
CN115567318A (en) Password encryption and decryption method and terminal
CN115225672A (en) End-to-end data transmission method, device and medium
CN107104792B (en) Portable mobile password management system and management method thereof
KR101329789B1 (en) Encryption Method of Database of Mobile Communication Device
CN1801699A (en) Method for accessing cipher device
CN111404680B (en) Password management method and device

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
CB02 Change of applicant information

Address after: No. 56 Nanli East Road, Shiqi Town, Panyu District, Guangzhou City, Guangdong Province, 510000

Applicant after: Guangdong Baolun Electronics Co.,Ltd.

Address before: No.19 Chuangyuan Road, Zhongcun street, Panyu District, Guangzhou, Guangdong 510000

Applicant before: GUANGZHOU ITC ELECTRONIC TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant