A method, device and medium for key generation verification based on offline mode

By adopting offline multi-key algorithm packet generation and verification mechanism in electronic ciphers, the application instability and security of electronic ciphers in a network-free environment is solved, and the effective verification and generation of keys is achieved, improving the The stability and security of the system are suitable for a wider range of scenarios.

CN118764197BActive Publication Date: 2024-12-17FUJIAN STAR NET COMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411244822.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-17
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

Existing electronic ciphers are vulnerable to attacks under network connections and are unstable in network-free environments, making them unable to effectively verify the keys, resulting in security and availability issues.

Method used

The key generation verification method based on offline mode is adopted, and the key is generated on the verification end and the client through the multi-key algorithm package, and the matching verification is carried out through the time seed and hash algorithm to ensure the validity and security of the key. And it does not depend on network connections.

Benefits of technology

Effective verification and generation of keys is realized in a network-free environment, improving the stability and security of the system, adapting to a wider range of application scenarios, increasing the difficulty of key cracking, and binding the key to the user equipment. Prevent other users from using it.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764197B_ABST
    Figure CN118764197B_ABST
Patent Text Reader

Abstract

The present invention discloses a key generation verification method, device and medium based on offline mode, and relates to the technical field of electronic ciphers. The method includes a multi-key algorithm package presetting process, a multi-key algorithm package importing process, a key generation process and a key verification process. By presetting a multi-key algorithm package, including multiple specified key algorithms and modulus algorithms, a client and a verification end without data interaction respectively select the same key algorithm through the modulus algorithm according to the time seed to generate a key, and the key validity is verified by matching the key, which increases the uncertainty of the key algorithm selection, increases the difficulty of cracking, and ensures the security of the electronic cipher; by generating a unique serial number and obtaining a user name, and then binding the generated unique serial number and the user name and synchronizing them to the verification end through an offline mode, the generated key is bound to the user device and cannot be used by other users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic ciphers, and in particular to an offline-based key generation verification method, device and medium. Background Art

[0002] In the prior art, most electronic password devices implement password verification in the following way: the password generated remotely by the server is sent to the electronic password device via the Internet, and the password is also sent to the user's mobile phone or PC at the same time. The electronic password device confirms whether the operation authority is granted by identifying the password entered by the mobile phone APP or PC.

[0003] However, when the electronic password device is connected to the Internet, the network security risk is very high. Once the downlink is attacked by the network, the password can be easily intercepted and leaked. At the same time, a stable network access environment is not guaranteed in all scenarios. In some cases, there is even no network access condition. The application of online electronic password devices will be affected, resulting in instability or even unusability. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a key generation and verification method, device and medium based on an offline manner. Through the password generation and collision verification mechanism of a multi-key algorithm, it is completely independent of network connection. It can not only be used in an environment without a network, but also improves the stability and security of the system and can adapt to a wider range of application scenarios.

[0005] In a first aspect, the present invention provides a key generation verification method based on an offline mode, which is used for a verification terminal and at least one client, where there is no data interaction between the verification terminal and the client, and the verification terminal is not connected to a public network, and the method includes:

[0006] Presetting process of multiple key algorithm packages: Presetting multiple specified key algorithms, modulus algorithms and time seed generation algorithms, each of the key algorithms corresponds to a serial number, and establishing a mapping rule between the modulus algorithm operation result and the key algorithm serial number; the time seed generation algorithm is used to generate a time seed according to the current time, and the time seeds generated within the specified time range are the same; the modulus algorithm is used to perform a modulus operation according to the time seed; each of the key algorithms is used to obtain a unique serial number and time seed, and then generate a key according to a specified hash algorithm and calculation rule;

[0007] Multi-key algorithm package import process: import the preset multi-key algorithm package to the verification end and at least one client respectively, and generate a unique serial number when importing the client; obtain the user name, and then bind the generated unique serial number and the user name and synchronize it to the verification end through offline mode;

[0008] Key generation process: When the client receives the key generation instruction, it generates a first time seed and a valid time according to the current time, then uses the modulus algorithm to obtain a calculation result according to the first time seed, obtains the corresponding hash algorithm according to the calculation result, and then uses the hash algorithm to generate the first key;

[0009] Key verification process: Enter the key and user name generated by the client on the server and submit them. Generate a second time seed based on the submission time. If the submission time is within the valid time, the generated second time seed is consistent with the first time seed. Then obtain the bound unique serial number based on the user name, generate the second key based on the preset hash algorithm and modulus algorithm, and then compare it with the first key. If they are consistent, the first key verification is successful.

[0010] Furthermore, a unique serial number is generated when the client is imported, specifically including: obtaining hardware information of the current device, and then generating a unique serial number using a UUID algorithm based on the hardware information, a timestamp and a pseudo-random number.

[0011] Furthermore, the method further includes: creating a pair of public and private keys on the verification end, presetting the public key in a mobile storage medium or a multi-key algorithm package, registering a user name after authorization by the verification end administrator, and then inputting the user name into the client; binding the generated unique serial number and the user name and synchronizing them to the verification end in an offline manner, specifically including:

[0012] Obtaining a public key from a mobile storage medium or a multi-key algorithm package, and then encrypting the unique serial number and the user name respectively by using the public key to obtain a first encrypted string and a second encrypted string, reversing the second encrypted string and dividing it according to a set rule, and then inserting it into a specified position of the first encrypted string to obtain a third encrypted string; then encrypting the third encrypted string by an asymmetric encryption algorithm to obtain encrypted information, and then exporting it to a mobile storage medium;

[0013] Connect the mobile storage medium to the verification end, decrypt the encrypted information through an asymmetric encryption algorithm to obtain a third encrypted string, then restore the third encrypted string to the first encrypted string and the second encrypted string, and then decrypt it through the public key to obtain a unique serial number and a user name.

[0014] Furthermore, a new key algorithm is added after the preset multiple designated key algorithms, and the modulo algorithm and the mapping rule between the operation result and the key algorithm serial number are updated, so that the modulo algorithm and the key algorithm serial number correspond one to one.

[0015] In a second aspect, the present invention provides a key generation verification device based on an offline mode, which is used for a verification terminal and at least one client, where there is no data interaction between the verification terminal and the client, and the verification terminal is not connected to a public network, and the device includes:

[0016] A multi-key algorithm package presetting module is used to presetting multiple specified key algorithms, modulus algorithms and time seed generation algorithms. Each of the key algorithms corresponds to a serial number, and a mapping rule between the modulus algorithm operation result and the key algorithm serial number is established; the time seed generation algorithm is used to generate a time seed according to the current time, and the time seeds generated within the specified time range are the same; the modulus algorithm is used to perform a modulus operation according to the time seed; each of the key algorithms is used to obtain a unique serial number and a time seed, and then generate a key according to a specified hash algorithm and calculation rule;

[0017] The multi-key algorithm package import module is used to import the preset multi-key algorithm package into the verification end and at least one client, and generate a unique serial number when importing the client; obtain the user name, and then bind the generated unique serial number and the user name and synchronize it to the verification end through offline mode;

[0018] A key generation module, for generating a first time seed and a valid time according to the current time when the client receives a key generation instruction, then obtaining a calculation result by using a modulo algorithm according to the first time seed, obtaining a corresponding hash algorithm according to the calculation result, and then generating a first key by using the hash algorithm;

[0019] The key verification module is used to input the key and user name generated by the client on the server side and submit them, generate a second time seed based on the submission time, if the submission time is within the valid time, the generated second time seed is consistent with the first time seed, and then obtain the bound unique serial number based on the user name, generate the second key based on the preset hash algorithm and modulus algorithm, and then compare it with the first key. If they are consistent, the first key verification is successful.

[0020] Furthermore, in the multi-key algorithm package import module, a unique serial number is generated when importing into the client, specifically including: obtaining hardware information of the current device, and then using a UUID algorithm to generate a unique serial number based on the hardware information, a timestamp and a pseudo-random number.

[0021] Furthermore, it also includes: creating a pair of public keys and private keys on the verification end, presetting the public key in a mobile storage medium or a multi-key algorithm package, registering the user name after authorization by the verification end administrator, and then inputting it into the client by the user; importing the multi-key algorithm package into the module, binding the generated unique serial number and the user name and synchronizing them to the verification end in an offline manner, specifically including:

[0022] Obtaining a public key from a mobile storage medium or a multi-key algorithm package, and then encrypting the unique serial number and the user name respectively by using the public key to obtain a first encrypted string and a second encrypted string, reversing the second encrypted string and dividing it according to a set rule, and then inserting it into a specified position of the first encrypted string to obtain a third encrypted string; then encrypting the third encrypted string by an asymmetric encryption algorithm to obtain encrypted information, and then exporting it to a mobile storage medium;

[0023] Connect the mobile storage medium to the verification end, decrypt the encrypted information through an asymmetric encryption algorithm to obtain a third encrypted string, then restore the third encrypted string to the first encrypted string and the second encrypted string, and then decrypt it through a private key to obtain a unique serial number and user name, and bind the unique serial number after matching the user name with the registered user name.

[0024] Furthermore, the multi-key algorithm package presetting module is also used to add a new key algorithm after the preset multiple specified key algorithms, and update the mapping rules between the modulus algorithm and the operation result and the key algorithm serial number, so that the modulus algorithm and the key algorithm serial number correspond one to one.

[0025] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0026] The technical solution provided in the embodiments of the present invention has at least the following technical effects:

[0027] By presetting a multi-key algorithm package, including multiple specified key algorithms and modulus algorithms, the client and verification end without data interaction respectively select the same key algorithm through the modulus algorithm according to the time seed to generate the key, and the key validity is verified by key matching, which increases the uncertainty of key algorithm selection, increases the difficulty of cracking, and ensures the security of the electronic password device; by generating a unique serial number and obtaining a user name, and then binding the generated unique serial number and user name and synchronizing them to the verification end offline, the generated key is bound to the user device and cannot be used by other users.

[0028] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.

[0030] Figure 1 is a flow chart of the method in Embodiment 1 of the present invention;

[0031] Figure 2 It is a structural schematic diagram of the device in the second embodiment of the present invention;

[0032] Figure 3 Schematic diagram of the structure of the medium in the third embodiment of the present invention. DETAILED DESCRIPTION

[0033] The embodiments of the present invention provide a key generation and verification method, device and medium based on an offline manner. Through the password generation and collision verification mechanism of a multi-key algorithm, it is completely independent of network connection and does not require data interaction. It can not only be used in an environment without a network, but also improves the stability and security of the system and can adapt to a wider range of application scenarios.

[0034] The technical solution in the embodiment of the present invention has the following general idea:

[0035] In order to avoid the network security risks of electronic ciphers connected to the Internet, and to be applicable to application scenarios where electronic ciphers do not have a stable network connection, the present invention designs a set of multi-key algorithm packages. After being imported into the verification end and the client, the same time seed can be generated within a specified time range, and the same key algorithm is selected from multiple specified key algorithms according to the time seed to generate a key. Since multiple key algorithms are preset, and the selected key algorithm will change with the generated time seed, the algorithms for generating keys at different times are likely to be different, and the methods for generating keys by different key algorithms are different, which increases security. At the same time, the multi-key algorithm packages are used by both ends to generate keys for matching, which does not rely on network connection and does not require data interaction. It can be used in an environment without a network, and the stability of the system is also improved, and it can adapt to a wider range of application scenarios. Embodiment 1

[0036] This embodiment provides a key generation verification method based on an offline mode, which is used for a verification terminal and at least one client. There is no data interaction between the verification terminal and the client, and the verification terminal is not connected to the public network. Figure 1 As shown, the method includes:

[0037] S1. Multi-key algorithm package presetting process: presetting multiple specified key algorithms, modulus algorithms and time seed generation algorithms, each of the key algorithms corresponds to a serial number, and establishing a mapping rule between the modulus algorithm operation result and the key algorithm serial number; the time seed generation algorithm is used to generate a time seed according to the current time, and the time seeds generated within the specified time range are the same; the modulus algorithm is used to perform modulus operations based on the time seed; each of the key algorithms is used to obtain a unique serial number and time seed, and then generate a key according to a specified hash algorithm and calculation rules.

[0038] S2, multi-key algorithm package import process: import the preset multi-key algorithm package into the verification end and at least one client respectively, and generate a unique serial number when importing the client; obtain the user name, and then bind the generated unique serial number and the user name and synchronize them to the verification end through offline mode;

[0039] S3, key generation process: when the client receives the key generation instruction, it generates a first time seed and a valid time according to the current time, then uses a modulus algorithm to obtain a calculation result according to the first time seed, obtains a corresponding hash algorithm according to the calculation result, and then uses the hash algorithm to generate a first key;

[0040] S4, key verification process: enter the key and user name generated by the client on the server and submit them, generate a second time seed based on the submission time, if the submission time is within the valid time, the generated second time seed is consistent with the first time seed, then obtain the bound unique serial number based on the user name, generate the second key based on the preset hash algorithm and modulus algorithm, and then compare it with the first key, if they are consistent, the first key verification is successful.

[0041] In one possible implementation, a unique serial number is generated when importing the client, specifically including: obtaining the hardware information of the current device, and then using the UUID algorithm to generate a unique serial number based on the hardware information, timestamp and pseudo-random number. If the multi-key algorithm package is deleted due to reinstallation or other reasons, another unique serial number different from the previous one will be generated when re-importing, which needs to be re-bound to the user name and synchronized to the verification end through offline mode.

[0042] In a possible implementation, the method further includes: creating a pair of public and private keys on the verification end, presetting the public key in a mobile storage medium or a multi-key algorithm package, registering a user name after authorization by an administrator of the verification end, and then inputting the user name into the client; binding the generated unique serial number and the user name and synchronizing them to the verification end in an offline manner, specifically including:

[0043] Obtaining a public key from a mobile storage medium or a multi-key algorithm package, and then encrypting the unique serial number and the user name respectively by using the public key to obtain a first encrypted string and a second encrypted string, reversing the second encrypted string and dividing it according to a set rule, and then inserting it into a specified position of the first encrypted string to obtain a third encrypted string; then encrypting the third encrypted string by an asymmetric encryption algorithm to obtain encrypted information, and then exporting it to a mobile storage medium;

[0044] Connect the mobile storage medium to the verification end, decrypt the encrypted information through an asymmetric encryption algorithm to obtain a third encrypted string, then restore the third encrypted string to the first encrypted string and the second encrypted string, and then decrypt it through a private key to obtain a unique serial number and user name, and bind the unique serial number after matching the user name with the registered user name.

[0045] The above encryption method can ensure the security of the process of binding the unique serial number and user name and synchronizing it to the verification end in an offline manner.

[0046] In a possible implementation, a new key algorithm is added after the preset multiple designated key algorithms, and the mapping rule between the modulo algorithm and the operation result and the key algorithm serial number is updated, so that the modulo algorithm and the key algorithm serial number correspond one to one.

[0047] The following example illustrates the implementation of a multi-key algorithm package in a simple and convenient way:

[0048] The multi-key algorithm package may include a key algorithm, a modulus algorithm, and a time seed generation algorithm.

[0049] The time seed generation algorithm is used to generate a time seed according to the current time, and the time seeds generated within the specified time range are the same.

[0050] Multiple key algorithms are preset. The core algorithm of the key algorithm is the hash algorithm. Different key algorithms use different hash algorithms, such as MD2, MD4, MD5, SHA1, SHA224, SHA256 SHA387, SHA512, SM3, etc. The contents involved in the hash algorithm calculation can be different, but must include the unique serial number and time seed. For example, the time seed and the unique serial number are concatenated to calculate the hash value. In order to increase security, other factors can also be preset to participate in the hash value calculation. When the key needs to be presented as a pure digital password, the mapping rules between the hash value and the number can also be preset for conversion.

[0051] The modular algorithm can set the divisor n according to the number of key algorithms, and the result of the modular algorithm operation is 0 to n-1. For example, 10 key algorithms are preset and the serial numbers are set to 0-9 respectively, then the result of the modular algorithm operation is 0 to 9. The key algorithm with the corresponding serial number can be selected according to the operation result to generate the key.

[0052] Based on the same inventive concept, the present application also provides a device corresponding to the method in Example 1, see Example 2 for details. Embodiment 2

[0053] In this embodiment, a key generation verification device based on an offline mode is provided, which is used for a verification terminal and at least one client. There is no data interaction between the verification terminal and the client, and the verification terminal is not connected to the public network. Figure 2 As shown, the device comprises:

[0054] A multi-key algorithm package presetting module is used to presetting multiple specified key algorithms, modulus algorithms and time seed generation algorithms. Each of the key algorithms corresponds to a serial number, and a mapping rule between the modulus algorithm operation result and the key algorithm serial number is established; the time seed generation algorithm is used to generate a time seed according to the current time, and the time seeds generated within the specified time range are the same; the modulus algorithm is used to perform a modulus operation according to the time seed; each of the key algorithms is used to obtain a unique serial number and a time seed, and then generate a key according to a specified hash algorithm and calculation rule;

[0055] The multi-key algorithm package import module is used to import the preset multi-key algorithm package into the verification end and at least one client, and generate a unique serial number when importing the client; obtain the user name, and then bind the generated unique serial number and the user name and synchronize it to the verification end through offline mode;

[0056] A key generation module, for generating a first time seed and a valid time according to the current time when the client receives a key generation instruction, then obtaining a calculation result by using a modulo algorithm according to the first time seed, obtaining a corresponding hash algorithm according to the calculation result, and then generating a first key by using the hash algorithm;

[0057] The key verification module is used to input the key and user name generated by the client on the server side and submit them, generate a second time seed based on the submission time, if the submission time is within the valid time, the generated second time seed is consistent with the first time seed, and then obtain the bound unique serial number based on the user name, generate the second key based on the preset hash algorithm and modulus algorithm, and then compare it with the first key. If they are consistent, the first key verification is successful.

[0058] In a possible implementation, in the multi-key algorithm package import module, a unique serial number is generated when importing into the client, specifically including: obtaining hardware information of the current device, and then using the UUID algorithm to generate a unique serial number based on the hardware information, timestamp and pseudo-random number.

[0059] In a possible implementation, the method further includes: creating a pair of public and private keys on the verification end, presetting the public key in a mobile storage medium or a multi-key algorithm package, registering a user name after authorization by the verification end administrator, and then inputting the user name into the client; importing the multi-key algorithm package into a module, binding the generated unique serial number and the user name and synchronizing them to the verification end in an offline manner, specifically including:

[0060] Obtaining a public key from a mobile storage medium or a multi-key algorithm package, and then encrypting the unique serial number and the user name respectively by using the public key to obtain a first encrypted string and a second encrypted string, reversing the second encrypted string and dividing it according to a set rule, and then inserting it into a specified position of the first encrypted string to obtain a third encrypted string; then encrypting the third encrypted string by an asymmetric encryption algorithm to obtain encrypted information, and then exporting it to a mobile storage medium;

[0061] Connect the mobile storage medium to the verification end, decrypt the encrypted information through an asymmetric encryption algorithm to obtain a third encrypted string, then restore the third encrypted string to the first encrypted string and the second encrypted string, and then decrypt it through a private key to obtain a unique serial number and user name, and bind the unique serial number after matching the user name with the registered user name.

[0062] In a possible implementation, the multi-key algorithm package preset module is also used to add a new key algorithm after the preset multiple specified key algorithms, and update the mapping rules between the modulus algorithm and the operation result and the key algorithm serial number, so that the modulus algorithm and the key algorithm serial number correspond one-to-one.

[0063] Since the device introduced in the second embodiment of the present invention is a device used to implement the method of the first embodiment of the present invention, those skilled in the art can understand the specific structure and deformation of the device based on the method introduced in the first embodiment of the present invention, so it is not described here in detail. All devices used in the method of the first embodiment of the present invention belong to the scope of protection of the present invention.

[0064] Based on the same inventive concept, the present application provides a storage medium corresponding to Example 1, see Example 3 for details. Embodiment 3

[0065] This embodiment provides a computer-readable storage medium, such as Figure 3 As shown, a computer program is stored thereon, and when the computer program is executed by a processor, any implementation method in Example 1 can be implemented.

[0066] Since the computer-readable storage medium introduced in this embodiment is a computer-readable storage medium used to implement the method in the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, a person skilled in the art can understand the specific implementation of the computer-readable storage medium of the present embodiment and its various variations, so how the computer-readable storage medium implements the method in the embodiment of the present application is not described in detail here. As long as a person skilled in the art implements the computer-readable storage medium used in the method in the embodiment of the present application, it belongs to the scope of protection of the present application.

[0067] The present invention presets a multi-key algorithm package, including multiple specified key algorithms and module algorithms, and selects the same key algorithm to generate a key through the module algorithm according to a time seed at a client and a verification end without data interaction, and verifies the validity of the key through key matching, thereby increasing the uncertainty of key algorithm selection, increasing the difficulty of cracking, and ensuring the security of the electronic cipher; by generating a unique serial number and obtaining a user name, and then binding the generated unique serial number and the user name and synchronizing them to the verification end in an offline manner, the generated key is bound to the user device and cannot be used by other users.

[0068] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable removable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0069] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0070] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0071] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps for the functions specified in one or more boxes.

[0072] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.

Claims

1. A key generation and verification method based on an offline mode, characterized in that: Used for a verification terminal and at least one client, there is no data interaction between the verification terminal and the client, and the verification terminal is not connected to the public network, the method includes: Presetting process of multiple key algorithm packages: Presetting multiple specified key algorithms, modulus algorithms and time seed generation algorithms, each of the key algorithms corresponds to a serial number, and establishing a mapping rule between the modulus algorithm operation result and the key algorithm serial number; the time seed generation algorithm is used to generate a time seed according to the current time, and the time seeds generated within the specified time range are the same; the modulus algorithm is used to perform a modulus operation according to the time seed; each of the key algorithms is used to obtain a unique serial number and time seed, and then generate a key according to a specified hash algorithm and calculation rule; Multi-key algorithm package import process: import the preset multi-key algorithm package to the verification end and at least one client respectively, and generate a unique serial number when importing the client; obtain the user name, and then bind the generated unique serial number and the user name and synchronize it to the verification end through offline mode; It also includes: creating a pair of public and private keys on the verification end, presetting the public key in a mobile storage medium or a multi-key algorithm package, registering the user name after authorization by the verification end administrator, and then inputting it into the client by the user; binding the generated unique serial number and the user name and synchronizing them to the verification end in an offline manner, specifically including: Obtaining a public key from a mobile storage medium or a multi-key algorithm package, and then encrypting the unique serial number and the user name respectively by using the public key to obtain a first encrypted string and a second encrypted string, reversing the second encrypted string and dividing it according to a set rule, and then inserting it into a specified position of the first encrypted string to obtain a third encrypted string; then encrypting the third encrypted string by an asymmetric encryption algorithm to obtain encrypted information, and then exporting it to a mobile storage medium; Connect the mobile storage medium to the verification end, decrypt the encrypted information through an asymmetric encryption algorithm to obtain a third encrypted string, then restore the third encrypted string to the first encrypted string and the second encrypted string, and then decrypt it through a private key to obtain a unique serial number and a user name, and bind the unique serial number after matching the user name with the registered user name; Key generation process: When the client receives the key generation instruction, it generates a first time seed and a valid time according to the current time, then uses the modulus algorithm to obtain a calculation result according to the first time seed, obtains the corresponding hash algorithm according to the calculation result, and then uses the hash algorithm to generate the first key; Key verification process: Enter the key and user name generated by the client on the server and submit them. Generate a second time seed based on the submission time. If the submission time is within the valid time, the generated second time seed is consistent with the first time seed. Then obtain the bound unique serial number based on the user name, generate the second key based on the preset hash algorithm and modulus algorithm, and then compare it with the first key. If they are consistent, the first key verification is successful.

