CN117978383A - Key exchange method, device, system, equipment and storage medium - Google Patents

Key exchange method, device, system, equipment and storage medium Download PDF

Info

Publication number
CN117978383A
CN117978383A CN202410202208.5A CN202410202208A CN117978383A CN 117978383 A CN117978383 A CN 117978383A CN 202410202208 A CN202410202208 A CN 202410202208A CN 117978383 A CN117978383 A CN 117978383A
Authority
CN
China
Prior art keywords
public key
temporary
response
fixed
key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410202208.5A
Other languages
Chinese (zh)
Inventor
李祖金
邹鹤良
刘磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Digital Guangdong Network Construction Co Ltd
Original Assignee
Digital Guangdong Network Construction Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Digital Guangdong Network Construction Co Ltd filed Critical Digital Guangdong Network Construction Co Ltd
Priority to CN202410202208.5A priority Critical patent/CN117978383A/en
Publication of CN117978383A publication Critical patent/CN117978383A/en
Pending legal-status Critical Current

Links

Landscapes

  • Storage Device Security (AREA)

Abstract

The application discloses a key exchange method, a device, a system, equipment and a storage medium, and relates to the technical field of communication. The method comprises the following steps: the first cooperative end and the second cooperative end cooperatively generate a fixed initiation public key, and the second cooperative end generates a temporary initiation public key; the second cooperative end sends the fixed initiation public key and the temporary initiation public key to the response end of the key exchange, so that the response end determines the shared key according to the fixed response public key, the temporary response public key, the fixed initiation public key and the temporary initiation public key; the first cooperative end and the second cooperative end cooperatively generate a fixed hidden response public key corresponding to the fixed response public key and a temporary hidden response public key corresponding to the temporary response public key; the second cooperative end determines the shared secret key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key. The application realizes the key exchange method and ensures the security of the key.

Description

