A key verification method
Through the quantum state verification method of shared keys between cloud servers and users, the problems of notaries and high-order entangled states in the QPC protocol are solved, the security and privacy of key verification are achieved, and it is suitable for Internet projects.
Patent Information
- Application Number
- CN202311153547.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-08
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2043-09-08
AI Technical Summary
Existing quantum privacy comparison (QPC) protocols require a semi-honest notary, and the preparation and maintenance of high-order entangled states are difficult, which limits their application in key verification.
A key verification method is adopted to share the key through the cloud server and the user. The verifier does not have the key. The key verification is achieved by using quantum states to avoid the intervention of notaries. There is no need to prepare high-order entangled states to ensure the security of the key.
Even if the authenticator is hacked or eavesdropped during the verification process, the key can still be prevented from being leaked, which improves security and is suitable for Internet projects.
Smart Images

Figure CN119602960B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cryptography, and in particular to a key verification method implemented with the help of quantum states. Background Art
[0002] In 1982, the following problem (also known as the millionaire problem) was posed: Two millionaires, each with a million and b million, where a and b are integers, want to compare the value of a and b without revealing the value of their respective assets. Subsequently, researchers proposed a quantum private comparison protocol that leverages quantum states. By intervening with an honest notary, they can compare a and b in this problem, and potentially even more private data. This method of comparing private data using quantum states later became known as the Quantum Private Comparison (QPC) protocol.
[0003] Quantum privacy comparison can be applied to key authentication, achieving high-confidentiality key comparison. However, existing QPC protocols require a semi-honest notary, which limits their application in key authentication. In practical applications, adding a notary introduces new risks. Furthermore, existing QPC protocols require the preparation of high-order entangled states. Preparing these states and preventing their decoherence are both challenging challenges in practical applications, placing high demands on the device. Summary of the Invention
[0004] In response to the above-mentioned problems in the prior art, the present invention proposes a key verification method implemented using quantum states, in which only the cloud server and the user have their own user keys, and the verifier does not have the key. Even if the verifier knows the answer to each question, it cannot obtain the specific value of the key bit corresponding to the key, and cannot infer the key based on the question, thus ensuring the security of the key. Therefore, in this key verification method, there is no need for a notary, nor is there a need to prepare high-order entangled states. Even if an attacker has controlled the verifier, the shared user key cannot be obtained, and it has excellent security performance. Obviously, this verification security makes the key verification method well suited for Internet projects and prevents key leakage during the verification process, because the verification method proposed by the present invention can effectively improve the security of verification. In the worst case, such as when the verifier is invaded, hijacked, or eavesdropped, this solution can still prevent the intruder from obtaining the shared key, thereby achieving the security of verification.
[0005] Specifically, the present invention relates to a key verification method, which includes a key length acquisition step, a question setting step, a server feedback step, a user feedback step, a comparison step, and a verification step;
[0006] The key length acquisition step is used for the verification party to obtain the length M of the user key from the server;
[0007] The question setting step is used for the verifier to generate L questions, where L is an integer satisfying [M / 3]≤L≤[M / 2]. The question includes comparing an integer i with a number j consisting of 3 bits in the user key, wherein for each question, the integer i is randomly selected from 2 to 6, and the positions of the 3 bits in the user key are randomly selected in sequence;
[0008] The server feedback step is used by the verifier to obtain answers to L questions from the server using the comparison step, where the verifier and the server are Alice and Bob in the comparison step respectively;
[0009] The user feedback step is used by the verifier to obtain answers to L questions from the user by using the comparison step, wherein the verifier and the user are Alice and Bob in the comparison step respectively;
[0010] In the comparison step, Alice selects a first basis vector to encode and prepare n=8 qubits and sends them to Bob in sequence, wherein the first basis vector is kept secret from Bob, and the first i qubits of the n qubits have a first value and the last ni qubits have a second value; Bob sends n-1 qubits of the n qubits except the j+1th qubit to Alice in a changing order; Alice measures the received n-1 qubits in sequence under the first basis vector to obtain an answer, wherein when i-1 first values are measured, the answer is recorded as the first result value, and when i first values are measured, the answer is recorded as the second result value, otherwise an error is fed back;
[0011] The verification step is used by the verification party to compare the L answers obtained through the server feedback step with the L answers obtained through the user feedback step, and pass the verification when the comparison is consistent.
[0012] Furthermore, in the key length acquisition step, the user sends a login request to the authenticator, and the authenticator applies to the server to obtain the length M of the user key in response to the login request; and the server searches for the user key and feeds back its length M to the authenticator in response to the application.
[0013] Furthermore, in the comparison step, the first basis vector is randomly selected.
[0014] Optionally, the first value is one of |0> or |1>, and the second value is the other of |0> or |1>; and / or, the first result value is one of 0 or 1, and the second result value is the other of 0 or 1.
[0015] Furthermore, if an error is reported in the server feedback step or the user feedback step and the number of errors does not exceed a preset threshold, the question setting step is repeated so that the verifier regenerates L questions, and verification is performed based on the regenerated questions using the server feedback step, the user feedback step, and the verification step; and
[0016] If an error is reported in the server feedback step or the user feedback step and the number of errors exceeds a preset threshold, the verification is terminated.
[0017] Preferably, the user key is formed by combining a K-bit random key P and an MK-bit hash function value Hash(P) of the key P. Prior to the server feedback step, the server may verify whether the last Mn bits of the user key are the hash function value of the first n bits; and / or, prior to the user feedback step, the user may verify whether the last Mn bits of the user key are the hash function value of the first n bits. Upon verification that the last Mn bits of the user key are the hash function value of the first n bits, the server feedback step and / or the user feedback step are executed.
[0018] Preferably, the server is a cloud server.
[0019] Preferably, the user key is achieved through a quantum key distribution process. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 A method for applying quantum states to solve the millionaire's problem according to the present invention is shown, wherein the first value is selected as |0> and the second value is selected as |1>;
[0023] Figure 2 A key verification method according to the present invention is shown. DETAILED DESCRIPTION
[0024] Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. The following embodiments are provided by way of example in order to fully convey the spirit of the present invention to those skilled in the art to which the present invention belongs. Therefore, the present invention is not limited to the embodiments disclosed herein.
[0025] Figure 1 The present invention shows a data comparison method using quantum states, which allows the comparison of the (private) data sizes of both parties without the introduction of an honest notary and the preparation of high-order entangled states, thereby solving the millionaire's problem.
[0026] Assume that the two parties who need to compare data sizes are Alice and Bob, where Alice has data i and Bob has data j, where i and j are integers and 0≤i, j<n. Alice and Bob want to compare the sizes of i and j.
[0027] To achieve the above data size comparison, such as Figure 1 As shown, the data comparison method of the present invention may include the following steps.
[0028] Step S101 is used to prepare quantum bits: Alice selects a basis, such as a first basis vector, to encode and prepare n quantum bits under the first basis vector, wherein the selected first basis vector is kept secret from Bob, and the first i of the n quantum bits have a first value, such as encoded as |0>, and the last n i have a different second value, such as encoded as |1>.
[0029] Step S102 is used to send the prepared quantum bits: Alice sends the n quantum bits she prepared to Bob in sequence.
[0030] Step S103 is used for Bob's quantum bit feedback: after receiving the n quantum bits sent by Alice, Bob extracts the j+1th quantum bit, and then sends the remaining n-1 quantum bits to Alice in a random order.
[0031] Step S104 is used for Alice to measure the feedback qubits: After receiving the n-1 qubits fed back by Bob, Alice measures the received n-1 qubits in sequence according to the basis selected in step S101, such as the first basis vector, and records the measurement results.
[0032] Step S105 is used to analyze the measurement results to obtain the answer to the comparison question: if there are i-1 first values (e.g., |0>) in the measurement results, it means that the j+1th qubit taken by Bob is the first value (|0>), which indicates that the answer to the comparison question is j<i. Accordingly, the answer can be recorded as the first result value, e.g., 0;
[0033] If there are i first values (|0>) in the measurement result, it means that the j+1th quantum bit taken by Bob is the second value (|1>), which means that the answer to the comparison problem is j≥i. Accordingly, the answer can be recorded as the second result value, for example, 1;
[0034] If the measurement result is otherwise, an error is fed back and the comparison process is terminated.
[0035] Thus, the above method enables comparison of the size of data i and j without Alice and Bob revealing their respective data i and j to each other. The use of quantum state information significantly improves security. On the one hand, if the information used in this method (protocol) is classical information, Bob can check the number of 0s and 1s to determine the data i. However, when this method uses quantum information, because the basis chosen by Alice is kept secret, Bob cannot know the measurement basis, and thus cannot perform measurements without causing changes in the qubits. He cannot also determine the number of |0> in the n qubits, and thus cannot determine the size of data i. Furthermore, Bob's measurement behavior will cause a change in the quantum state, which will be discovered by Alice in step S105. On the other hand, if this method uses classical information, Alice uses encrypted numbers that Bob cannot decrypt. If Alice changes the encrypted information from 0 / 1 to numbers from 0 to n, then Bob can remove the jth encrypted information and return the remaining encrypted information, allowing Alice to obtain j through decryption. However, in the present invention, there is only one qubit that carries the information 0 or 1. Since the order of the n-1 qubits that Bob feeds back to Alice is disrupted, distinguishing these n-1 qubits is equivalent to distinguishing the 1 qubit that Bob took away. However, there are only two measurement results for a qubit. Therefore, when n ≥ 3, a qubit with n possibilities cannot be completely distinguished. Therefore, no matter what qubit Alice prepares, the qubit taken by Bob cannot be distinguished, and Alice cannot know the data j. Therefore, with the data size comparison method of the present invention, the use of quantum information is superior to the use of classical information and can effectively prevent the leakage of data i and j. Compared with the previous QPC protocol, there is no need for a notary; there is no need to prepare and maintain multi-quantum entangled states; only Alice needs to prepare and measure qubits, which has lower requirements for equipment and environment.
[0036] Due to the many advantages of the above-mentioned data comparison method, the present invention further proposes a key verification method based on the data comparison method, which is used to realize key verification between a user and a server (such as a cloud server) with the help of any verification party.
[0037] Figure 2The key verification method according to the present invention is shown. For example, in an application scenario where a user key is shared between a user and a (cloud) server, the verification party can verify whether the user key provided by the user is consistent with the corresponding user key maintained in the server, thereby realizing functions related to key verification, such as login, query, etc.
[0038] like Figure 2 As shown, the key verification method of the present invention may include a key length acquisition step, a question setting step, a server feedback step, a user feedback step, a comparison step and a verification step.
[0039] According to the present invention, in order to implement key verification by means of the above data comparison method, it is first necessary to use a key length acquisition step, where the verifier obtains the length M of the user key from the server.
[0040] For example, when a user sends a login request to the authenticator, the authenticator, in response to the login request, requests the cloud server to obtain the length M of the user key. After receiving the user key length request from the authenticator, the cloud server can find the corresponding (shared) user key based on, for example, the user name and feedback its length M to the authenticator.
[0041] After obtaining the length M of the user key, L specific size comparison questions are needed to verify the key between the user and the cloud server based on the answers to the size comparison questions, where L is an integer and [M / 3]≤L≤[M / 2]. Therefore, in the present invention, the verifier generates L questions using the problem setting step. These questions involve comparing the size of an integer i with a 3-bit number j in the user key. Specifically, when generating each question, the integers i and j (i.e., the 3 bit positions in the user key) need to be set accordingly. The integer i is randomly selected from 2 to 6 each time, and the 3 bit positions in the user key are also randomly selected sequentially each time. For example, for one question, i=2 is randomly selected from 2-6, and the bit positions j at positions 1, 3, and M-1 are randomly selected from the 1-M bit positions in the user key. For another question, i=5 is randomly selected, and the bit positions j at positions 4, 8, and M-3 are randomly selected from the M-bit user key. With this randomness, in these L questions, the randomly selected number i and the 3 bit positions on the user data will not be exactly the same.
[0042] Subsequently, the answers to the L questions can be obtained from the server and the user respectively by means of the server feedback step and the user feedback step, wherein the answer to each question needs to be obtained by means of the comparison step implemented by the above-mentioned data comparison method.
[0043] Specifically, corresponding to the above-mentioned data comparison method, in the comparison step of the present invention, Alice can choose to encode n=8 (corresponding to a range of 0-7 for a number composed of 3 bits) quantum bits under the first basis vector and send them to Bob sequentially, wherein the first basis vector is kept confidential to Bob, and the first i of the n quantum bits have a first value (for example, |0>), and the last ni have a second value (for example, |1>); Bob sends the n-1 quantum bits of the n quantum bits except the j+1th quantum bit to Alice in a changing order (that is, disrupting the original order); Alice measures the received n-1 quantum bits in turn under the first basis vector to obtain an answer, wherein when i-1 first values are measured, the answer is recorded as the first result value (for example, 0), and when i first values are measured, the answer is recorded as the second result value (for example, 1), otherwise the feedback is an error.
[0044] Therefore, in the server feedback step, the verifier and the server act as Alice and Bob, respectively, in the comparison step. The verifier obtains the answers to L questions from the server using the comparison step. In the user feedback step, the verifier and the user act as Alice and Bob, respectively, in the comparison step. The verifier obtains the answers to L questions from the user using the comparison step.
[0045] Furthermore, it can be known that in the server feedback step, the verifier can obtain L answers with the help of the comparison step, which may include an answer with an incorrect result (i.e., feedback error). In order to ensure the efficiency and reliability of the verification method, a threshold value can be pre-set for the number of errors in the present invention. If the feedback error is received and the number of errors does not exceed the preset threshold value, the question setting step is repeated to regenerate L questions by the verifier, and then based on the regenerated questions, verification is performed again with the help of the server feedback step, the user feedback step, and the verification step; and if the feedback error is received and the number of errors exceeds the preset threshold value, the current verification process can be terminated.
[0046] Similarly, in the user feedback step, the verifier can also obtain L answers through the comparison step, which may include an incorrect answer (i.e., an incorrect feedback). Therefore, a preset threshold can be used. If the feedback is incorrect and the number of errors does not exceed the preset threshold, the question setting step can be repeated to allow the verifier to regenerate L questions. Based on the regenerated questions, verification can be performed again through the server feedback step, the user feedback step, and the verification step. If the feedback is incorrect and the number of errors exceeds the preset threshold, the current verification process can be terminated.
[0047] After the verifier obtains the correct answers to L questions from the server and the user respectively with the help of the server feedback step and the user feedback step, the verifier can use the verification step to compare the L answers obtained through the server feedback step with the L answers obtained through the user feedback step. If the comparison is consistent, the verification is passed, and if the comparison is inconsistent, it will feedback the verification failure to the user.
[0048] Furthermore, the M-bit user key can preferably be formed by combining the K-bit random key P and the MK-bit hash function value Hash(P), i.e., P+Hash(P), where the hash function value Hash(P) is the value generated by operating the key P using a hash function. The user and the cloud server can use the same hash function to maximize the differences in the random keys.
[0049] In this case, in the key verification method of the present invention, before the server feedback step, the server may verify whether the last Mn bits of the user key are the hash function value of the first n bits; and before the user feedback step, the user may verify whether the last Mn bits of the user key are the hash function value of the first n bits. Furthermore, when it is verified that the last Mn bits of the user key are the hash function value of the first n bits, the server feedback step and the user feedback step are performed.
[0050] Furthermore, the user key can be securely distributed between the user and the cloud server via quantum key distribution (QKD) technology.
[0051] Based on the above content, it can be seen that in the key verification method of the present invention, only the cloud server and the user have the key, and the verifier does not have the key. Moreover, even if the verifier knows the answer to each question, it cannot obtain the specific value of the key bit, so it cannot infer the key based on the question, thereby ensuring the security of the key. Therefore, in this key verification method, there is no need for a notary, nor is there a need to prepare high-order entangled states. Even if the attacker has controlled the verifier, the shared user key cannot be obtained, and it has good security performance. Obviously, this verification security makes the key verification method well suited for Internet projects and prevents key leakage during the verification process, because the verification method proposed by the present invention can effectively improve the security of verification. In the worst case, such as when the verifier is invaded, hijacked, and eavesdropped, this solution can still prevent the intruder from obtaining the shared key, thereby achieving the security of verification.
[0052] Although the present invention has been described above through specific embodiments in conjunction with the accompanying drawings, it is easy for those skilled in the art to recognize that the above embodiments are merely exemplary and are used to illustrate the principles of the present invention. They do not limit the scope of the present invention. Those skilled in the art can make various combinations, modifications and equivalent substitutions to the above embodiments without departing from the spirit and scope of the present invention.
Claims
1. A key verification method comprising a key length acquisition step, a question setting step, a server feedback step, a user feedback step, a comparison step, and a verification step; The key length acquisition step is used for the verification party to obtain the length M of the user key from the server; The question setting step is used for the verifier to generate L questions, where L is an integer and [M / 3]≤L≤[M / 2], and the question includes comparing the integer i with the number j consisting of 3 bits in the user key, wherein, For each question, randomly select an integer i between 2 and 6, and sequentially randomly select the positions of the 3 bits in the user key; The server feedback step is used by the verifier to obtain answers to L questions from the server using the comparison step, where the verifier and the server are Alice and Bob in the comparison step respectively; The user feedback step is used by the verifier to obtain answers to L questions from the user by using the comparison step, where the verifier and the user are Alice and Bob in the comparison step respectively; In the comparison step, Alice selects a first basis vector to encode and prepare n=8 qubits and sends them sequentially to Bob, wherein the first basis vector is kept secret from Bob, and the first i qubits of the n qubits have a first value and the last ni qubits have a second value; Bob sends n-1 qubits of the n qubits except the j+1th qubit to Alice in a changing order; Alice measures the received n-1 qubits in sequence under the first basis vector to obtain an answer, wherein when i-1 first values are measured, the answer is recorded as the first result value, and when i first values are measured, the answer is recorded as the second result value, otherwise an error is fed back; The verification step is used by the verification party to compare the L answers obtained through the server feedback step with the L answers obtained through the user feedback step, and pass the verification when the comparison is consistent.
2. The key verification method according to claim 1, wherein: In the key length acquisition step, the user sends a login request to the verification party, and the verification party applies to the server to obtain the length M of the user key in response to the login request; And, in response to the application, the server searches for the user key and feeds back its length M to the verifier.
3. The key verification method according to claim 1, wherein: In the comparing step, the first basis vector is randomly selected.
4. The key verification method according to claim 1, wherein: The first value is one of |0> or |1>, and the second value is the other of |0> or |1>; and / or the first result value is one of 0 or 1, and the second result value is the other of 0 or 1.
5. The key verification method according to claim 1, wherein: If an error is reported in the server feedback step or the user feedback step and the number of errors does not exceed a preset threshold, repeating the question setting step so that the verifier regenerates L questions, and performing verification based on the regenerated questions using the server feedback step, the user feedback step, and the verification step; and If an error is reported in the server feedback step or the user feedback step and the number of errors exceeds a preset threshold, the verification is terminated.
6. The key verification method according to claim 1, wherein: The user key is formed by combining a K-bit random key P and an MK-bit hash function value Hash(P) of the key P.
7. The key verification method according to claim 6, wherein: Before the server feedback step, the method further includes a step in which the server verifies whether the last Mn bits of the user key are the hash function value of the first n bits; and / or, before the user feedback step, the method further includes a step in which the user verifies whether the last Mn bits of the user key are the hash function value of the first n bits.
8. The key verification method as claimed in claim 7, wherein: When verifying that the last Mn bits in the user key are the hash function value of the first n bits, a server feedback step and / or a user feedback step is performed.
9. The key verification method according to any one of claims 1 to 8, wherein: The server is a cloud server.
10. The key verification method according to any one of claims 1 to 8, wherein: The user key is achieved through a quantum key distribution process.
Citation Information
Patent Citations
Semi-quantum privacy comparison method based on Bell state and not requiring classical user to perform quantum measurement
CN114710283A
Method and apparatus for authenticating user in multiparty quantum communications
US20140068765A1