Login password encryption method and device based on national secret algorithm and related equipment

By introducing strongly associated fields and digital random code processing during the encryption process, the problems of user passwords being easily cracked and network transmissions being easily leaked are solved, achieving higher security and complexity.

CN116633536BActive Publication Date: 2025-10-21SHENZHEN YLINK COMPUTING SYST
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310470894.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-26
Publication Date
2025-10-21
Estimated Expiration
2043-04-26

Smart Images

  • Figure CN116633536B_ABST
    Figure CN116633536B_ABST
Patent Text Reader

Abstract

The application discloses a login password encryption method and device based on a national secret algorithm and related equipment, and uses the national secret algorithm to encrypt a login password set by a user; in view of the login password set by the user, a strong correlation field is introduced in the encryption process, the length and complexity of the password are increased, and the possibility of password collision cracking is reduced; a string obtained by splicing the original login password set by the user and the strong correlation field is used as the input of the national secret algorithm; in order to avoid the same password being sent to the server side and the same password ciphertext, the output result of the national secret algorithm is processed by using a digital random code field, and is transmitted to the server side for password checking; the request message is encrypted and transmitted in the network transmission process, so that the password ciphertext is prevented from being intercepted and cracked in the transmission process, and the real password is prevented from being leaked; the possibility of collision cracking is reduced, and the security of the password is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of encryption technology, and in particular to a login password encryption method, apparatus and related equipment based on a national secret algorithm. Background Art

[0002] With the development of computer network technology, network transmission security has become particularly important. When data is transmitted over the network, cryptographic technology is the main method to ensure the secure transmission of information. Therefore, a series of encryption algorithms such as 3DES, SSF33, SSF28, SCB2 (SM1) have emerged.

[0003] As financial security has risen to the level of national security, in recent years, relevant state agencies and regulatory agencies have put forward requirements to promote the application and implementation of national secret algorithms and strengthen industry security and control from the perspective of national security and long-term strategy.

[0004] Currently, for trading systems, network transmission security has the following technical problems:

[0005] (1) Since users set their own passwords, there are problems such as simple password rules and short password lengths, which leads to a high possibility of passwords being cracked by collisions;

[0006] (2) The passwords set by users when logging into the system may be the same, or the ciphertexts of the passwords sent to the server may be the same;

[0007] (3) It is easy to be intercepted or leaked during network transmission, resulting in the password being cracked.

[0008] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention. Summary of the Invention

[0009] The purpose of the present invention is to provide a login password encryption method, device and related equipment based on the national secret algorithm, which is used to solve the technical problems that passwords are easily collided due to problems such as the length and complexity of the passwords set by users, and the original ciphertext is leaked due to the direct exposure of the password ciphertext during network transmission.

[0010] To achieve the above object, the present invention adopts the following technical solutions:

[0011] According to one aspect of the present invention, a login password encryption method based on a national secret algorithm is provided, the method comprising:

[0012] According to the original login password set by the user, a strongly associated field is introduced in the encryption process; the original login password is encrypted using the national secret algorithm and the strongly associated field, and a first password ciphertext is output;

[0013] Converting the first ciphertext into a second ciphertext in HEX format;

[0014] According to the second cryptographic ciphertext, an n-byte digital random code is introduced to convert the corresponding bit value to generate a third cryptographic ciphertext, and the third cryptographic ciphertext is encrypted and transmitted to the server;

[0015] According to the third password ciphertext, reverse conversion is performed using the digital random code to convert it into a second password ciphertext; the second password ciphertext is stored in a database or ciphertext verification is performed in the database.

[0016] Based on the above solution, the strongly associated fields are key elements of the user, and the key elements include but are not limited to the customer number and identity identification identifier generated by the system.

[0017] Based on the above scheme, the string formed by concatenating the original password value and the strongly associated field is used as the input of the national encryption algorithm.

[0018] Based on the aforementioned scheme, the length of the second password ciphertext is greater than that of the first password ciphertext.

[0019] Based on the above solution, the second password ciphertext is the user login password ciphertext stored and verified in the actual database.

[0020] Based on the above solution, the method of generating a third cryptographic ciphertext by introducing an n-byte digital random code to convert a corresponding numerical value according to the second cryptographic ciphertext includes:

[0021] The second password ciphertext is divided into n segments according to the n-byte digital random code, and each segment of ciphertext is converted using the digital random code to generate the third password ciphertext.

[0022] Based on the above solution, the above encryption algorithm is encapsulated, compiled into a dynamic library file and provided for calling by other applications. The file suffixes include but are not limited to .dll and .so.

[0023] According to another aspect of the present invention, a login password encryption device based on a national secret algorithm is provided, the device comprising a user login unit, an encryption unit, a digital random code generation unit, a first conversion unit, a second conversion unit and a password verification unit;

[0024] The user login unit is used to obtain the user's original login password and the strongly associated field;

[0025] The encryption unit uses the national secret algorithm and the strong correlation field to encrypt the original login password and output a first password ciphertext;

[0026] The digital random code generating unit is used to generate a digital random code and provide it to the first converting unit for calling;

[0027] The first conversion unit generates a third cryptographic ciphertext by converting the second cryptographic ciphertext into a corresponding numerical value using the digital random code;

[0028] The second conversion unit generates a second cryptographic ciphertext by performing a reverse conversion of a corresponding numerical value on the third cryptographic ciphertext using the digital random code;

[0029] The password verification unit is used to receive the second password ciphertext transmitted by the second conversion unit, perform password verification in the database, and return the verification result.

[0030] An embodiment of the present invention further provides an electronic device, comprising:

[0031] a memory storing at least one instruction;

[0032] The processor executes the instructions stored in the memory to implement the login password dynamic encryption method based on the national secret algorithm.

[0033] An embodiment of the present invention also provides a computer-readable storage medium, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, a login password encryption method based on a national secret algorithm is implemented.

[0034] It can be seen from the above technical solutions that the present invention has at least the following advantages and positive effects compared with the prior art:

[0035] (1) The present invention uses a national secret algorithm to encrypt the login password set by the user. A strong correlation field is introduced into the encryption process of the login password set by the user to increase the length and complexity of the password and reduce the possibility of password collision cracking;

[0036] (2) An n-byte digital random code field is introduced to process the password ciphertext encrypted by the national secret algorithm to prevent multiple users from setting and entering the same password or sending the same password ciphertext to the server.

[0037] (3) Use digital random codes to convert password ciphertext and transmit it to the server, and verify the password ciphertext in the database after reverse conversion, so as to prevent the password ciphertext from being directly exposed during network transmission, reduce the possibility of password collision and cracking, and improve the security of the password.

[0038] The present invention should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification, are used to explain the principles of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and those skilled in the art can derive other drawings based on these drawings without inventive effort. In the drawings:

[0040] Figure 1 This is a flow chart of the login password encryption method based on the national secret algorithm of the present invention;

[0041] Figure 2 This is a schematic diagram of the encryption method of the national secret algorithm of the present invention;

[0042] Figure 3 This is a schematic diagram of the process of processing a cryptographic ciphertext using a digital random code according to the present invention;

[0043] Figure 4 This is a schematic diagram of the login password encryption device based on the national secret algorithm of the present invention. DETAILED DESCRIPTION

[0044] In order to more clearly explain the purpose, technical solutions and advantages of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The example implementation methods can be implemented in various forms and should not be understood as being limited to the examples described herein. On the contrary, these implementation methods are provided to make the present invention more comprehensive and complete, and to fully convey the concepts of the example implementation methods to those skilled in the art.

[0045] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, it will be appreciated by those skilled in the art that the technical solutions of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.

[0046] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0047] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0048] The present invention will be described in detail below with reference to specific embodiments:

[0049] Example 1

[0050] This embodiment provides a login password encryption method based on the national secret algorithm, such as Figure 1 As shown, the specific steps of the method are as follows:

[0051] S1: According to the original login password value set by the user, a strongly associated field is introduced in the encryption process, and the original login password value is encrypted using the national secret algorithm and the strongly associated field, and a first password ciphertext is output;

[0052] In this embodiment, the strongly associated fields are the key elements of the user, such as the customer number and identity identification identifier generated by the system; the national encryption algorithm uses the SM3 algorithm, and the string of the original login password set by the user and the key elements of the user is used as the input of the national encryption SM3 algorithm, and the first password ciphertext is output, and the first password ciphertext is a 32-byte string.

[0053] Specifically, if Figure 2 As shown, assuming that the user's key factor is '0226' and the original login password set by the user is '123456', the input of the national encryption SM3 algorithm is '1234560226'.

[0054] S2: Convert the first cryptographic ciphertext into a second cryptographic ciphertext in HEX format, introduce an n-byte digital random code field to convert the corresponding value, generate a third cryptographic ciphertext, and transmit the third cryptographic ciphertext to the server;

[0055] In this embodiment, the first password ciphertext is the output result of the national secret SM3 algorithm, and the output result of the national secret SM3 algorithm is converted into a second password ciphertext in HEX format. The present invention does not specifically limit the method of converting the HEX format; the output result of the national secret SM3 algorithm is a 32-byte character string, and the 32-byte character string is converted into a password ciphertext of a 64-byte HEX format character string, that is, the second password ciphertext.

[0056] Furthermore, the actual password ciphertext field is easily intercepted during network transmission, which may cause the password to be cracked by collision. Therefore, before transmitting the encrypted password ciphertext to the server, the password ciphertext is first processed using a digital random code, that is, the second password ciphertext introduces an n-byte digital random code field for conversion, such as Figure 3 As shown, the second ciphertext is divided into n segments according to n bytes. Each ciphertext segment uses the corresponding digit character of the digital random code field to perform right rotation of the corresponding value. Other rotation or conversion methods can also be used. In this embodiment, the right rotation conversion processing method is used for illustration. The rotation rule here is: A rotated right by one bit is B, B rotated right by one bit is C, and so on. Z rotated right by one bit is A; 0 rotated right by one bit is 1, 1 rotated right by one bit is 2, and so on. 9 rotated right by one bit is 0; the left rotation and right rotation rules are opposite.

[0057] Specifically, for n=8, assuming that the user's key element is '0226', the original login password set by the user is '123456', the 8-byte digital random code field introduced is '12345678', encrypted using the national secret SM3 algorithm and converted into HEX format, calculating HEX(SM3(1234560226)), the ciphertext result of the second password is: 'D9920957FC7E851995204D9A82E5711C7FB5BE21ABC7896D0F58B3E0D46C122B';

[0058] The second ciphertext is a 64-byte HEX format string. The second ciphertext is divided into 8 segments, each with 8 bytes. In each segment, the corresponding digits and characters of the introduced digital random code field ('12345678') are right-rotated. After the second ciphertext is right-rotated, the right-rotation process is shown in Table 1:

[0059] Table 1

[0060]

[0061]

[0062] That is, the third password ciphertext is:

[0063] 'E0031068HE9G073128537G2D26I9155H2KG0GJ77GHI3452K7M25I0L8L24K900J'.

[0064] S3: After the third password ciphertext is transmitted to the server, the digital random code is used to perform reverse conversion to convert it into the second password ciphertext; the second password ciphertext is stored in the database or the ciphertext is verified in the database.

[0065] Specifically, in this embodiment, the response server receives the request message as follows:

[0066] '......#trade_pwd=E0031068HE9G073128537G2D26I9155H2KG0GJ77GHI3452K7M25I0L8L24K900J#random_num=12345678#......'

[0067] In this embodiment, the request message received by the server, i.e., the third ciphertext, is converted into the second ciphertext, i.e., the original 64-byte HEX format string, through a reverse left-hand rotation. The left-hand rotation process is shown in Table 2:

[0068] Table 2

[0069]

[0070]

[0071] The result of getting the original 64-byte HEX format string is:

[0072] 'D9920957FC7E851995204D9A82E5711C7FB5BE21ABC7896D0F58B3E0D46C122B' is the ciphertext of the password stored or verified in the database.

[0073] Example 2

[0074] like Figure 4 As shown, this embodiment exemplarily presents a login password encryption device based on the national secret algorithm, the device includes: a user login unit, an encryption unit, a digital random code generation unit, a first conversion unit, a second conversion unit and a password verification unit, specifically as follows:

[0075] The user login unit is used to obtain the user's username, original login password and the strongly associated field;

[0076] The encryption unit uses the national secret algorithm and the strong correlation field to encrypt the original login password and output a first password ciphertext;

[0077] The digital random code generating unit is used to generate a digital random code and provide it to the first converting unit for calling;

[0078] The first conversion unit generates a third cryptographic ciphertext by converting the second cryptographic ciphertext into a corresponding numerical value using the digital random code;

[0079] The second conversion unit generates a second cryptographic ciphertext by performing a reverse conversion of a corresponding numerical value on the third cryptographic ciphertext using the digital random code;

[0080] The password verification unit receives the second password ciphertext transmitted by the second conversion unit, performs password verification in the database, and returns a verification result.

[0081] Specifically, combined Figure 4 The specific implementation method of the login password dynamic encryption device based on the national secret algorithm is as follows:

[0082] The user login unit transmits the original login password and the strongly associated field set by the user to the encryption unit, and encrypts them through the national secret algorithm. In this embodiment, the national secret SM3 algorithm is used for description and explanation. The strongly associated field is the key element of the user. The string of the original login password and the key elements of the user is used as the input of the national secret SM3 algorithm, and the first password ciphertext is output. The first password ciphertext is a 32-byte string. The first password ciphertext is converted into the HEX format to generate the second password ciphertext. The second password ciphertext is a 64-byte HEX format password ciphertext. The present invention does not limit the conversion method of the HEX format.

[0083] The first conversion unit calls the digital random code generation unit, and the digital random code generation unit transmits the n-byte digital random code to the first conversion unit; the first conversion unit uses the obtained n-byte digital random code field to convert the corresponding digit character value of the digital random code to the second password ciphertext to generate the third password ciphertext. In this embodiment, the conversion is performed in a right-handed manner. The specific implementation method can be referred to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0084] The first conversion unit transmits the third cryptographic ciphertext to the server; the server transmits the received third cryptographic ciphertext and the corresponding digital random code field to the second conversion unit;

[0085] The second conversion unit uses the corresponding n-byte digital random code field to reversely convert the character value of the corresponding digit of the digital random code on the third password ciphertext, and reversely converts the third password ciphertext into the second password ciphertext; in this embodiment, the reverse conversion is performed in a left-handed manner. The specific implementation method can be referred to Figure 1 The description of the relevant steps in the corresponding embodiment will not be repeated here;

[0086] The second conversion unit transmits the second password ciphertext obtained through reverse conversion to the password verification unit. The password verification unit verifies the received second password ciphertext with the password in the database. If the verification is successful, the user logs into the system.

[0087] Example 3

[0088] This embodiment exemplifies the application of a login password encryption method and device based on a national secret algorithm, as follows:

[0089] Will Figure 1 The corresponding encryption algorithm in the corresponding embodiment is encapsulated and compiled into a dynamic library file for calling by other applications, and its file suffix includes but is not limited to .dll and .so; the dynamic library file can receive the original login password of the user to be encrypted, and after the encryption unit calls the dynamic library file, the original login password is encrypted and converted into the first password ciphertext; the password verification unit can call the dynamic library file to verify the correctness of the ciphertext password.

[0090] Furthermore, a dynamic library is called a dynamic link library (DLL) on Windows, with a file extension of .dll; on UNIX or Linux, it is called a shared library, with a file extension of .so (shared object). A shared library is a library containing code and data that can be used simultaneously by multiple programs, and is a way to implement the concept of a shared library.

[0091] Dynamic link library files (DLL files) allow programs to share code and other resources necessary to perform specific tasks. DLL files provided by the Windows operating system contain many functions and resources that allow Windows-based programs to operate within the Windows environment. Dynamic library SO files, which end with the suffix .so on Linux platforms, contain functions that perform specific services. To facilitate the management of numerous dynamic library SO files, they can be stored on a server, allowing users to call these files.

[0092] Specifically, in some embodiments of the present invention, the above encryption algorithm is encapsulated and compiled into a dynamic library file with a suffix such as .dll or .so, and provided for calling by other applications, so that there is no need for front-end and back-end interaction during data interaction, thereby improving data interaction efficiency.

[0093] Furthermore, the user enters the original login password set on the login platform, and the user login unit transmits the original login password to be encrypted and the strongly associated field to the dynamic library file;

[0094] The dynamic library file receives the original login password that needs to be encrypted, and the encryption unit calls the dynamic library file. The dynamic library file outputs the first password ciphertext through the built-in national secret algorithm. In this embodiment, the national secret SM3 algorithm is used for illustration. After the encryption unit calls the dynamic library file, it outputs the first password ciphertext of a 32-byte character string; the first password ciphertext is converted into a 64-byte HEX format second password ciphertext through HEX format conversion; the second password ciphertext introduces an n-byte digital random code field to convert the corresponding digit character value of the digital random code, generate a third password ciphertext and transmit it to the server; the server uses the corresponding digital random code field to perform reverse conversion on the received third password ciphertext and convert it into the second password ciphertext; the specific implementation method of using digital random code conversion can be referred to Figure 1 The description of the relevant steps in the corresponding embodiment will not be repeated here;

[0095] The server calls the dynamic library file and transmits it to the password verification unit. The password verification unit performs password verification on the second password ciphertext received from the server and returns the verification result to the server. If the verification is successful, the system is logged in.

[0096] Example 4

[0097] This embodiment exemplarily presents an application scenario and implementation method of a login password dynamic encryption method based on the national secret algorithm.

[0098] This example is extracted from an actual login platform, and only the core functional implementation is taken out to illustrate the application scenario and implementation method of login password encryption based on the national secret SM3 algorithm. The details are as follows:

[0099] When a user logs in to the platform, he or she enters the user name and password in the login pop-up window. In the login password encryption device based on the national secret algorithm of the present invention, the user login unit obtains the user's original login password and the user's key elements and transmits them to the encryption unit.

[0100] The encryption unit encrypts the user's original login password using a national secret algorithm, encapsulates the corresponding national secret encryption algorithm, and compiles it into a dynamic library file for invocation by other applications. The dynamic library file can receive the user's original login password and the user's key elements. In this embodiment, the national secret SM3 algorithm is used for illustration. The encryption unit calls the dynamic library file. The dynamic library file uses the built-in national secret SM3 algorithm to take the concatenated string of the user's original login password value and the key elements as input to the national secret SM3 algorithm. After encryption calculation by the national secret algorithm of the encryption unit, the first password ciphertext is output. The first password ciphertext is a 32-byte string. The first password ciphertext is converted into a HEX format to generate a second password ciphertext. The second password ciphertext is a 64-byte HEX format string. The present invention does not limit the format conversion method of the HEX format string. The second password ciphertext introduces an n-byte digital random code field to convert the corresponding digit character value of the digital random code to generate a third password ciphertext and transmit it to the server; the server uses the corresponding digital random code field to perform reverse conversion on the received third password ciphertext and converts it into the second password ciphertext; the server calls the dynamic library file and transmits it to the password verification unit, which performs password verification on the second password ciphertext received from the server and returns the verification result to the server. If the verification is successful, the system is logged in. The specific implementation method of using digital random code conversion can be referred to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0101] Specifically, when a user logs in to the platform, he or she enters the original password, such as '123456', in the login pop-up window. In order to ensure the security of the password and prevent the password from being stolen and cracked during the system data transmission process, this embodiment adopts a dynamic encryption method for the login password based on the national secret algorithm. Figure 2 As shown, the key elements of the user are spliced ​​on the basis of the original login password set by the user, the real plain text password of the user is changed, and the length of the password is increased; the password encryption algorithm adopts the standard national secret SM3 algorithm, which is composed of Figure 4 The encryption unit of the corresponding encryption device in the embodiment calls the dynamic library file, encrypts the concatenation string of the user's original login password and the user's key elements and converts it into the first password ciphertext, which increases the complexity of the password and the difficulty of cracking; according to the output result of the national secret SM3 algorithm and converts it into HEX format, the final result is

[0102] HEX(SM3(1234560226))=

[0103] D9920957FC7E851995204D9A82E5711C7FB5BE21ABC7896D0F58B3E0D46C122B, the calculation result is the second password ciphertext value; an n-byte digital random code field is introduced for conversion to prevent the password ciphertext from being intercepted or leaked during network transmission; in this embodiment, the conversion is performed in a right-handed manner. For specific implementation methods, please refer to Figure 1 The description of the relevant steps in the corresponding embodiment is not repeated here; the third password ciphertext value is

[0104] 'E0031068HE9G073128537G2D26I9155H2KG0GJ77GHI3452K7M25I0L8L24K900J'.

[0105] The third password ciphertext is transmitted to the server, and the third password ciphertext is converted into the second password ciphertext through the reverse conversion of the corresponding digital random code field. In this embodiment, the reverse conversion is performed in a left-handed manner. The specific implementation method can be referred to Figure 1 The description of the relevant steps in the corresponding embodiment is not repeated here. The server calls the dynamic library file, and the password verification unit verifies the second password ciphertext in the database and returns the verification result to the server. After the verification is successful, the system is logged in.

[0106] In exemplary embodiments of the present invention, a computer storage medium capable of implementing the aforementioned method is also provided, on which a program product capable of implementing the aforementioned method of this specification is stored. In some possible embodiments, various aspects of the present disclosure may also be implemented in the form of a program product comprising program code. When the program product is executed on a device, the program code is used to cause the device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present disclosure.

[0107] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present invention are indicated by the claims. It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and that various modifications and changes can be made without departing from its scope. The scope of the present invention is limited only by the appended claims.

Claims

1. A login password encryption method based on a national secret algorithm, characterized in that: The method comprises: According to the original password value set by the user, a strongly associated field is introduced in the encryption process; the original password value is encrypted using the national secret algorithm and the strongly associated field, and a first password ciphertext is output; Converting the first ciphertext into a second ciphertext in HEX format; Introducing an n-byte digital random code, dividing the second cryptographic ciphertext into segments according to the n bytes, performing a right or left rotation operation on each segment based on corresponding bits of the digital random code to generate a third cryptographic ciphertext, and encrypting the third cryptographic ciphertext and transmitting it to the server; The third password ciphertext transmitted to the server is reversely converted using the digital random code to convert it into a second password ciphertext; and a ciphertext check is performed based on the second password ciphertext.

2. The login password encryption method based on the national secret algorithm according to claim 1 is characterized in that: The strongly associated fields are key elements of the user, and the key elements include but are not limited to the customer number and identity identification identifier generated by the system.

3. The login password encryption method based on the national secret algorithm according to claim 1 is characterized in that: The string formed by concatenating the original password value and the strongly associated field is used as the input of the national encryption algorithm.

4. The login password encryption method based on the national secret algorithm according to claim 1 is characterized in that: The second password ciphertext is longer than the first password ciphertext.

5. The login password encryption method based on the national secret algorithm according to claim 1 is characterized in that: The second password ciphertext is the user login password ciphertext stored and verified in the actual database.

6. The login password encryption method based on the national secret algorithm according to claim 1 is characterized in that: The method of generating a third cryptographic ciphertext by introducing an n-byte digital random code to convert a corresponding numerical value according to the second cryptographic ciphertext includes: The second password ciphertext is divided into n segments according to the n-byte digital random code, and each segment of ciphertext is converted using the digital random code to generate the third password ciphertext.

7. The login password encryption method based on the national secret algorithm according to claim 1 is characterized in that: The encryption algorithm according to any one of claims 1 to 6 is encapsulated, compiled into a dynamic library file and provided for calling by other applications, and the file suffix includes but is not limited to .dll and .so.

8. A login password encryption device based on a national secret algorithm, characterized in that: It includes a user login unit, an encryption unit, a digital random code generation unit, a first conversion unit, a second conversion unit and a password verification unit; The user login unit is used to obtain the user's original login password and the strongly associated field; The encryption unit uses the national secret algorithm and the strong correlation field to encrypt the original login password and output a first password ciphertext; The digital random code generating unit is used to generate a digital random code and provide it to the first converting unit for calling; The first conversion unit generates a third cryptographic ciphertext by converting the second cryptographic ciphertext into a corresponding numerical value using the digital random code; The second conversion unit generates a second cryptographic ciphertext by performing a reverse conversion of a corresponding numerical value on the third cryptographic ciphertext using the digital random code; The password verification unit receives the second password ciphertext transmitted by the second conversion unit, performs password verification in the database, and returns a verification result.

9. An electronic device, characterized in that: The electronic device includes: a memory storing computer-readable instructions; and a processor executing the computer-readable instructions stored in the memory to implement the login password encryption method based on the national secret algorithm as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the login password encryption method based on the national secret algorithm as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • A password management method and system based on multi-hash calculation

    CN109714365A

  • Character data linear random encryption and decryption algorithm

    CN110543778A

  • Encrypted data processing method and device

    CN111797416A