Key exchange method, device, system, equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, a system, a device, and a storage medium for key exchange.
Background
With the wide application of internet technology, government service systems gradually transmit encrypted data such as files, videos and voices through the internet, and verify legal identities of both parties through keys and decrypt the received encrypted data.
At present, before transmitting data (such as files, videos and voices), an initiating terminal and a responding terminal of a government service system mainly transmit keys in a plaintext form, and then judge whether the keys of the opposite party are the same as the keys of the opposite party or not so as to verify the legal identity of the opposite party, thereby establishing a data transmission safety channel.
However, in the prior art, a plaintext key is easy to be attacked by malicious software in the transmission process, and the risk of disclosure or impossibility exists, so that a government service system is easy to be illegally attacked and illegally tampered.
Disclosure of Invention
The embodiment of the application provides a key exchange method, a device, a system, equipment and a storage medium, which realize the key exchange method, avoid the risk that the key is easy to leak and impersonate due to the transmission of the key in the plaintext in the prior art, and effectively ensure the security of the key.
In a first aspect, an embodiment of the present application provides a key exchange method, applied to an initiating terminal of a key exchange, where the initiating terminal includes a first cooperative terminal and a second cooperative terminal, and the method includes:
The first cooperative end and the second cooperative end cooperatively generate a fixed initiation public key, and the second cooperative end generates a temporary initiation public key;
The second cooperative end sends the fixed initiation public key and the temporary initiation public key to the response end of the key exchange, so that the response end determines the shared key according to the fixed response public key, the temporary response public key, the fixed initiation public key and the temporary initiation public key;
The first cooperative end and the second cooperative end cooperatively generate a fixed hidden response public key corresponding to the fixed response public key and a temporary hidden response public key corresponding to the temporary response public key;
the second cooperative end determines the shared secret key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key.
In the embodiment of the application, a first cooperative end and a second cooperative end of an initiating end cooperatively generate a fixed initiating public key, and the second cooperative end generates a temporary initiating public key; the second cooperative end sends the fixed initiation public key and the temporary initiation public key to the response end of the key exchange, so that the response end determines the shared key according to the fixed response public key, the temporary response public key, the fixed initiation public key and the temporary initiation public key; the first cooperative end and the second cooperative end cooperatively generate a fixed hidden response public key corresponding to the fixed response public key and a temporary hidden response public key corresponding to the temporary response public key; the second cooperative end determines the shared secret key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key. In the technical scheme, the same shared secret key is respectively generated by the initiating terminal and the responding terminal, so that a secret key exchange method is realized, the national standard of SM2 elliptic curve public key cryptographic algorithm is met, meanwhile, the shared secret key is not required to be transmitted during data (such as files, videos and voices) transmission, the risk that secret keys are easy to leak and impersonate due to the fact that secret keys are transmitted in the clear text in the prior art is avoided, the safety of the secret keys is effectively ensured, the communication of the two parties is safer, and the safety of a government service system is improved; in addition, the first cooperative end and the second cooperative end cooperatively generate a shared secret key, so that the security of the secret key is further ensured.
In a second aspect, an embodiment of the present application provides a key exchange device, applied to an initiating terminal of a key exchange, where the initiating terminal includes a first cooperative terminal and a second cooperative terminal, and the device includes:
the first generation module is used for cooperatively generating a fixed initiation public key by the first cooperative end and the second cooperative end, and generating a temporary initiation public key by the second cooperative end;
The first determining module is used for sending the fixed initiation public key and the temporary initiation public key to the response end of the key exchange by the second cooperative end so that the response end determines the shared key according to the fixed response public key, the temporary response public key, the fixed initiation public key and the temporary initiation public key;
the second generation module is used for cooperatively generating a fixed hidden response public key corresponding to the fixed response public key and a temporary hidden response public key corresponding to the temporary response public key by the first cooperative end and the second cooperative end;
And the second determining module is used for determining the shared secret key by the second cooperative end according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key.
In a third aspect, an embodiment of the present application provides a key exchange system, including: a response end and an initiating end for executing the key exchange method of any of the embodiments of the present application.
In a fourth aspect, an embodiment of the present application provides an electronic device, including:
at least one processor; and a memory communicatively coupled to the at least one processor;
Wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the key exchange method of any one of the embodiments of the present application.
In a fifth aspect, embodiments of the present application provide a computer readable storage medium storing computer instructions for causing a processor to perform the key exchange method of any of the embodiments of the present application.
The description of the second, third, fourth and fifth aspects of the present application may refer to the detailed description of the first aspect; moreover, the advantages described in the second aspect, the third aspect, the fourth aspect and the fifth aspect may refer to the analysis of the advantages of the first aspect, and are not described herein.
In the present application, the names of the above-described key exchange means do not constitute limitations on the devices or function modules themselves, and in actual implementation, these devices or function modules may appear under other names. Insofar as the function of each device or function module is similar to that of the present application, it falls within the scope of the claims of the present application and the equivalents thereof.
These and other aspects of the application will be more readily apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a key exchange method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a key exchange system according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a specific interaction between a first collaboration terminal and a second collaboration terminal according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a specific interaction between an initiator and a responder according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a key exchange device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," "target," and "original," etc. in the description and claims of the present application and the above-described drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be capable of executing sequences other than those illustrated or otherwise described. Furthermore, the terms "comprises," "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a schematic flow chart of a key exchange method provided in an embodiment of the present application, where the embodiment can be applied to a scenario where two parties need to generate a shared key before an initiator and a responder transmit data (e.g. file, video, voice). The key exchange method provided by the embodiment of the application can be implemented by the key exchange device provided by the embodiment of the application, and the device can be realized by software and/or hardware. In a specific embodiment, the key exchange means may be integrated in the key exchange system.
In a specific embodiment, the key exchange system may be configured as shown in fig. 2, where the key exchange system shown in fig. 2 includes an initiator 210 and a responder 220. The initiating terminal 210 includes a first cooperative terminal and a second cooperative terminal, and the initiating terminal 210 and the responding terminal 220 may be connected in a communication manner, and the connection manner may be bluetooth, wiFi or other local area network, which is not specifically limited in the embodiment of the present application.
Alternatively, the initiator 210 and the responder 220 may be devices such as a smart phone, a tablet computer, or a personal computer, which is not limited in particular in the embodiment of the present application.
In the following, a key exchange method provided by an embodiment of the present application is described with reference to a key exchange system shown in fig. 2, where an execution body for executing the method may be an initiator 210 of the key exchange system, and with continued reference to fig. 1, the key exchange method of the present embodiment includes, but is not limited to, the following steps:
s110, the first cooperative end and the second cooperative end cooperatively generate a fixed initiation public key, and the second cooperative end generates a temporary initiation public key.
The first cooperative end and the second cooperative end are two communication ends of the initiating end 210, and the two communication ends may be connected in a communication manner, which may be an internet manner or a local area network manner, and the embodiment of the present application is not limited in particular.
The fixed initiation public key is a public key cooperatively generated by the first cooperative end and the second cooperative end. The temporary initiation public key is a temporary public key generated by the second cooperative end.
Specifically, before the initiator 210 and the responder 220 transmit data (such as files, video, and voice), they need to generate the same shared key, so that the initiator 210 and the responder 220 decrypt the received files, video, and voice with the shared key to establish a secure channel for data transmission. Thus, the first and second cooperating ends may cooperate to generate a fixed originating public key of the originating end 210 prior to data transmission by the originating end 210 and the responding end 220.
Fig. 3 is a schematic diagram of a specific interaction between a first collaboration terminal and a second collaboration terminal provided by an embodiment of the present application, which describes a specific process of the first collaboration terminal and the second collaboration terminal cooperatively generating a fixed originating public key. The process specifically comprises the following steps:
the Sa1 and the first coordination end generate a fixed initiation public key component according to the multiplication inverse element of the first random number and base point position data of a preset elliptic curve.
The preset elliptic curve is a preset elliptic curve (denoted as E) meeting the SM2 algorithm, and the first cooperative end and the second cooperative end share a preset elliptic curve parameter E (F q), where the preset elliptic curve E is an elliptic curve defined on the finite field F q. The SM2 algorithm is an asymmetric encryption algorithm in Chinese cipher algorithm standards, is an elliptic curve public key cipher algorithm based on elliptic curve cryptography (Elliptic curve cryptography, ECC), and comprises digital signature, key exchange and public key encryption.
The base point position data of the preset elliptic curve is the position coordinate of the base point (marked as G) on the preset elliptic curve E, the base point G is a fixed point on the preset elliptic curve E and is used for executing key operation and generating key pairs, and each elliptic curve corresponds to one base point.
The first random number is a value randomly generated by the first cooperative end and is in the range of [1, n-1], wherein n is the order of the base point G. Alternatively, the first random number may be determined as the private key component of the first cooperating.
The fixed originating public key component is a public key component determined by the first cooperative end according to the first random number and the base point G, and is used to generate a fixed originating public key of the originating end 210.
Specifically, the first coordination end may generate a fixed initiation public key component, that is, the first coordination end may generate a random number by using a random number generator to obtain a first random number, determine the first random number as a private key component of the first coordination end, then calculate a multiplication inverse element of the first random number, and then calculate the fixed initiation public key component according to the multiplication inverse element of the first random number and the base point G, where a calculation formula may be:
Where P 1 represents the fixed-originating public key component, d 1 represents the first random number, Representing the multiplicative inverse of the first random number, [ ] represents a multiple point operation on a preset elliptic curve E, i.e./>Represents/>, on GDoubling points.
The first cooperating terminal may then send the fixed originating public key component to the second cooperating terminal.
And Sa2, the second cooperative end generates a fixed initiation public key according to the multiplication inverse element of the second random number, the base point position data of the preset elliptic curve and the fixed initiation public key component.
The second random number is a value randomly generated by the second cooperative end and is in the range of [1, n-1], and n is the order of the base point G. Alternatively, the second random number may be determined as the private key component of the second cooperating.
Specifically, after the first cooperative end obtains the fixed originating public key, the second cooperative end may generate the fixed originating public key, that is, the second cooperative end may receive the fixed originating public key component sent by the first cooperative end, then generate a random number by using a random number generator to obtain a second random number, determine the second random number as a private key component of the second cooperative end, then calculate a multiplicative inverse of the second random number, and calculate the fixed originating public key according to the multiplicative inverse of the second random number, the base point G and the fixed originating public key component, where a calculation formula may be:
Where P A represents the fixed initiation public key, d 2 represents a second random number, Representing the multiplicative inverse of the second random number.
In addition, after the first and second cooperating terminals cooperatively generate the fixed originating public key, the second cooperating terminal may separately generate the temporary originating public key of the originating terminal 210.
Further, the second cooperative end generates a temporary initiation public key, including: the second cooperative end generates a temporary initiation public key according to the third random number and base point position data of a preset elliptic curve.
The third random number is a value randomly generated by the second cooperative end and is in the range of [1, n-1], and n is the order of the base point G. Alternatively, the third random number may be determined as the temporary private key of the second coordination terminal.
Specifically, after the first cooperative end and the second cooperative end cooperatively generate the fixed initiation public key, the second cooperative end may generate the temporary initiation public key, that is, the second cooperative end may generate a random number by using a random number generator to obtain a third random number, determine the third random number as a temporary private key of the second cooperative end, and then calculate the temporary initiation public key according to the third random number and the base point G, where the calculation formula may be:
RA=[rA]G
Where R A represents the temporary initiation public key and R A represents a third random number.
Illustratively, the client is an initiator 210, the server is a responder 220, and the cooperative a-side and the cooperative b-side of the client generate a fixed initiation public key and a temporary initiation public key before the client sends the encrypted file to the server.
And S120, the second cooperative end sends the fixed initiation public key and the temporary initiation public key to the response end of the key exchange, so that the response end determines the shared key according to the fixed response public key, the temporary response public key, the fixed initiation public key and the temporary initiation public key.
The fixed public key is the public key of the responding terminal 220, and the temporary public key is the temporary public key of the responding terminal 220. The shared key is a key generated by the response end 220 according to its own fixed response public key and temporary response public key, and the fixed initiation public key and temporary initiation public key of the initiation end 210, and is used for decrypting received data (such as files, video and voice).
Specifically, after generating the fixed originating public key and the temporary originating public key, the second cooperative end may transmit the fixed originating public key and the temporary originating public key to the responding end 220. Then, the responding end 220 may receive the fixed initiation public key and the temporary initiation public key sent by the second cooperative end, and calculate the private key, the temporary private key, the fixed response public key and the temporary response public key of the responding end.
In one implementation, the responding end 220 may utilize the GM-T0003.3-2012 SM2 elliptic curve public key cryptography algorithm part 3: an algorithm (0003.3 standard algorithm for short) specified in the key exchange protocol calculates a private key, a temporary private key, a public key and a temporary public key of the algorithm, determines the public key as a fixed response public key, and determines the temporary public key as a temporary response public key.
For example, the response end 220 may generate a fourth random number by using a random number generator, determine the fourth random number as a temporary private key of the response end 220, and then calculate a temporary response public key according to the fourth random number and the base point G B of the SM2 elliptic curve, where the calculation formula may be:
RB=[rB]GB
Where R B represents the temporary response public key and R B represents the fourth random number.
It should be noted that the preset elliptic curve of the initiating terminal 210 and the SM2 elliptic curve of the responding terminal 220 may be the same elliptic curve, or may be different elliptic curves, that is, the base point G and the base point G B may be the same or different, which is not particularly limited in the embodiment of the present application.
In another implementation, the responding unit 220 may include a third cooperating unit and a fourth cooperating unit, where the third cooperating unit and the fourth cooperating unit may cooperatively generate a fixed response public key based on the same method as S110, and then the fourth cooperating unit may generate a temporary response public key, and the third cooperating unit and the fourth cooperating unit may respectively generate respective private key components based on the same method as S110. The third coordination end and the fourth coordination end are two communication ends of the response end 220, and the two communication ends may be mutually connected in a communication manner, which may be an internet manner or a local area network manner, and the embodiment of the present application is not limited in particular.
The responder 220 may then send the fixed response public key and the temporary response public key to the initiator 210, and calculate the shared key according to the fixed response public key and the temporary response public key of itself, and the fixed initiation public key and the temporary initiation public key of the initiator 210 using 0003.3 standard algorithm.
Illustratively, the client is an initiator 210, the server is a responder 220, and before the server sends the encrypted file to the client, the server generates its own private key and public key (i.e., a fixed response public key and a temporary response public key), and generates a shared key according to the fixed initiation public key and the temporary initiation public key sent by the client, and its own public key.
S130, the first cooperative end and the second cooperative end cooperatively generate a fixed hidden response public key corresponding to the fixed response public key and a temporary hidden response public key corresponding to the temporary response public key.
The fixed hidden response public key is a public key cooperatively generated by the first cooperative end and the second cooperative end according to the fixed response public key. The temporary hidden response public key is a public key cooperatively generated by the first cooperative end and the second cooperative end according to the temporary response public key.
Specifically, after the response terminal 220 transmits the fixed response public key and the temporary response public key, the second cooperative terminal may receive the fixed response public key and the temporary response public key and transmit the fixed response public key and the temporary response public key to the first cooperative terminal. The first cooperating terminal may then receive the fixed response public key and the temporary response public key.
The first cooperating terminal and the second cooperating terminal can cooperatively generate a fixed hidden response public key based on the fixed response public key.
Further, the first cooperative end and the second cooperative end cooperatively generate a fixed hidden response public key corresponding to the fixed response public key, which comprises the following steps:
and Sb1, the first cooperative end generates a fixed intermediate response public key according to the multiplication inverse element of the first random number and the fixed response public key.
The fixed intermediate response public key is a public key generated by the first cooperative end according to the first random number and the fixed response public key and is used for determining a fixed hidden response public key corresponding to the fixed response public key.
Specifically, after the first cooperative end receives the fixed response public key, the first cooperative end may generate a fixed intermediate response public key, that is, the first cooperative end may calculate the fixed intermediate response public key according to the multiplicative inverse of the first random number and the fixed response public key, and the calculation formula may be:
where P Ba represents a fixed intermediate response public key and P B represents a fixed response public key.
The first cooperating terminal may then send the fixed intermediate response public key to the second cooperating terminal.
And Sb2, the second cooperative end generates a fixed hidden response public key according to the multiplication inverse element of the second random number and the fixed intermediate response public key.
Specifically, after the first cooperative end generates the fixed intermediate response public key, the second cooperative end may generate the fixed hidden response public key, that is, the second cooperative end may receive the fixed intermediate response public key, and calculate the fixed hidden response public key according to the multiplicative inverse of the second random number and the fixed intermediate response public key, where the calculation formula may be:
Where P Bab represents a fixed hidden response public key.
Meanwhile, the first cooperative end and the second cooperative end can cooperatively generate the temporary hidden response public key based on the temporary response public key.
Further, the first cooperative end and the second cooperative end cooperatively generate a temporary hidden response public key corresponding to the temporary response public key, which comprises the following steps:
sc1, the first cooperative end generates a temporary intermediate response public key according to the multiplication inverse element of the first random number and the temporary response public key.
The temporary intermediate response public key is a public key generated by the first cooperative end according to the first random number and the temporary response public key and is used for determining a temporary hidden response public key corresponding to the temporary response public key.
Specifically, after the first cooperative end receives the temporary response public key, the first cooperative end may generate a temporary intermediate response public key, that is, the first cooperative end may calculate the temporary intermediate response public key according to the multiplicative inverse of the first random number and the temporary response public key, and the calculation formula may be:
Where R Ba represents the temporary intermediate response public key and R B represents the temporary response public key.
The first cooperating terminal may then send the temporary intermediate response public key to the second cooperating terminal.
Sc2, the second cooperative end generates a temporary hidden response public key according to the multiplication inverse element of the second random number and the temporary intermediate response public key.
Specifically, after the first cooperative end generates the temporary intermediate response public key, the second cooperative end may generate the temporary hidden response public key, that is, the second cooperative end may receive the temporary intermediate response public key, and calculate the temporary hidden response public key according to the multiplicative inverse of the second random number and the temporary intermediate response public key, where the calculation formula may be:
Where R Bab represents the temporary hidden response public key.
And S140, the second cooperative end determines the shared secret key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key.
Specifically, after obtaining the fixed hidden response public key, the temporary hidden response public key, the fixed response public key, and the temporary response public key, the second cooperative may generate the shared key.
Further, the second cooperative end determines a shared key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key, including:
Sd1, the second cooperative end determines position data of the temporary initiation public key on a preset elliptic curve, and determines position data of the temporary response public key on the preset elliptic curve.
The position data of the temporary initiation public key on the preset elliptic curve E is the position coordinate of the temporary initiation public key on the preset elliptic curve E. The position data of the temporary response public key on the preset elliptic curve E is the position coordinate of the temporary response public key on the preset elliptic curve E.
Specifically, the second cooperative end may obtain, based on the preset elliptic curve E, the position coordinates of the temporary initiation public key and the position coordinates of the temporary response public key, respectively, to obtain the position data of the temporary initiation public key on the preset elliptic curve E and the position data of the temporary response public key on the preset elliptic curve E, and then obtain the abscissa data of the temporary initiation public key and the abscissa data of the temporary response public key from the position data.
Sd2, the second cooperative end determines the shared secret key according to the third random number, the position data of the temporary initiation public key on the preset elliptic curve, the position data of the temporary response public key on the preset elliptic curve, the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key.
Specifically, the second coordination end may calculate the shared secret point according to the third random number, the abscissa data of the temporary initiation public key, the abscissa data of the temporary response public key, the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key, and the calculation formula may be:
Where U is the shared secret point, For temporarily initiating the abscissa data of the public key on the preset elliptic curve E,/>And (5) temporarily responding to the abscissa data of the public key on the preset elliptic curve E.
The second cooperating may then determine the shared key of the originating terminal 210 based on the shared secret point U using 0003.3 standard algorithms.
Illustratively, the client is an initiator 210, the server is a responder 220, and after the cooperative a-side and the cooperative b-side of the client generate the fixed initiation public key and the temporary initiation public key, the cooperative a-side and the cooperative b-side may generate the shared secret key according to the private key and the public key of the client and the public key of the server. When the shared secret keys respectively generated by the client and the server are the same, the client and the server are indicated to be legal identities, at the moment, the two parties can encrypt the file by using the shared secret key, and can decrypt the received encrypted file by using the shared secret key.
Fig. 4 is a schematic diagram of specific interaction between an initiating terminal and a responding terminal provided by an embodiment of the present application, which describes a specific interaction procedure in which the initiating terminal 210 and the responding terminal 220 each generate a shared key. The process of generating the shared key by the initiator 210 shown in fig. 4 includes the second coordinator generating a temporary initiation public key, and the first and second coordinators generating the shared key (i.e., sb1 to Sb2, sc1 to Sc2, and Sd1 to Sd 2) cooperatively.
Alternatively, the initiator 210 and the responder 220 may be replaced with each other, that is, the responder 220 performs the method steps of the initiator 210 (S110 to S140), and the initiator 210 performs the method steps of the responder 220.
According to the technical scheme, the first coordination end and the second coordination end can cooperatively generate the fixed initiation public key, namely the first coordination end determines the fixed initiation public key component according to the first random number and the base point G of the preset elliptic curve, then the second coordination end determines the fixed initiation public key according to the second random number, the base point G of the preset elliptic curve and the fixed initiation public key component, the function of cooperatively generating the fixed initiation public key by the first coordination end and the second coordination end is realized, the first coordination end and the second coordination end independently generate and store own private key components, in the whole life cycle of the private key, the complete private key cannot be generated in the computing environment of any one of the first coordination end and the second coordination end, meanwhile, the first coordination end and the second coordination end cannot acquire the private key component of the other party, so that an intruder cannot acquire the private key component of the other party when the other party is intruded, the security of the private key is effectively ensured, and the security of a government service system is further improved; the second cooperative end can generate a temporary initiation public key, namely the second cooperative end determines the temporary initiation public key according to the third random number and a base point G of a preset elliptic curve, so that the function of independently generating the temporary initiation public key by the second cooperative end is realized, the calculation efficiency of generating the temporary initiation public key is improved, and the implementation complexity is reduced; then, the responding end can determine the fixed response public key and the temporary response public key by using the same method as the initiating end or using 0003.3 standard algorithm, and calculate the shared key according to the fixed response public key and the temporary response public key of the responding end, and the fixed initiation public key and the temporary initiation public key of the initiating end, so that the function of determining the shared key by the responding end according to the public keys of the two parties (namely the initiating end and the responding end) is realized; after that, the first cooperative end and the second cooperative end can cooperatively generate a fixed hidden response public key corresponding to the fixed response public key, namely, the first cooperative end determines a fixed intermediate response public key according to the first random number and the fixed response public key, then the second cooperative end determines the fixed hidden response public key according to the second random number and the fixed intermediate response public key, and the first cooperative end and the second cooperative end realize the function of cooperatively generating the fixed hidden response public key according to the fixed response public key and respective private key components, so that data preparation can be made for cooperatively generating a shared key; meanwhile, the first cooperative end and the second cooperative end can cooperatively generate a temporary hidden response public key corresponding to the temporary response public key, namely the first cooperative end determines the temporary intermediate response public key according to the first random number and the temporary response public key, then the second cooperative end determines the temporary hidden response public key according to the second random number and the temporary intermediate response public key, and the first cooperative end and the second cooperative end realize the function of cooperatively generating the temporary hidden response public key according to the temporary response public key and respective private key components and can prepare data for cooperatively generating a shared key; and then, the second cooperative end can determine the shared key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key, namely, the abscissa data of the temporary initiation public key and the abscissa data of the temporary response public key are respectively acquired based on a preset elliptic curve, and the shared key is determined according to the third random number (namely, the temporary private key), the fixed hidden response public key, the temporary hidden response public key and the response end public key (namely, the fixed response public key and the temporary response public key), so that the function of determining the shared key by the initiating end according to the private key of the initiating end and the public keys of the two parties (namely, the initiating end and the response end) is realized, the key exchange method is further realized, the shared key and the private key are not transmitted in the interaction process of the initiating end and the response end, the security of the key is further ensured, and the security of a government service system is improved.
Fig. 5 is a schematic structural diagram of a key exchange device according to an embodiment of the present application, and referring to fig. 5, the key exchange device may include:
the first generating module 510 is configured to cooperatively generate a fixed initiation public key by using the first cooperative end and the second cooperative end, and generate a temporary initiation public key by using the second cooperative end;
The first determining module 520 is configured to send the fixed initiation public key and the temporary initiation public key to the response end of the key exchange by the second coordination end, so that the response end determines the shared key according to the fixed response public key, the temporary response public key, the fixed initiation public key and the temporary initiation public key;
the second generating module 530 is configured to cooperatively generate a fixed hidden response public key corresponding to the fixed response public key and a temporary hidden response public key corresponding to the temporary response public key by using the first cooperative end and the second cooperative end;
The second determining module 540 is configured to determine the shared key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key, and the temporary response public key by the second coordination end.
In an embodiment, the first cooperative end and the second cooperative end in the first generating module 510 cooperatively generate a fixed originating public key, including:
the first cooperative end generates a fixed initiation public key component according to the multiplication inverse element of the first random number and base point position data of a preset elliptic curve;
the second cooperative end generates a fixed initiation public key according to the multiplication inverse element of the second random number, the base point position data of the preset elliptic curve and the fixed initiation public key component.
In an embodiment, the first cooperative end and the second cooperative end in the second generating module 530 cooperatively generate a fixed hidden response public key corresponding to the fixed response public key, which includes:
The first cooperative end generates a fixed intermediate response public key according to the multiplication inverse element of the first random number and the fixed response public key;
and the second coordination end generates a fixed hidden response public key according to the multiplication inverse element of the second random number and the fixed intermediate response public key.
In an embodiment, the cooperative generation of the temporary hidden response public key corresponding to the temporary response public key by the first cooperative end and the second cooperative end in the second generating module 530 includes:
The first cooperative end generates a temporary intermediate response public key according to the multiplication inverse element of the first random number and the temporary response public key;
and the second coordination end generates a temporary hidden response public key according to the multiplication inverse element of the second random number and the temporary intermediate response public key.
In one embodiment, the generating, by the second cooperating terminal in the first generating module 510, the temporary initiation public key includes:
the second cooperative end generates a temporary initiation public key according to the third random number and base point position data of a preset elliptic curve.
In an embodiment, the determining, by the second cooperating terminal in the second determining module 540, the shared key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key includes:
the second cooperative end determines position data of the temporary initiation public key on a preset elliptic curve and determines position data of the temporary response public key on the preset elliptic curve;
The second cooperative end determines a shared secret key according to the third random number, the position data of the temporary initiation public key on the preset elliptic curve, the position data of the temporary response public key on the preset elliptic curve, the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above. The specific working process of the functional module described above may refer to the corresponding process in the foregoing method embodiment, and will not be described herein.
The key exchange device provided in this embodiment is applicable to the key exchange method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Fig. 6 shows a block diagram of an exemplary electronic device 11 suitable for use in implementing embodiments of the present application, wherein the electronic device 11 may be a first cooperating terminal of an initiating terminal or a second cooperating terminal of an initiating terminal. The electronic device 11 shown in fig. 6 is only an example, and should not impose any limitation on the function and the range of use of the present embodiment.
As shown in fig. 6, the electronic device 11 is in the form of a general purpose computing electronic device. Components of the electronic device 11 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The electronic device 11 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic device 11 and includes both volatile and non-volatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The electronic device 11 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the application.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 11 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the electronic device 11, and/or with any device (e.g., network card, modem, etc.) that enables the electronic device 11 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 11 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 20.
As shown in fig. 6, the network adapter 20 communicates with other modules of the electronic device 11 via the bus 18. It should be appreciated that although not shown in fig. 6, other hardware and/or software modules may be used in connection with the electronic device 11, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and page displays by running a program stored in the system memory 28, for example, implementing a key exchange method provided in the present embodiment, applied to an originating terminal of a key exchange, where the originating terminal includes a first cooperative terminal and a second cooperative terminal, and the method includes:
The first cooperative end and the second cooperative end cooperatively generate a fixed initiation public key, and the second cooperative end generates a temporary initiation public key;
The second cooperative end sends the fixed initiation public key and the temporary initiation public key to the response end of the key exchange, so that the response end determines the shared key according to the fixed response public key, the temporary response public key, the fixed initiation public key and the temporary initiation public key;
The first cooperative end and the second cooperative end cooperatively generate a fixed hidden response public key corresponding to the fixed response public key and a temporary hidden response public key corresponding to the temporary response public key;
the second cooperative end determines the shared secret key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key.
Of course, those skilled in the art will appreciate that the processor may also implement the technical solution of the key exchange method provided in any embodiment of the present application.
The present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a key exchange method, for example provided by an embodiment of the present application, applied to an originating terminal of a key exchange, the originating terminal including a first cooperating terminal and a second cooperating terminal, the method comprising:
The first cooperative end and the second cooperative end cooperatively generate a fixed initiation public key, and the second cooperative end generates a temporary initiation public key;
The second cooperative end sends the fixed initiation public key and the temporary initiation public key to the response end of the key exchange, so that the response end determines the shared key according to the fixed response public key, the temporary response public key, the fixed initiation public key and the temporary initiation public key;
The first cooperative end and the second cooperative end cooperatively generate a fixed hidden response public key corresponding to the fixed response public key and a temporary hidden response public key corresponding to the temporary response public key;
the second cooperative end determines the shared secret key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key.
The computer storage media of the present embodiments may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
It will be appreciated by those of ordinary skill in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed over a network of computing devices, or they may alternatively be implemented in program code executable by a computer device, such that they are stored in a memory device and executed by the computing device, or they may be separately fabricated as individual integrated circuit modules, or multiple modules or steps within them may be fabricated as a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
In addition, the technical scheme of the application can acquire, store, use, process and the like the data, which accords with the relevant regulations of national laws and regulations.
Note that the above is only a preferred embodiment of the present application and the technical principle applied. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, while the application has been described in connection with the above embodiments, the application is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit of the application, which is set forth in the following claims.

