A dynamic password generation method, system, device, computer equipment and medium
By generating and encrypting truly random numbers in a dynamic password lock, and using public keys and device identifiers for interaction, the problem of easily obtainable keys is solved, enabling secure generation and comparison of dynamic passwords and ensuring system security.
Patent Information
- Application Number
- CN202310295572.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2043-03-22
AI Technical Summary
The existing dynamic password locks have keys that are easily obtained during the generation process, resulting in insufficient system security.
The first key is generated using a dynamic combination lock. The private key is stored on an encryption chip in the key management host. A true random number is generated through the encryption chip. The public key and device identifier are used for encrypted interaction to ensure that the data is not leaked during transmission. The unlocking password is compared in the dynamic combination lock.
It enables the generation of dynamic passwords in an encrypted environment, preventing key leakage, ensuring system security, and preventing individuals familiar with encryption algorithms from breaking into the system.
Smart Images

Figure CN116318675B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cryptographic devices, and more specifically to a dynamic password generation method, apparatus, computer equipment, and medium. Background Technology
[0002] Current dynamic combination locks require transmitting the unlocking password to the server during the dynamic password generation process. The server then verifies the unlocking password, and if the password is correct, the lock is unlocked.
[0003] However, there is a risk of data interception during the transmission of the unlocking password to the server, which could potentially compromise the password generation algorithm. The current solution to this problem is to no longer directly transmit the unlocking password to the server for verification. Instead, a key and encryption factor are transmitted. The dynamic lock and the server use the same key and encryption factor to verify the same password, thus significantly reducing the probability of the password generation algorithm being compromised.
[0004] However, this method also has security vulnerabilities. When someone familiar with the algorithm, such as a developer, obtains the key, the system is still insecure.
[0005] Therefore, how to solve the problem of easy access to keys has become a technical problem that urgently needs to be solved and a key focus of continuous research for those skilled in the art. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a dynamic password generation method, apparatus, computer equipment, and medium.
[0007] The first aspect of this invention provides a dynamic password generation method applied to a dynamic combination lock, comprising: generating a first key based on a key factor, the first key including a public key and a private key, the key factor being a string of custom values input by a user to a server; generating a first true random number through an encryption chip and encrypting the first true random number to obtain an encrypted first true random number, the encryption chip being configured in the dynamic combination lock; sending the encrypted first true random number, the public key, and a device identifier to a key management host; receiving encrypted data generated by the key management host and generating a second key based on the encrypted data; generating a second true random number through the encryption chip and encrypting the second true random number based on the second key to obtain an encrypted second true random number; sending the encrypted second true random number to the key management host; receiving a first unlocking password input on a keyboard, the first unlocking password being generated by the key management host based on the second true random number and the device identifier; generating a second unlocking password based on the second true random number and the device identifier; comparing the first unlocking password and the second unlocking password, and if they match, controlling a motor to rotate to complete unlocking.
[0008] The beneficial effects are as follows: The dynamic password lock of the present invention generates a first key, and the private key in the first key is stored on the encryption chip in the key management host and cannot be read. The dynamic password lock generates a first true random number and encrypts it. The encrypted first true random number, public key and device identifier are sent to the key management host. The dynamic password lock receives the encrypted data generated by the key management host and generates a second key based on the encrypted data. In this process, the key management host and the dynamic password lock exchange a common data, namely the second key. However, the data transmitted in the interaction is the first true random number, public key, device identifier and encrypted data. The second key does not appear in the interaction, so there is no transmission leakage. The dynamic combination lock generates a second true random number and encrypts it. The encrypted second true random number is then sent to the key management host. The key management host generates a first unlocking password based on the obtained second true random number and the device identifier. The dynamic combination lock generates a second unlocking password based on the second true random number and the device identifier. The dynamic combination lock compares the first and second unlocking passwords; if they match, it controls a motor to rotate and unlock the device. This comparison process is completed within the dynamic combination lock itself, preventing password leakage. Furthermore, in the dynamic password generation process of this invention, each step is completed in an encrypted environment, and each step contains unreadable data. Even if someone understands the encryption algorithm, they cannot break the system to obtain the dynamic password, thus protecting those who understand the encryption algorithm.
[0009] In conjunction with the first aspect, in the first embodiment of the first aspect, the dynamic password lock is further configured with a chip timer, which generates a first true random number through an encryption chip, including: generating an update seed through the current time on the chip timer; and generating the first true random number through the encryption chip based on the update seed.
[0010] The beneficial effects are: the first truly random number generated is different depending on the current time, and the first truly random number is used in subsequent steps, resulting in different dynamic passwords in the end, thus realizing the true dynamism of dynamic passwords.
[0011] In conjunction with the first aspect, in the second implementation of the first aspect, the device identifier is a unique identifier generated by the chip hardware in the dynamic combination lock.
[0012] The beneficial effect is that the device identifier is used when generating the unlocking password. Each dynamic combination lock has a different device identifier, which ensures that it does not repeat with other dynamic combination locks.
[0013] A second aspect of this invention provides a dynamic password generation system, comprising: a server, a dynamic password lock, and a key management host; the server receives a key factor input by a user and sends the key factor to the dynamic password lock; the dynamic password lock generates a first key based on the key factor, the first key including a public key and a private key, the key factor being a string of custom values input by the user to the server; the dynamic password lock generates a first truly random number through an encryption chip and encrypts the first truly random number to obtain an encrypted first truly random number, the encryption chip being configured in the dynamic password lock; the dynamic password lock sends the encrypted first truly random number, the public key, and a device identifier to the key management host; the key management host generates encrypted data and sends the encrypted data to the dynamic password lock. The dynamic combination lock receives encrypted data sent by the key management host and generates a second key based on the encrypted data. The dynamic combination lock generates a second true random number through an encryption chip, encrypts the second true random number using the second key, and sends the encrypted second true random number to the key management host. The key management host receives the encrypted second true random number and generates a first unlocking password based on the second true random number and a device identifier. The key management host sends the first unlocking password to the server. The server displays the first unlocking password on the interface. The dynamic combination lock generates a second unlocking password based on the second true random number and the device identifier. The dynamic combination lock compares the first unlocking password and the second unlocking password; if they match, it controls the motor to rotate and complete the unlocking.
[0014] The beneficial effects are as follows: The dynamic password lock of the present invention generates a first key, and the private key in the first key is stored on the encryption chip in the key management host and cannot be read. The dynamic password lock generates a first true random number and encrypts it. The encrypted first true random number, public key and device identifier are sent to the key management host. The dynamic password lock receives the encrypted data generated by the key management host and generates a second key based on the encrypted data. In this process, the key management host and the dynamic password lock exchange a common data, namely the second key. However, the data transmitted in the interaction is the first true random number, public key, device identifier and encrypted data. The second key does not appear in the interaction, so there is no transmission leakage. The dynamic combination lock generates a second true random number and encrypts it. The encrypted second true random number is then sent to the key management host. The key management host generates a first unlocking password based on the obtained second true random number and the device identifier. The dynamic combination lock generates a second unlocking password based on the second true random number and the device identifier. The dynamic combination lock compares the first and second unlocking passwords; if they match, it controls a motor to rotate and unlock the device. This comparison process is completed within the dynamic combination lock itself, preventing password leakage. Furthermore, in the dynamic password generation process of this invention, each step is completed in an encrypted environment, and each step contains unreadable data. Even if someone understands the encryption algorithm, they cannot break the system to obtain the dynamic password, thus protecting those who understand the encryption algorithm.
[0015] In conjunction with the second aspect, in the first embodiment of the second aspect, when the key management host is started, the encryption chip inside the key management host generates a first key based on the key factor. The first key includes a public key and a private key.
[0016] The beneficial effect is that the private key in the first key is stored on an encryption chip in the key management host and cannot be read, thus ensuring the security of the password lock.
[0017] In conjunction with the second aspect, in the second embodiment of the second aspect, the second key generated by the key management host is the same as the first key and the second key.
[0018] In conjunction with the second aspect, in the second embodiment of the second aspect, after the dynamic password lock sends the encrypted first true random number, public key, and device identifier to the key management host, it further includes: the key management host receiving and parsing the encrypted first true random number, public key, and device identifier sent by the dynamic password lock, and generating encrypted data based on the parsed encrypted first true random number, public key, and device identifier.
[0019] In conjunction with the second aspect, in the third embodiment of the second aspect, generating a second true random number by means of an encryption chip includes: generating an update seed by means of the current time on the chip timer; and generating the second true random number by means of the encryption chip based on the update seed.
[0020] A third aspect of the present invention provides a dynamic password generation device, comprising the following modules: a first key generation module, used to generate a first key based on a key factor, the first key including a public key and a private key, the key factor being a string of custom values input by a user to a server; a first true random number generation module, used to generate a first true random number through an encryption chip and encrypt the first true random number to obtain an encrypted first true random number, the encryption chip being configured in a dynamic password lock; a first sending module, used to send the encrypted first true random number, the public key, and a device identifier to a key management host; and a first receiving module, used to receive encrypted data generated by the key management host and, based on the encryption... The system comprises: a first key generation module; a second true random number generation module, used to generate a second true random number through an encryption chip, and encrypt the second true random number according to the first key; a second sending module, used to send the encrypted second true random number to the key management host; a second receiving module, used to receive a first unlocking password input from the keyboard, which is generated by the key management host based on the second true random number and the device identifier; a second unlocking password generation module, used to generate a second unlocking password based on the second true random number and the device identifier; and a comparison module, used to compare the first unlocking password and the second unlocking password, and if they match, to control the motor to rotate and complete the unlocking.
[0021] The beneficial effects are as follows: The dynamic password lock of the present invention generates a first key, and the private key in the first key is stored on the encryption chip in the key management host and cannot be read. The dynamic password lock generates a first true random number and encrypts it. The encrypted first true random number, public key and device identifier are sent to the key management host. The dynamic password lock receives the encrypted data generated by the key management host and generates a second key based on the encrypted data. In this process, the key management host and the dynamic password lock exchange a common data, namely the second key. However, the data transmitted in the interaction is the first true random number, public key, device identifier and encrypted data. The second key does not appear in the interaction, so there is no transmission leakage. The dynamic combination lock generates a second true random number and encrypts it. The encrypted second true random number is then sent to the key management host. The key management host generates a first unlocking password based on the obtained second true random number and the device identifier. The dynamic combination lock generates a second unlocking password based on the second true random number and the device identifier. The dynamic combination lock compares the first and second unlocking passwords; if they match, it controls a motor to rotate and unlock the device. This comparison process is completed within the dynamic combination lock itself, preventing password leakage. Furthermore, in the dynamic password generation process of this invention, each step is completed in an encrypted environment, and each step contains unreadable data. Even if someone understands the encryption algorithm, they cannot break the system to obtain the dynamic password, thus protecting those who understand the encryption algorithm.
[0022] A fourth aspect of the present invention provides a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to perform the dynamic password generation method of any one of the first aspects and its optional embodiments.
[0023] The fifth aspect of the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the dynamic password generation method of the first aspect and any of its optional embodiments. Attached Figure Description
[0024] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention.
[0025] Figure 1 A flowchart of the dynamic password generation system provided in an embodiment of the present invention is shown;
[0026] Figure 2 A flowchart of the dynamic password generation method provided in an embodiment of the present invention is shown;
[0027] Figure 3 A schematic diagram of the dynamic password generation device provided in an embodiment of the present invention is shown;
[0028] Figure 4 This diagram illustrates a hardware structure of a computer device according to an embodiment of the present invention.
[0029] Figure 5 A schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present invention is shown. Detailed Implementation
[0030] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0031] In the description of this invention, it should be noted that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0032] This invention provides a dynamic password generation system, such as... Figure 1As shown, the system includes a server, a dynamic password lock, and a key management host. Each device performs the following steps:
[0033] Step S101: The server receives the key factor input by the user and sends the key factor to the dynamic password lock.
[0034] In one alternative embodiment, the key factor is a string of custom values entered by the user through a server-side interface.
[0035] In one alternative embodiment, the dynamic combination lock has a built-in network chip for connecting to a server for data interaction.
[0036] Step S102: The dynamic password lock generates a first key based on the key factors. The first key includes a public key and a private key.
[0037] In one alternative embodiment, the key factors are held only by the user, so personnel familiar with the algorithm cannot obtain the same public and private keys as the actual system through a simulation system.
[0038] In one alternative embodiment, the dynamic combination lock has a built-in encryption chip for storing the core key. The private key is stored in the encryption chip as the core key and cannot be read by anyone.
[0039] Step S103: The dynamic combination lock generates a first true random number through the encryption chip and encrypts the first true random number to obtain the encrypted first true random number. The encryption chip is configured in the dynamic combination lock.
[0040] In one alternative embodiment, the true random number is 128 bits long and is an absolutely random value.
[0041] In an optional embodiment, the encryption chip in the dynamic combination lock encrypts the first true random number using an asymmetric encryption algorithm. For example, the asymmetric encryption algorithm may be the SM2 national cryptographic algorithm.
[0042] Step S104: The dynamic password lock sends the encrypted first true random number, public key, and device identifier to the key management host.
[0043] Step S105: The key management host generates encrypted data and sends the encrypted data to the dynamic password lock.
[0044] In an optional embodiment, after the dynamic password lock in the dynamic password generation system provided by this invention sends the encrypted first true random number, public key, and device identifier to the key management host, it includes:
[0045] The key management host receives and parses the encrypted first true random number, public key, and device identifier sent by the dynamic password lock, and generates encrypted data based on the parsed encrypted first true random number, public key, and device identifier.
[0046] In one optional embodiment, the key management host generates encrypted data by parsing the first true random number, public key, and device identifier obtained by the asymmetric encryption algorithm. For example, the asymmetric encryption algorithm may be the SM2 national cryptographic algorithm.
[0047] In one alternative embodiment, the key management host generates a first key based on the encrypted data using an asymmetric encryption algorithm. For example, the asymmetric encryption algorithm may be an elliptic cryptography algorithm.
[0048] Step S106: The dynamic password lock receives encrypted data sent by the key management host and generates a second key based on the encrypted data.
[0049] In one alternative embodiment, the dynamic password lock generates a first key based on the encrypted data using an asymmetric encryption algorithm. For example, the asymmetric encryption algorithm may be an elliptic cryptography algorithm.
[0050] In one optional embodiment, based on the mechanism of asymmetric encryption algorithms such as elliptic cryptography, the key management host and the dynamic password lock interact to exchange common data, namely the second key. Since the second key in both the key management host and the dynamic password lock is generated from encrypted data through asymmetric encryption algorithms, the data of the second key in the key management host and the dynamic password lock is the same. During the interaction, the transmitted data is the encrypted first true random number, public key, device identifier and encrypted data. The second key has never appeared, so there will be no transmission leakage.
[0051] Step S107: The dynamic password lock generates a second true random number through the encryption chip, encrypts the second true random number according to the second key, obtains the encrypted second true random number, and sends the encrypted second true random number to the key management host.
[0052] In an optional embodiment, the dynamic password lock encrypts the second true random number using a second key and a symmetric encryption algorithm. For example, the symmetric encryption algorithm may be the SM4 national cryptographic algorithm.
[0053] Step S108: The key management host receives the encrypted second true random number and generates the first unlocking password based on the second true random number and the device identifier.
[0054] In an optional embodiment, the key management host decrypts the received data using a second key and a symmetric encryption algorithm to obtain a second true random number.
[0055] In an optional embodiment, the key management host generates a first unlocking password based on a second true random number and a device identifier using an irreversible encryption algorithm. For example, the irreversible encryption algorithm may be the SM3 national cryptographic algorithm.
[0056] Step S109: The key management host sends the first unlocking password to the server.
[0057] In an alternative embodiment, the key management host connects and communicates with the server via a network or USB.
[0058] In one optional embodiment, after receiving the first unlocking password, the server transmits it to the user, allowing the user to input the first unlocking password into the dynamic combination lock to unlock it. For example, the server can send the first unlocking password to the user's corresponding mobile terminal; alternatively, the server can display the first unlocking password on a display screen, allowing the user to access it through the server's display.
[0059] Step S1010: The dynamic combination lock generates a second unlocking password based on the second true random number and the device identifier.
[0060] In an optional embodiment, the dynamic combination lock generates a second unlocking password based on a second true random number and a device identifier using the same irreversible encryption algorithm as the password management host. For example, the irreversible encryption algorithm may be the SM3 national cryptographic algorithm.
[0061] Step S1011: The dynamic combination lock compares the first unlocking password with the second unlocking password. If they match, the motor is controlled to rotate to complete the unlocking.
[0062] In one optional embodiment, the unlocking operator enters a first unlocking password into the dynamic combination lock. The dynamic combination lock compares the first unlocking password with a second unlocking password generated internally. If they match, it indicates that the dynamic password entered by the unlocking operator is correct, and the dynamic combination lock controls the motor to rotate to complete the unlocking.
[0063] In the dynamic password generation system provided in this embodiment of the invention, the dynamic password lock generates a first key. The private key of the first key is stored on the encryption chip in the key management host and cannot be read. The dynamic password lock generates a first true random number and encrypts it. The encrypted first true random number, public key, and device identifier are sent to the key management host. The dynamic password lock receives the encrypted data generated by the key management host. During this process, the key management host and the dynamic password lock exchange a common data, namely the second key. However, the data transmitted during the interaction is the first true random number, public key, device identifier, and encrypted data. The second key does not appear during the interaction, so there is no transmission leakage. The dynamic combination lock generates a second true random number and encrypts it. The encrypted second true random number is then sent to the key management host. The key management host generates a first unlocking password based on the obtained encrypted second true random number and the device identifier. The dynamic combination lock generates a second unlocking password based on the second true random number and the device identifier. The dynamic combination lock compares the first and second unlocking passwords; if they match, it controls a motor to rotate and unlock the device. This comparison process is completed within the dynamic combination lock itself, preventing password leakage. Furthermore, in the dynamic password generation process of this invention, each step is completed in an encrypted environment, and each step contains unreadable data. Even if the encryption algorithm is understood, the system cannot be breached to obtain the dynamic password, thus protecting against individuals who understand the encryption algorithm.
[0064] In an optional embodiment, the dynamic password lock generation system provided in this invention generates a first key based on a key factor when the key management host is started. The first key includes a public key and a private key.
[0065] In an optional embodiment, the key management host is also equipped with an encryption chip to store the core key. The private key is stored in the encryption chip as the core key and cannot be read by anyone.
[0066] In an optional embodiment, the dynamic password lock generation system provided in this invention generates a second true random number through an encryption chip, including:
[0067] First, an update seed is generated using the current time on the chip's timer;
[0068] Secondly, the encryption chip generates the second true random number based on the updated seed.
[0069] In one optional embodiment, the second true random number generated at different times is also different. The second true random number is used in subsequent steps, and the final dynamic password generated is also different. Moreover, the first unlocking password generated at the end becomes invalid after completing an unlocking operation, or becomes invalid after a certain period of time without unlocking.
[0070] This invention also provides a dynamic password generation method, applied to dynamic password locks, such as... Figure 2 As shown, it includes the following steps:
[0071] Step S201: Generate a first key based on the key factor. The first key includes a public key and a private key. The key factor is a string of custom values input by the user to the server. For details, please refer to the description of step S102 in the above embodiment, which will not be repeated here.
[0072] Step S202: Generate a first true random number through the encryption chip, and encrypt the first true random number to obtain the encrypted first true random number. The encryption chip is configured in the dynamic password lock. For details, please refer to the description of step S103 in the above embodiment, which will not be repeated here.
[0073] Step S203: Send the encrypted first true random number, public key, and device identifier to the key management host. For details, please refer to the description of step S104 in the above embodiment, which will not be repeated here.
[0074] Step S204: Receive encrypted data generated by the key management host, and generate a second key based on the encrypted data. For details, please refer to the description of step S105 in the above embodiment, which will not be repeated here.
[0075] Step S205: Generate a second true random number using the encryption chip, and encrypt the second true random number using the second key to obtain the encrypted second true random number. For details, please refer to the description of step S107 in the above embodiment, which will not be repeated here.
[0076] Step S206: Send the encrypted second true random number to the key management host. For details, please refer to the description of step S107 in the above embodiment, which will not be repeated here.
[0077] Step S207: Receive the first unlocking password input on the keyboard. The first unlocking password is generated by the key management host based on the second true random number and the device identifier. For details, please refer to the description of step S108 in the above embodiment, which will not be repeated here.
[0078] Step S208: Generate a second unlocking password based on the second true random number and the device identifier. For details, please refer to the description of step S1010 in the above embodiment, which will not be repeated here.
[0079] Step S209: Compare the first unlocking password and the second unlocking password. If they match, control the motor to rotate and complete the unlocking. For details, please refer to the description of step S1011 in the above embodiment, which will not be repeated here.
[0080] In the dynamic password generation method provided in this embodiment of the invention, the dynamic password lock generates a first key. The private key of the first key is stored on the encryption chip in the key management host and cannot be read. The dynamic password lock generates a first true random number and encrypts it. The encrypted first true random number, public key, and device identifier are sent to the key management host. The dynamic password lock receives the encrypted data generated by the key management host and generates a second key based on the encrypted data. In this process, the key management host and the dynamic password lock exchange a common data, namely the second key. However, the data transmitted during the interaction is the first true random number, public key, device identifier, and encrypted data. The first key does not appear in the interaction process, so there is no transmission leakage. The dynamic combination lock generates a second true random number and encrypts it. The encrypted second true random number is then sent to the key management host. The key management host generates a first unlocking password based on the obtained encrypted second true random number and the device identifier. The dynamic combination lock generates a second unlocking password based on the second true random number and the device identifier. The dynamic combination lock compares the first and second unlocking passwords; if they match, it controls a motor to rotate and unlock the device. This comparison process is completed within the dynamic combination lock itself, preventing password leakage. Furthermore, in the dynamic password generation process of this invention, each step is completed in an encrypted environment, and each step contains unreadable data. Even if the encryption algorithm is understood, the system cannot be breached to obtain the dynamic password, thus protecting against individuals who understand the encryption algorithm.
[0081] In one alternative embodiment, the device identifier is a unique identifier generated by the chip hardware in the dynamic combination lock.
[0082] In one optional embodiment, a device identifier is used when generating the unlocking password. Each dynamic combination lock has a unique device identifier, ensuring that it does not overlap with other dynamic combination locks.
[0083] This invention provides a dynamic password generation device, such as... Figure 3 As shown, it includes the following modules:
[0084] First key generation module 301: Generates a first key based on a key factor. The first key includes a public key and a private key. The key factor is a string of custom values input by the user to the server. For details, please refer to the description of step S201 in the above embodiment, which will not be repeated here.
[0085] The module 302 for generating the first true random number generates a first true random number through an encryption chip and encrypts the first true random number to obtain the encrypted first true random number. The encryption chip is configured in the dynamic password lock. For details, please refer to the description of step S202 in the above embodiment, which will not be repeated here.
[0086] First sending module 303: Sends the encrypted first true random number, public key and device identifier to the key management host. For details, please refer to the description of step S203 in the above embodiment, which will not be repeated here.
[0087] First receiving module 304: Receives encrypted data generated by the key management host, and generates a second key based on the encrypted data. For details, please refer to the description of step S204 in the above embodiment, which will not be repeated here.
[0088] The second true random number generation module 305 generates a second true random number through an encryption chip, encrypts the second true random number according to the second key, and obtains the encrypted second true random number. For details, please refer to the description of step S205 in the above embodiment, which will not be repeated here.
[0089] The second sending module 306 sends the encrypted second true random number to the key management host. For details, please refer to the description of step S206 in the above embodiment, which will not be repeated here.
[0090] The second receiving module 307 receives the first unlocking password input on the keyboard. The first unlocking password is generated by the key management host based on the second true random number and the device identifier. For details, please refer to the description of step S207 in the above embodiment, which will not be repeated here.
[0091] The second unlocking password generation module 308 generates a second unlocking password based on a second true random number and a device identifier. For details, please refer to the description of step S208 in the above embodiment, which will not be repeated here.
[0092] Comparison module 309: Compares the first unlocking password and the second unlocking password. If they match, it controls the motor to rotate and complete the unlocking. For details, please refer to the description of step S209 in the above embodiment, which will not be repeated here.
[0093] In the dynamic password generation device provided in this embodiment of the invention, the dynamic password lock generates a first key. The private key of the first key is stored on the encryption chip in the key management host and cannot be read. The dynamic password lock generates a first true random number and encrypts it. The encrypted first true random number, public key, and device identifier are sent to the key management host. The dynamic password lock receives the encrypted data generated by the key management host and generates a second key based on the encrypted data. In this process, the key management host and the dynamic password lock exchange a common data, namely the second key. However, the data transmitted during the interaction is the first true random number, public key, device identifier, and encrypted data. The first key does not appear in the interaction process, so there is no transmission leakage. The dynamic combination lock generates a second true random number and encrypts it. The encrypted second true random number is then sent to the key management host. The key management host generates a first unlocking password based on the obtained encrypted second true random number and the device identifier. The dynamic combination lock generates a second unlocking password based on the second true random number and the device identifier. The dynamic combination lock compares the first and second unlocking passwords; if they match, it controls a motor to rotate and unlock the device. This comparison process is completed within the dynamic combination lock itself, preventing password leakage. Furthermore, in the dynamic password generation process of this invention, each step is completed in an encrypted environment, and each step contains unreadable data. Even if the encryption algorithm is understood, the system cannot be breached to obtain the dynamic password, thus protecting against individuals who understand the encryption algorithm.
[0094] This invention also provides a computer device, such as... Figure 4 This is a schematic diagram of the hardware structure of a computer device according to an exemplary embodiment.
[0095] like Figure 4 As shown, the device includes one or more processors 401 and a memory 402, the memory 402 including persistent memory, volatile memory, and a hard disk. Figure 4 Taking a processor 401 as an example, the device may also include an input device 403 and an output device 404.
[0096] The processor 401, memory 402, input device 403, and output device 404 can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0097] Processor 401 can be a Central Processing Unit (CPU). Processor 401 can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof. The general-purpose processor can be a microprocessor or any conventional processor.
[0098] The memory 402, as a non-transitory computer-readable storage medium, includes persistent memory, volatile memory, and a hard disk. It can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instruction module corresponding to the business management method in this embodiment. The processor 401 executes various server functions and data processing by running the non-transitory software programs, instructions, and modules stored in the memory 402, thereby implementing any of the above-mentioned dynamic password generation methods.
[0099] Memory 402 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data that is needed and required. Furthermore, memory 402 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 402 may optionally include memory remotely located relative to processor 401, and these remote memories can be connected to the data processing device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0100] Input device 403 can receive input numerical or character information, and generate key signal inputs related to user settings and function control. Output device 404 may include display devices such as a display screen.
[0101] One or more modules are stored in memory 402, and when executed by one or more processors 401, they perform actions such as... Figure 1 The method shown.
[0102] The above-described product can execute the method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in [reference 1]. Figure 1 and Figure 2 The relevant descriptions in the illustrated embodiments.
[0103] This invention also provides a computer-readable storage medium, such as... Figure 5 As shown, a computer-readable storage medium stores computer-executable instructions 501, which can execute the dynamic password generation method in any of the above method embodiments.
[0104] Storage media can be magnetic disks, optical disks, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drives (HDDs), or solid-state drives (SSDs), etc.; storage media can also include combinations of the above types of memory.
[0105] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A dynamic password generation method, characterized in that, For use with dynamic combination locks, the following steps are included: A first key is generated based on a key factor. The first key includes a public key and a private key. The key factor is a string of custom values that the user inputs into the server. A first true random number is generated by an encryption chip storing the private key, and the first true random number is encrypted to obtain an encrypted first true random number. The encryption chip is configured in the dynamic password lock. The encrypted first true random number, the public key, and the device identifier are sent to the key management host; the key management host is used to receive and parse the encrypted first true random number, the public key, and the device identifier according to the asymmetric algorithm, and generate encrypted data by using the parsed encrypted first true random number, the public key, and the device identifier through the asymmetric encryption algorithm; The system receives encrypted data generated by the key management host and generates a second key based on the encrypted data; the generation of the second key based on the encrypted data includes: obtaining the second key based on the encrypted data using the asymmetric encryption algorithm. A second true random number is generated by the encryption chip, and the second true random number is encrypted according to the second key to obtain the encrypted second true random number; The encrypted second true random number is sent to the key management host; the key management host is used to decrypt the encrypted second true random number using the second key and a symmetric encryption algorithm to obtain the second true random number. The system receives a first unlocking password input from the keyboard, which is generated by the key management host based on the second true random number and the device identifier. A second unlocking password is generated based on the second true random number and the device identifier; Compare the first unlocking code and the second unlocking code. If they match, control the motor to rotate and complete the unlocking.
2. The dynamic password generation method according to claim 1, characterized in that, The dynamic combination lock is also equipped with a chip timer. The generation of the first true random number through the encryption chip includes: An update seed is generated using the current time on the chip's timer; The encryption chip generates the first true random number based on the updated seed.
3. The dynamic password generation method according to claim 1, characterized in that, The device identifier is a unique identifier generated by the chip hardware in the dynamic combination lock.
4. A dynamic password generation system, characterized in that, include: Server-side components, dynamic password lock, and key management host; The server receives the key factor input by the user and sends the key factor to the dynamic password lock; The dynamic password lock generates a first key based on a key factor. The first key includes a public key and a private key. The key factor is a string of custom values that the user inputs into the server. A first true random number is generated by an encryption chip storing the private key, and the first true random number is encrypted to obtain an encrypted first true random number. The encryption chip is configured in the dynamic password lock. The encrypted first true random number, the public key, and the device identifier are sent to the key management host; The key management host generates encrypted data and sends the encrypted data to the dynamic password lock; The key management host is used to receive and parse the encrypted first true random number, the public key, and the device identifier according to the asymmetric algorithm, and generate encrypted data by using the parsed encrypted first true random number, the public key, and the device identifier through the asymmetric encryption algorithm; The dynamic password lock receives the encrypted data sent by the key management host and generates a second key based on the encrypted data; A second true random number is generated by the encryption chip, and the second true random number is encrypted according to the second key to obtain an encrypted second true random number. The encrypted second true random number is then sent to the key management host. The step of generating the second key based on the encrypted data includes: obtaining the second key based on the encrypted data using the asymmetric encryption algorithm; The key management host receives the encrypted second true random number, generates a first unlocking password based on the second true random number and the device identifier, and sends the first unlocking password to the server. The key management host is used to decrypt the encrypted second true random number using the second key and a symmetric encryption algorithm to obtain the second true random number. The dynamic combination lock generates a second unlocking password based on the second true random number and the device identifier; the first unlocking password and the second unlocking password are compared, and if they match, the motor is controlled to rotate to complete the unlocking; the first unlocking password is the password entered by the unlocking operator on the dynamic combination lock.
5. The dynamic password generation system according to claim 4, characterized in that, Also includes: When the key management host starts up, the encryption chip inside the key management host generates a first key based on the key factor. The first key includes a public key and a private key.
6. The dynamic password generation system according to claim 4, characterized in that, The generation of the second true random number through the encryption chip includes: An update seed is generated using the current time on the chip's timer; The encryption chip generates the second true random number based on the updated seed.
7. A dynamic password generation device, characterized in that, Including dynamic password locks, and Includes the following modules: A first key generation module is used to generate a first key based on a key factor. The first key includes a public key and a private key. The key factor is a string of custom values input by the user to the server. A module for generating a first true random number is used to generate a first true random number through an encryption chip storing the private key, and to encrypt the first true random number to obtain an encrypted first true random number. The encryption chip is configured in the dynamic password lock. The first sending module is used to send the encrypted first true random number, public key and device identifier to the key management host; The key management host is used to receive and parse the encrypted first true random number, the public key, and the device identifier according to the asymmetric algorithm, and generate encrypted data by using the parsed encrypted first true random number, the public key, and the device identifier through the asymmetric encryption algorithm; The first receiving module is used to receive encrypted data generated by the key management host and generate a second key based on the encrypted data. The step of generating the second key based on the encrypted data includes: obtaining the second key based on the encrypted data using the asymmetric encryption algorithm; A module for generating a second true random number is used to generate a second true random number through an encryption chip, and to encrypt the second true random number according to the second key to obtain an encrypted second true random number. The second sending module is used to send the encrypted second true random number to the key management host; the key management host is used to decrypt the encrypted second true random number using the second key and a symmetric encryption algorithm to obtain the second true random number. The second receiving module is used to receive the first unlocking password input on the keyboard, the first unlocking password being generated by the key management host based on the second true random number and the device identifier; The second unlocking password generation module is used to generate a second unlocking password based on the second true random number and the device identifier; The comparison module is used to compare the first unlocking password and the second unlocking password. If they match, the motor is controlled to rotate to complete the unlocking.
8. A computer device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to perform the dynamic password generation method as described in any one of claims 1-3.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the dynamic password generation method as described in any one of claims 1-3.
Citation Information
Patent Citations
Control method and system for intelligent lock and related device
CN108055235A
Electronic lock safety system and key distribution method thereof
CN111815816A