Algorithm library authorization and encryption method, system and device based on encryption dog

By randomly generating public and private key B in the dongle and storing private key A in the algorithm library, the problem of the security of the authorization mechanism being threatened after the dongle private key is acquired is solved, and the high security and authorization of the dongle are achieved effectiveness.

CN118611876BActive Publication Date: 2024-11-12ZHEJIANG MIAXIS TECH CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411098219.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-11-12
Estimated Expiration
2044-08-12

AI Technical Summary

Technical Problem

In the existing dongle-based algorithm library authorization scheme, after the private key is obtained, the security of the authorization mechanism is threatened. How to ensure the security of the dongle itself is a key issue.

Method used

Instead of storing the private key A of the algorithm manufacturer in the dongle, the dongle randomly generates the public and private key B. The public key B is used to construct the plaintext, and the private key A generated by the algorithm manufacturer encrypts the plaintext and generates encrypted information. Stored in the private memory area of ​​the dongle, and the public key A is stored in the algorithm library. The authorization verification is completed through the dongle's own public and private key B.

Benefits of technology

It effectively avoids the possibility of dongle private key being acquired, improves the security of algorithm library authorization, reduces the risk of external exposure of keys and sensitive data, increases the difficulty of cracking, and ensures the effectiveness and reliability of authorization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118611876B_ABST
    Figure CN118611876B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of information technology security, and in particular to an algorithm library authorization and encryption method, system and device based on a dongle. It includes: S101. Obtaining a public key B in a public-private key B randomly generated by a dongle; S102. Constructing a plaintext including the public key B; S103. Obtaining a private key A in a public-private key A generated by an algorithm manufacturer; S104. Encrypting the plaintext using the private key A to generate encrypted information; S105. Writing the encrypted information into a private memory area of ​​the dongle; wherein the public key A is stored in the algorithm library. In order to overcome the technical problem of cracking the dongle to obtain the private key to implement algorithm library authorization verification, the present invention does not need to store the private key A of the algorithm manufacturer in the dongle, thereby effectively avoiding the possibility of the private key in the dongle being obtained, and can effectively protect the algorithm library authorization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology security, and in particular to a dongle-based algorithm library authorization and encryption method, system and device. Background Art

[0002] Most of the existing dongle-based algorithm authorization schemes store the private key in the dongle and the public key in the algorithm library, and perform algorithm library authorization verification by using the private key to encrypt and decrypt the public key or the public key to encrypt and decrypt the private key. The defect of this scheme is that if the security mechanism of the dongle itself is cracked and the private key is obtained, the security of the entire authorization mechanism will be threatened. Once the dongle is cracked, that is, the private key is obtained, the algorithm library authorization cannot be controlled, resulting in losses. How to ensure the security of the dongle itself is an issue that needs to be considered in this scheme. Summary of the invention

[0003] Technical problem to be solved by the invention

[0004] In order to overcome the technical problem of cracking the encryption dog to obtain the private key to implement algorithm library authorization verification, the present invention provides an algorithm library authorization and encryption method, system and device based on the encryption dog, which does not need to store the private key A of the algorithm manufacturer in the encryption dog, thereby effectively avoiding the possibility of the private key in the encryption dog being obtained, and can effectively protect the algorithm library authorization.

[0005] Technical Solution

[0006] To solve the above problems, the technical solution provided by the present invention is:

[0007] An algorithm library authorization encryption method based on an encryption dog comprises: S101. obtaining a public key B in a public-private key B randomly generated by the encryption dog; S102. constructing a plain text including the public key B; S103. obtaining a private key A in a public-private key A generated by an algorithm manufacturer; S104. encrypting the plain text using the private key A to generate encrypted information;

[0008] S105. Write the encrypted information into the private memory area of ​​the dongle; wherein the public key A is stored in the algorithm library.

[0009] Optionally, if the plain text also includes one or more of the algorithm manufacturer information and the dongle unique identifier UID, then before step S102, it also includes: obtaining one or more of the algorithm manufacturer information and the dongle unique identifier UID.

[0010] Optionally, the encryption algorithm used by the public and private keys A generated by the algorithm manufacturer, and the encryption algorithm used by the public and private keys B randomly generated by the encryption dog, are one or more of the RSA algorithm, the ECC algorithm and the DSA algorithm.