Claims (10)

1.A key exchange method, applied to an originating terminal of a key exchange, the originating terminal including a first cooperating terminal and a second cooperating terminal, the method comprising:
The first cooperative end and the second cooperative end cooperatively generate a fixed initiation public key, and the second cooperative end generates a temporary initiation public key;
The second cooperative end sends the fixed initiation public key and the temporary initiation public key to a response end of the key exchange, so that the response end determines a shared key according to the fixed response public key, the temporary response public key, the fixed initiation public key and the temporary initiation public key;
The first cooperative end and the second cooperative end cooperatively generate a fixed hidden response public key corresponding to the fixed response public key and a temporary hidden response public key corresponding to the temporary response public key;
And the second cooperative end determines the shared secret key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key.
2. The key exchange method according to claim 1, wherein the first cooperating terminal and the second cooperating terminal cooperatively generate a fixed originating public key, comprising:
the first coordination end generates a fixed initiation public key component according to the multiplication inverse element of the first random number and base point position data of a preset elliptic curve;
And the second cooperative end generates the fixed initiation public key according to the multiplication inverse element of the second random number, the base point position data of the preset elliptic curve and the fixed initiation public key component.
3. The key exchange method according to claim 2, wherein the first cooperative end and the second cooperative end cooperatively generate a fixed hidden response public key corresponding to the fixed response public key, including:
the first cooperative end generates a fixed intermediate response public key according to the multiplication inverse element of the first random number and the fixed response public key;
and the second cooperative end generates the fixed hidden response public key according to the multiplication inverse element of the second random number and the fixed intermediate response public key.
4. The key exchange method according to claim 2, wherein the first cooperating terminal and the second cooperating terminal cooperatively generate a temporary hidden response public key corresponding to the temporary response public key, including:
the first cooperative end generates a temporary intermediate response public key according to the multiplication inverse element of the first random number and the temporary response public key;
and the second cooperative end generates the temporary hidden response public key according to the multiplication inverse element of the second random number and the temporary intermediate response public key.
5. The key exchange method according to claim 1, wherein the generating of the temporary initiation public key by the second coordination terminal includes:
And the second cooperative end generates the temporary initiation public key according to the third random number and the base point position data of the preset elliptic curve.
6. The key exchange method according to claim 5, wherein the second coordination terminal determining the shared key according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key, and the temporary response public key, includes:
the second cooperative end determines the position data of the temporary initiation public key on the preset elliptic curve and determines the position data of the temporary response public key on the preset elliptic curve;
The second cooperative end determines the shared key according to the third random number, the position data of the temporary initiation public key on the preset elliptic curve, the position data of the temporary response public key on the preset elliptic curve, the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key.
7. A key exchange apparatus, characterized by an originating terminal for use in a key exchange, the originating terminal comprising a first cooperating terminal and a second cooperating terminal, the apparatus comprising:
The first generation module is used for cooperatively generating a fixed initiation public key by the first cooperative end and the second cooperative end, and generating a temporary initiation public key by the second cooperative end;
the first determining module is configured to send the fixed initiation public key and the temporary initiation public key to a response end of key exchange by the second coordination end, so that the response end determines a shared key according to the fixed response public key, the temporary response public key, the fixed initiation public key and the temporary initiation public key;
The second generation module is used for cooperatively generating a fixed hidden response public key corresponding to the fixed response public key and a temporary hidden response public key corresponding to the temporary response public key by the first cooperative end and the second cooperative end;
And the second determining module is used for determining the shared secret key by the second cooperative end according to the fixed hidden response public key, the temporary hidden response public key, the fixed response public key and the temporary response public key.
8. A key exchange system, the system comprising: a response end and an initiating end for performing the key exchange method of any one of claims 1 to 6.
9. An electronic device, the electronic device comprising:
At least one processor; and a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the key exchange method of any one of claims 1 to 6.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the key exchange method of any one of claims 1 to 6.
CN202410202208.5A 2024-02-23 2024-02-23 Key exchange method, device, system, equipment and storage medium Pending CN117978383A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410202208.5A CN117978383A (en) 2024-02-23 2024-02-23 Key exchange method, device, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410202208.5A CN117978383A (en) 2024-02-23 2024-02-23 Key exchange method, device, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117978383A true CN117978383A (en) 2024-05-03