2. The method according to claim 1, characterized in that A unique serial number is generated when the client is imported, specifically including: obtaining the hardware information of the current device, and then using the UUID algorithm to generate a unique serial number based on the hardware information, timestamp and pseudo-random number.

3. The method according to claim 1, characterized in that Also includes: A new key algorithm is added after the preset multiple specified key algorithms, and the modulus algorithm and the mapping rule between the operation result and the key algorithm serial number are updated to make the modulus algorithm correspond to the key algorithm serial number one by one.

4. A key generation and verification device based on an offline method, characterized in that: Used for a verification terminal and at least one client, there is no data interaction between the verification terminal and the client, and the verification terminal is not connected to the public network, the device includes: A multi-key algorithm package presetting module is used to presetting multiple specified key algorithms, modulus algorithms and time seed generation algorithms. Each of the key algorithms corresponds to a serial number, and a mapping rule between the modulus algorithm operation result and the key algorithm serial number is established; the time seed generation algorithm is used to generate a time seed according to the current time, and the time seeds generated within the specified time range are the same; the modulus algorithm is used to perform a modulus operation according to the time seed; each of the key algorithms is used to obtain a unique serial number and a time seed, and then generate a key according to a specified hash algorithm and calculation rule; The multi-key algorithm package import module is used to import the preset multi-key algorithm package into the verification end and at least one client, and generate a unique serial number when importing the client; obtain the user name, and then bind the generated unique serial number and the user name and synchronize it to the verification end through offline mode; The method further includes: creating a pair of public and private keys on the verification end, presetting the public key in a mobile storage medium or a multi-key algorithm package, registering a user name after authorization by the verification end administrator, and then inputting the user name into the client; importing the multi-key algorithm package into a module, binding the generated unique serial number and the user name and synchronizing them to the verification end in an offline manner, specifically including: Obtaining a public key from a mobile storage medium or a multi-key algorithm package, and then encrypting the unique serial number and the user name respectively by using the public key to obtain a first encrypted string and a second encrypted string, reversing the second encrypted string and dividing it according to a set rule, and then inserting it into a specified position of the first encrypted string to obtain a third encrypted string; then encrypting the third encrypted string by an asymmetric encryption algorithm to obtain encrypted information, and then exporting it to a mobile storage medium; Connect the mobile storage medium to the verification end, decrypt the encrypted information through an asymmetric encryption algorithm to obtain a third encrypted string, then restore the third encrypted string to the first encrypted string and the second encrypted string, and then decrypt it through a private key to obtain a unique serial number and a user name, and bind the unique serial number after matching the user name with the registered user name; A key generation module, for generating a first time seed and a valid time according to the current time when the client receives a key generation instruction, then obtaining a calculation result by using a modulo algorithm according to the first time seed, obtaining a corresponding hash algorithm according to the calculation result, and then generating a first key by using the hash algorithm; The key verification module is used to input the key and user name generated by the client on the server side and submit them, generate a second time seed based on the submission time, if the submission time is within the valid time, the generated second time seed is consistent with the first time seed, and then obtain the bound unique serial number based on the user name, generate the second key based on the preset hash algorithm and modulus algorithm, and then compare it with the first key. If they are consistent, the first key verification is successful.

5. The device according to claim 4, characterized in that In the multi-key algorithm package import module, a unique serial number is generated when importing the client, specifically including: obtaining the hardware information of the current device, and then using the UUID algorithm to generate a unique serial number based on the hardware information, timestamp and pseudo-random number.

6. The device according to claim 4, characterized in that Also includes: The multi-key algorithm package presetting module is also used to add a new key algorithm after the preset multiple specified key algorithms, and update the mapping rules between the modulus algorithm and the operation result and the key algorithm serial number, so that the modulus algorithm and the key algorithm serial number correspond one to one.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.