[0011] An algorithm library authorization encryption system based on a dongle comprises: a plaintext construction module, used for obtaining a public key B in a public-private key B randomly generated by a dongle, and constructing a plaintext including the public key B; an encryption module, used for obtaining a private key A in a public-private key A generated by an algorithm manufacturer, and encrypting the plaintext with the private key A to generate encrypted information; a dongle storage module, used for writing the encrypted information into a private memory area of ​​the dongle; and an algorithm library storage module, used for obtaining a public key A in a public-private key A generated by an algorithm manufacturer, and storing the public key A in the algorithm library.

[0012] Optionally, the plaintext construction module is also used to obtain one or more of the algorithm manufacturer information and the encryption dog unique identifier UID, and construct a plaintext including the public key B and one or more of the algorithm manufacturer information and the encryption dog unique identifier UID; the algorithm library storage module is also used to obtain the algorithm manufacturer information and store the algorithm manufacturer information in the algorithm library.

[0013] A dongle-based algorithm library authorization method comprises: S201. obtaining encrypted information in the dongle; S202. obtaining a public key A stored in the algorithm library; S203. decrypting the encrypted information using the public key A to obtain plain text; S204. obtaining a random number X randomly generated by the algorithm library; S205. obtaining a random number Y obtained by decrypting the encrypted information of the random number X using the public key B in the plain text by the algorithm library; S206. judging whether the random number X is consistent with the random number Y, if so, the verification succeeds and the algorithm library authorization is obtained; if not, the verification fails and the execution of the algorithm library authorization is rejected; wherein, the encrypted information of the random number X is obtained by encrypting the random number X randomly generated by the algorithm library after the dongle receives it, using the private key B to encrypt the random number X.

[0014] Optionally, if the plain text also includes one or more of the algorithm manufacturer information and the dongle unique identifier UID, it also includes: S213. Verify one or more of the algorithm manufacturer information and the dongle unique identifier UID. If the verification is successful, continue with the random number verification. If the verification fails, the algorithm library authorization is rejected.

[0015] An algorithm library authorization system based on a dongle comprises: a decryption module, which is used to obtain encrypted information in the dongle, obtain a public key A stored in the algorithm library, and use the public key A to decrypt the encrypted information to obtain plain text; a random number acquisition module, which is used to obtain a random number X randomly generated by the algorithm library, and obtain a random number Y obtained by decrypting the encrypted information of the random number X by using the public key B in the plain text of the algorithm library; wherein the encrypted information of the random number X is obtained by using the private key B to encrypt the random number X after the dongle receives the random number X randomly generated by the algorithm library; and a random number verification module, which is used to judge whether the random number X and the random number Y are consistent, if so, the verification is successful and the algorithm library authorization is obtained; if not, the verification fails and the execution of the algorithm library authorization is rejected.

[0016] Optionally, it also includes a plaintext verification module, which is used to verify one or more of the algorithm manufacturer information and the dongle unique identifier UID. If the verification is successful, the random number verification module continues to execute; if the verification fails, the execution algorithm library authorization is rejected.

[0017] An algorithm library authorization device based on a dongle is used to execute or store the method described in any of the above technical solutions, or to install the system described in any of the above technical solutions.

[0018] Compared with the prior art, the technical solution provided by the present invention has the following beneficial effects:

[0019] The embodiments of the present application propose an algorithm library authorization encryption method, system and device based on a dongle, wherein an algorithm library authorization encryption method based on a dongle is only mastered by the algorithm manufacturer and is not provided to customers. After completing the method, the dongle and the algorithm library are delivered to the customer, and the customer obtains the dongle and the algorithm library. Since the algorithm library stores the public key A, the dongle itself randomly generates the public and private keys B. Therefore, for the customer, the public key A and the public and private keys B are mastered, and the information of the private key A is completely unknown, that is, the private key A is only controlled by the algorithm manufacturer and is used when performing the above method. Therefore, there is no need for the dongle to store the private key A, and there is no risk of the private key A being leaked, which effectively ensures the security and reliability of the algorithm library authorization.

