Quantum cryptographic operation method, storage medium and PQC password card
By decoupling the functional units of the cryptographic operation core group in the cryptographic card, executing the algorithm independently and storing it in DDR, the problem of low efficiency in the existing technology is solved, and efficient quantum cryptographic operation is realized.
Patent Information
- Application Number
- CN202411033693.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2026-02-06
AI Technical Summary
The existing cryptographic card has multiple functional modules running in a bundled manner, resulting in low efficiency and the inability to execute different algorithms efficiently.
The three functional units of the cryptographic operation core are decoupled, each executing one of the three types of algorithms, and the inputs and outputs are stored in DDR. Each unit operates independently.
It improves operational efficiency, enabling multiple functional modules to run different algorithms simultaneously, thus meeting the needs of different users.
Smart Images

Figure CN121485907A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of password cards, in particular to a quantum password operation method, a storage medium and a PQC password card. BACKGROUND
[0002] Information security is a comprehensive cross-science field, which is widely related to mathematics, cryptography, computers, communications, control, artificial intelligence, security engineering, humanities and many other disciplines, and is a hot discipline field rapidly developed in recent years. With the development of information technology, people enjoy the huge benefits brought by information resources, but also face the severe test of information security. The security problem of information is increasingly prominent, and various security applications based on the principle of cryptography are becoming more and more widespread. Data encryption has penetrated into every corner of information application. So far, cryptography is the most effective method to achieve information security, and is the core technology of information security. Through data encryption, people can effectively ensure that the content on the communication line is not leaked, and can also verify the integrity of the transmitted information.
[0003] However, with the rapid development of quantum computer technology, traditional password technology will no longer have unbreakable nature, and quantum computers can easily crack traditional passwords. In order to cope with this crisis, cryptography has emerged as a new research direction: post-quantum cryptography (PQC, Post Quantum Cryptography), as the name implies, the password used after the quantum computer is a password that can resist quantum computer cracking. At present, there are many password card products on the market, which use multiple functional modules to execute algorithms to realize the process of key pair generation, password packaging and password unpacking. However, multiple functional modules are associated with each other in the process of running algorithms and need to be bound for execution, such as the working form of pipeline, which is low in efficiency. SUMMARY
[0004] The purpose of the present application is to provide a quantum password operation method, a storage medium and a PQC password card, which are used to solve the problem of binding operation of functional modules running algorithms in the prior art password card, decouple the modules running different algorithms, and improve the running efficiency.
[0005] The first aspect of the present application provides a quantum password operation method applied to a password operation core group in a PQC password card, wherein the PQC password card further comprises a DDR in communication connection with the password operation core group, and the method comprises the following steps:
[0006] performing operation to generate a public key and a corresponding private key according to the obtained fixed-length random number sequences, and storing the public key and the corresponding private key in the DDR; wherein the public key is used for user to view;
[0007] acquire the public key and first information from the DDR, perform operation and generate first signature information and package key, and store the first signature information to the DDR; wherein the first information is information to be encrypted, and the first signature information is a password for encrypting the first information;
[0008] acquire the private key and the first signature information from the DDR, perform operation and generate unpackage key; wherein the key is used for decrypting the encrypted first information.
[0009] The method described above, optionally, the PQC cryptographic card further comprises a data processing module in communication connection with the cryptographic operation core group, before generating the public key and the corresponding private key and storing them into the DDR according to the received fixed-length random number sequence, the method further comprises:
[0010] The data processing module sends a configuration instruction to the cryptographic operation core group;
[0011] The cryptographic operation core group configures the working mode and the security level in response to the configuration instruction.
[0012] The method described above, optionally, the data processing module sends a configuration instruction to the cryptographic operation core group, comprising:
[0013] The data processing module acquires the working state of the cryptographic operation core group through register access;
[0014] The data processing module sends the configuration instruction to the cryptographic operation core group through the register when the working state of the cryptographic operation core group is an idle state.
[0015] The method described above, optionally, the cryptographic operation core group and the DDR are in communication connection through a DMA controller, performing operation according to the public key and the first information to generate first signature information and package key, and storing the first signature information and the package key to the DDR, comprising:
[0016] The data processing module receives the public key and the first information sent by the user and stores them into the DDR;
[0017] The cryptographic operation core group acquires the public key and the first information from the DDR to perform operation and generate first signature information and package key when the DMA controller is in an open state;
[0018] The cryptographic operation core group stores the first signature information and the package key to the DDR when the DMA controller is in an open state.
[0019] The method as described above, optionally, the operation is performed according to the obtained fixed-length random number sequence to generate the public key and the corresponding private key and store in the DDR, comprising:
[0020] In the DMA controller is enabled state, the fixed-length random number sequence is obtained from the DDR to perform operation to generate the public key and the corresponding private key;
[0021] In the DMA controller is enabled state, the public key and the corresponding private key are stored in the DDR.
[0022] The method as described above, optionally, the operation is performed according to the obtained fixed-length random number sequence to generate the public key and the corresponding private key and store in the DDR, comprising:
[0023] According to a plurality of random number sequences, the public key and the corresponding first sub-private key are generated;
[0024] The first sub-private key is transformed by H function to generate the private key, wherein the H function includes the security level and the preset fixed constant.
[0025] The method as described above, optionally, the operation is performed according to the public key and the first information to generate the first signature information and the encapsulation key, comprising:
[0026] The first information is transformed by H function to obtain the second information;
[0027] The public key and the second information are transformed by G function to obtain the first signature information and the encapsulation key; wherein the G function transformation includes the security level and the preset fixed constant.
[0028] The method as described above, optionally, the operation is performed according to the private key and the first signature information to generate the decryption key, comprising:
[0029] The private key is separated to obtain the first sub-public key, the second sub-public key and the first parameter;
[0030] The operation is performed according to the first signature information and the private key to obtain the second information;
[0031] The second information and the second sub-public key are transformed by G function to obtain the second parameter;
[0032] The operation is performed according to the first sub-public key, the second information and the second parameter to obtain the decryption key.
[0033] The second aspect of the application provides a computer readable storage medium, the computer readable storage medium stores a computer program, the computer program is executed by the processor to realize the method of any one of the first aspect.
[0034] The third aspect of the present application provides a PQC cryptographic card, which performs quantum cryptographic operation by using the method of any one of the first aspect.
[0035] Compared with the prior art, the present application performs the steps of three types of algorithms by three functional units of the cryptographic operation core group respectively, and decouples the three functional units, so that the algorithms running in the three functional units can be controlled respectively, the input and output of each type of algorithm are stored in the DDR, and the input data can be read from the DDR when one of the functional units needs to perform an algorithm. In this way, different algorithms can be run in each functional unit, so that the three functions under the original pipeline can be performed simultaneously, and the running efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 A composition diagram of a cryptographic operation system provided for the embodiment Figure 1 ;
[0037] Figure 2 A flowchart of a quantum cryptographic operation method provided for the embodiment
[0038] Figure 3 A composition diagram of a cryptographic operation system provided for the embodiment Figure 2 ;
[0039] Figure 4 A flowchart of a cryptographic operation core group configuration provided for the embodiment
[0040] Figure 5 A flowchart of a data processing module sending a configuration instruction provided for the embodiment
[0041] Figure 6 A flowchart of generating a first signature information and an encapsulation key provided for the embodiment
[0042] Figure 7 A flowchart of generating a public key and a corresponding private key provided for the embodiment
[0043] Figure 8 A flowchart of performing operation and generating a decryption key according to a private key and a first signature information provided for the embodiment. DETAILED DESCRIPTION
[0044] The following detailed description is merely illustrative and is not intended to limit embodiments and / or the application or uses of embodiments. Furthermore, there is no intention to be bound by any expressed or implied information presented in the preceding "BACKGROUND" or "SUMMARY" sections or the "DETAILED DESCRIPTION".
[0045] For the purposes of this disclosure, one or more embodiments are now described with reference to the attached figures, wherein like reference numerals are used to refer to like elements throughout. In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a more thorough understanding of one or more embodiments. It is evident, however, that one or more embodiments can be practiced without these specific details, in various instances, and that one or more embodiments can include one or more of the features, structures, methods, concepts, and / or functions described in this disclosure without limitation.
[0046] It should be noted that the terms "first", "second", and the like, in the description and in the claims of this application as well as in the above description of the drawings merely mean different instances of similar objects, and do not necessarily imply a specific order or chronology. It is understood that the data thus designated can be interchanged, where appropriate, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. Furthermore, the terms "comprise" and "have", as well as any variations thereof, are intended to cover non-exclusive inclusions, for example, processes, methods, systems, products, or devices that comprise a list of steps or units do not necessarily have to be limited to those steps or units expressly listed, but can include other steps or units not expressly listed or inherent to such processes, methods, products, or devices.
[0047] The cryptographic operation system of the embodiment is applied to a PQC cryptographic card, and runs quantum cryptographic operations. The cryptographic operation system uses a chip as a core chip to run quantum cryptographic operations, such as a ZYNQ chip, and sets corresponding functional modules in the chip to perform operations. In addition, a DDR (Double Data Rate) for storage is set outside the chip. The quantum cryptographic operations include quantum cryptographic encryption operations and quantum cryptographic decryption operations. The quantum cryptographic encryption operations are used by a user to encrypt information through a key, and the quantum cryptographic decryption operations are used to decrypt the encrypted information.
[0048] As shown in the accompanying Figure 1 The cryptographic operation system of the embodiment is applied to a PQC cryptographic card, and runs quantum cryptographic operations. The cryptographic operation system uses a chip as a core chip to run quantum cryptographic operations, such as a ZYNQ chip, and sets corresponding functional modules in the chip to perform operations. In addition, a DDR (Double Data Rate) for storage is set outside the chip. The quantum cryptographic operations include quantum cryptographic encryption operations and quantum cryptographic decryption operations. The quantum cryptographic encryption operations are used by a user to encrypt information through a key, and the quantum cryptographic decryption operations are used to decrypt the encrypted information. The cryptographic operation system of the embodiment is applied to a PQC cryptographic card, and runs quantum cryptographic operations. The cryptographic operation system uses a chip as a core chip to run quantum cryptographic operations, such as a ZYNQ chip, and sets corresponding functional modules in the chip to perform operations. In addition, a DDR (Double Data Rate) for storage is set outside the chip. The quantum cryptographic operations include quantum cryptographic encryption operations and quantum cryptographic decryption operations. The quantum cryptographic encryption operations are used by a user to encrypt information through a key, and the quantum cryptographic decryption operations are used to decrypt the encrypted information.
[0049] The data processing module is used to acquire several sets of random number sequences and user-preset operation parameters. The random number sequences are used by the cryptographic operation core group to perform quantum cryptographic operations, while the preset operation parameters are used to configure the cryptographic operation core group. The corresponding operation parameters are set according to different user needs, and the cryptographic operation core group is configured according to the operation parameters to perform quantum cryptographic operations that meet the user's needs.
[0050] There can be multiple cryptographic core groups, using one algorithm to perform quantum cryptographic operations, or using different algorithms for each. For example, the multiple cryptographic core groups include a first cryptographic core group and a second cryptographic core group, which run different algorithms; each of the first and second cryptographic core groups contains multiple operation cores.
[0051] For example, the first cryptographic core group is used to process the Kyber algorithm, and the second cryptographic core group is used to process the Dilithium algorithm. Both the Kyber and Dilithium algorithms are NIST post-quantum cryptography algorithms used for key encapsulation and key negotiation, and are used in many network security and encryption applications. Using two cryptographic core groups to perform quantum cryptographic operations improves the level of security.
[0052] based on Figure 1 cryptographic systems, such as Figure 2 As shown, this embodiment provides a quantum cryptography method applied to a cryptographic core group in a PQC cryptographic card. The PQC cryptographic card also includes a DDR that is communicatively connected to the cryptographic core group. The method includes the following steps.
[0053] Step S10: Perform operations based on the obtained fixed-length random number sequences to generate a public key and a corresponding private key, and store them in DDR; wherein, the public key is used for users to view.
[0054] Step S20: Obtain the public key and the first information from the DDR, perform the operation and generate the first signature information and the encapsulation key, and store the first signature information in the DDR; wherein, the first information is the information to be encrypted, and the first signature information is the password for encrypting the first information.
[0055] Step S30: Obtain the private key and the first signature information from the DDR, perform the operation, and generate the decryption key; wherein, the decryption key is used to decrypt the encrypted first information.
[0056] As attached Figure 3As shown, when the first algorithm processing module is integrated in the cryptographic operation core group in the implementation, the Kyber algorithm is run for encryption and decryption; the algorithm modules therein include: a first key pair generation unit, a key encapsulation unit, and a key decapsulation unit. Specifically, the first key pair generation unit is configured to perform the step S10 to realize the function of key pair generation; the key encapsulation unit is configured to perform the step S20 to realize the function of key encapsulation; and the key decapsulation unit is configured to perform the step S30 to realize the decryption function of the first information.
[0057] The process of quantum cryptographic operation performed by the three functional units in the cryptographic operation core group is as follows: the first key pair generation unit needs to read two groups of random number sequences, such as a fixed-length random number sequence d and a random number sequence z, through DDR when working, and generates a public key pk and a private key sk after internal operation. pk and sk are outputs of the operation performed by the first key pair generation unit, and are written into the storage space of a specific address of DDR by DMA in the DMA access mode for address access by the data processing module. pk is the non-secret part of the key pair for users to view; and sk is the secret part of the key pair, which is locally saved (stored in DDR) and not viewed by users.
[0058] The key encapsulation unit needs to input the public key pk and the information m (i.e., the first information, which is the information to be encrypted) when working, and generates c (the first signature information) and K1 (the encapsulation key) after internal operation. c and K1 are outputs of the operation performed by the key encapsulation unit, and are written into the storage space of a specific address of DDR by DMA in the DMA access mode for address access by the data processing module. The information m is the information to be encrypted; the public key pk is the public part of the key pair; c is an encrypted password for users to view; and K1 is the encapsulation key, which cannot be viewed by users in this process and is locally saved for verification of the key decapsulation unit.
[0059] The key decapsulation unit needs to input c (the first signature information) and the private key sk when working, and generates K2 (the decapsulation key) after internal operation. K2 is an output of the operation performed by the key decapsulation unit, and is written into the storage space of a specific address of DDR by DMA in the DMA access mode for address access by the data processing module. Users obtain K2 (the decapsulation key) through c and the saved sk to decrypt the ciphertext. If the input is problematic, a false K2 is obtained to confuse attackers.
[0060] Further, when the second algorithm processing module is integrated in the cryptographic operation core group, and the Dilithium algorithm is run for encryption and verification, the algorithm modules in the cryptographic operation core group include: a second key pair generation unit, a key signature unit, and a key verification unit. Specifically, the second key pair generation unit is configured to perform the step S10 to realize the function of key pair generation; the key signature unit is configured to perform the step S20 to realize the function of key signature; and the key verification unit is configured to perform the step S30 to realize the function of verifying the first information.
[0061] The process of executing quantum cryptographic operation by the three functional units in the cryptographic operation core group is as follows: when the second key pair generation unit is working, it needs to read a sequence of random numbers, such as a sequence of random numbers ζ of a fixed length, from the DDR, and generate a public key pk and a private key sk after internal operation. The pk and the sk are outputs of the operation performed by the second key pair generation unit, and are written into the storage space of the specific address of the DDR by the DMA in the DMA access mode, so as to be accessed by the data processing module according to the address.
[0062] When the key signature unit is working, it needs to input the private key sk and the information m (i.e., the first information, which is the information to be encrypted), and generate a signature σ (i.e., the first signature information) after internal operation; the σ is an output of the operation performed by the key signature unit, and is written into the storage space of the specific address of the DDR by the DMA in the DMA access mode, so as to be accessed by the data processing module according to the address. The user inputs the personal private key sk and the information m, and the generated signature σ is the encrypted information, which is for the user.
[0063] When the key verification unit is working, the algorithm needs to input the public key, the signature σ, the public key pk, and the information m, and generate a decryption key after internal operation, and compare the generated decryption key with the input key to verify whether the signature is true; the result of verifying the signature is accessed and queried by the data processing module according to the register address, and the user can verify the authenticity of the signature by the algorithm.
[0064] Compared with the prior art, the three functional units of the cryptographic operation core group execute three types of algorithms respectively, and are decoupled, so that the three functional units can be controlled respectively, the input and output of each type of algorithm are stored in the DDR, and the input data can be read from the DDR when one of the functional units needs to execute the algorithm. In this way, each algorithm core group can be in a different algorithm, so that the three functions in the original pipeline can be performed simultaneously, and the running efficiency is improved.
[0065] The cryptographic operation core group and the data processing module are in communication connection through a register bus in the chip, receive a configuration instruction sent by the data processing module, and configure a working mode and a security level in response to the configuration instruction, configure accordingly according to different needs of a user, meet different quantum cryptographic operation needs, read input data required by a task through access to a DDR after configuration is completed, and execute quantum cryptographic operation. The quantum cryptographic operation method of the application can meet different user needs.
[0066] As shown in Figure 1 and Figure 3 , the PQC cryptographic card further includes a data processing module in communication connection with the cryptographic operation core group, as shown in Figure 4 , before generating a public key and a corresponding private key by performing operation according to a received fixed-length random number sequence and storing in a DDR, the method of the application further includes the following steps.
[0067] Step S11: The data processing module sends a configuration instruction to the cryptographic operation core group.
[0068] Step S12: The cryptographic operation core group configures a working mode and a security level in response to the configuration instruction.
[0069] In the embodiment, the cryptographic operation core group needs to configure a corresponding working mode and operation security level according to different user needs when performing quantum cryptographic operation. Specifically, the operation security level is the security level of the mode in which the cryptographic operation core group runs, for example, divided into three levels (lv2, lv3, lv4), the security level will affect the data volume of input and output of each unit in the cryptographic operation core group described above, and needs to be configured by a user. The data processing module will issue the operation security level to the cryptographic operation core group through a register before starting the working mode of the cryptographic operation core group. The working mode needs to be configured by a user, and the cryptographic operation core group is configured through a register to configure its internal units. A data processing module can only be in one mode at the same time, and can be reconfigured after the mode is completed.
[0070] Therefore, when the cryptographic operation system performs quantum cryptographic operation, the data processing module first accepts the quantum cryptographic operation needs of a user, then determines the working mode and operation security level of the cryptographic operation core group for each operation according to the needs, and sends them to the cryptographic operation core group in the form of a configuration instruction through a register.
[0071] After the data processing module sends the configuration instruction to the cryptographic operation core group through a register, the cryptographic operation core group configures the working mode and the security level in the configuration instruction, and can perform specific quantum cryptographic operation according to received input data after configuration is completed.
[0072] As shown in Figure 5As shown, the data processing module sends the configuration instruction to the cryptographic operation core group, including the following steps.
[0073] Step S110: The data processing module obtains the working state of the cryptographic operation core group through register access.
[0074] Step S111: The data processing module sends the configuration instruction to the cryptographic operation core group through the register when the working state of the cryptographic operation core group is the idle state.
[0075] In this embodiment, the number of cryptographic operation core groups can be multiple, and multiple cryptographic operation core groups perform multiple quantum cryptographic operation tasks in parallel. Before the data processing module receives the quantum cryptographic operation task to be executed and issues it to the cryptographic operation core group, the working state of the cryptographic operation core group is obtained through register access to determine whether the cryptographic operation core group is currently in the working state or the idle state, and the configuration instruction is sent through the register when the working state of the cryptographic operation core group is the idle state.
[0076] The working state of the cryptographic operation core group is the state of reading the random number sequence from the DDR and performing the quantum cryptographic operation; when the cryptographic operation core group does not perform the quantum cryptographic operation, or the quantum cryptographic operation has been performed and the key generated by the operation is stored to the DDR, its working state is the idle state, and the next quantum cryptographic operation task can be performed. The configuration instruction is sent according to the obtained working state to control the cryptographic operation core group to perform the quantum cryptographic operation task, avoid quantum cryptographic task conflicts, and improve the execution efficiency.
[0077] As shown in the figure, Figure 3 The cryptographic operation core group and the DDR are connected in communication through the DMA controller, which has the characteristics of program interruption mode, so the above-mentioned quantum cryptographic operation method further includes: the data processing module obtains whether the DMA controller is turned on through register access. Since the DMA mode transmits data without passing through the CPU, it is not necessary to interrupt the current program, the I / O and the host work in parallel, the program and the transmission work in parallel, and it is suitable for the transmission of large quantities of data of high-speed devices. The use of the DMA controller can speed up the data transmission between the DDR and the data processing module, improving the system efficiency. The DMA needs to be preprocessed through the program before transmission starts and needs to be post-processed through the interruption mode after the end.
[0078] As shown in the figure, Figure 6 The cryptographic operation core group and the DDR are connected in communication through the DMA controller, which has the characteristics of program interruption mode, so the above-mentioned quantum cryptographic operation method further includes: the data processing module obtains whether the DMA controller is turned on through register access. Since the DMA mode transmits data without passing through the CPU, it is not necessary to interrupt the current program, the I / O and the host work in parallel, the program and the transmission work in parallel, and it is suitable for the transmission of large quantities of data of high-speed devices. The use of the DMA controller can speed up the data transmission between the DDR and the data processing module, improving the system efficiency. The DMA needs to be preprocessed through the program before transmission starts and needs to be post-processed through the interruption mode after the end.
[0079] Step S201: The data processing module receives the public key and the first information sent by the user and stores them into the DDR.
[0080] Step S202: The cryptographic operation core group obtains the public key and the first information from the DDR in the DMA controller enabled state, performs operation and generates the first signature information and the packaging key.
[0081] Step S203: The cryptographic operation core group stores the first signature information and the packaging key to the DDR in the DMA controller enabled state.
[0082] When the PQC cryptographic card runs a quantum cryptographic operation task, the data processing module first receives the public key and the first information sent by the user and stores them in the DDR. When the cryptographic operation core group is configured with instructions and is configured, it can execute the quantum cryptographic operation task. First, the public key and the first information corresponding to the task are read from the DDR in the DMA controller enabled state through the DMA controller, and then operation is performed according to the configured working mode and operation security level to generate the first signature information and the packaging key. The first signature information and the packaging key are stored in the DDR in the DMA controller enabled state.
[0083] As shown in Figure 7 , similar to the above steps S201-S203, the operation is performed according to the obtained fixed-length random number sequences to generate the public key and the corresponding private key and store them in the DDR, including the following steps.
[0084] Step S101: Obtain the fixed-length random number sequences from the DDR in the DMA controller enabled state to perform operation to generate the public key and the corresponding private key.
[0085] Step S102: Store the public key and the corresponding private key in the DDR in the DMA controller enabled state.
[0086] The above two steps are executed by the cryptographic operation core group. In the DMA controller enabled state, the fixed-length random number sequences are obtained from the DDR to perform operation to generate the public key and the corresponding private key, and then the public key and the corresponding private key are stored in the DDR in the DMA controller enabled state.
[0087] The above steps S201-S203 and steps S101-S102 are process methods for executing quantum cryptographic operation in the DMA controller enabled state. When the DMA controller is not enabled, the data transmission link between the cryptographic operation core group and the DDR is in an interrupted state. The transmission of input data and output data of the cryptographic operation core group can be realized through the data processing module.
[0088] The data processing module can access and configure the plurality of cryptographic operation core groups through the registers, and write a plurality of random number sequences to the plurality of cryptographic operation core groups. After the cryptographic operation core groups complete the operation task, the unencrypted key generated by the operation is stored in the RAM, and then written to the DDR by the data processing module.
[0089] In this embodiment, as one of the implementation manners, the Kyber algorithm is taken as an example to illustrate the operation of the data processing module. When the cryptographic operation core group generates the public key and the corresponding key in step S10, a plurality of random number sequences of a fixed length are obtained from the DDR to generate the public key and the corresponding private key, including the following steps: generating the public key and the corresponding first private key according to the plurality of random number sequences; performing H function transformation of the first private key by a hash algorithm to generate the private key, wherein the H function includes the security level and a preset fixed constant. For example, the operation method of the public key and the private key is as follows:
[0090]
[0091] z←β 32 ;
[0092] (pk,sk′)=KeyGen()
[0093] sk=(sk′||pk||H(pk)||z);
[0094] In the above formula, pk is the public key, sk′ is the first private key, and sk is the private key; k is the security level, n is the preset fixed constant, and β is a one-dimensional vector. The calculation amount of the superscript is the data amount, and it can be seen that the value of k affects the data amount of the actual public key and the private key.
[0095] Compared with the prior art, the algorithm further performs H function transformation on the obtained pk, and writes the sk′, pk, H(pk) and z in the order to the RAM. The result sk′ of the public key encryption (KeyGen) is encapsulated again, the random number value z and the pk after the hash algorithm (H(pk)) are added, the complexity of the private key is improved, and the characteristics of the hash algorithm are introduced. Irreversible, even if the private key sk is intercepted, sk′ cannot be solved in theory, and the security of the private key is improved.
[0096] In this embodiment, as one of the implementation manners, the first signature information and the encapsulated key are generated by performing operation according to the public key and the first information, including the following steps.
[0097] Step S211: performing H function transformation on the first information to obtain the second information.
[0098] For example:
[0099] m' <- H(m);
[0100] In the above formula, m is the first information, and m' is the second information, wherein the first information and the second information both represent information to be encrypted, and the second information is obtained by transforming the first information through the H function of the hash algorithm.
[0101] Step S212: performing G function transformation on the public key and the second information to obtain the first signature information and the encapsulation key; wherein the G function transformation includes a security level and a preset fixed constant.
[0102] For example:
[0103] K1 ∈ β * ;
[0104]
[0105] In the above formula, c is the first signature information, k is the security level, n is the preset fixed constant, d v and d u are fixed constants, and K1 is the encapsulation key.
[0106] It should be noted that in the above formula, the G function and the H function will have different operation results due to different security levels.
[0107] In this embodiment, as one of the implementation manners, as shown in the following formula, an operation is performed according to the private key and the first signature information to generate a decryption key, wherein the decryption key is used for decrypting or verifying the encrypted first information, including the following steps. Figure 8
[0108] Step S311: separating the private key to obtain a first sub-public key, a second sub-public key and a first parameter.
[0109] For example:
[0110] pk' = sk + 12 * k * n / 8;
[0111] h = sk + 24 * k * n / 8 + 32 ∈ β 32 ;
[0112] z = sk + 24 * k * n / 8 + 64;
[0113] In the above formula, pk' is the first sub-public key, h is the second sub-public key, and z is the first parameter.
[0114] Step S312: performing an operation according to the first signature information and the private key to obtain the second information.
[0115] For example:
[0116] m' = DEC(sk, c);
[0117] In the above formula, m' is the second information, sk is the private key, and c is the first signature information.
[0118] Step S313: Perform G function transformation on the second information and the second sub-public key to obtain a second parameter.
[0119] Examples include:
[0120] r' = G(m' || h);
[0121] In the above formula, r' is the second parameter.
[0122] Step S314: Perform an operation based on the first sub-public key, the second information, and the second parameter to obtain a decryption key.
[0123] Examples include:
[0124] c' = Enc(pk', m', r');
[0125] In the above formula, c' is the decryption key, pk' is the first sub-public key, m' is the second information, and r' is the second parameter.
[0126] After obtaining the decryption key, the encrypted information can be decrypted or verified through the decryption key. For example, the verification steps include verifying the encrypted first information based on the comparison result of the first signature information and the decryption key.
[0127] Compare the decryption key obtained in step S314 with the input first signature information. If they are equal, the verification is true, and the obtained decryption key is stored in the DDR. Otherwise, a false decryption key is generated and stored in the DDR.
[0128] Based on the same application concept, the embodiments of the present application also provide a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method of any of the above embodiments is implemented.
[0129] Based on the same application concept, the embodiments of the present application also provide a PQC cryptographic card, which performs quantum cryptography operations by using the method of any of the above embodiments.
[0130] In the embodiments described above, all or some of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or some of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded into and executed by a computer, all or some of the processes or functions according to the embodiments described in the specification are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through a wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, solid state disk (SSD)) and the like.
[0131] It should be noted that, in this document, the terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.
[0132] The above embodiments according to the drawings illustrate the structure, features and effects of the present application. The above description is only the preferred embodiment of the present application, but the present application is not limited by the drawings shown. Any changes or modifications made in accordance with the concept of the present application, or equivalent embodiments with equivalent changes, are still within the scope of protection of the specification and drawings.
Claims
1. A quantum cryptography method applied to a cryptographic core group in a PQC cryptographic card, wherein the PQC cryptographic card further includes a DDR communicatively connected to the cryptographic core group, characterized in that, The method includes: A public key and a corresponding private key are generated by performing operations on several sets of random number sequences of fixed length obtained, and stored in DDR; wherein, the public key is for users to view; The public key and first information are obtained from the DDR, and a calculation is performed to generate first signature information and encapsulation key. The first signature information is stored in the DDR. The first information is information to be encrypted, and the first signature information is a password for encrypting the first information. The private key and the first signature information are obtained from the DDR, and an operation is performed to generate a decryption key; wherein, the decryption key is used to decrypt the encrypted first information.
2. The method as described in claim 1, characterized in that, The PQC cryptographic card further includes a data processing module communicatively connected to the cryptographic operation core group. Before generating a public key and corresponding private key based on several received random number sequences of fixed length and storing them in the DDR, the method further includes: The data processing module sends configuration instructions to the cryptographic operation core group; The cryptographic operation core group responds to the configuration command to configure the working mode and security level.
3. The method as described in claim 2, characterized in that, The data processing module sends configuration instructions to the cryptographic operation core group, including: The data processing module obtains the working status of the cryptographic operation core group through register access; When the cryptographic operation core group is in an idle state, the data processing module sends the configuration instruction to the cryptographic operation core group through a register.
4. The method as described in claim 3, characterized in that, The cryptographic operation core group is connected to the DDR via a DMA controller. It performs operations based on the public key and first information to generate first signature information and a sealing key, and stores the first signature information in the DDR, including: The data processing module receives the public key and first information sent by the user and stores them in the DDR; When the DMA controller is enabled, the cryptographic operation core group obtains the public key and the first information from the DDR, performs operations, and generates the first signature information and the encapsulation key. The cryptographic operation core group stores the first signature information and the encapsulation key to the DDR when the DMA controller is enabled.
5. The method as described in claim 4, characterized in that, The step of generating a public key and a corresponding private key by performing operations on several sets of random number sequences of fixed length and storing them in DDR includes: With the DMA controller enabled, a fixed-length sequence of random numbers is obtained from the DDR and operations are performed to generate a public key and a corresponding private key. With the DMA controller enabled, the public key and the corresponding private key are stored together in the DDR.
6. The method as described in claim 5, characterized in that, The step of obtaining several sets of random number sequences of fixed length from the DDR and performing operations to generate a public key and a corresponding private key includes: Generate a public key and a corresponding first sub-private key based on several sets of random number sequences; The first sub-private key is transformed by the H function to generate a private key, wherein the H function includes the security level and a preset fixed constant.
7. The method as described in claim 2, characterized in that, Performing calculations based on the public key and the first information to generate first signature information and encapsulation key includes: The first information is transformed using the H function to obtain the second information; The public key and the second information are subjected to a G-function transformation to obtain the first signature information and the encapsulation key; wherein the G-function transformation includes the security level and a preset fixed constant.
8. The method as described in claim 1, characterized in that, Based on the private key and the first signature information, an operation is performed to generate an unsealing key, including: The private key is separated to obtain a first sub-public key, a second sub-public key, and a first parameter; The second information is obtained by performing calculations based on the first signature information and the private key; The second parameter is obtained by performing a G-function transformation on the second information and the second sub-public key; The decryption key is obtained by performing calculations based on the first sub-public key, the second information, and the second parameter.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-8.
10. A PQC cryptographic card, characterized in that, Quantum cryptography is performed using the method described in any one of claims 1-8.