CN115225273A - Method, device, equipment and storage medium for changing encryption algorithm - Google Patents

Method, device, equipment and storage medium for changing encryption algorithm Download PDF

Info

Publication number
CN115225273A
CN115225273A CN202210874830.1A CN202210874830A CN115225273A CN 115225273 A CN115225273 A CN 115225273A CN 202210874830 A CN202210874830 A CN 202210874830A CN 115225273 A CN115225273 A CN 115225273A
Authority
CN
China
Prior art keywords
password
encryption
encryption algorithm
user
result
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.)
Pending
Application number
CN202210874830.1A
Other languages
Chinese (zh)
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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202210874830.1A priority Critical patent/CN115225273A/en
Publication of CN115225273A publication Critical patent/CN115225273A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
    • 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/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0822Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using key encryption key
    • 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/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
    • H04L9/16Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms the keys or algorithms being changed during operation

Abstract

The application provides a method, a device, equipment and a storage medium for changing an encryption algorithm, which can be applied to the field of network security or the field of finance, and are used for switching a first encryption algorithm currently applied by a software system into a second encryption algorithm, wherein the method comprises the following steps: obtaining a first password input by a user; if the user is not a new user, determining whether the first encryption algorithm or the second encryption algorithm is used for encrypting the first password; if the first password is encrypted by the first encryption algorithm, verifying the first password based on the first encryption algorithm; if the first password passes the verification, encrypting the first password by using a second encryption algorithm to obtain a second encryption result; replacing the first encryption result in the database with the second encryption result; the first encryption result is obtained by encrypting the first password by using a first encryption algorithm. The scheme can automatically realize the switching of the encryption algorithm under the condition that a user does not sense.

Description

Method, device, equipment and storage medium for changing encryption algorithm
Technical Field
The present invention relates to the field of password management technologies, and in particular, to a method, an apparatus, a device, and a storage medium for changing an encryption algorithm.
Background
Modern background systems of some software encrypt the password of the user to obtain a corresponding encryption result, and only store the encryption result. When the user logs in the system, the system can encrypt the password input by the user at this time to obtain an encryption result, then the encryption result obtained at this time is compared with the encryption result stored in the database, if the encryption result obtained at this time is consistent with the encryption result stored in the database, the password verification is passed, and if the encryption result obtained at this time is inconsistent with the encryption result stored in the database, the password verification is not passed.
Although this is a higher security than a user password that stores the plaintext directly, the fixed encryption algorithm is also vulnerable.
Disclosure of Invention
In view of the above drawbacks of the prior art, the present invention provides a method, an apparatus, a device, and a storage medium for changing an encryption algorithm, which can switch a currently used first encryption algorithm to a second encryption algorithm as needed without user perception, thereby further improving the security of the system.
A first aspect of the present application provides a method for changing an encryption algorithm, configured to switch a first encryption algorithm currently applied by a software system to a second encryption algorithm, where the method includes:
obtaining a first password input by a user;
judging whether the user is a new user;
if the user is not a new user, determining whether the first encryption algorithm or the second encryption algorithm is used for encrypting the first password;
if the first encryption algorithm is used for encrypting the first password, verifying the first password based on the first encryption algorithm;
if the first password passes the verification, encrypting the first password by using the second encryption algorithm to obtain a second encryption result;
replacing the first encryption result in the database with the second encryption result; and the first encryption result is obtained by encrypting the first password by using the first encryption algorithm.
Optionally, after verifying the first password based on the first encryption algorithm, the method further includes:
if the first password passes the verification, a second password input by the user is obtained; wherein the second password is used to replace the first password;
encrypting the second password by using the second encryption algorithm to obtain a third encryption result;
storing the third encryption result in the database; wherein the third encryption result is used as a basis for verifying the second password.
Optionally, after determining whether the user is a new user, the method further includes:
if the user is a new user, encrypting the first password by using the second encryption algorithm to obtain a second encryption result;
storing the second encryption result in the database; wherein the second encryption result is used as a basis for verifying the first password.
Optionally, after verifying the first password based on the first encryption algorithm, the method further includes:
and if the first password is not verified, outputting a password error prompt.
A second aspect of the present application provides an apparatus for changing an encryption algorithm, configured to switch a first encryption algorithm currently applied by a software system to a second encryption algorithm, where the apparatus includes:
an obtaining unit, configured to obtain a first password input by a user;
the judging unit is used for judging whether the user is a new user or not;
a determining unit, configured to determine whether the first password is encrypted by the first encryption algorithm or the second encryption algorithm if the user is not a new user;
the authentication unit is used for authenticating the first password based on the first encryption algorithm if the first password is encrypted by the first encryption algorithm;
the encryption unit is used for encrypting the first password by using the second encryption algorithm to obtain a second encryption result if the first password passes the verification;
a storage unit for replacing the first encryption result in the database with the second encryption result; and the first encryption result is obtained by encrypting the first password by using the first encryption algorithm.
Optionally, the obtaining unit is further configured to obtain a second password input by the user if the first password passes the verification; wherein the second password is used to replace the first password;
the encryption unit is further configured to encrypt the second password by using the second encryption algorithm to obtain a third encryption result;
the storage unit is further configured to store the third encryption result in the database; wherein the third encryption result is used as a basis for verifying the second password.
Optionally, the encrypting unit is further configured to encrypt the first password with the second encryption algorithm to obtain a second encryption result if the user is a new user;
the storage unit is further configured to store the second encryption result in the database; wherein the second encryption result is used as a basis for verifying the first password.
Optionally, the apparatus further comprises:
and the output unit is used for outputting a password error prompt if the first password is not verified.
A third aspect of the present application provides an electronic device comprising a memory and a processor;
wherein the memory is for storing a computer program;
the processor is configured to execute the computer program, and when executed, the computer program is specifically configured to implement the method for changing an encryption algorithm provided in any one of the first aspects of the present application.
A fourth aspect of the present application provides a computer storage medium for storing a computer program, which, when executed, is particularly adapted to implement the method for changing an encryption algorithm as provided in any one of the first aspects of the present application.
The application provides a method, a device, equipment and a storage medium for changing an encryption algorithm, which can be applied to the field of network security or the field of finance, and are used for switching a first encryption algorithm currently applied by a software system into a second encryption algorithm, wherein the method comprises the following steps: obtaining a first password input by a user; if the user is not a new user, determining whether the first encryption algorithm or the second encryption algorithm is used for encrypting the first password; if the first password is encrypted by the first encryption algorithm, verifying the first password based on the first encryption algorithm; if the first password passes the verification, encrypting the first password by using a second encryption algorithm to obtain a second encryption result; replacing the first encryption result in the database with the second encryption result; the first encryption result is obtained by encrypting the first password by using a first encryption algorithm. The scheme can automatically realize the switching of the encryption algorithm under the condition that a user does not sense.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for changing an encryption algorithm according to an embodiment of the present application;
fig. 2 is a flowchart of another method for changing an encryption algorithm according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an apparatus for changing an encryption algorithm according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Background systems of some modern software encrypt user passwords and only store the encrypted passwords, that is, users cannot retrieve the passwords again after losing the passwords and only can reset the passwords. After the database storing the encrypted password is hacked by a hacker, the hacker cannot obtain the password of the user. But the algorithm of the encryption password can be broken, the encryption algorithm which is considered to be safe in the past is also considered to be no longer safe in the current era, and the encryption algorithm needs to be switched to adapt to the development of the current era.
In view of the above problems, the present application provides a method, an apparatus, a device, and a storage medium for changing an encryption algorithm, wherein when a user inputs a password to log in or uses the existing password to change the password, when the password is transmitted to a background of a system, the system can first determine whether the current user's password encryption algorithm has been switched; if the user password is not switched, the old encryption algorithm is used for verifying whether the user password is correct, if the user password is correct, the new encryption algorithm is used for re-encrypting the user password, the result is stored in the database, and if the user password is wrong, the user password is not processed; if the switching is already performed, the new encryption algorithm is directly used. When a new user registers or resets the password, the user password is directly encrypted by using a new encryption algorithm and stored in the database. Therefore, the unsafe old encryption algorithm can be seamlessly and invisibly switched to the safe new encryption algorithm.
The method for changing the encryption algorithm provided by the embodiment of the application can be applied to a login scene or a password resetting scene, and specific implementation processes of the scheme under the two scenes are described below respectively.
Referring to fig. 1, a method for changing an encryption algorithm provided in this embodiment is used to switch a first encryption algorithm currently applied by a software system to a second encryption algorithm.
The encryption method and the encryption device are used for switching an old encryption algorithm for encrypting a user password in a system into a new encryption algorithm, wherein the first encryption algorithm is used for referring to the old encryption algorithm, and the second encryption algorithm is used for referring to the new encryption algorithm.
The software system may be any system that requires a user to register and log in for use, including but not limited to an online banking system, a social media system, and the like.
S101, obtaining a first password input by a user.
In this embodiment, a user may input, in a login interface of the system, an account registered in the system in advance and a first password corresponding to the account.
S102, judging whether the user is a new user.
If the current user is not a new user, step S103 is performed, and if the current user is a new user, step S107 is performed.
The determination method in step S102 may be that whether an account entered together with the first password exists in the system is determined, if the account exists in the system, it indicates that the current user is not a new user, and if the account does not exist in the system, it indicates that the current user is not a new user.
S103, determining an algorithm for encrypting the first password.
If the first encryption algorithm is used for encrypting the first password, step S104 is executed, and if the second encryption algorithm is used for encrypting the first password, the embodiment is ended.
It should be noted that, for different users, the first encryption algorithm for encrypting the password of the user may be the same or different, but for the same user, the encryption algorithm for encrypting the password of the user is fixed before the change of the encryption algorithm is performed by the scheme of the embodiment.
For each user, in order to verify the password of the user when the user logs in, an algorithm for encrypting the password of each user is recorded in the system, and in step S103, whether the algorithm currently used for encrypting the first password of the user is the first encryption algorithm or the second encryption algorithm can be directly determined through the record.
S104, verifying the first password based on the first encryption algorithm.
If the first password is verified, step S105 is executed, and if the first password is not verified, step S109 is executed.
The specific implementation of step S104 may be:
and encrypting the first password by using a first encryption algorithm to obtain a corresponding encryption result, namely a ciphertext of the first password, comparing the encryption result obtained this time with a first encryption result prestored in a database of the system, if the encryption result is consistent with the first encryption result, indicating that the first password passes the verification, and if the encryption result is inconsistent with the first encryption result, indicating that the first password does not pass the verification.
The first encryption result pre-stored in the database is an encryption result obtained by encrypting the first password by using a first encryption algorithm after the first password is input for the first time when the user registers (or resets the password).
And S105, encrypting the first password by using a second encryption algorithm to obtain a second encryption result.
As described above, the second encryption algorithm is another encryption algorithm different from the first encryption algorithm, and the second encryption algorithm serves as a new algorithm for replacing the first encryption algorithm which is the old algorithm.
And S106, replacing the first encryption result in the database with the second encryption result.
And the first encryption result is obtained by encrypting the first password by using a first encryption algorithm. The second encryption result is used as a basis for verifying the first password when the user logs in with the first password again.
The above verification process may be referred to as step S104, that is, when the user logs in with the first password again, the first password is encrypted with the second encryption algorithm, and then the encryption result obtained this time is compared with the second encryption result pre-stored in the database in step S106, if the two are consistent, it is determined that the first password is verified to be passed, and if the two are not consistent, it is determined that the first password is not verified to be passed.
S107, the first password is encrypted by a second encryption algorithm to obtain a second encryption result.
If the current user is a new user, an old encryption algorithm (namely, a first encryption algorithm) originally used for encrypting the password of the user does not exist, an encryption result obtained by encrypting with the first encryption algorithm does not exist, and authentication is not needed.
And S108, storing the second encryption result in the database.
Wherein the second encryption result is used as a basis for verifying the first password.
As described above, when the user logs in the system with the first password again, the first password input by the user may be encrypted with the second encryption result, the encrypted second encryption result is compared with the second encryption result pre-stored in step S108, if the two encryption results are identical, the first password is verified, and if the two encryption results are not identical, the first password is not verified.
And S109, outputting a password error prompt.
After outputting the password error prompt, the user may input the first password again, at which point the present embodiment may be executed again from step S101.
It should be noted that, in any embodiment of the present application, the encryption result stored in the database is stored in correspondence to the account of the user, so that the corresponding encryption result for authentication can only be found in the database when the user logs in with the account and the password.
The application provides a method for changing an encryption algorithm, which can be applied to the field of network security or the field of finance, is used for switching a first encryption algorithm currently applied by a software system into a second encryption algorithm, and comprises the following steps: obtaining a first password input by a user; if the user is not a new user, determining whether the first encryption algorithm or the second encryption algorithm is used for encrypting the first password; if the first password is encrypted by the first encryption algorithm, verifying the first password based on the first encryption algorithm; if the first password passes the verification, encrypting the first password by using a second encryption algorithm to obtain a second encryption result; replacing the first encryption result in the database with the second encryption result; the first encryption result is obtained by encrypting the first password by using a first encryption algorithm. The scheme can automatically realize the switching of the encryption algorithm under the condition that a user does not sense.
In addition, the method provided by the application can change the originally used old encryption algorithm into the new encryption algorithm at any time according to the requirement, thereby obviously improving the safety of the system.
Referring to fig. 2, a method for changing an encryption algorithm provided in this embodiment is used to switch a first encryption algorithm currently applied by a software system to a second encryption algorithm.
S201, a first password input by a user is obtained.
S202, judging whether the user is a new user.
If the current user is not a new user, step S203 is performed, and if the current user is a new user, step S208 is performed.
S203, an algorithm for encrypting the first password is determined.
If the first encryption algorithm is used to encrypt the first password, step S204 is executed, and if the second encryption algorithm is used to encrypt the first password, the present embodiment is ended.
S204, the first password is verified based on the first encryption algorithm.
If the first password passes the verification, step S205 is executed, and if the first password does not pass the verification, the embodiment is ended.
The specific implementation of steps S201 to S204 are the same as steps S101 to S104 of the embodiment corresponding to fig. 1, and are not described again.
And S205, obtaining a second password input by the user.
Wherein the second password is used to replace the first password.
That is, when resetting the password, the old password input by the user, i.e. the first password, is first verified by using the old first encryption algorithm, and after the verification is passed, the new password provided by the user to replace the old password, i.e. the second password, is obtained.
It should be noted that the second password in step S205 may be input by the user together with the first password, or the user may be prompted to input after the first password passes.
S206, the second password is encrypted by using a second encryption algorithm to obtain a third encryption result.
The third encryption result is equivalent to the second password encrypted by the second encryption algorithm, namely, the ciphertext of the second password.
S207, the third encryption result is stored in the database.
Wherein the third encryption result is used as a basis for verifying the second password.
As mentioned above, when the user logs in the system again with the second password, the system may encrypt the second password input by the user with the second encryption algorithm, and then compare the encrypted result with the third encryption result pre-stored in the database in step S207, if the two are consistent, the second password passes the authentication, and if the two are not consistent, the second password passes the authentication.
S208, the first password is encrypted by using a second encryption algorithm to obtain a second encryption result.
S209, the second encryption result is stored in the database.
The specific implementation of step S208 and step S209 is the same as that of step S107 and step S108 in the foregoing embodiment, and is not described again.
It should be noted that some of the steps in the foregoing embodiments, such as steps S105 and S106, and step S109, may still be executed after the first password is verified in this embodiment. That is, the present embodiment can be regarded as another embodiment obtained by adding steps S205 to S207 to the foregoing embodiment.
For the convenience of understanding the present embodiment, the following describes the implementation process of the method for changing the encryption algorithm according to the present application with reference to a specific example.
First, a login scenario will be described as an example. The user enters the pre-registered account abc and the bound first password 1234 at the login interface.
After the input is completed, the system determines that the user is already registered, that is, the user is not a new user, and then determines that the encryption algorithm currently corresponding to the user, that is, the algorithm currently used for encrypting the password of the user is algorithm a (equivalent to the first encryption algorithm of the foregoing embodiment), whereas at present, in order to ensure security, the encryption algorithm corresponding to all users in the system needs to be changed to algorithm B (equivalent to the second encryption algorithm of the foregoing embodiment).
Then, the system first verifies the password 1234 based on the algorithm a, and after verification, determines 1234 as the password input when the user registers, and the verification passes.
Subsequently, the system encrypts the first password 1234 using the algorithm B to obtain a corresponding second encryption result, and then replaces the original first encryption result obtained by encrypting 1234 using the algorithm a in the database with the second encryption result, thereby completing the encryption algorithm change for the user.
Subsequently, when the user logs in with the password 1234 again, the system can verify the password 1234 by using the algorithm B, and meanwhile, the database of the system stores a second encryption result obtained by encrypting with the algorithm B, so that even if the algorithm a is broken, the security of the replaced encryption result is not affected.
The password reset scenario is then described as an example.
The user enters the pre-registered account abc and the bound first password, i.e., old password 1234, and enters the reset new password, i.e., second password 5678, at the password reset interface.
After the input is completed, the system determines that the user is already registered, that is, the user is not a new user, and then determines that the encryption algorithm currently corresponding to the user, that is, the algorithm currently used for encrypting the password of the user is algorithm a (equivalent to the first encryption algorithm of the foregoing embodiment), whereas at present, in order to ensure security, the encryption algorithm corresponding to all users in the system needs to be changed to algorithm B (equivalent to the second encryption algorithm of the foregoing embodiment).
Then, the system first verifies the password 1234 based on the algorithm a, and after verification, determines 1234 as the password input when the user registers, and the verification passes.
The system then encrypts the second password 5678 using algorithm B to obtain a corresponding third encryption result, which is then stored in the database, thereby completing the encryption algorithm change and password reset for the user. After the above process is completed, the original first encryption result in the database may or may not be deleted.
Subsequently, when the user logs in the system with the new password 5678 after reset, the system can be authenticated by using the second encryption algorithm and a third encryption result pre-stored in the database.
According to the method for changing the encryption algorithm provided by the embodiment of the present application, an apparatus for changing the encryption algorithm is further provided in the embodiment of the present application, and is used for switching the first encryption algorithm currently applied by the software system to the second encryption algorithm, please refer to fig. 3, and the apparatus may include the following units.
An obtaining unit 301, configured to obtain a first password input by a user.
A determining unit 302, configured to determine whether the user is a new user.
A determining unit 303, configured to determine whether the first password is used for encrypting the first encryption algorithm or the second encryption algorithm if the user is not a new user.
An authentication unit 304, configured to authenticate the first password based on the first encryption algorithm if the first encryption algorithm is used for encrypting the first password.
And an encrypting unit 305, configured to encrypt the first password by using a second encryption algorithm to obtain a second encryption result if the first password passes the authentication.
A storage unit 306 for replacing the first encryption result in the database with the second encryption result.
And the first encryption result is obtained by encrypting the first password by using a first encryption algorithm.
Optionally, the obtaining unit 301 is further configured to obtain a second password input by the user if the first password passes the verification; wherein the second password is used for replacing the first password;
the encryption unit 305 is further configured to encrypt the second password by using a second encryption algorithm to obtain a third encryption result;
the storage unit 306 is further configured to store the third encryption result in the database; wherein the third encryption result is used as a basis for verifying the second password.
Optionally, the encrypting unit 305 is further configured to encrypt the first password by using a second encryption algorithm to obtain a second encryption result if the user is a new user;
the storage unit 306 is further configured to store the second encryption result in the database; wherein the second encryption result is used as a basis for verifying the first password.
Optionally, the apparatus further comprises:
the output unit 307 is configured to output a password error prompt if the first password fails to be verified.
For the device for changing an encryption algorithm provided in this embodiment, specific working principles thereof may refer to relevant steps in the method for changing an encryption algorithm provided in any embodiment of the present application, and details are not described here.
The application provides a device for changing an encryption algorithm, which can be applied to the field of network security or the field of finance, is used for switching a first encryption algorithm currently applied by a software system into a second encryption algorithm, and comprises: the obtaining unit 301 obtains a first password input by a user; the judging unit 302 is configured to judge whether the user is a new user, and if the user is not a new user, the determining unit 303 determines whether the first password is a first encryption algorithm or a second encryption algorithm; if the first encryption algorithm is used for encrypting the first password, the verification unit 304 verifies the first password based on the first encryption algorithm; if the first password passes the verification, the encryption unit 305 encrypts the first password by using a second encryption algorithm to obtain a second encryption result; the storage unit 306 replaces the first encryption result in the database with the second encryption result; the first encryption result is obtained by encrypting the first password by using a first encryption algorithm. The scheme can automatically realize the switching of the encryption algorithm under the condition that a user does not sense.
An electronic device is also provided in the embodiments of the present application, please refer to fig. 4, which includes a storage 401 and a processor 402.
The memory 401 is used for storing a computer program, among other things.
The processor 402 is configured to execute a computer program, which when executed is configured to implement the method for changing an encryption algorithm provided in any of the embodiments of the present application.
The embodiments of the present application further provide a computer storage medium, which is used to store a computer program, and when the computer program is executed, the computer program is specifically used to implement the method for changing an encryption algorithm provided in any embodiment of the present application.
It should be noted that the method, apparatus, device and storage medium for changing an encryption algorithm provided by the present invention may be used in the field of network security or in the field of finance. The above description is only an example, and does not limit the application field of the name of the invention provided by the present invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
It should be noted that the terms "first", "second", and the like in the present invention are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
Those skilled in the art can make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of changing encryption algorithms for switching a first encryption algorithm currently applied by a software system to a second encryption algorithm, the method comprising:
obtaining a first password input by a user;
judging whether the user is a new user;
if the user is not a new user, determining whether the first encryption algorithm or the second encryption algorithm is used for encrypting the first password;
if the first encryption algorithm is used for encrypting the first password, verifying the first password based on the first encryption algorithm;
if the first password passes the verification, encrypting the first password by using the second encryption algorithm to obtain a second encryption result;
replacing the first encryption result in the database with the second encryption result; and the first encryption result is obtained by encrypting the first password by using the first encryption algorithm.
2. The method of claim 1, wherein after the verifying the first password based on the first encryption algorithm, further comprising:
if the first password passes the verification, a second password input by the user is obtained; wherein the second password is used to replace the first password;
encrypting the second password by using the second encryption algorithm to obtain a third encryption result;
storing the third encryption result in the database; wherein the third encryption result is used as a basis for verifying the second password.
3. The method of claim 1, wherein after determining whether the user is a new user, the method further comprises:
if the user is a new user, encrypting the first password by using the second encryption algorithm to obtain a second encryption result;
storing the second encryption result in the database; wherein the second encryption result is used as a basis for verifying the first password.
4. The method of claim 1, wherein after the verifying the first password based on the first encryption algorithm, further comprising:
and if the first password is not verified, outputting a password error prompt.
5. An apparatus for changing an encryption algorithm, wherein the apparatus is configured to switch a first encryption algorithm currently applied by a software system to a second encryption algorithm, the apparatus comprising:
an obtaining unit, configured to obtain a first password input by a user;
the judging unit is used for judging whether the user is a new user or not;
a determining unit, configured to determine whether the first password is encrypted by the first encryption algorithm or the second encryption algorithm if the user is not a new user;
the authentication unit is used for authenticating the first password based on the first encryption algorithm if the first password is encrypted by the first encryption algorithm;
the encryption unit is used for encrypting the first password by using the second encryption algorithm to obtain a second encryption result if the first password passes the verification;
a storage unit for replacing the first encryption result in the database with the second encryption result; and the first encryption result is obtained by encrypting the first password by using the first encryption algorithm.
6. The apparatus according to claim 5, wherein the obtaining unit is further configured to obtain a second password input by the user if the first password is verified; wherein the second password is used to replace the first password;
the encryption unit is further configured to encrypt the second password by using the second encryption algorithm to obtain a third encryption result;
the storage unit is further configured to store the third encryption result in the database; wherein the third encryption result is used as a basis for verifying the second password.
7. The apparatus according to claim 5, wherein the encryption unit is further configured to encrypt the first password with the second encryption algorithm to obtain a second encryption result if the user is a new user;
the storage unit is further configured to store the second encryption result in the database; wherein the second encryption result is used as a basis for verifying the first password.
8. The apparatus of claim 5, further comprising:
and the output unit is used for outputting a password error prompt if the first password is not verified.
9. An electronic device comprising a memory and a processor;
wherein the memory is for storing a computer program;
the processor is configured to execute the computer program, which, when executed, is specifically configured to implement the method of changing an encryption algorithm according to any one of claims 1 to 4.
10. A computer storage medium for storing a computer program which, when executed, is particularly adapted to implement a method of changing an encryption algorithm as claimed in any one of claims 1 to 4.
CN202210874830.1A 2022-07-25 2022-07-25 Method, device, equipment and storage medium for changing encryption algorithm Pending CN115225273A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210874830.1A CN115225273A (en) 2022-07-25 2022-07-25 Method, device, equipment and storage medium for changing encryption algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210874830.1A CN115225273A (en) 2022-07-25 2022-07-25 Method, device, equipment and storage medium for changing encryption algorithm

Publications (1)

Publication Number Publication Date
CN115225273A true CN115225273A (en) 2022-10-21

Family

ID=83614222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210874830.1A Pending CN115225273A (en) 2022-07-25 2022-07-25 Method, device, equipment and storage medium for changing encryption algorithm

Country Status (1)

Country Link
CN (1) CN115225273A (en)

Similar Documents

Publication Publication Date Title
US11223614B2 (en) Single sign on with multiple authentication factors
US10904234B2 (en) Systems and methods of device based customer authentication and authorization
KR102307665B1 (en) identity authentication
EP3691215B1 (en) Access token management method, terminal and server
US10187797B2 (en) Code-based authorization of mobile device
CN109510796B (en) Equipment binding method and system
US9780950B1 (en) Authentication of PKI credential by use of a one time password and pin
KR101451359B1 (en) User account recovery
WO2015088533A2 (en) Near field communication authentication mechanism
US10320774B2 (en) Method and system for issuing and using derived credentials
CN113672897B (en) Data communication method, device, electronic equipment and storage medium
US11838421B2 (en) Systems and methods for enhanced mobile device authentication
WO2017084569A1 (en) Method for acquiring login credential in smart terminal, smart terminal, and operating systems
Alqubaisi et al. Should we rush to implement password-less single factor FIDO2 based authentication?
CN104410580B (en) Credible and secure WiFi routers and its data processing method
US10333707B1 (en) Systems and methods for user authentication
US20190297071A1 (en) Managing security credentials
US20170201528A1 (en) Method for providing trusted service based on secure area and apparatus using the same
CN114444134A (en) Data use authorization method, system and device
TW201544983A (en) Data communication method and system, client terminal and server
CN111901303A (en) Device authentication method and apparatus, storage medium, and electronic apparatus
CN107548542B (en) User authentication method with enhanced integrity and security
US11245684B2 (en) User enrollment and authentication across providers having trusted authentication and identity management services
CN112929388B (en) Network identity cross-device application rapid authentication method and system, and user agent device
CN115225273A (en) Method, device, equipment and storage medium for changing encryption algorithm

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