[0020] The embodiment of the present application proposes a dongle-based algorithm library authorization method, system and device. After the customer obtains the dongle and algorithm library from the algorithm manufacturer, the algorithm library is authorized. The public key A is stored in the algorithm library, and the encrypted information is stored in the dongle. The encrypted information is decrypted by the public key A without the participation of the private key A. The authorization verification of the algorithm library is completed using the public and private keys B randomly generated by the dongle itself. The public and private keys B randomly generated inside the dongle itself are used to optimize the security encryption mechanism of the dongle itself, which can reduce the risk of external exposure of keys and sensitive data. Since the encryption process is completely completed inside the dongle, it is difficult for attackers to obtain key information through software means, thereby improving security. Even if the dongle is cracked and private key B is obtained, the algorithm library authorization verification cannot be completed, because the ciphertext stored in the private memory area of ​​the dongle is encrypted with private key A, and public key A must be obtained to decrypt it. Public key A is stored in the algorithm library, not in the dongle, so the algorithm library needs to be cracked to obtain public key A for decryption. This greatly increases the difficulty of cracking, thereby ensuring the validity of the algorithm library authorization based on the dongle. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 The present invention is a flowchart of an algorithm library authorization encryption method based on a dongle according to an embodiment of the present invention.

[0022] Figure 2 This is a structural block diagram of an algorithm library authorization encryption system based on a dongle proposed in one embodiment of the present invention.

[0023] Figure 3 This is one of the flow charts of a dongle-based algorithm library authorization method proposed in one embodiment of the present invention.

[0024] Figure 4 This is a second flow chart of an algorithm library authorization method based on a dongle proposed in an embodiment of the present invention.

[0025] Figure 5 This is a structural block diagram of an algorithm library authorization system based on a dongle proposed in one embodiment of the present invention.

[0026] Figure 6 A schematic diagram of the structure of an algorithm library authorization device based on a dongle proposed in one embodiment of the present invention.

[0027] Figure 7 A block diagram of the content structure of an algorithm library and a dongle when executing an algorithm library authorization encryption method, system and device based on a dongle proposed in a combined embodiment of the present invention.

[0028] Figure 8A block diagram of the content structure of an algorithm library and a dongle when a dongle-based algorithm library authorization method, system and device are executed in accordance with a combined embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to further understand the content of the present invention, the present invention is described in detail in conjunction with the accompanying drawings and embodiments.

[0030] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It will be understood that the specific embodiments described herein are only used to explain the relevant inventions, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the invention are shown in the accompanying drawings. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

[0031] Example 1

[0032] This embodiment proposes an algorithm library authorization encryption method based on a dongle, such as Figure 1 As shown, including:

[0033] S101. Obtain the public key B in the public and private key B randomly generated by the dongle;

[0034] S102. Construct plaintext including public key B;

[0035] S103. Obtain the private key A in the public and private key A generated by the algorithm manufacturer;

[0036] S104. Encrypt the plaintext using private key A to generate encrypted information;

[0037] S105. Write the encrypted information into the private memory area of ​​the dongle; wherein the public key A is stored in the algorithm library.

[0038] Regarding the execution order of the technical solution of this embodiment, the order of steps S101 and S103 can be performed simultaneously or successively without restriction, but step S101 must be completed before step S102, and step 103 must be completed before step S104; steps S102, S104 and S105 must be performed in sequence.

[0039] The technical solution of this embodiment is only controlled by the algorithm manufacturer and is used for the security management of the industry algorithm library. It is not provided to customers. After completing the above method, the encryption dog and the algorithm library are delivered to the customer. The customer obtains the encryption dog and the algorithm library, and uses the public and private keys B randomly generated inside the encryption dog itself to optimize the encryption dog's own security encryption mechanism, which can reduce the risk of external exposure of keys and sensitive data. Since the encryption generation process of the public and private keys B is completely completed inside the encryption dog, it is difficult for attackers to obtain key information through software means, thereby improving security. Figure 7 As shown, the algorithm library stores public key A, and the dongle itself randomly generates public and private keys B; therefore, for the customer, by opening the algorithm library and the dongle, public key A and public and private keys B are obtained, and the information of private key A is completely unknown, that is, private key A is only controlled by the algorithm manufacturer and used when performing the above method, so there is no need for the dongle to store private key A, and there is no risk of private key A being leaked; thus, the reliability and effectiveness of the algorithm library authorization can be ensured. Even if the dongle encryption mechanism is cracked, because the public key A is stored in the algorithm library, the algorithm library must be cracked to obtain the public key A, which further increases the difficulty of cracking, thereby ensuring the effectiveness of the algorithm library authorization.

[0040] The memory area division and design of the dongle is designed to meet the needs of high security and efficiency, which is achieved by clearly partitioning different functions and data types. It includes read-only storage area, random access storage area, programmable storage area, secure storage area and encryption processor. Among them, the read-only storage area ensures the immutability of the firmware; the random access storage area provides space for temporary data processing, while ensuring the volatility of data helps to protect sensitive information; the programmable storage area and the secure storage area provide the functions of user data storage and key protection respectively; and the encryption processor focuses on improving the efficiency and security of encryption operations; this design makes the dongle an ideal hardware device for performing key management and encryption tasks. The private memory area in the dongle corresponds to the secure storage area of ​​the dongle. Considering security, the encrypted information should be stored in the secure storage area, because the secure storage area requires a password to access. Only attackers who break the password can access the data in the secure storage area, which enhances the security of encrypted information storage and further ensures the validity and reliability of algorithm library authorization.

[0041] As a further improvement of the present technical solution, if the plain text also includes one or more of the algorithm manufacturer information and the dongle unique identifier UID, then before step S102, it also includes: obtaining one or more of the algorithm manufacturer information and the dongle unique identifier UID.

[0042] By adding one or more of the algorithm manufacturer information and the dongle unique identifier UID in plain text, including adding the algorithm manufacturer information and the dongle unique identifier UID separately, or adding both at the same time, the verification step of the corresponding information is added when authorizing the algorithm library, thereby further enhancing the effectiveness of the dongle-based algorithm library authorization.

[0043] As a further improvement of this embodiment, the encryption algorithm used by the public and private keys A generated by the algorithm manufacturer, and the encryption algorithm used by the public and private keys B randomly generated by the encryption dongle, are one or more of the RSA algorithm, the ECC algorithm and the DSA algorithm.

[0044] When the public and private keys A generated by the algorithm manufacturer and the public and private keys B randomly generated by the dongle are generated, the algorithm manufacturer's terminal and the dongle need to add algorithms for generating public and private key pairs. Different public key encryption algorithms can be used, such as RSA, ECC (elliptic curve encryption) and DSA (digital signature algorithm) One or a combination of several. The choice of which algorithm to generate public and private key pairs can be determined based on specific application scenarios, security requirements, performance considerations, cost budgets, and storage capabilities. ECC has become an increasingly popular choice due to its high efficiency and low resource requirements, especially in resource-constrained environments. However, RSA's wide support and maturity also make it still the first choice in many occasions. DSA is more suitable for scenarios that require digital signatures.

[0045] Example 2

[0046] This embodiment proposes an algorithm library authorization encryption system based on a dongle, such as Figure 2 As shown, it includes: a plaintext construction module, used to obtain the public key B in the public-private key B randomly generated by the encryption dog, and construct a plaintext including the public key B; an encryption module, used to obtain the private key A in the public-private key A generated by the algorithm manufacturer, and use the private key A to encrypt the plaintext to generate encrypted information; the encryption dog storage module, used to write the encrypted information into the private memory area of ​​the encryption dog; the algorithm library storage module, used to obtain the public key A in the public-private key A generated by the algorithm manufacturer, and store the public key A in the algorithm library.

[0047] In the system of this embodiment, for the customer, by opening the algorithm library and the encryption dog, the public key A is obtained, and the information of the private key A is completely unknown, that is, the private key A is only controlled by the algorithm manufacturer. When operating in this system, the encryption dog is not required to store the private key A, and there is no risk of the private key A being leaked; thus, the reliability and effectiveness of the algorithm library authorization can be ensured. Even if the encryption mechanism of the encryption dog is cracked, because the public key A is stored in the algorithm library, the algorithm library must be cracked to obtain the public key A, which further increases the difficulty of cracking, thereby ensuring the effectiveness of the algorithm library authorization.

[0048] As a further improvement of this embodiment, the plaintext construction module is also used to obtain one or more of the algorithm manufacturer information and the dongle unique identifier UID, and construct a plaintext including the public key B and one or more of the algorithm manufacturer information and the dongle unique identifier UID; the algorithm library storage module is also used to obtain the algorithm manufacturer information and store the algorithm manufacturer information in the algorithm library.

[0049] The system of this embodiment is used for the security management of industry algorithm libraries. This solution increases the plaintext information content. The acquisition and verification of plaintext information requires cracking the algorithm library and the encryption dog at the same time, which increases the difficulty of cracking for attackers, thereby effectively ensuring the algorithm library authorization mechanism based on the encryption dog.

[0050] Example 3

[0051] This embodiment proposes an algorithm library authorization method based on a dongle, such as Figure 3 As shown, including:

[0052] S201. Obtain the encryption information in the dongle;

[0053] S202. Obtain the public key A stored in the algorithm library;

[0054] S203. Decrypt the encrypted information using public key A to obtain plain text;

[0055] S204. Obtain a random number X randomly generated by the algorithm library;

[0056] S205. Obtain a random number Y obtained by decrypting the encrypted information of the random number X using the public key B in the plain text by the algorithm library;

[0057] S206. Determine whether the random number X and the random number Y are consistent. If so, the verification is successful and the algorithm library authorization is obtained; if not, the verification fails and the execution algorithm library authorization is rejected;

[0058] The encryption information of the random number X is obtained by encrypting the random number X using the private key B after the encryption dog receives a random number X randomly generated by the algorithm library.

[0059] Regarding the execution order of the technical solution, it should be noted that there is no specific order among steps S201, S202, and S204, but steps S201 and S202 must be completed before executing step S203.

[0060] In this embodiment, an algorithm library authorization method based on a dongle is described. Steps S201, S202 and S203 correspond to the decryption part of the algorithm library authorization encryption method based on a dongle in Embodiment 1; steps S204, S205 and S206 correspond to the verification part.

[0061] After the customer obtains the dongle and algorithm library from the algorithm manufacturer, he can execute the method of the technical solution of this embodiment to obtain authorization for the algorithm library. Figure 8 As shown in the figure, the public key A is stored in the algorithm library, the encrypted information is stored in the dongle, and the encrypted information is decrypted by the public key A without the participation of the private key A. The authorization verification of the algorithm library is completed by using the public and private keys B randomly generated by the dongle itself. The public and private keys B randomly generated inside the dongle itself optimize the security encryption mechanism of the dongle itself, which can reduce the risk of external exposure of keys and sensitive data. Since the encryption generation process of the public and private keys B is completely completed inside the dongle, it is difficult for attackers to obtain key information through software means, thereby improving security.

[0062] Because the public and private keys B are randomly generated by the dongle, they are generally stored in the secure storage area of ​​the dongle or in the dedicated public and private key storage area of ​​the dongle. After the dongle is opened, the public and private key data in the dongle cannot be directly accessed in this area. The data can only be accessed by calling the encryption and decryption functions provided by the dongle, thereby ensuring the security of the public and private keys B. The public key B is used as part of the plaintext information to encrypt the private key A to form encrypted information; the public key A stored in the algorithm library is used to decrypt the encrypted information to obtain the public key B in the plaintext. The decrypted public key B is used to decrypt the ciphertext data of the random number X encrypted by the private key B - the encrypted information of the random number X. The method of encrypting the plaintext containing the public key B by the private key A increases the difficulty of attack, because only the public key A in the algorithm library can decrypt the correct public key B. If the attacker can decrypt the ciphertext with other public keys C, but cannot decrypt the correct public key B, then the incorrect public key B cannot decrypt the correct random number X, so the random number check will not pass, thereby ensuring the validity and reliability of the algorithm library authorization.

[0063] Even if the dongle is cracked and private key B is obtained, the algorithm library authorization verification cannot be completed, because the ciphertext stored in the private memory area of ​​the dongle is encrypted with private key A, and public key A must be obtained to decrypt it. Public key A is stored in the algorithm library, not in the dongle, so the algorithm library needs to be cracked to obtain public key A for decryption. This greatly increases the difficulty for attackers to crack the algorithm, thereby ensuring the validity of the dongle-based algorithm library authorization.

[0064] As a further improvement of this embodiment, if the plain text also includes one or more of the algorithm manufacturer information and the dongle unique identifier UID, it also includes: S213. Verify one or more of the algorithm manufacturer information and the dongle unique identifier UID. If the verification is successful, continue with the random number verification. If the verification fails, the algorithm library authorization is rejected.

[0065] The plain text includes adding the algorithm manufacturer information and the unique identifier UID of the dongle separately, or adding both at the same time. For example, adding the algorithm manufacturer information and the unique identifier UID of the dongle in the plain text at the same time, such as Figure 4 As shown, S213. Verify the algorithm manufacturer information and the dongle unique identifier UID. If both are verified successfully, continue; if any of the verifications fails, the execution algorithm library authorization is rejected.

[0066] Among them, the algorithm manufacturer information and public key A are stored in the algorithm library. After the algorithm manufacturer delivers the dongle and algorithm library to the customer, the algorithm manufacturer information can be obtained by opening the algorithm library for verification. By opening the dongle and reading the private memory area of ​​the dongle, the encrypted information stored in the private memory area of ​​the dongle can be obtained. The content of the encrypted information itself is unknown to the customer, which further strengthens the effectiveness of the algorithm library authorization based on the dongle.

[0067] When the dongle manufacturer produces the dongle, each dongle has its own unique identification UID, that is, the unique chip serial number (UID) of the dongle. When the dongle manufacturer delivers the dongle to the customer, it will provide a function to obtain the dongle's unique identification UID. The user can get the dongle's unique identification UID by opening the dongle and calling the function. As for the storage location of the dongle's unique identification UID, it is only known by the dongle manufacturer and the user is unaware of it. If the dongle's unique identification UID is to be verified, it will further increase the difficulty for attackers to crack it, thereby ensuring the validity of the algorithm library authorization.

[0068] Example 4

[0069] This embodiment proposes an algorithm library authorization system based on a dongle, such as Figure 5 As shown, including:

[0070] The decryption module is used to obtain the encrypted information in the encryption dongle, obtain the public key A stored in the algorithm library, and use the public key A to decrypt the encrypted information to obtain the plain text;

[0071] A random number acquisition module is used to obtain a random number X randomly generated by the algorithm library, and obtain a random number Y obtained by decrypting the encryption information of the random number X by the algorithm library using the public key B in plain text; wherein the encryption information of the random number X is obtained by encrypting the random number X by using the private key B after the encryption dongle receives the random number X randomly generated by the algorithm library;

[0072] The random number verification module is used to determine whether the random number X and the random number Y are consistent. If so, the verification is successful and the algorithm library authorization is obtained; if not, the verification fails and the execution of the algorithm library authorization is rejected.

[0073] The system of this embodiment does not need to save the private key A, which can avoid the security risk of the encryption dog being cracked. By using the decryption module, random number acquisition module and random number verification module, the encryption dog itself generates a public and private key B randomly, which optimizes the encryption dog's own security encryption mechanism, can reduce the risk of external exposure of keys and sensitive data, and because the encryption process is completely completed inside the encryption dog, it is difficult for attackers to obtain key information through software means, thereby improving security. Even if the encryption dog is cracked to obtain the private key B, the algorithm library authorization verification cannot be completed, because the ciphertext stored in the private memory area of ​​the encryption dog is encrypted using the private key A, and the public key A must be obtained to decrypt, and the public key A is stored in the algorithm library, not in the encryption dog, so it is also necessary to crack the algorithm library to obtain the public key A to decrypt, so the difficulty of cracking is greatly increased, thereby ensuring the validity of the algorithm library authorization based on the encryption dog.

[0074] As a further improvement of the technical solution of this embodiment, a plain text verification module is further included, which is used to verify one or more of the algorithm manufacturer information and the dongle unique identifier UID. If the verification is successful, the random number module continues to execute, and if the verification fails, the execution of the algorithm library authorization is rejected. This technical solution further increases the reliability of the system by adding a verification step, thereby ensuring the effectiveness of the dongle-based algorithm library authorization system.

[0075] Example 5

[0076] An algorithm manufacturer builds a pair of RSA2048 public and private keys A, and stores public key A in the algorithm library, which is used to submit to customers. Public key A is used to decrypt ciphertext and then complete the authorization verification of the algorithm library; private key A is stored in the dongle burning software, which is only used by the algorithm manufacturer to burn dongles and is not provided to customers.

[0077] The algorithm manufacturer uses the burning software to burn the dongle as follows:

[0078] 1. Open the dongle and obtain the unique identification of the dongle, that is, the unique chip serial number (UID) of the dongle;

[0079] 2. The dongle itself randomly generates a pair of RSA2048 public and private keys B;

[0080] 3. Construct plaintext C, which is public key B + algorithm manufacturer information + dongle unique identifier UID;

[0081] 4. Use private key A to encrypt plaintext C to generate ciphertext D;

[0082] 5. Write the ciphertext D into the private memory area of ​​the dongle.

[0083] At this point, the dongle burning process is completed, and the dongle and algorithm library can be provided to customers.

[0084] After the customer receives the dongle and algorithm library, the algorithm library authorization verification process is carried out:

[0085] 1. Open the dongle to obtain the ciphertext D stored in the private memory area of ​​the dongle, and obtain the unique identifier UID of the dongle;

[0086] The algorithm library calls the function that reads the private memory in the dongle to obtain the ciphertext D in the private memory, the unique identifier UID of the dongle, which is unknown to the client; the public key A and algorithm manufacturer information are stored in the algorithm library, which is also unknown to the client. The dongle contains the public and private keys B.

[0087] 2. Use the public key A in the algorithm library to decrypt the ciphertext D to obtain the plaintext C, that is, C is the public key B + algorithm manufacturer information + encryption dog unique identifier UID;

[0088] 3. Verify the algorithm manufacturer information and the dongle’s unique identifier UID;

[0089] 4. The algorithm library generates a random number X and sends it to the dongle;

[0090] 5. The encryption dongle uses the private key B to encrypt the random number X to generate encrypted information E;

[0091] 6. The algorithm library uses the public key B obtained in 2 to decrypt the encrypted information E and obtain the random number Y;

[0092] 7. The algorithm library verifies the random number X and the random number Y. If the verification passes, the algorithm library authorization verification passes.

[0093] Example 6

[0094] This embodiment provides an algorithm library authorization device based on a dongle, and the device includes: one or more processors; a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors execute the method described in any of the technical solutions in Embodiment 1 or 3 above; or, the device is used to install the system described in any of the technical solutions in Embodiment 2 or 4.

[0095] In addition, this embodiment provides a storage medium storing a computer program, which, when executed by a processor, implements the method described in any of the technical solutions in Embodiments 1 or 3 above.

[0096] Figure 6 A schematic diagram of the structure of an algorithm library authorization device based on a dongle is provided in one embodiment of the present invention.

[0097] like Figure 6 As shown, as another aspect, the present application also provides a device 500, including one or more central processing units (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0098] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0099] In particular, according to the embodiments disclosed in the present application, the method described in any of the above embodiments can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing the method described in any of the above embodiments. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 509, and / or installed from a removable medium 511.

[0100] As another aspect, the present application further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus of the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the method described in the present application.

[0101] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs a specified function or operation, or can be realized by a combination of dedicated hardware and computer instructions.

[0102] The units or modules involved in the embodiments described in the present application may be implemented by software or by hardware. The units or modules described may also be arranged in a processor. For example, each of the units may be a software program arranged in a computer or a mobile smart device, or may be a separately configured hardware device. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0103] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0104] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0105] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0106] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0107] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0108] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0109] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0110] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the concept of the present application. For example, the above features are replaced with the technical features with similar functions disclosed in the present application (but not limited to) to form a technical solution.

Claims

1. An algorithm library authorization encryption method based on a dongle, executed by an algorithm manufacturer, characterized in that: include: S101. Obtain the public key B in the public and private key B randomly generated by the dongle; S102. Construct plaintext including public key B; S103. Obtain the private key A in the public and private key A generated by the algorithm manufacturer; S104. Encrypt the plaintext using private key A to generate encrypted information; S105. Write the encrypted information into the private memory area of ​​the dongle; Among them, the public key A is stored in the algorithm library.

2. The algorithm library authorization encryption method based on a dongle according to claim 1 is characterized in that: If the plain text further includes one or more of the algorithm manufacturer information and the dongle unique identifier UID, then before step S102, the process further includes: obtaining one or more of the algorithm manufacturer information and the dongle unique identifier UID.

3. The algorithm library authorization encryption method based on a dongle according to claim 1 is characterized in that: The encryption algorithm used by the public and private keys A generated by the algorithm manufacturer, and the encryption algorithm used by the public and private keys B randomly generated by the encryption dog, are one or more of the RSA algorithm, the ECC algorithm and the DSA algorithm.

4. An algorithm library authorization encryption system based on a dongle, located at the terminal where the algorithm manufacturer is located, characterized in that: include: A plaintext construction module, used to obtain the public key B in the public-private key B randomly generated by the dongle, and construct the plaintext including the public key B; The encryption module is used to obtain the private key A in the public and private keys A generated by the algorithm manufacturer, and encrypt the plain text using the private key A to generate encrypted information; The dongle storage module is used to write the encrypted information into the private memory area of ​​the dongle; The algorithm library storage module is used to obtain the public key A in the public and private keys A generated by the algorithm manufacturer, and store the public key A in the algorithm library.

5. The algorithm library authorization encryption system based on the dongle according to claim 4 is characterized in that: The plaintext construction module is also used to obtain one or more of the algorithm manufacturer information and the encryption dog unique identification UID, and construct a plaintext including the public key B and one or more of the algorithm manufacturer information and the encryption dog unique identification UID; the algorithm library storage module is also used to obtain the algorithm manufacturer information and store the algorithm manufacturer information in the algorithm library.

6. A dongle-based algorithm library authorization method, characterized in that: include: S201. Obtain the encryption information in the dongle; S202. Obtain the public key A stored in the algorithm library; S203. Decrypt the encrypted information using public key A to obtain plain text; S204. Obtain a random number X randomly generated by the algorithm library; S205. Obtain a random number Y obtained by decrypting the encrypted information of the random number X using the public key B in the plain text by the algorithm library; S206. Determine whether the random number X and the random number Y are consistent. If so, the verification is successful and the algorithm library authorization is obtained; if not, the verification fails and the execution algorithm library authorization is rejected; The encryption information of the random number X is obtained by encrypting the random number X using the private key B after the encryption dog receives a random number X randomly generated by the algorithm library.

7. The algorithm library authorization method based on a dongle according to claim 6 is characterized in that: If the plain text also includes one or more of the algorithm manufacturer information and the dongle unique identifier UID, it also includes: S213. Verify one or more of the algorithm manufacturer information and the dongle unique identifier UID. If the verification succeeds, continue with the random number verification. If the verification fails, the algorithm library authorization is rejected.

8. An algorithm library authorization system based on a dongle, characterized in that: include: The decryption module is used to obtain the encrypted information in the encryption dongle, obtain the public key A stored in the algorithm library, and use the public key A to decrypt the encrypted information to obtain the plain text; A random number acquisition module is used to obtain a random number X randomly generated by the algorithm library, and obtain a random number Y obtained by decrypting the encryption information of the random number X by the algorithm library using the public key B in plain text; wherein the encryption information of the random number X is obtained by encrypting the random number X by using the private key B after the encryption dongle receives the random number X randomly generated by the algorithm library; The random number verification module is used to determine whether the random number X and the random number Y are consistent. If so, the verification is successful and the algorithm library authorization is obtained; if not, the verification fails and the execution of the algorithm library authorization is rejected.

9. The algorithm library authorization system based on dongle according to claim 8, characterized in that: It also includes a plaintext verification module, which is used to verify one or more of the algorithm manufacturer information and the dongle unique identifier UID. If the verification is successful, the random number verification module continues to execute, and if the verification fails, the execution algorithm library authorization is rejected.

10. An algorithm library authorization device based on a dongle, characterized in that: Used to execute or store the method described in any one of claims 1-3, 6-7, or used to install the system described in any one of claims 4, 5, 8, and 9.