Family

ID=90857519

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410202208.5A Pending CN117978383A (en) 2024-02-23 2024-02-23 Key exchange method, device, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117978383A (en)

Similar Documents

Publication Publication Date Title
CN107483212B (en) Method for generating digital signature by cooperation of two parties
CN109150499B (en) Method and device for dynamically encrypting data, computer equipment and storage medium
WO2021012574A1 (en) Multisignature method, signature center, medium and electronic device
CN111130803B (en) Method, system and device for digital signature
CN111200502B (en) Collaborative digital signature method and device
CN113364760A (en) Data encryption processing method and device, computer equipment and storage medium
CN113708930B (en) Data comparison method, device, equipment and medium for private data
CN107342861B (en) Data processing method, device and system
CN110177099B (en) Data exchange method, transmitting terminal and medium based on asymmetric encryption technology
EP3720164A1 (en) Message authentication method for communication network system, communication method and communication network system
CN111753318A (en) Multi-party security calculation method, device and system for private data
CN111555880B (en) Data collision method and device, storage medium and electronic equipment
CN108964893A (en) A kind of cipher key processing method, device, equipment and medium
CN109981576A (en) Key migration method and apparatus
CN109272314A (en) A kind of safety communicating method and system cooperateing with signature calculation based on two sides
CN111327605A (en) Method, terminal, server and system for transmitting private information
CN112734423A (en) Transaction method based on block chain and terminal equipment
CN109903047A (en) Key migration method and apparatus
CN106411520B (en) Method, device and system for processing virtual resource data
CN114553590A (en) Data transmission method and related equipment
CN113742709A (en) Information processing method and device, readable medium and electronic equipment
CN110690969A (en) Method and system for completing bidirectional SSL/TLS authentication in cooperation of multiple parties
US20190081790A1 (en) Authenticated broadcast encryption
CN114465801A (en) Method and device for reporting trusted data and electronic equipment
CN111798236B (en) Transaction data encryption and decryption methods, devices and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination