User password encryption method and device, equipment, medium and program product

By obtaining user feature information to generate random numbers and combining SHA and MD5 algorithms for multiple iterative encryption, the problem of traditional password storage being easily attacked is solved, the security of user passwords is improved, and the risk of network attacks is reduced.

CN119276462APending Publication Date: 2025-01-07SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411149731.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

Traditional user password storage methods are vulnerable to cyber attacks, such as brute force cracking and rainbow table attacks, which cannot meet the current network security needs.

Method used

By obtaining user's characteristic information (such as user ID, timestamp and IP address), random numbers are generated, combined with SHA and MD5 algorithms to perform multiple iterative encryption, the target ciphertext is generated, and stored in an encrypted database for encryption and verification User password.

Benefits of technology

It significantly improves the security of user passwords, reduces the difficulty of obtaining user passwords such as brute force cracking and rainbow table attacks, and enhances the confidentiality of passwords.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276462A_ABST
    Figure CN119276462A_ABST
Patent Text Reader

Abstract

The invention provides a user password encryption method and device, equipment, a medium and a program product, and relates to the technical field of data security, and the method comprises the steps: obtaining feature information and a user password corresponding to a user under the condition that the user logs in for the first time; the feature information is used for representing login information of the user; and encrypting the user password based on the feature information, and determining a target ciphertext. According to the technical scheme, the user password is encrypted based on the feature information of the user, the safety of the user password is improved, and the user password is difficult to obtain only through network attack means such as brute force cracking and rainbow table attack.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data security technology, and in particular to a method, device, equipment, medium and program product for encrypting a user password. Background Art

[0002] With the rapid development of information technology and the widespread popularization of network applications, network security issues have become increasingly prominent, especially the security of user login passwords has become the focus of attention.

[0003] User login authentication is an important part of protecting user account security. Traditional login authentication systems usually require users to provide usernames and passwords. The login authentication system compares the user password with the password information stored in the database to verify the user's identity. However, this traditional password storage method, such as storing user passwords in plain text or performing simple encryption, can no longer meet the current network security needs. This is because traditional methods are vulnerable to various attacks, such as brute force cracking and rainbow table attacks.

[0004] In order to enhance the security of user passwords, a more reliable encryption method for user passwords is urgently needed. Summary of the invention

[0005] The present invention provides a method, device, equipment, medium and program product for encrypting a user password, so as to solve the defect in the prior art that the user password is easily cracked by network attacks, and improve the security of the user password.

[0006] The present invention provides a method for encrypting a user password, comprising the following steps.

[0007] When a user logs in for the first time, obtain the characteristic information and user password corresponding to the user; the characteristic information is used to represent the login information of the user; The user password is encrypted based on the characteristic information to determine a target ciphertext.

[0008] According to a method for encrypting a user password provided by the present invention, the characteristic information includes a user identifier, a timestamp and a user IP address; The encrypting the user password based on the characteristic information to determine the target ciphertext includes: Generate a first random number based on the user identifier, generate a second random number based on the timestamp, and generate a third random number based on the user IP address; The user password is encrypted based on the first random number, the second random number, and the third random number to determine a target ciphertext.

[0009] According to a method for encrypting a user password provided by the present invention, the step of generating a first random number based on the user identifier includes: Generate a first digest corresponding to the user identifier using a SHA algorithm, cut the first digest into a random length, and determine the first random number; The generating a second random number based on the timestamp comprises: Generate a second digest corresponding to the timestamp using the SHA algorithm, cut the second digest into a random length, and determine the second random number; The generating a third random number based on the user IP address comprises: A SHA algorithm is used to generate a third digest corresponding to the user IP address, and the third digest is cut into a random length to determine the third random number.

[0010] According to a method for encrypting a user password provided by the present invention, encrypting the user password based on the first random number, the second random number, and the third random number to determine a target ciphertext includes: Determine a first combination result of the first random number and the user password, and encrypt the first combination result using the MD5 algorithm to obtain a first ciphertext; Determine a second combination result of the second random number and the first ciphertext, and encrypt the second combination result using the MD5 algorithm to obtain a second ciphertext; A third combination result of the third random number and the second ciphertext is determined, and the third combination result is encrypted by using the MD5 algorithm to determine the target ciphertext.

[0011] According to a method for encrypting a user password provided by the present invention, the method further comprises: The target ciphertext, the user identifier, the first random number, the second random number and the third random number are stored in an encryption database.

[0012] According to a method for encrypting a user password provided by the present invention, the method further comprises: In the case that it is not the first time for the user to log in, the user identifier and the current user password corresponding to the user are obtained, and based on the user identifier corresponding to the user, the target ciphertext, the first random number, the second random number and the third random number corresponding to the user are obtained from the encryption database; Encrypt the current user password based on the first random number, the second random number, and the third random number to determine a ciphertext to be verified; The target ciphertext and the ciphertext to be verified are compared and verified to determine a verification result.

[0013] The present invention also provides a user password encryption device, comprising the following modules: An acquisition module, used to acquire characteristic information and a user password corresponding to the user when the user logs in for the first time; the characteristic information is used to represent the login information of the user; The encryption module is used to encrypt the user password based on the characteristic information to determine the target ciphertext.

[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, an encryption method for a user password as described above is implemented.

[0015] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the encryption method of the user password as described in any one of the above is implemented.

[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned user password encryption methods.

[0017] The user password encryption method, device, equipment, medium and program product provided by the present invention obtain the characteristic information and user password corresponding to the user when the user logs in for the first time; encrypt the user password based on the characteristic information to determine the target ciphertext. The technical solution of the present invention encrypts the user password based on the user's characteristic information, thereby improving the security of the user password. It is difficult to obtain the user password only through network attack means such as brute force cracking and rainbow table attack. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 This is one of the flow charts of the method for encrypting a user password provided by the present invention.

[0020] Figure 2 This is the second flow chart of the method for encrypting a user password provided by the present invention.

[0021] Figure 3 It is a structural schematic diagram of the user password encryption device provided by the present invention.

[0022] Figure 4It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] In view of the above problems in the prior art, the present invention provides a method for encrypting a user password. Figure 1 This is one of the flow charts of the method for encrypting a user password provided by the present invention, such as Figure 1 As shown, the method includes the following steps 110 and 120.

[0025] Step 110: When the user logs in for the first time, obtain the characteristic information and user password corresponding to the user; the characteristic information is used to represent the login information of the user.

[0026] Specifically, when a user logs in for the first time, the characteristic information corresponding to the user and the user password entered by the user can be obtained. In addition, when a user registers an account, the characteristic information corresponding to the user and the user password entered by the user can also be obtained. The characteristic information represents the user's login information.

[0027] Step 120: Encrypt the user password based on the characteristic information to determine the target ciphertext.

[0028] In one embodiment, the characteristic information includes a user identifier, a timestamp, and a user IP address; The encrypting the user password based on the characteristic information to determine the target ciphertext includes: Generate a first random number based on the user identifier, generate a second random number based on the timestamp, and generate a third random number based on the user IP address; The user password is encrypted based on the first random number, the second random number, and the third random number to determine a target ciphertext.

[0029] Specifically, the characteristic information may include a user ID, a timestamp and a user IP (Internet Protocol) address. It is easy to understand that the user ID is used to distinguish users, and different users have different user IDs. The timestamp may be the timestamp corresponding to the user's login, that is, the total number of seconds from 00:00:00 Greenwich time on January 1, 1970 (08:00:00 Beijing time on January 1, 1970) to the time of user login.

[0030] Further, after obtaining the characteristic information and user password corresponding to the user, a first random number can be generated based on the user identifier, a second random number can be generated based on the timestamp, and a third random number can be generated based on the user IP address. It should be noted that the method of generating each random number is not specifically limited in this embodiment. Then, the user password can be encrypted based on the first random number, the second random number, and the third random number to determine the target ciphertext.

[0031] In the above embodiment, a first random number is generated based on the user identifier, a second random number is generated based on the timestamp, and a third random number is generated based on the user IP address, thereby increasing the randomness of the random numbers. Then, the user password is encrypted based on the first random number, the second random number, and the third random number to determine the target ciphertext, thereby increasing the difficulty of deciphering the target ciphertext.

[0032] In one embodiment, generating a first random number based on the user identifier includes: Generate a first digest corresponding to the user identifier using a SHA algorithm, cut the first digest into a random length, and determine the first random number; The generating a second random number based on the timestamp comprises: Generate a second digest corresponding to the timestamp using the SHA algorithm, cut the second digest into a random length, and determine the second random number; The generating a third random number based on the user IP address comprises: A SHA algorithm is used to generate a third digest corresponding to the user IP address, and the third digest is cut into a random length to determine the third random number.

[0033] Specifically, Figure 2 This is a second flow chart of the method for encrypting a user password provided by the present invention. Figure 2As shown, the user identification can be encrypted using the SHA algorithm (Secure Hash Algorithm) to generate a first random number, that is, the SHA algorithm is used to generate a first digest corresponding to the user identification, and the first digest is cut to a random length to determine the first random number. The timestamp can also be encrypted using the SHA algorithm to generate a second random number, that is, the SHA algorithm is used to generate a second digest corresponding to the timestamp, and the second digest is cut to a random length to determine the second random number. The user IP address can also be encrypted using the SHA algorithm to generate a third random number, that is, the SHA algorithm is used to generate a third digest corresponding to the user IP address, and the third digest is cut to a random length to determine the third random number.

[0034] It should be noted that the SHA algorithm used in this embodiment may be a SHA algorithm such as a SHA-224 algorithm, a SHA-256 algorithm, a SHA-384 algorithm, and a SHA-512 algorithm, and the embodiment of the present invention does not specifically limit it. The lengths of the first digest, the second digest, and the third digest are related to the SHA algorithm used. For example, when the SHA-256 algorithm is used, the lengths of the first digest, the second digest, and the third digest are all 256 bits.

[0035] In the above embodiment, the SHA algorithm is used to encrypt the user identification, timestamp and user IP address, and the first random number, the second random number and the third random number are generated, which increases the randomness of the random numbers and makes the target ciphertext obtained by subsequent encryption more difficult to crack.

[0036] In one embodiment, encrypting the user password based on the first random number, the second random number, and the third random number to determine the target ciphertext includes: Determine a first combination result of the first random number and the user password, and encrypt the first combination result using the MD5 algorithm to obtain a first ciphertext; Determine a second combination result of the second random number and the first ciphertext, and encrypt the second combination result using the MD5 algorithm to obtain a second ciphertext; A third combination result of the third random number and the second ciphertext is determined, and the third combination result is encrypted by using the MD5 algorithm to determine the target ciphertext.

[0037] Specifically, Figure 2As shown, the first random number can be combined with the user password, and an MD5 (Message-Digest Algorithm version 5) operation can be performed to obtain a first ciphertext, that is, the first combination result of the first random number and the user password can be determined, and the first combination result can be encrypted using the MD5 algorithm to obtain the first ciphertext. After obtaining the first ciphertext, the second random number can be combined with the first ciphertext, and an MD5 operation can be performed to obtain a second ciphertext, that is, the second combination result of the second random number and the first ciphertext can be determined, and the second combination result can be encrypted using the MD5 algorithm to obtain the second ciphertext. Further, the third random number can be combined with the second ciphertext, and an MD5 operation can be performed to obtain the current ciphertext, that is, the third combination result of the third random number and the second ciphertext can be determined, and the third combination result can be encrypted using the MD5 algorithm to determine the target ciphertext.

[0038] The MD5 algorithm is a hash function that can convert input data of any length into a 128-bit hash value, with high computational efficiency and low collision probability. The MD5 algorithm is often used for password storage and data integrity verification due to its unique unidirectionality, rapidity and relative security. The scope of application includes but is not limited to file verification, transaction verification, account comparison and message verification. With the advancement of password cracking technology, especially the emergence of specific attack methods against the MD5 algorithm, it is no longer safe enough to rely solely on the MD5 algorithm for password encryption. In order to overcome this defect, there is currently a method of introducing salt values ​​to improve the security of passwords encrypted by the MD5 algorithm. However, although the method of encrypting passwords with salt using the MD5 algorithm is safer than encrypting passwords with the MD5 algorithm alone, it still has certain risks. The security is highly dependent on the randomness and confidentiality of the salt value. If the salt value is not random enough or the salt value is leaked, the overall security will be greatly reduced. Attackers can build rainbow tables for specific salt values ​​to crack passwords. The method of generating the first random number, the second random number and the third random number in this application greatly improves the randomness of the salt value.

[0039] In addition, it should be noted that the random number, the user password, and the combination encryption of the ciphertext can also be in other orders. For example, the second random number can be combined with the user password, and the MD5 operation can be performed to obtain the third ciphertext, and then the third random number can be combined with the third ciphertext, and the MD5 operation can be performed to obtain the fourth ciphertext, and finally the first random number can be combined with the third ciphertext, and the MD5 operation can be performed to obtain another different target ciphertext.

[0040] In the above embodiment, based on the first random number, the second random number and the third random number, combined with multiple rounds of MD5 algorithm iterative encryption, the security of MD5 algorithm encrypting user passwords is greatly enhanced, and the probability of user passwords being cracked is reduced.

[0041] The user password encryption method provided by the present invention obtains the characteristic information and user password corresponding to the user when the user logs in for the first time; encrypts the user password based on the characteristic information to determine the target ciphertext. The technical solution of the present invention encrypts the user password based on the user's characteristic information, thereby improving the security of the user password. It is difficult to obtain the user password only through network attack means such as brute force cracking and rainbow table attack.

[0042] In one embodiment, the method further comprises: The target ciphertext, the user identifier, the first random number, the second random number and the third random number are stored in an encryption database.

[0043] Specifically, after the target ciphertext is determined, the target ciphertext, the user identifier, the first random number, the second random number and the third random number may be stored in an encryption database, which may be pre-established.

[0044] In the above embodiment, the target ciphertext, the user identifier, the first random number, the second random number and the third random number are stored in an encrypted database, so that the user can obtain the above data when logging in again.

[0045] In one embodiment, the method further comprises: In the case that it is not the first time for the user to log in, the user identifier and the current user password corresponding to the user are obtained, and based on the user identifier corresponding to the user, the target ciphertext, the first random number, the second random number and the third random number corresponding to the user are obtained from the encryption database; Encrypt the current user password based on the first random number, the second random number, and the third random number to determine a ciphertext to be verified; The target ciphertext and the ciphertext to be verified are compared and verified to determine a verification result.

[0046] Specifically, when the user is not logging in for the first time, the user ID and current user password corresponding to the user can be obtained, and the current user password is the password entered by the user in the current login. Then, based on the user ID corresponding to the user, the target ciphertext, the first random number, the second random number and the third random number corresponding to the user can be obtained from the encryption database, and the current user password can be further encrypted based on the first random number, the second random number and the third random number to determine the ciphertext to be verified. It is easy to understand that the method of determining the ciphertext to be verified is similar to the method of determining the target ciphertext.

[0047] Furthermore, after the ciphertext to be verified is determined, the target ciphertext and the ciphertext to be verified can be compared and verified to determine the verification result. If the target ciphertext is the same as the ciphertext to be verified, the verification result is successful verification, and the user logs in successfully. If the target ciphertext is different from the ciphertext to be verified, the verification result is failed verification, and the user logs in unsuccessfully.

[0048] In the above embodiment, when it is not the first time for the user to log in, the current user password is encrypted to obtain the ciphertext to be verified, and then the ciphertext to be verified is compared and verified with the target ciphertext to ensure that the user can log in normally if the current user password is correct, and cannot log in successfully if the current user password is incorrect.

[0049] In addition, the method of the present invention combines a random salt value with a user password and combines it with multiple rounds of MD5 algorithm iterative encryption. On the one hand, the randomness of the salt value is improved by introducing the SHA algorithm, and on the other hand, the confidentiality of the MD5 algorithm is improved by multiple rounds of MD5 salt encryption, which greatly enhances the security of MD5 algorithm encryption. The method of the present invention is mainly used in the scenario of encrypting user passwords, reducing the probability of user passwords being cracked.

[0050] The following is a description of the user password encryption device provided by the present invention. The user password encryption device described below and the user password encryption method described above can be referred to each other.

[0051] Figure 3 It is a schematic diagram of the structure of the encryption device of the user password provided by the present invention, such as Figure 3 As shown, the user password encryption device 300 includes: The acquisition module 310 is used to acquire the characteristic information and user password corresponding to the user when the user logs in for the first time; the characteristic information is used to represent the login information of the user; The encryption module 320 is used to encrypt the user password based on the characteristic information to determine the target ciphertext.

[0052] In one embodiment, the characteristic information includes a user identifier, a timestamp, and a user IP address, and the encryption module 320 is specifically used to: Generate a first random number based on the user identifier, generate a second random number based on the timestamp, and generate a third random number based on the user IP address; The user password is encrypted based on the first random number, the second random number, and the third random number to determine a target ciphertext.

[0053] In one embodiment, the encryption module 320 is further configured to: Generate a first digest corresponding to the user identifier using a SHA algorithm, cut the first digest into a random length, and determine the first random number; The generating a second random number based on the timestamp comprises: Generate a second digest corresponding to the timestamp using the SHA algorithm, cut the second digest into a random length, and determine the second random number; The generating a third random number based on the user IP address comprises: A SHA algorithm is used to generate a third digest corresponding to the user IP address, and the third digest is cut into a random length to determine the third random number.

[0054] In one embodiment, the encryption module 320 is further configured to: Determine a first combination result of the first random number and the user password, and encrypt the first combination result using the MD5 algorithm to obtain a first ciphertext; Determine a second combination result of the second random number and the first ciphertext, and encrypt the second combination result using the MD5 algorithm to obtain a second ciphertext; A third combination result of the third random number and the second ciphertext is determined, and the third combination result is encrypted by using the MD5 algorithm to determine the target ciphertext.

[0055] The user password encryption device provided by the present invention obtains the characteristic information and user password corresponding to the user when the user logs in for the first time; encrypts the user password based on the characteristic information to determine the target ciphertext. The technical solution of the present invention encrypts the user password based on the user's characteristic information, thereby improving the security of the user password. It is difficult to obtain the user password only through network attack means such as brute force cracking and rainbow table attack.

[0056] In one embodiment, the user password encryption device further includes a storage module, which is specifically used for: The target ciphertext, the user identifier, the first random number, the second random number and the third random number are stored in an encryption database.

[0057] In one embodiment, the user password encryption device further includes a verification module, which is specifically used to: In the case that it is not the first time for the user to log in, the user identifier and the current user password corresponding to the user are obtained, and based on the user identifier corresponding to the user, the target ciphertext, the first random number, the second random number and the third random number corresponding to the user are obtained from the encryption database; Encrypt the current user password based on the first random number, the second random number, and the third random number to determine a ciphertext to be verified; The target ciphertext and the ciphertext to be verified are compared and verified to determine a verification result.

[0058] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communications interface 420 and the memory 430 communicate with each other via the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the encryption method of the user password, and the method includes: When a user logs in for the first time, obtain the characteristic information and user password corresponding to the user; the characteristic information is used to represent the login information of the user; The user password is encrypted based on the characteristic information to determine a target ciphertext.

[0059] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0060] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the encryption method of the user password provided by the above methods, the method includes: When a user logs in for the first time, obtain the characteristic information and user password corresponding to the user; the characteristic information is used to represent the login information of the user; The user password is encrypted based on the characteristic information to determine a target ciphertext.

[0061] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the encryption method of the user password provided by the above methods, the method comprising: When a user logs in for the first time, obtain the characteristic information and user password corresponding to the user; the characteristic information is used to represent the login information of the user; The user password is encrypted based on the characteristic information to determine a target ciphertext.

[0062] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0063] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for encrypting a user password, characterized in that: include: When a user logs in for the first time, obtain the user's corresponding feature information and user password; The characteristic information is used to represent the login information of the user; The user password is encrypted based on the characteristic information to determine a target ciphertext.

2. The method for encrypting a user password according to claim 1, characterized in that: The characteristic information includes user identification, timestamp and user IP address; The encrypting the user password based on the characteristic information to determine the target ciphertext includes: Generate a first random number based on the user identifier, generate a second random number based on the timestamp, and generate a third random number based on the user IP address; The user password is encrypted based on the first random number, the second random number, and the third random number to determine a target ciphertext.

3. The method for encrypting a user password according to claim 2, characterized in that: The generating a first random number based on the user identifier comprises: Generate a first digest corresponding to the user identifier using a SHA algorithm, cut the first digest into a random length, and determine the first random number; The generating a second random number based on the timestamp comprises: Generate a second digest corresponding to the timestamp using the SHA algorithm, cut the second digest into a random length, and determine the second random number; The generating a third random number based on the user IP address comprises: A SHA algorithm is used to generate a third digest corresponding to the user IP address, and the third digest is cut into a random length to determine the third random number.

4. The method for encrypting a user password according to claim 2, characterized in that: The step of encrypting the user password based on the first random number, the second random number, and the third random number to determine a target ciphertext includes: Determine a first combination result of the first random number and the user password, and encrypt the first combination result using the MD5 algorithm to obtain a first ciphertext; Determine a second combination result of the second random number and the first ciphertext, and encrypt the second combination result using the MD5 algorithm to obtain a second ciphertext; A third combination result of the third random number and the second ciphertext is determined, and the third combination result is encrypted by using the MD5 algorithm to determine the target ciphertext.

5. The method for encrypting a user password according to claim 4, characterized in that: The method further comprises: The target ciphertext, the user identifier, the first random number, the second random number and the third random number are stored in an encryption database.

6. The method for encrypting a user password according to claim 5, characterized in that: The method further comprises: In the case that it is not the first time for the user to log in, the user identifier and the current user password corresponding to the user are obtained, and based on the user identifier corresponding to the user, the target ciphertext, the first random number, the second random number and the third random number corresponding to the user are obtained from the encryption database; Encrypt the current user password based on the first random number, the second random number, and the third random number to determine a ciphertext to be verified; The target ciphertext and the ciphertext to be verified are compared and verified to determine a verification result.

7. A user password encryption device, characterized in that: include: The acquisition module is used to acquire the characteristic information and user password corresponding to the user when the user logs in for the first time; The characteristic information is used to represent the login information of the user; The encryption module is used to encrypt the user password based on the characteristic information to determine the target ciphertext.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for encrypting the user password according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for encrypting a user password as claimed in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for encrypting a user password as claimed in any one of claims 1 to 6 is implemented.