Method, device, and storage medium for determining algorithm type of secret key

By decoding the preset algorithm ID and labeling products in the encapsulated information, the algorithm type is determined, and the problem of low key compatibility under multiple algorithms is solved, and compatibility between different applications and upgrade support for key algorithms is achieved.

CN115549946BActive Publication Date: 2025-05-27ENTROPY CHAIN TECH (FUJIAN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210930777.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-04
Publication Date
2025-05-27
Estimated Expiration
2042-08-04

AI Technical Summary

Technical Problem

In the prior art, the key compatibility under multiple algorithms is low, resulting in the inability to recognize applications of different implementation methods and the inability to cope with scenarios such as key algorithm upgrades.

Method used

The encapsulated information containing the preset algorithm ID and standard key information is obtained through the child nodes, and decoded to obtain the preset algorithm ID and the label product. Finally, the corresponding algorithm type is determined based on the label product and the preset algorithm ID.

Benefits of technology

Compatibility between different asymmetric encryption algorithms is achieved, the problem of low key compatibility under multiple algorithms is solved, and the upgrade of key algorithms and efficient collaborative work between different applications is supported.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115549946B_ABST
    Figure CN115549946B_ABST
Patent Text Reader

Abstract

This application relates to the field of blockchain technology. This application provides a method, apparatus, device, and storage medium for determining the algorithm type of a key. The method obtains the encapsulation information of the key through the sub-node, where the encapsulation information includes a preset algorithm ID and standard key information; the sub-node decodes the encapsulation information based on the encapsulation algorithm to obtain the preset algorithm ID of the decoded information and the annotation product, and the annotation product is obtained by decoding the standard key information; the sub-node determines the corresponding algorithm type based on the annotation product and the preset algorithm ID. The key of the asymmetric encryption algorithm is encapsulated, so that the application can parse the unique ID of the asymmetric encryption algorithm in different scenarios and obtain the type of the encryption algorithm, solving the technical problem of low key compatibility under multiple existing algorithms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular, to a method, apparatus, device, and computer-readable storage medium for determining the algorithm type of a key. Background Art

[0002] With the development of Internet technology, people's lives are becoming increasingly inseparable from network technology. In today's network era, the Internet has become the main channel for transmitting various information such as files, photos, audio, and video. However, unsigned or unencrypted files can no longer meet people's needs for copyright protection and confidential information protection of Internet content, and the most effective solution is to digitally sign or encrypt the files. Encryption algorithms are the cornerstone of information security and trust maintenance in the blockchain, and digital encryption technology is the key to the application and development of blockchain technology. Once the encryption method is cracked, the data security of the blockchain will be challenged, and the immutability and digital assets of the blockchain will no longer exist.

[0003] In decentralized applications, it is necessary to rely on asymmetric encryption algorithms to complete the identification of the identities of all parties participating in the application. However, there are multiple implementation methods for asymmetric encryption algorithms. Different encryption algorithms are used in an application, and the generated key formats are different, which results in the inability of applications using different implementation methods to recognize each other. At the same time, only one fixed asymmetric encryption algorithm can be used in an application, and it cannot cope with scenarios such as key algorithm upgrades. Therefore, how to solve the problem of low key compatibility under multiple algorithms that cannot be solved currently has become an urgent technical problem to be solved. Summary of the Invention

[0004] The main purpose of the present invention is to provide a method, apparatus, device, and computer-readable storage medium for determining the algorithm type of a key, aiming to solve the technical problem of low key compatibility under multiple existing algorithms.

[0005] To achieve the above object, the present invention provides a method for determining the algorithm type of a key, and the method for determining the algorithm type of a key includes:

[0006] The child node obtains the encapsulation information of the key, where the encapsulation information includes a preset algorithm ID and standard key information;

[0007] The child node decodes the encapsulation information based on the encapsulation algorithm to obtain the preset algorithm ID and the annotation product of the decoded information, and the annotation product is decoded from the standard key information;

[0008] The child node determines the corresponding algorithm type based on the annotation product and the preset algorithm ID.

[0009] Further, before the step where the encapsulation information includes a preset algorithm ID and standard key information, the following steps are also included:

[0010] The master node receives task information from the control center and introduces a key encryption algorithm library from the intelligent contract virtual machine to determine the preset algorithm;

[0011] The master node generates an algorithm key based on the preset algorithm and obtains algorithm key information;

[0012] The master node registers the preset algorithm in the registration module, obtains the unique ID of the preset algorithm, and uses it as the preset algorithm ID.

[0013] Further, after the step where the master node registers the algorithm in the registration module, obtains the unique ID of the algorithm, and uses it as the preset algorithm ID, the following steps are also included:

[0014] The master node obtains the key information standard and adds a label to the algorithm key information based on the preset algorithm ID to obtain the labeled product;

[0015] Based on the encapsulation algorithm, the labeled product, and the preset algorithm ID, the master node generates the standard key information.

[0016] Further, the step where the master node registers the algorithm in the registration module, obtains the unique ID of the algorithm, and uses it as the preset algorithm ID includes:

[0017] The master node obtains the code library of the registration module from the control center, registers the preset algorithm based on the code library, and generates the preset algorithm ID.

[0018] Further, the master node obtains the key information standard and adds a label to the algorithm key information based on the preset algorithm ID to obtain the labeled product includes:

[0019] The master node obtains the key information standard from the control center and compares it with the category of the algorithm key information;

[0020] When the category of the algorithm key information is the same as the key information standard, the master node uses the algorithm key information as the labeled product based on the preset algorithm ID;

[0021] When the category of the algorithm key information is different from the key information standard, the master node adds a label to the algorithm key information based on the preset algorithm ID to obtain the labeled product.

[0022] Further, the standard key information includes signature implementation, encryption, signature verification, serialization, and deserialization, and the algorithm key information includes a public key and a signature.

[0023] In addition, to achieve the above object, the present invention further provides an apparatus for determining the algorithm type of a key, the apparatus comprising:

[0024] An acquisition module, configured to acquire, for the child node, the encapsulation information of the key, where the encapsulation information includes a preset algorithm ID and standard key information;

[0025] A decoding module, configured to decode, for the child node, the encapsulation information based on an encapsulation algorithm to obtain the preset algorithm ID of the decoded information and a labeled product, where the labeled product is obtained by decoding the standard key information;

[0026] A search module, configured to determine, for the child node, the corresponding algorithm type based on the labeled product and the preset algorithm ID.

[0027] Furthermore, the apparatus for determining the algorithm type of the key further comprises:

[0028] An ID generation module, configured to receive, for the master node, task information from a control center, introduce a key encryption algorithm library from a smart contract virtual machine to determine a preset algorithm; the master node generates an algorithm key based on the preset algorithm and obtains algorithm key information; the master node registers the preset algorithm in a registration module, obtains a unique ID of the preset algorithm, and uses it as the preset algorithm ID;

[0029] A standard key information generation module, configured to obtain, for the master node, a key information standard, add a label to the algorithm key information based on the preset algorithm ID to obtain the labeled product; based on the encapsulation algorithm, the labeled product, and the preset algorithm ID, the master node generates the standard key information.

[0030] In addition, to achieve the above object, the present invention further provides a device for determining the algorithm type of a key, the device for determining the algorithm type of a key comprising a processor, a memory, and a program for determining the algorithm type of a key stored on the memory and executable by the processor, where when the program for determining the algorithm type of a key is executed by the processor, the steps of the method for determining the algorithm type of a key as described above are implemented.

[0031] In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, on which a program for determining the algorithm type of a key is stored, where when the program for determining the algorithm type of a key is executed by a processor, the steps of the method for determining the algorithm type of a key as described above are implemented.

[0032] The present invention provides a method for determining the algorithm type of a key. The method obtains the encapsulation information of the key through the child node, where the encapsulation information includes a preset algorithm ID and standard key information; the child node decodes the encapsulation information based on the encapsulation algorithm to obtain the preset algorithm ID of the decoded information and the annotation product, and the annotation product is obtained by decoding the standard key information; the child node determines the corresponding algorithm type based on the annotation product and the preset algorithm ID. In the above manner, the present invention encapsulates the key of asymmetric encryption, and at the same time obtains the ID of the asymmetric encryption algorithm. Through this ID, other applications can parse different asymmetric encryption algorithms to obtain the types of encryption algorithms, solve the problem of low key compatibility under multiple algorithms, and achieve efficient collaborative work among various applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a schematic hardware structure diagram of a device for determining the algorithm type of a key involved in the solution of the embodiment of the present invention;

[0034] Figure 2 It is a schematic flowchart of the first embodiment of the method for determining the algorithm type of a key of the present invention;

[0035] Figure 3 It is a schematic diagram of the functional modules of the first embodiment of the device for determining the algorithm type of a key of the present invention.

[0036] The implementation, functional features and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0037] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0038] The method for determining the algorithm type of a key involved in the embodiment of the present invention is mainly applied to a device for determining the algorithm type of a key. The device for determining the algorithm type of a key can be a device with display and processing functions such as a PC, a portable computer, a mobile terminal, etc.

[0039] Refer to Figure 1 , Figure 1Schematic diagram of the hardware structure of the device for determining the algorithm type of the key involved in the embodiment of the present invention. In the embodiment of the present invention, the device for determining the algorithm type of the key may include a processor 1001 (such as a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components; the user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface); the memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory, and the memory 1005 may optionally also be a storage device independent of the aforementioned processor 1001.

[0040] Those skilled in the art can understand that Figure 1 the hardware structure shown in does not constitute a limitation on the device for determining the algorithm type of the key, and may include more or fewer components than shown, or combine some components, or arrange different components.

[0041] Continuing to refer to Figure 1 , Figure 1 the memory 1005, as a computer-readable storage medium, may include an operating system, a network communication module, and a program for determining the algorithm type of the key.

[0042] In Figure 1 , the network communication module is mainly used to connect to the server and communicate with the server for data; while the processor 1001 can call the program for determining the algorithm type of the key stored in the memory 1005 and execute the method for determining the algorithm type of the key provided by the embodiment of the present invention.

[0043] The embodiment of the present invention provides a method for determining the algorithm type of the key.

[0044] Referring to Figure 2 , Figure 2 is a schematic flowchart of the first embodiment of the method for determining the algorithm type of the key of the present invention.

[0045] In this embodiment, the method for determining the algorithm type of the key includes the following steps:

[0046] Step S10, the child node obtains the encapsulation information of the key, where the encapsulation information includes a preset algorithm ID and standard key information;

[0047] In this embodiment, the child node collects the encapsulation information published by the master node on the blockchain. These encapsulation information are generated by the encapsulation algorithm. In this encapsulation information, the key information has a unified format, which is not limited to the key setting formats of multiple types of asymmetric encryption algorithms. At the same time, each type of algorithm in the asymmetric encryption algorithm has a unique ID, which is generated through registration.

[0048] Specifically, when blockchain nodes are directly connected end-to-end based on P2P technology, an SSL (Secure Socket Layer) link can be used to achieve encrypted communication. For example, when blockchain node Node A needs to send a blockchain message to blockchain node Node B, a key negotiation can be performed between Node A and Node B based on the SSL protocol, so as to establish an SSL link between Node A and Node B based on the negotiated transmission key. Then, when the blockchain message is transmitted inside the SSL link, it is in ciphertext state (encrypted by the above-mentioned transmission key), and only Node A and Node B holding the transmission key can decrypt the corresponding message plaintext. However, when blockchain nodes communicate through a blockchain relay communication network, the situation is different. Assume that Node A is connected to relay node a in the blockchain relay communication network. Although an SSL link can be established between Node A and relay node a, so that the blockchain message is in ciphertext state when transmitted inside the SSL link, since the transmission key is negotiated between Node A and relay node a, the relay node a can decrypt the received message ciphertext through the transmission key, exposing the message plaintext to the blockchain relay communication network. Through the above method, the security of the key can be enhanced, and at the same time, the child node can identify the key acquisition information.

[0049] Step S20, the child node decodes the encapsulation information based on the encapsulation algorithm to obtain the preset algorithm ID of the decoded information and the annotation product, and the annotation product is decoded from the standard key information;

[0050] In this embodiment, the preset algorithm ID and the standard key information are obtained by decoding the encapsulation information. Among them, the standard key information is further decoded to obtain the annotation product, and the child node can continue to search for the types of asymmetric encryption algorithms adopted by the master node based on the self-description information in the annotation product.

[0051] Specifically, decoding is the process by which the recipient restores the received symbols or codes into information, corresponding to the encoding process. Decoding refers to the process by which the recipient restores the received symbols or codes into information, corresponding to the encoding process. The blockchain relay communication network can be applied to various types of blockchain networks, including public blockchains, private blockchains, and consortium blockchains, etc. For example, the blockchain relay communication networks applied to public blockchains mainly include Falcon, Fast Bitcoin Relay Network (FBRN), Fast Internet Bitcoin Relay Engine (FIBRE), etc., while the blockchain relay communication networks applied to consortium blockchains mainly include BloXRoute, Blockchain Transmission Network (BTN), etc. This specification does not limit the blockchain relay communication network adopted.

[0052] It can be understood that the key encapsulation operation mode is the latest type of block cipher operation mode formulated by NIST. The key encapsulation mode uses AES or three types of DES as the underlying encryption algorithm. Usually, a protocol needs to call keys at different levels. Among them, the low-level keys are used frequently, and in order to resist attacks, they need to be changed frequently. While the high-level keys are used less frequently and are relatively less threatened by cryptographic attacks. High-level keys are usually used to encrypt newly created low-level keys for the exchange of low-level keys between communication parties that already share high-level keys. The key encapsulation adopts a new operation mode, and its purpose is to be used for encryption algorithms where the key length is longer than the block length. For example, the block length of the AES algorithm is 128 bits, but the key length can be 128 bits, 192 bits, or 256 bits. For the latter two key lengths, encrypting the key requires multiple blocks to complete. Note that the importance of key data is higher than that of other data because the key will be used multiple times, and the leakage of the key means the leakage of all data encrypted with this key. At the same time, the key encapsulation mode is robust because in the key encapsulation mode, the value of each output bit is randomly affected by the value of each input bit. Since the encapsulated key has a unified standard and encrypts information based on the encapsulation algorithm, querying the encryption algorithm used by the master node through the decoding method ensures the integrity of the encrypted information.

[0053] Step S30, the sub-node determines the corresponding algorithm type based on the annotation product and the preset algorithm ID.

[0054] In this embodiment, the annotation product contains the self-description information of the master node key, and a unique algorithm corresponds to a unique ID, so that an algorithm ID can be mapped to the self-description information of a key.

[0055] It is understandable that key management includes all aspects from key generation to key destruction. It is mainly manifested in the management system, management protocol, and key generation, distribution, replacement, and injection. When using a specific wrapper class to wrap the algorithm implementation and performing related operations on the asymmetric key using the wrapper class, the wrapper class will use the unique id of the registration module to add annotations to the ciphertext, public key, signature, and other products generated by the algorithm, which can indicate the encryption algorithm adopted by the node itself and facilitate key information management.

[0056] Based on the above Figure 2 In the illustrated embodiment, before the step S10, the following steps are further included:

[0057] The master node receives task information from the control center and introduces a key encryption algorithm library from the intelligent contract virtual machine to determine a preset algorithm;

[0058] The master node generates an algorithm key based on the preset algorithm and obtains algorithm key information;

[0059] The master node registers the preset algorithm in the registration module, obtains the unique ID of the preset algorithm, and uses it as the preset algorithm ID.

[0060] In this embodiment, an encryption algorithm library is imported on the virtual machine, and the encryption algorithm is used according to the task requirements to generate the corresponding key of the encryption algorithm.

[0061] Specifically, the asymmetric encryption algorithm is a method for keeping keys secret. The asymmetric encryption algorithm requires two keys: a public key and a private key. The public key and the private key are a pair. If the data is encrypted with the public key, only the corresponding private key can decrypt it; if the data is encrypted with the private key, then only the corresponding public key can decrypt it. Because different keys are used for encryption and decryption, this algorithm is called an asymmetric encryption algorithm. The asymmetric encryption algorithm can include RSA, DSA (Digital Signature Algorithm), and ECDSA (Elliptic Curve Digital Signature Algorithm). The asymmetric encryption algorithm has good confidentiality and eliminates the need for end-users to exchange keys at the same time.

[0062] Further, after the step that the master node registers the algorithm in the registration module and obtains the unique ID of the algorithm as the preset algorithm ID, the following steps are further included:

[0063] The master node obtains a key information standard and adds an annotation to the algorithm key information based on the preset algorithm ID to obtain the annotated product;

[0064] Based on the packaging algorithm, the labeled product, and the preset algorithm ID, the master node generates the standard key information.

[0065] In this embodiment, the key is encapsulated at one layer so that different encryption algorithms all implement the same standard, and self-descriptive information is added to the generated public key, private key, signature, etc., indicating the algorithm adopted by itself.

[0066] Specifically, a decentralized application (Dapp) generally refers to an application that runs on a distributed network, where the information of participants is securely protected (it may also be anonymous), and different people on the network nodes perform decentralized operations. It is a transaction protocol that executes a contract or a set of contracts according to the conditions set on the blockchain. By generating a standard and unified key data form, it can help different application nodes to be able to read the key information and work collaboratively. To ensure the security of keys in network applications, different types of keys need to play different roles in a confidentiality system. For example, the session key is used to encrypt the communication data information, and the key encryption key is used to encrypt the session key. Classified from the differences in key systems, keys include symmetric encryption and asymmetric keys. Classified from the role: session key (which refers to the key used to encrypt user data during communication or data exchange. The session key is often only valid for the current session or valid for a short period); key encryption key (which refers to the key used to encrypt the key (session key), that is, the session key used to encrypt user data); master key (which is a long-term shared secret key between a pair of users, and it often serves as the seed for generating the session key and the key encryption key to realize the distribution and security protection of these keys). Hierarchical keys have the advantages of the generation and management of the security keys of the cryptosystem. By generating a standard and unified key data form, it can help different application nodes to be able to read the key information and work collaboratively.

[0067] Based on the above embodiment, in this embodiment, the steps for the master node to register the algorithm in the registration module and obtain the unique ID of the algorithm as the preset algorithm ID include:

[0068] The master node obtains the code library of the registration module from the control center, registers the preset algorithm based on the code library, and generates the preset algorithm ID.

[0069] In this embodiment, registering the preset algorithm on the code library, obtaining the unique ID of the preset algorithm, and converting the algorithm name into an array.

[0070] Specifically, corresponding the algorithm to the array, changing the algorithm name, generating the array simply and quickly, and having strong practicability.

[0071] Furthermore, the master node obtains the key information standard, and adds annotations to the algorithm key information based on the preset algorithm ID, and obtains the annotation product including:

[0072] The master node obtains the key information standard from the control center and compares it with the category of the algorithm key information;

[0073] When the category of the algorithm key information and the key information standard are the same, based on the preset algorithm ID, the master node uses the algorithm key information as the marked product;

[0074] When the category and key information standard of the algorithm key information are different, based on the preset algorithm ID, the master node adds a label to the algorithm key information to obtain the label product.

[0075] In a specific embodiment, self-descriptive information is added to the signature, ciphertext, etc. generated by the key to indicate the algorithm used so that the receiver can use the corresponding algorithm for parsing, thereby achieving compatibility with multiple encryption algorithms.

[0076] Furthermore, the standard key information includes implementation of signing, encryption, signature verification, serialization and deserialization, and the algorithm key information includes a public key and a signature.

[0077] It can be understood that by obtaining the on-chain node identity public key of the target blockchain node, and using the on-chain node identity public key to encrypt the symmetric key to be distributed based on an asymmetric encryption algorithm, thereby generating the corresponding key ciphertext, the key form is made more structured and easier to manage.

[0078] In addition, an embodiment of the present invention also provides a device for determining the algorithm type of a key.

[0079] Reference Figure 3 , Figure 3 This is a functional module diagram of the first embodiment of the device for determining the algorithm type of a key according to the present invention.

[0080] In this embodiment, the key algorithm type determination device includes:

[0081] An acquisition module 10, configured for the subnode to acquire encapsulation information of a key, wherein the encapsulation information includes a preset algorithm ID and standard key information;

[0082] A decoding module 20, configured for the subnode to decode the encapsulation information based on an encapsulation algorithm to obtain the preset algorithm ID and annotated product of the decoded information, wherein the annotated product is obtained by decoding the standard key information;

[0083] A search module 30, configured for the child node to determine the corresponding algorithm type based on the labeled product and a preset algorithm ID.

[0084] Further, the apparatus for determining the algorithm type of the key further includes:

[0085] An ID generation module, configured for the master node to receive task information from a control center, introduce a key encryption algorithm library from a smart contract virtual machine to determine a preset algorithm; the master node generates an algorithm key based on the preset algorithm and obtains algorithm key information; the master node registers the preset algorithm in a registration module, obtains a unique ID of the preset algorithm, and uses it as the preset algorithm ID;

[0086] A standard key information generation module, configured for the master node to obtain a key information standard, add a label to the algorithm key information based on the preset algorithm ID to obtain the labeled product; based on the encapsulation algorithm, the labeled product, and the preset algorithm ID, the master node generates the standard key information.

[0087] Further, the ID generation module further includes:

[0088] A registration unit, configured for the master node to obtain a code library of a registration module from the control center, register the preset algorithm based on the code library, and generate the preset algorithm ID.

[0089] Further, the standard key information generation module further includes:

[0090] A labeling unit, configured for the master node to obtain the key information standard from the control center and compare it with the category of the algorithm key information; when the category of the algorithm key information is the same as the key information standard, the master node uses the algorithm key information as the labeled product based on the preset algorithm ID; when the category of the algorithm key information is different from the key information standard, the master node adds a label to the algorithm key information based on the preset algorithm ID to obtain the labeled product.

[0091] Further, an apparatus for determining the algorithm type of a key further includes that the standard key information includes signature implementation, encryption, signature verification, serialization, and deserialization, and the algorithm key information includes a public key and a signature.

[0092] Wherein, each module in the above apparatus for determining the algorithm type of the key corresponds to each step in the embodiment of the method for determining the algorithm type of the key, and its functions and implementation processes will not be elaborated here one by one.

[0093] In addition, an embodiment of the present invention further provides a computer-readable storage medium.

[0094] A program for determining the algorithm type of a key is stored on a computer-readable storage medium of the present invention. When the program for determining the algorithm type of the key is executed by a processor, the steps of the method for determining the algorithm type of the key as described above are implemented.

[0095] Among them, the method implemented when the program for determining the algorithm type of the key is executed can refer to each embodiment of the method for determining the algorithm type of the key of the present invention, which will not be elaborated here.

[0096] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or system including the element.

[0097] The serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.

[0098] This application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This application can also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0099] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present invention.

[0100] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A method for determining the algorithm type of a key, characterized in that, the method for determining the algorithm type of the key is applied to a blockchain, and the blockchain includes a main node and sub-nodes, and specifically includes the following steps: The sub-node obtains the encapsulation information of the key, where the encapsulation information includes a preset algorithm ID and standard key information; The sub-node decodes the encapsulation information based on the encapsulation algorithm to obtain the preset algorithm ID of the decoded information and the annotation product, and the annotation product is obtained by decoding the standard key information; Obtaining the annotation product includes: The main node obtains the key information standard from the control center and compares it with the category of the algorithm key information; When the category of the algorithm key information is the same as the key information standard, based on the preset algorithm ID, the main node uses the algorithm key information as the annotation product; When the category of the algorithm key information is different from the key information standard, based on the preset algorithm ID, the main node adds an annotation to the algorithm key information to obtain the annotation product; The sub-node determines the corresponding algorithm type based on the annotation product and the preset algorithm ID.

2. The method for determining the algorithm type of a key according to claim 1, characterized in that, before the step that the sub-node obtains the encapsulation information of the key, where the encapsulation information includes a preset algorithm ID and standard key information, it further includes: The main node receives task information from the control center and introduces a key encryption algorithm library from the smart contract virtual machine to determine a preset algorithm; The main node generates an algorithm key based on the preset algorithm and obtains algorithm key information; The main node registers the preset algorithm in the registration module and obtains the unique ID of the preset algorithm as the preset algorithm ID.

3. The method for determining the algorithm type of a key according to claim 2, characterized in that, after the step that the main node registers the preset algorithm in the registration module and obtains the unique ID of the preset algorithm as the preset algorithm ID, it further includes: The main node obtains the key information standard and adds an annotation to the algorithm key information based on the preset algorithm ID to obtain the annotation product; Based on the encapsulation algorithm, the annotation product and the preset algorithm ID, the main node generates the standard key information.

4. The method for determining the algorithm type of a key according to claim 2, characterized in that, the step that the main node registers the preset algorithm in the registration module and obtains the unique ID of the preset algorithm as the preset algorithm ID includes: The main node obtains the code library of the registration module from the control center, registers the preset algorithm based on the code library, and generates the preset algorithm ID.

5. The method for determining the algorithm type of a key according to any one of claims 1-3, characterized in that, the standard key information includes implementing signature, encryption, signature verification, serialization and deserialization, and the algorithm key information includes a public key and a signature.

6. A device for determining the algorithm type of a key, characterized in that, The device for determining the algorithm type of the key includes a processor, a memory, and a program for determining the algorithm type of the key stored on the memory and executable by the processor. When the program for determining the algorithm type of the key is executed by the processor, the steps of the method for determining the algorithm type of the key according to any one of claims 1 to 5 are implemented.

7. A computer-readable storage medium, characterized in that a program for determining the algorithm type of the key is stored on the computer-readable storage medium. When the program for determining the algorithm type of the key is executed by a processor, the steps of the method for determining the algorithm type of the key according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Data processing method and device and medium

    CN110912920A

  • BFT consensus algorithm hot plug switching system

    CN112068900A