CN110022320A - A kind of communication partner method and communication device - Google Patents
A kind of communication partner method and communication device Download PDFInfo
- Publication number
- CN110022320A CN110022320A CN201910275903.3A CN201910275903A CN110022320A CN 110022320 A CN110022320 A CN 110022320A CN 201910275903 A CN201910275903 A CN 201910275903A CN 110022320 A CN110022320 A CN 110022320A
- Authority
- CN
- China
- Prior art keywords
- equipment
- key
- public key
- median
- identifying code
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
- H04L63/0442—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/06—Network architectures or network communication protocols for network security for supporting key management in a packet data network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/06—Network architectures or network communication protocols for network security for supporting key management in a packet data network
- H04L63/068—Network architectures or network communication protocols for network security for supporting key management in a packet data network using time-dependent keys, e.g. periodically changing keys
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the invention discloses a kind of communication partner methods, are applied to the first equipment, this method comprises: receiving the second temporary public key from the second equipment after sending pairing request to the second equipment;Generate the first temporary public key and the first temporary private, and the dynamic password based on the first equipment of input generates the first median, the second median is generated based on the first temporary public key and the second temporary public key, the first identifying code is generated based on the first median and the second median, the first temporary public key and the first identifying code are sent to the second equipment and carry out the first verifying;After first is verified, public key is matched with the second devices exchange.The embodiment of the invention also discloses a kind of communication devices.Pairing scheme through the embodiment of the present invention can establish the communication key with higher-security and ease for use.
Description
Technical field
The present invention relates to field of information security technology, in particular to a kind of communication partner method and communication device.
Background technique
Communication channel between equipment, especially wireless communication are easy by the eavesdropping of malicious attacker and to logical
Letter data is distorted.Therefore, it is necessary to data encryption is carried out in communication channel.Pairing refers to establishes mutually between both devices
The relationship of trust is capable of the negotiation communication key of safety, to establish the data channel of safety in equipment room.
In the prior art, usually in equipment, identical encryption key is preset.This mode needs equipment going out
Unified setting is carried out when factory to need to negotiate common key, key between different vendor if equipment is produced by different vendor
Negotiation and management cost it is very high, and be easy leakage.
In the prior art, also have using Diffie-Hellman negotiating algorithm key, Diffie-Hellman algorithm
The disadvantage is that there is man-in-the-middle attack, attacker can intercept and capture key agreement information in communication channel, and respectively with communication
Both sides establish communication key.
Summary of the invention
In view of this, the embodiment of the present invention proposes a kind of communication partner method and communication device, it is able to solve existing skill
Security risk in art, attacker can not carry out man-in-the-middle attack by intercepting and capturing key agreement information over the communication channels.
For this purpose, on the one hand the embodiment of the present invention proposes a kind of communication partner method, it is applied to the first equipment, this method packet
It includes: after sending pairing request to the second equipment, receiving the second temporary public key from the second equipment;Generate the first temporary public key and first
Temporary private, and the dynamic password based on the first equipment of input generates the first median, is faced based on the first temporary public key and second
When public key generate the second median, the first identifying code is generated based on the first median and the second median, by the first temporary public key
The second equipment, which is sent to, with the first identifying code carries out the first verifying;After first is verified, matched with the second devices exchange
Public key.
On the other hand the embodiment of the present invention proposes a kind of communication partner method, be applied to the first equipment, comprising: generates the
Third temporary public key is sent to the second equipment, and receives pairing public affairs from the second equipment by three temporary public keys and third temporary private
Key identifies ciphertext and the 4th temporary public key;The parameter of algorithm and agreement based on agreement calculates the second key, uses the second key
Pairing public key mark and the first check value are obtained from pairing public key mark ciphertext, the parameter of the agreement includes that third is interim
Private key and the 4th temporary public key;Third is carried out to first check value using pairing public key corresponding with pairing public key mark to test
Card;After third is verified, data communication is carried out by communication key and the second equipment of second key.
The embodiment of the present invention provides a kind of communication device simultaneously, as the first equipment, comprising: memory, configuration
To store scheduled computer instruction;Processor is configured to execute the scheduled computer instruction aforementioned any to realize
Processing in communication partner embodiment of the method.
Communication partner method and communication device through the embodiment of the present invention, both devices to be paired first carry out being based on facing
When public key and dynamic password verifying, be verified rear both devices exchange pairing public key, to be matched and to be communicated, once
Successful matching can easily establish the communication key for having certain timeliness, have very high ease for use.
Detailed description of the invention
Fig. 1 is the schematic flow chart of the communication partner method of one embodiment of the invention;
Fig. 2 is the schematic flow chart of the communication partner method of another embodiment of the present invention;
Fig. 3 is the schematic flow chart of the communication partner method of another embodiment of the present invention;
Fig. 4 is the flow chart of an illustrative examples of communication partner method of the invention.
Specific embodiment
Each embodiment of the invention is described in detail with reference to the accompanying drawings.
Fig. 1 is the schematic flow chart of the communication partner method of one embodiment of the invention.The communication of the embodiment of the present invention
Matching method is applied to carry out in communication partner and two communication equipments (the first equipment and the second equipment) of data transmission
Issue a communication equipment (the first equipment) for pairing request.
As shown in Figure 1, the communication partner method of the embodiment of the present invention includes:
After S11, the first equipment send pairing request to the second equipment, the second temporary public key is received from the second equipment;
S12, the first temporary public key and the first temporary private are generated, and the dynamic password based on the first equipment of input generates the
One median generates the second median based on the first temporary public key and the second temporary public key, based in the first median and second
Between value generate the first identifying code, by the first temporary public key and the first identifying code be sent to the second equipment carry out first verifying;
S13, after first is verified, with the second devices exchange match public key.
First equipment and the second equipment can be owned by same user, can also be owned by different user.First equipment and
After second equipment sets up communication channel by broadcast singal and request connection, the first equipment issues communication to the second equipment and matches
To request.After second equipment receives the request of the communication partner from the first equipment, the second temporary public key and second is generated temporarily
Second temporary public key therein is sent to the first equipment by private key.
User inputs dynamic password to the first equipment, is based on dynamic password for the first equipment and generates the first median.It is dynamic
State password can be after the second equipment is generated and displayed to user and is input in the first equipment by user, be also possible to be set by other
The first equipment is separately input to by user for generation and after showing or being sent to the user of the first equipment and the user of the second equipment
In the second equipment.First equipment and the second equipment can negotiate the algorithm that the first median is generated based on dynamic password in advance,
So that the first equipment and the second equipment can generate identical first median based on same dynamic password.Generate the first median
Algorithm for example can be MD5, SHA1, MAC etc..
First equipment generates the first temporary public key and the second temporary public key of itself, and is receiving second from the second equipment
After temporary public key, the second median is generated based on the first temporary public key and the second temporary public key.Generate the algorithm of the second median
Also negotiated in advance by the first equipment and the second equipment, so as to the first equipment and the second equipment can based on the first temporary public key and
Second temporary public key generates identical second median.The algorithm for generating the second median can be with the calculation of the first median of generation
Method is same or different, such as be also possible to MD5, SHA1, MAC etc..
After generating the first median and the second median, the first equipment is based on the first median and the second median generates
First identifying code.It for example can be directly using MD5, SHA1, MAC scheduling algorithm to the first median and the when generating the first identifying code
Two medians carry out operation and obtain, and first can also use the agreement negotiated with the second equipment to the first median and the second median
Algorithm calculates third median, reuses MD5, SHA1, MAC scheduling algorithm and carries out operation to third median and obtains, etc..
After generating the first identifying code, the first equipment is by the first identifying code of generation and is the first temporary public key of itself generation
The second equipment is sent to be verified.Second equipment receives the first identifying code and the first temporary public key from the first equipment
Afterwards, a median is generated based on the algorithm negotiated with the first equipment of above-mentioned dynamic password, based on the first temporary public key and the
The algorithm negotiated with the first equipment of two temporary public keys generates a median, and based on the two medians generated with
First equipment negotiate algorithm generate an identifying code, by the identifying code of generation with from received first identifying code of the first equipment into
Row compares, as comparison result unanimously if by the first verifying, the first equipment and the second equipment carry out exchanging for pairing public key, completion
Communication partner between first equipment and the second equipment.
It, can be public to pairing using the equipment public key of other side respectively in the first equipment and the second devices exchange pairing public key
Key is sent to other side after being encrypted, also can be used the symmetric key negotiated in advance to after pairing public key encryption again with other side's
Equipment public key is sent to other side to the symmetric key encryption and by pairing public key cryptography and symmetric key ciphertext.In addition, sending
When matching public key, the mark for matching public key can also be sent to other side together simultaneously, to be managed to pairing public key,
Convenient for according to the pairing public key of identifier lookup distinct device.In addition, pairing private key pair can also be used when sending and matching public key
Pairing public key carries out signature operation, and obtained digital signature is sent to other side together with pairing public key, so as to other side's use
The pairing public key for sending method, apparatus carries out sign test to digital signature, further increases the safety of equipment room pairing.
Communication partner method through the embodiment of the present invention, in the verifying before being matched, not only using based on first
The median that the temporary public key of equipment and the temporary public key of the second equipment generate, also using based on the first equipment and the second equipment two
The median that dynamic password that person shares generates generates the identifying code for carrying out pair verification, and dynamic password is not by logical
Believe that line transmission to the first equipment, but by user's the first equipment of input, realizes safe pair verification and pair-wise key
Safety is sent with charge free.Even if attacker has intercepted and captured the interim public affairs of the first equipment in the communication channel between the first equipment and the second equipment
The temporary public key of key and the second equipment also can not can not illegally be set it by the means of man-in-the-middle attack without dynamic password is obtained
Standby the first equipment with as legitimate device and the second equipment are matched respectively, thus can not be with the first equipment and the second equipment
Set up legal pairing relationship.In addition, communications equipment vendor is avoided without preset communication key in a communications device in advance
Negotiate the troublesome operation and insecurity of common key between different vendor.
Fig. 2 is the schematic flow chart of the communication partner method of another embodiment of the present invention.
As shown in Fig. 2, the communication partner method of the embodiment of the present invention includes:
After S21, the first equipment send pairing request to the second equipment, the second temporary public key is received from the second equipment;
S22, the first temporary public key and the first temporary private are generated, and the dynamic password based on the first equipment of input generates the
One median generates the second median based on the first temporary public key and the second temporary public key, based in the first median and second
Between value generate the first identifying code, by the first temporary public key and the first identifying code be sent to the second equipment carry out first verifying;
S23, after first is verified, from the second equipment receive the second identifying code and carry out second verifying, that is, base
Third identifying code is generated at least one of the first temporary public key and the second temporary public key and the first identifying code, and by third
Identifying code is compared with the second identifying code;
S24, after second is verified, with the second devices exchange match public key.
S21-S22 is identical as the S11-S12 in embodiment illustrated in fig. 1 in the embodiment of the present invention, omits illustrate herein,
Lower mask body is illustrated S23-S24.
In embodiments of the present invention, after the second equipment is verified the first identifying code, the second identifying code is also generated
It returns to the first equipment and carries out the second verifying, the first equipment after the second verifying by just carrying out between the first equipment and the second equipment
The operation of exchange pairing public key.Specifically, in an embodiment of the invention, the second equipment verifies the first identifying code
By rear, the algorithm negotiated with the first equipment can be used, the data being made of the first identifying code and the first temporary public key are carried out
Operation generates the second identifying code and is sent to the second verifying of the first equipment progress, and the second equipment is tested using identical algorithm by first
The data of card code and the first temporary public key composition carry out operation and generate identifying code and send the identifying code of generation and the second equipment
The second identifying code compare, by the second verifying if comparison is consistent, otherwise terminate to match process.It is another in the present invention
In a embodiment, after the second equipment is verified the first identifying code, negotiation algorithm can be used to by the first identifying code
It is sent to the first equipment progress second with data progress operation the second identifying code of generation of the second temporary public key composition to verify, second
Equipment carries out operation to the data being made of the first identifying code and the second temporary public key using identical algorithm and generates identifying code simultaneously
The second identifying code that the identifying code of generation and the second equipment are sent is compared into verifying.In further embodiment of the present invention,
After second equipment is verified the first identifying code, negotiation algorithm can be used to by the first identifying code, the first interim public affairs
The data of key and the second temporary public key composition carry out operation the second identifying code of generation and are sent to the second verifying of the first equipment progress, the
Two equipment carry out operation to the data being made of the first identifying code and the second temporary public key using identical algorithm and generate identifying code
And the second identifying code for sending the identifying code of generation with the second equipment is compared and is verified.
Communication partner method through the embodiment of the present invention, the second equipment complete the first verifying to the first identifying code
Afterwards, the second identifying code also is generated based on the first identifying code to verify the first equipment, further improved by bi-directional verification
The reliability of pair verification can successfully manage man-in-the-middle attack.
In some embodiment of the invention, the first equipment and the second equipment are generating the first median and the second median
When, a part of the value generated using negotiation algorithm operation can be taken as median to be used.Specifically, optionally,
When generating the first median, the negotiation algorithms such as MD5 can be used based on dynamic password progress operation and obtain the first operation values, take
The predetermined portions of first operation values are as the first median, such as take the preceding 1-3 byte of the first operation values as among first
Value.Optionally, when generating the second median, the negotiation algorithms such as MD5 can be used and be based on the first temporary public key and second temporarily
The data splitting of public key carries out operation and obtains the second operation values, takes the predetermined portions of the second operation values as the second median, example
Such as take preceding 2 bytes of the second operation values as the second median.Communication partner method through the embodiment of the present invention, Neng Gou
While ensuring higher safety, operand needed for reducing pairing process improves operating efficiency.
In some embodiment of the invention, when the first equipment generates the first temporary private and the first temporary public key, Ke Yixian
A random number is generated as the first temporary private, the progress operation of the first temporary private is then based on and obtains the first temporary public key,
Such as ECC private key can be first generated, then corresponding private key is calculated using KDF (cipher key derivation function) method.Optionally, second
Equipment generate the second temporary private with similar method can also be used when the second temporary public key.
In some embodiment of the invention, when the first equipment generates the first temporary public key, the first temporary private can be based on
And it is calculated according to the operation of one or both of power operation and modular arithmetic.It is, for example, possible to use the radixes of agreement to first
Temporary private carries out power operation and obtains the first temporary public key, or is obtained using the modulus of agreement to the progress modular arithmetic of the first temporary private
The first temporary private arrange operation result after power operation to the first temporary public key, or using the radix of agreement
Modulus carry out modular arithmetic obtain the first temporary public key.Optionally, the second equipment generates the second temporary private and the second interim public affairs
Similar method can also be used when key.
In some embodiment of the invention, the second equipment also generates random number as the first salt figure and is sent to the first equipment,
After first equipment receives the first salt figure from the second equipment, the first median, the second median or the first verifying can generated
Also it is used as one of operational parameter to carry out operation the first salt figure when code, it can be only when generating the first median and the second median
Use the first salt figure to carry out operation as one of parameter, can also be tested in the first median of generation and the second median and first
Using the first salt figure as one of operational parameter when demonstrate,proving code.For example, by the first salt figure and can be moved when generating the first median
State password reuses negotiation algorithm and carries out operation the first median of generation after being combined.Second equipment is generating among first
Also the first salt figure is used to carry out operation as one of parameter when value, the second median and the first identifying code, correspondingly so as to second
Equipment can favorably accomplish the verifying to the first identifying code.Through the embodiment of the present invention, pair verification can be further increased
Safety and reliability.
In some embodiment of the invention, the first equipment can first be based on the first median when generating the first identifying code
With the second middle-value calculating first key factor, first key is generated according to the first key factor, is then based on first key again
Generate the first identifying code.Second equipment is calculated accordingly when verifying to the first identifying code.In the embodiment of the present invention,
The method for calculating the first key factor is unrestricted, for example, the algorithm of negotiation can be used to by the first median in the first equipment
Operation, which is carried out, with the numerical value that the second median is spliced into obtains the first key factor;Optionally, the first equipment can also be by first
Median and the second median carry out multiplying and the numerical value that takes the pact of operation result to position is as the first key factor, etc.
Deng.Generating first key according to the first key factor can be used SHA algorithm or any KDF algorithm.It is raw based on first key
When at the first identifying code, negotiation algorithm can be used, operation the first identifying code of generation is carried out to first key, association also can be used
Quotient's algorithm carries out operation to the numerical value being spliced by first key and other data and generates the first identifying code.In the embodiment of the present invention
The first key of generation can be used as agreement key pair predetermined value and be encrypted, for example, can set in the first equipment and second
When standby exchange pairing public key, use first key as the agreement key pair pairing public key to be transmitted and other data (as identified
Data, signed data etc.) encrypted together after transmitted, to further increase the safety of communication partner and reliable
Property.
In some embodiment of the invention, the first equipment is being based on the first median and the second middle-value calculating first key
Because of the period of the day from 11 p.m. to 1 a.m, the operation of at least one of power operation and modular arithmetic can be carried out to the first median and the second median to calculate the
One cryptographic key factor.For example, the first equipment can by according to the radix of agreement to the first median carry out the obtained value of power operation with
The obtained value of power operation is carried out to the second median according to the radix of agreement the operations such as it is added, subtracts each other or be multiplied to obtain first key
The factor;Optionally, the first equipment can will carry out the value and basis that modular arithmetic obtains to the first median according to the modulus of agreement
The modulus of agreement to the second median carry out the obtained value of modular arithmetic be added, subtract each other or be multiplied etc. operations obtain first key because
Son, or by according to the radix of agreement to the first median carry out the obtained value of power operation with according to the modulus of agreement in second
Between value carry out the operations such as be added, subtracted each other or be multiplied of modular arithmetic obtained value and obtain the first key factor;Optionally, it first sets
It is standby can also be after carrying out power operation using average value of the radix of agreement to the first median and the second median to operation
As a result modular arithmetic is carried out with the modulus of agreement obtain first key factor, etc..
In some embodiment of the invention, the first equipment is being based on the first median and the second middle-value calculating first key
Because of the period of the day from 11 p.m. to 1 a.m, in addition to using the first median and the second median as operational parameter other than, the first temporary public key, second can also be faced
When public key or the first temporary private as one of operational parameter, or using the second temporary public key and the first temporary public key as operation
Parameter, or using the second temporary public key and the first temporary private as operational parameter.
Specifically, in some embodiment of the invention, when by the first temporary public key and/or the second temporary public key and
When one median and the second median are as operational parameter, it can be used and using the first median and the second median as parameter
When similar mode calculate the first key factor, such as using agreement radix respectively to the first median, the second median,
One temporary public key and the second temporary public key obtain the operations such as be added, subtracted each other or be multiplied of each operation result after power operation
To the first key factor, with the radix of agreement to the value being added by the first median, the second median, the first temporary public key
Modular arithmetic, etc. is carried out to the modulus of operation result agreement after carrying out power operation.
When the first equipment and the second equipment are calculating separately what first key had been shared because the period of the day from 11 p.m. to 1 a.m has used in above-described embodiment
Parameter, therefore identical formula or the algorithm calculating first key factor can be used.In further embodiments, when the first/the
Two temporary public keys are when being calculated based on first/second temporary private, and the first equipment and the second equipment are calculating separately first
When cryptographic key factor using can be different parameter, and calculate the first key factor using corresponding formula or algorithm.In some realities
It applies in example, when the first equipment calculates first using the first temporary private and the first median and the second median as operational parameter
When cryptographic key factor, the first temporary public key and the first median and the second median is can be used as operational parameter in the second equipment
The first key factor is calculated, for example, the first median is denoted as x, the second median is denoted as u, and the first key factor is denoted as S, and
First temporary private is denoted as a, the first temporary public key is denoted as A, and A=g^a%N, and wherein g is the radix of agreement, and N is agreement
Modulus, ^ indicate that power operation, % indicate modular arithmetic, then the first equipment calculates first key because formula S=(g^a can be used in the period of the day from 11 p.m. to 1 a.m
+ g^x+g^u) %N, the second equipment calculates first key and formula S=(A+g ∧ x+g^u) %N can be used because of the period of the day from 11 p.m. to 1 a.m.Another
In a little embodiments, when the first equipment makees the first temporary private, the second temporary public key and the first median and the second median
It is that operational parameter calculates first key because of the period of the day from 11 p.m. to 1 a.m, the first temporary public key, the second temporary private and the can be used in the second equipment
One median and the second median calculate the first key factor as operational parameter, for example, continue to use above-mentioned label, and by second
Temporary private is denoted as b, and the second temporary public key is denoted as B, and A=g^a%N, B=g^b%N, then the first equipment calculates first key
Because formula S=(g^a+B+g^x+g^u) %N can be used in the period of the day from 11 p.m. to 1 a.m, the second equipment calculates first key because calculation can be used in the period of the day from 11 p.m. to 1 a.m
Formula S=(A+g^b+g^x+g^u) %N.Method through the embodiment of the present invention, the first equipment and the second equipment use different calculations
Formula or algorithm calculate the first key factor, can further increase the safety and reliability of pair verification.
In some embodiment of the invention, when the second equipment also generates the first salt figure as previously described and is sent to the first equipment,
First equipment can also also regard the first salt figure as one of parameter when generating the first identifying code, such as using negotiation algorithm to
The data splitting of one key and the first salt figure carries out operation and obtains the first identifying code, or using negotiation algorithm to first key,
The data splitting of first salt figure and the first temporary public key carries out operation and obtains the first identifying code, or using negotiation algorithm to first
The data splitting progress operation of key, the first salt figure, the first temporary public key and the second temporary public key obtains the first identifying code.Pass through
The embodiment of the present invention can further increase the complexity of the first identifying code, improve the safety and reliability of pair verification.
In some embodiment of the invention, the first equipment is when generating the first identifying code, can also use first key and
First about definite value is as parameter the first identifying code of generation.In some embodiments, the first about definite value can be the first equipment and
The fixed value that two equipment are negotiated, such as agreement radix above-mentioned or agreement modulus are that can be used as the first about definite value.In other realities
It applies in example, the first about definite value can be what the first equipment and the second equipment engagement arithmetic negotiated the first equipment and the second equipment
What fixed value was calculated, MD5 the or SHA scheduling algorithm of negotiation can be used for example to agreement radix above-mentioned or about cover half
It counts progress operation and obtains the first about definite value, or algorithm the obtaining with progress operation to agreement cardinal sum agreement modulus using negotiation
To the first about definite value.The negotiation algorithm of such as SHA can also be used respectively to agreement radix above-mentioned in yet other embodiments,
After about cover half number carries out operation, operation result add, is subtracted, the operations such as OR (or operation) or HOR (XOR operation) obtain
First about definite value.Through the embodiment of the present invention, the complexity that can also further increase the first identifying code, improves pair verification
Safety and reliability.
It can be obtained by carrying out different combinations to above-described embodiment in some embodiments of the invention.For example, can incite somebody to action
The embodiment for carrying out the embodiment and calculating first key that carry out the second verifying after the first verifying is combined, and is implemented as follows
Example: after the first equipment sends pairing request to the second equipment, the second temporary public key is received from the second equipment.Then, the first equipment
The first temporary public key and the first temporary private are generated, and the dynamic password based on the first equipment of input generates the first median, base
The second median is generated in the first temporary public key and the second temporary public key, is based on the first median and the second middle-value calculating first
Cryptographic key factor, generates first key according to the first key factor, the first identifying code is generated further according to first key, then by first
Temporary public key and the first identifying code are sent to the second equipment and carry out the first verifying.Second equipment is based in first according to negotiation algorithm
Between value and the second middle-value calculating first key factor, according to the first key factor generate first key, further according to first key
Identifying code is generated, the identifying code of generation is compared verifying with the first identifying code.The first identifying code is carried out in the second equipment
It is proved to be successful, namely after first is verified, the second equipment is using negotiation algorithm to by the first identifying code and first key
The data of composition carry out operation the second identifying code of generation and are sent to the second verifying of the first equipment progress, and the second equipment, which uses, negotiates calculation
Method carries out operation generation third identifying code to the data being made of the first identifying code and first key and verifies the third of generation
The second identifying code that code is sent with the second equipment compares verifying.Match after second is verified, then with the second devices exchange
To public key, wherein in exchange pairing public key, carried out after being encrypted with first key to pairing public key and other data
Transmission.Optionally, in the present embodiment, the second equipment, can also be by the first temporary public key and when generating the second identifying code
At least one of two temporary public keys are used as operational parameter simultaneously, and the first temporary public key, first key and the can be used for example
One identifying code as a parameter to calculate the second identifying code, or using the first temporary public key, the second temporary public key, first key and
First identifying code is as a parameter to calculate the second identifying code.First equipment is when verifying the second identifying code, also using corresponding ginseng
Whether number calculates third identifying code consistent to verify the second identifying code.Through the embodiment of the present invention, identifying code is based on first key
It generates, pairing public key transmits after being encrypted with first key, can increase strongly the safety and reliability of pair verification.
Fig. 3 is the schematic flow chart of the communication partner method of another embodiment of the present invention.The communication of the embodiment of the present invention
Matching method, which is applied to the sending communication in two communication equipments to be carried out data transmission (the first equipment and the second equipment), asks
The communication equipment (the first equipment) asked.The method of the embodiment of the present invention can be walked in the exchange pairing public key of previous embodiment
It carries out, can also be carried out after carrying out pairing exchange of public keys according to the prior art after rapid.
As shown in figure 3, the communication partner method of the embodiment of the present invention includes:
S31, third temporary public key and third temporary private are generated, third temporary public key is sent to the second equipment, and from
Second equipment receives pairing public key mark ciphertext and the 4th temporary public key;
The parameter of S32, the algorithm based on agreement and agreement calculates the second key, using the second key from the pairing public key
It identifies ciphertext and obtains pairing public key mark and the first check value, the parameter of the agreement includes that third temporary private and the 4th are interim
Public key;
S33, third verifying is carried out to first check value using pairing public key corresponding with pairing public key mark;
S34, after third is verified, it is logical to carry out data using second key as communication key and the second equipment
Letter.
In the embodiment of the present invention, after the first equipment and the second equipment complete the exchange of pairing public key, when the first equipment and the
When needing to establish communication key between two equipment, pair verification step is executed.In pair verification, the first equipment does not use
One temporary public key and the second temporary public key, but generate third temporary public key and third temporary private, and by third therein
Temporary public key is sent to the second equipment by pair verification request.Second equipment from the first equipment receive third temporary public key and
When pair verification is requested, the 4th temporary public key and the 4th temporary private are generated, the parameter of algorithm and agreement based on agreement generates
The method or other methods similar with aforementioned generation first key can be used in second key, the method for generating the second key.So
Afterwards, the second equipment carries out processing to the mark of the pairing public key of the second equipment using the pairing private key of the second equipment and generates the first school
It tests value, or uses the number that forms to the mark of the pairing public key by the second equipment and other data of pairing private key of the second equipment
The first check value is generated according to processing is carried out, then using the mark of the pairing public key of second the second equipment of key pair or includes second
Data and the first check value including the mark of the pairing public key of equipment encrypt to obtain pairing public key mark ciphertext, will match public key
Mark ciphertext and the 4th temporary public key are sent to the first equipment.Wherein, the first check value for example can be using the second equipment
Match private key to the second equipment pairing public key mark or comprising the second equipment pairing public key mark including data into
The digital signature that row signature obtains.It and may include the second equipment in the data handled when wherein, generating the first check value
Match mark, third temporary public key and/or the 4th temporary public key of public key.
First equipment from the second equipment receive pairing public key mark ciphertext and the 4th temporary public key after, also based on agreement
The parameter of algorithm and agreement generates the second key, is decrypted to obtain the first school using the second key pair pairing public key mark ciphertext
The data including the pairing public key volume mark of value and the second equipment or the mark of the pairing public key comprising the second equipment are tested, then root
The second equipment that the identifier lookup of the pairing public key of the second equipment obtained according to decryption is obtained and stored to previously passed pairing
Public key is matched, third verifying is carried out to the first check value using the pairing public key of second equipment found.It is verified in third
By rear, the first equipment and the second equipment can carry out mutual data communication as communication key using the second key.
In the embodiment of the present invention, by carrying out individual pair verification when establishing communication key, built after enabling to
The safety with higher of vertical communication channel, effectively resists man-in-the-middle attack.
In some embodiment of the invention, it in S34 after third is verified, also needs to carry out the 4th verifying and verify logical
It crosses, the first equipment and the second equipment just carry out mutual data communication by communication key of the second key.Specifically, the first equipment
Using the pairing private key of the first equipment to the mark of the pairing public key of the first equipment or the pairing public key including the first equipment
Data including mark calculate the second check value, set with the mark of the pairing public key of second the first equipment of key pair or comprising first
Data including the mark of standby pairing public key are sent to the second equipment and carry out the 4th verification after encrypting together with the second check value.
After second equipment receives the pairing public key mark ciphertext of the first equipment, decrypted using the second key pair pairing public key mark ciphertext
Including obtaining the mark of the pairing public key of the second check value and the first equipment or the mark of the pairing public key comprising the first equipment
Data, what the identifier lookup of the pairing public key of the first equipment then obtained according to decryption was obtained and stored to previously passed pairing
The pairing public key of first equipment carries out the 4th verifying to the second check value using the pairing public key of first equipment found.
After the 4th is verified, the first equipment and the second equipment can carry out mutual data as communication key using the second key
Communication.
In the embodiment of the present invention, by carrying out individually two-way pair verification when establishing communication key, it is enabled to
The communication channel established afterwards has higher safety, more effectively resists man-in-the-middle attack.
The embodiment of the present invention provides a kind of communication device simultaneously, can be used as above-mentioned first equipment, which includes
Memory and processor, memory are configurable to store scheduled computer instruction, and processor is configurable to execute this pre-
Fixed computer instruction is to realize operation processing that the first equipment in any of the above-described communication partner method is realized.The embodiment of the present invention
A kind of communication device has been also correspondingly provided, can be used as above-mentioned second equipment, which includes memory and processor, is deposited
Reservoir is configurable to store scheduled computer instruction, and processor is configurable to execute the scheduled computer instruction with reality
The operation processing that the second equipment is realized in existing any of the above-described communication partner method.
Fig. 4 is the flow chart of an illustrative examples of communication partner method of the invention.In Fig. 4, two are connected
The operating process carried out after communication channel has been established in the equipment connect, the two equipment are respectively labeled as equipment A and equipment B.Specifically
Operating process is as follows:
Step 401, equipment A initiate pairing request to equipment B.
Step 402, equipment B generate salt figure s and temporary private b at random, random to generate dynamic password p and on its display screen
It has been shown that, and the first median x=H of calculating (s | p), H indicates Hash calculation, and takes a portion;Calculate temporary public key B=g^ (x
+ b) %N, wherein g is the radix arranged in advance, and N is the modulus arranged in advance, and ^ indicates that power operation, % indicate modular arithmetic;By s and
B is sent to equipment A.
The password p that step 403, equipment A reception user input, the first median x=H of calculating (s | p);Random generate is faced
When private key a, calculate temporary public key A=g^a%N;Calculate the second median u=H (A | B);It calculates as the first key factor
Shared secret S=(B-g^x) ^ (a+u*x) %N;The key K as first key is derived by shared secret S, derives from algorithm
It can be hash algorithm or any KDF algorithm;Calculate identifying code M=H (H (N) XOR H (g) | s | A | B | K), wherein XOR table
Show XOR operation;A and M are sent to equipment B.
Step 404, equipment B calculate shared secret S=(A*v^u) ^b%N, wherein v=g^x%N;Pass through shared secret S
Derive key K;Equipment B calculates M ' with same method, compared with M, if it is different, pairing failure, terminates this process;If phase
Together, it calculates M2=H (A | M | K), M2 is sent to equipment A.
Step 405, equipment A calculate M2 ' with same method, compared with M2, if it is different, pairing failure, terminates this process;
If identical, Enc (IdA | PublicKeyA | Sig) is sent to equipment B.Wherein, IdA is the mark of equipment A pair-wise key,
PublicKeyA is that equipment A matches public key, and Sig is to match private key using equipment A to calculate IdA | the digital signature of PublicKeyA,
Enc indicates to encrypt using shared key K.
Step 406, equipment B are verified digital signature, are tested using shared key K decryption Enc (IdA | PublicKeyA | Sig)
By IdA and PublicKeyA associated storage after demonstrate,proving successfully, and Enc (IdB | PublicKeyB | Sig) is sent to equipment A.Its
In, IdB is the mark of equipment B pair-wise key, and PublicKeyB is that equipment B matches public key, and Sig is to match private key using equipment B
Calculating IdB | the digital signature of PublicKeyB, Enc indicate to encrypt using shared key K.
Step 407, equipment A are verified digital signature, are tested using shared key K decryption Enc (IdB | PublicKeyB | Sig)
IdB and PublicKeyB is saved after demonstrate,proving successfully.
401-407 through the above steps completes the pairing of equipment A Yu equipment B.
When to establish communication key between equipment A and equipment B, following pair verification step is executed:
Step 408, equipment A initiate pair verification to equipment B, generate temporary key pair: temporary public key
Temporary public key TempPublicKeyA is sent to equipment B by TempPublicKeyA and temporary private TempPrivateKeyA.
Step 409, equipment B generate temporary key pair: temporary public key TempPublicKeyB and temporary private
TempPrivateKeyB is calculated using TempPrivateKeyB and TempPublicKeyA by Diffie-Hellman algorithm
Out as the shared secret S of the second cryptographic key factor, the key K as the second key is derived by shared secret S, derives from algorithm
It can be hash algorithm or any KDF algorithm;Calculating Enc (IdB | Sig), wherein IdB is that equipment B matches public key mark, Sig
To use pairing private key to calculate TempPublicKeyB | IdB | the digital signature of TempPublicKeyA, Enc indicate to use key
K encryption;Temporary public key TempPublicKeyB and Enc (IdB | Sig) are sent to equipment A.
Step 410, equipment A are calculated using TempPrivateKeyA and TempPublicKeyB by Diffie-Hellman
Method calculates shared secret S, derives key K by shared secret S, and deriving from algorithm can be hash algorithm or any KDF
Algorithm;Decryption Enc (IdB | Sig) obtain IdB | Sig is signed using the pairing public key verifications of equipment B.If verifying does not pass through,
Pair verification failure, terminates this process;If the verification passes, it calculates Enc (IdA | Sig), wherein IdA is that equipment A matches public key
Mark, Sig are to calculate TempPublicKeyA using pairing private key | IdA | the digital signature of TempPublicKeyB, Enc are indicated
It is encrypted using key K;Enc (IdA | Sig) is sent to equipment B.
Step 411, equipment B obtain IdA using key K decryption Enc (IdA | Sig) | and Sig uses the pairing public key of equipment A
Verifying signature.If verifying does not pass through, pair verification failure terminates this process;If the verification passes, pair verification success, if
Standby A and equipment B establishes shared key K.
Although it should be noted that simultaneously including pairing process (401- according to the present invention in the embodiment of the present invention
407) it and pair verification process (408-411) according to the present invention, but can be independent from each other between the two processes, change speech
It, step 408-411 can not also be continued to execute after step 401-407, but executes the pair verification mistake of the prior art
Journey does not execute pair verification and directly carries out data transmission;Meanwhile it may not be before step 408-411 and executing step
Rapid 408-411, but execute and match process according to prior art to complete the exchange of pairing public key.
By the above method, the pairing between equipment is realized, participating in without using person can be in the equipment matched
Between establish reliable communication key, so that it is guaranteed that the data safety of communication channel.As can be seen that even if malicious attacker is intercepted and captured
Data on channel, since dynamic password can not be obtained, can not by man-in-the-middle attack by its illegality equipment and legitimate device into
Row pairing, and then legal signature can not be also forged during pair verification, to can not be shared with legitimate device foundation close
Key.
Two specific embodiments of embodiment as indicated at 4 are given below, this can be more fully understood referring now still to Fig. 4
The embodiment of invention:
First embodiment
For convenience of explanation, the parameter digit chosen in present embodiment is smaller, should use in practical application bigger
Digit guarantees the safety of algorithm.In this example, pairing is established between equipment A and equipment B, equipment A's is identified as 00, equipment
B's is identified as 01 (unless otherwise specified, following data is indicated with 16 system formats).G value 2, N value 7.Hash algorithm makes
With SHA1 algorithm, Digital Signature Algorithm uses RSA Algorithm, and temporary key is Diffie-Hellman algorithm secret key.
401, equipment A initiates pairing request to equipment B.
402, equipment B generates random number 5 and is used as salt figure, generates random number 6 and is used as dynamic password, generates 2 conduct of random number
Temporary private, then SHA1 (05 | 06) takes first character section to obtain x=F0, public key B=2^F0+2^2%7=5, and 05 05 are sent
Give equipment A.
403, equipment A receives the password 06 of user's input, calculates x=F0;It generates random number 3 and is used as temporary private,
Public key A=2^3%7=1;SHA1 (01 | 04) take first character section to obtain u=A7;Calculate shared secret S=(05-2^F0) ^
(03+A7*F0) %7=1 uses 01 34 32 C7 of ED 3B 9D E1 of SHA1 algorithm derivative key K=2D, 20 FE 69
53 2B 4C of 7B calculates check code M=SHA1 (99 F1 C6,52 EB FA, 50 62 63 4C 9D 2A BC 96 08 30
11 63 FA of 7A | 05 | 01 | 04 | 01 34 69 7B of ED 3B 9D E1 32C7 20FE of 2D, 53 2B 4C)=83 4A 72
02 C0 2F, 33 47 39 DD ED of E4 F9 3C, 33 D8 E1 0,7D2 57, by 01 83 4A, 72 02 C0 2F 33
33 D8E1 of E4 F9 47 39 DD ED of 3C, 07 D2 57 is sent to equipment B.
404, equipment B calculates shared secret S=(01*1^A7) ^2%7=1, uses SHA1 algorithm derivative key K=2D
01 34 69 7B of ED 3B 9D E1 32 C7,20 FE, 53 2B 4C calculates 72 02 C0 2F of check code M '=834A
33 33 D8 E1 of E4 F9 47 39 DD ED of 3C 07 D2 57 is identical as received M;Calculate check code M2=SHA1 (01
|83 4A 72 02 C0 2F 33 E4 F9 3C 47 39 DD ED 33 D8 E1 07 D2 57|2D 01 34 ED 3B
69 7B of 9D E1 32 C7,20 FE, 53 2B 4C)=65 11 5B 7B of E2 D1 4C of B5 E4 6C E5,81 99 F2
89 DD of D3,80 A2 09, is sent to equipment A for M2.
405, equipment A calculates M2 '=65 11 5B 7B of E2 D1 4C of B5 E4 6C E5,81 99 F2 with same method
89 DD of D3 80 A2 09 is identical as M2.Generate RSA public private key pair, public key are as follows:
30818902818100a2a13e18384ff3cf56f9b52f5e80625d8ae5349c23bc122e9acf69
7c59cd479da95022e2b2709c4e3ad74e02c51d94d1eb471896a7cece375805240c67e4fb21fd
752305c9086df489e8d32ac5b40824b706783bb41ee0284b75f7c95f8e6c6606f80808090c32
974d23359ab353c5e32fb9802fffe67135f89ff5a3a22643030203010001
Private key are as follows:
3082025c02010002818100a2a13e18384ff3cf56f9b52f5e80625d8ae5349c23bc12
2e9acf697c59cd479da95022e2b2709c4e3ad74e02c51d94d1eb471896a7cece375805240c67
e4fb21fd752305c9086df489e8d32ac5b40824b706783bb41ee0284b75f7c95f8e6c6606f808
08090c32974d23359ab353c5e32fb9802fffe67135f89ff5a3a2264303020301000102818004
40f26bab6c0fefa591e776cde279702d40b1d51456dd7a36eb63921b3e8977d564b6b2364248
1c55b6a9a031ec0451f9f4ef4435846d140e807d410e7b48999578eea5aeadd2805c88e95cb6
b9955ec8ddb2323651cbd18d2ef2dd1dd3e57c11bfc5a11ffc97ba27e4d9d3892eaa85b8f785
a85f2de26bf9303fe544e18799024100c0f1ca4a5b1cd37a3459151f2f83e2a6c51c6c5291d0
6fd2d537fc52bc644ef5960d5af012e4dd794bedcaab9ccc54e8543410bc28aebdcab92b7a0e
67999eeb024100d7c74157be575a550aec6ceed3334b18b45675f55a5bdbef0fc475912ac444
0658e56480c892416a9ff5c3af973bb189b4d45eaacc739295a51ff110589f5649024060575b
3f0d87b3410dea7d5579104d98204c34fa75bcb2598005d88427759ec79a0949231f0c105a84
c353b3a533922200098f61a49ebc3e017fe80e5144afc902410083db4f22bf3dc20595d743f9
ed35bafe2db567ffb667cbce1a648333625eecf2b3fff99a78f666e3313c8d880f727adb1b95
6b04144bcb9786802e5f3ec89f8102404aceb656c94ea442419e9ecd74b28118dbe576483674
20b5cdd786cdd1270335eb39ff123f02c9fb0ea2a641d2c565d1eac5a005aa7c8c0cbe54a9f6
adfe180f
Use private key pair
00|30818902818100a2a13e18384ff3cf56f9b52f5e80625d8ae5349c23bc122e9ac
f697c59cd479da95022e2b2709c4e3ad74e02c51d94d1eb471896a7cece375805240c67e4fb2
1fd752305c9086df489e8d32ac5b40824b706783bb41ee0284b75f7c95f8e6c6606f80808090
The signature of c32974d23359ab353c5e32fb9802fffe67135f89ff5a3a2264303020 3010001 obtains:
24b999451f018ce9d15a61bbdf984a6669066b48fd8e2c3eafb2c72dbb317c29c5c9
7b03b49eaac7a7cc0c5415ff15a34e8d69655db277721cf4427ef2c67e2f41a304217a652d7f
05e0959baf1871cff9da2a2fef0f4b323cb0a5dea6b65dc94a88d81009b1afbec96b350b162c
b0562e5bad71024f9f42893033f71c970850
It is encrypted using key K
00|30818902818100a2a13e18384ff3cf56f9b52f5e80625d8ae5349c23bc122e9ac
f697c59cd479da95022e2b2709c4e3ad74e02c51d94d1eb471896a7cece375805240c67e4fb2
1fd752305c9086df489e8d32ac5b40824b706783bb41ee0284b75f7c95f8e6c6606f80808090
c32974d23359ab353c5e32fb9802fffe67135f89ff5a3a22643030203010001|24b999451f01
8ce9d15a61bbdf984a6669066b48fd8e2c3eafb2c72dbb317c29c5c97b03b49eaac7a7cc0c54
15ff15a34e8d69655db277721cf4427ef2c67e2f41a304217a652d7f05e0959baf1871cff9da
2a2fef0f4b323cb0a5dea6b65dc94a88d81009b1afbec96b350b162cb0562e5bad71024f9f42
893033f71c970850030303
It obtains:
1239acf9750e0b3cd7a18658ce721148ee992861757f772c3ba8a5f02d074c85060f
5139fc665be3dbe911f89a132d95404f48886a2253717819e483106c92c35ef584314b0cca00
ee8c5388d53593cb6ab6ca7b16cda29d166a8144221f867f113cb0a6e7a505ca5618a68fecbc
7120d9907ba3da6ea325cabbf6b54e583ab861c35f1be7186e3fd622ccfdabe40bb904ae7c0a
59d722fffbd35ed9ea09c9f6dedc2ae9b2f34f9c279b415a79560b94e97cf5128547e93eb75e
1513778df2d7f2aa44a147d0410e014fb0c82269f8544bd00d32020e70297e46de314a9384b0
faa2d598ccd43f954a4e883b565e5111a25834d5a0577193a6f75091af07cb8aeca20066ed8a
e03b96e7fe7c2cc13f02
Send it to equipment B.
406, equipment B decrypts to obtain using key K:
0030818902818100a2a13e18384ff3cf56f9b52f5e80625d8ae5349c23bc122e9acf
697c59cd479da95022e2b2709c4e3ad74e02c51d94d1eb471896a7cece375805240c67e4fb21
fd752305c9086df489e8d32ac5b40824b706783bb41ee0284b75f7c95f8e6c6606f80808090c
32974d23359ab353c5e32fb9802fffe67135f89ff5a3a2264303020301000124b999451f018c
e9d15a61bbdf984a6669066b48fd8e2c3eafb2c72dbb317c29c5c97b03b49eaac7a7cc0c5415
ff15a34e8d69655db277721cf4427ef2c67e2f41a304217a652d7f05e0959baf1871cff9da2a
2fef0f4b323cb0a5dea6b65dc94a88d81009b1afbec96b350b162cb0562e5bad71024f9f4289
3033f71c970850
After verifying signature, by equipment A mark 00 and public key
30818902818100a2a13e18384ff3cf56f9b52f5e80625d8ae5349c23bc122e9acf69
7c59cd479da95022e2b2709c4e3ad74e02c51d94d1eb471896a7cece375805240c67e4fb21fd
752305c9086df489e8d32ac5b40824b706783bb41ee0284b75f7c95f8e6c6606f80808090c32
974d23359ab353c5e32fb9802fffe67135f89ff5a3a2264303020301 0001 is saved.It is public and private to generate RSA
Key pair, public key are as follows:
30818902818100b0b83434bb25eba44ed48cdab0eec816b7dc672a755f4538ddf35f
09c673d925f2c3ce99d127145f695031609015650e21eddc6cae313a819e08d4b5c5953a2fd0
1cb3d87131d39da423958dc56539b62aa040474e2712b6c6ec18c38a30722770e85fc3866022
f616b04655650dc4a9665a881905f76ebbd201f85fbe5909dd0203010001
Private key are as follows:
3082025c02010002818100b0b83434bb25eba44ed48cdab0eec816b7dc672a755f45
38ddf35f09c673d925f2c3ce99d127145f695031609015650e21eddc6cae313a819e08d4b5c5
953a2fd01cb3d87131d39da423958dc56539b62aa040474e2712b6c6ec18c38a30722770e85f
c3866022f616b04655650dc4a9665a881905f76ebbd201f85fbe5909dd020301000102818053
84aaffa4d71617d03db9d7fd38cc8d98156d186ee238b7d885958bec238223e228d23275db8f
504c585f0db0eabb98c346441f84efb523df097365f8dc3ee3e2da0a3b6ecd293094aba565ea
11a1c9efce99375a0ac3f1d7d774e6a2a3982f33ad8699b37690daa691588d8a25658444fc85
b2c9c423a191afe0d1c353348d024100d77f92e8643792d14ec356b323ac839b17cc2e77cde9
f292de090dcf416c0551f0bb6ef620f04f2fc7a1229f0efb360a920d406634b969eb9bd088db
d975f853024100d1eed69eed467df25cf62b273d1444502c45d0e109a5d69964d8c9a86bd39e
3ed379a1b7ea0f1cdeef92118bd05da877fa78fb2af95235226c736bd930beef0f024100807c
74f81080be0e03fb1ddf735eb19d3044325486367dc629929664436a878582960ea3bba1ec64
dd8eea98919320768efc4db062b146410f46f7c2b556cc3702403f6a4b70c4b237977fd768df
b886a7c0242f8ed27bcc99cfca73e62eb72bbcb0b3c7193fea37587c4b982f2eb1e9a8db5d51
306621dc606a9ea21b2107a595a702401ca2359415432ccb243e08b77de0b9791379ecbef017
9813f38b3752121f8a68276959a1785019c052072546866d9206f5c748044a341c8bad019e2a
187bbee2
Use private key pair
01|30818902818100b0b83434bb25eba44ed48cdab0eec816b7dc672a755f4538ddf
35f09c673d925f2c3ce99d127145f695031609015650e21eddc6cae313a819e08d4b5c5953a2
fd01cb3d87131d39da423958dc56539b62aa040474e2712b6c6ec18c38a30722770e85fc3866
The signature of 022f616b04655650dc4a9665a881905f76ebbd201f85fbe5909dd020 3010001 obtains:
0ae2357a8a97ec6e5e4bc754d9619f76cb217e57e57069467cbd169e4c4939a39da8
e2303c8f0cc8ab31ba528acee2e6d309428197350b29762735ab979456ff874680cd78bc1d8f
0dee4a839a9227c7f7c2c6c5dfc4f62363b1ff738b4e94bb7f2a7f7433368f14eb497efe47c0
57eb8dd45a56207a8c9ba18a12dcae5b6813
It is encrypted using key K
01|30818902818100b0b83434bb25eba44ed48cdab0eec816b7dc672a755f4538ddf
35f09c673d925f2c3ce99d127145f695031609015650e21eddc6cae313a819e08d4b5c5953a2
fd01cb3d87131d39da423958dc56539b62aa040474e2712b6c6ec18c38a30722770e85fc3866
022f616b04655650dc4a9665a881905f76ebbd201f85fbe5909dd0203010001|0ae2357a8a97
ec6e5e4bc754d9619f76cb217e57e57069467cbd169e4c4939a39da8e2303c8f0cc8ab31ba52
8acee2e6d309428197350b29762735ab979456ff874680cd78bc1d8f0dee4a839a9227c7f7c2
c6c5dfc4f62363b1ff738b4e94bb7f2a7f7433368f14eb497efe47c057eb8dd45a56207a8c9b
a18a12dcae5b6813030303
It obtains:
8b5a647c3c10bb5c495121d03ddbba7c55093f3a93a6d9c7196888d18a538cf9acfc
04c5917ddfccd31e8568cd5ed1543e7bb6e293f37f7bf8e666ea9aed780081ba50e150a0e018
f39ff3f490e870020f08d67b3c73f9e33ea375cc3793a92fbebdf0d617f17adc8b2f6585209b
34bd4b3bcc9e3e781dca94889b3f594d830ba9de867e62f51e7c6ad0e06fe57fb90ae934d466
dc0b2c83fff2add73c09c64d23dfc492e658717852518512c852651d2bb311343d9b9a1a029c
1cab8a2aa545e50a5d3399d4f492590fe24866788b43bfb3ff31ed29e3af1d8aac22700985b0
ff13e30d52d743b65bf1fa06374889300ce6b30ee144fc7b2eae5d06ca213136b36c47da29a9
1cd8d9af1543adac2c73
Send it to equipment A.
407, equipment A decrypts to obtain using key K:
0130818902818100b0b83434bb25eba44ed48cdab0eec816b7dc672a755f4538ddf3
5f09c673d925f2c3ce99d127145f695031609015650e21eddc6cae313a819e08d4b5c5953a2f
d01cb3d87131d39da423958dc56539b62aa040474e2712b6c6ec18c38a30722770e85fc38660
22f616b04655650dc4a9665a881905f76ebbd201f85fbe5909dd02030100010ae2357a8a97ec
6e5e4bc754d9619f76cb217e57e57069467cbd169e4c4939a39da8e2303c8f0cc8ab31ba528a
cee2e6d309428197350b29762735ab979456ff874680cd78bc1d8f0dee4a839a9227c7f7c2c6
c5dfc4f62363b1ff738b4e94bb7f2a7f7433368f14eb497efe47c057eb8dd45a56207a8c9ba1
8a12dcae5b6813
After verifying signature, by equipment B mark 01 and public key
30818902818100b0b83434bb25eba44ed48cdab0eec816b7dc672a755f4538ddf35f
09c673d925f2c3ce99d127145f695031609015650e21eddc6cae313a819e08d4b5c5953a2fd0
1cb3d87131d39da423958dc56539b62aa040474e2712b6c6ec18c38a30722770e85fc3866022
F616b04655650dc4a9665a881905f76ebbd201f85fbe5909dd020301 0001 is saved.
So far, equipment A and equipment B complete pairing, and pair verification process is described below:
G value 2 in Diffie-Hellman algorithm, N value 5.
408, equipment A generates random number 3 and is used as temporary private, temporary public key 2^3%5=3.Equipment B is sent to by 03.
409, equipment B generates random number 2 and is used as temporary private, temporary public key 2^2%5=4;Shared secret S=3^2%5
=4;K=SHA1 (S)=a42c6cf1de3abfdea9b95f34687cbbe9 is calculated using SHA1 algorithm;Calculate the signature Sig
=Sign (04 01 03)=
2804c0441052398b6c030e5016b62e34144852e97e68599099ec2ba25b77039f2289
3f832ca2b714c2f35c7ae1fe2b9ba5810ed7c640bdf32d24b691b948e3246b9f9bfaa3607d90
8f8985ea615be52d03c51b5865932faa6347ba8c012695b4cb83c0ce458e81ace6793f7b3205
4f3a007a50d7655b26957d68f098a2e45458;
It is encrypted using key K
01
2804c0441052398b6c030e5016b62e34144852e97e68599099ec2ba25b77039f2289
3f832ca2b714c2f35c7ae1fe2b9ba5810ed7c640bdf32d24b691b948e3246b9f9bfaa3607d90
8f8985ea615be52d03c51b5865932faa6347ba8c012695b4cb83c0ce458e81ace6793f7b3205
4f3a007a50d7655b26957d68f098a2e454580f0f0f0f0f0f0f0f0f0f 0f0f0f0f0f is obtained:
91202ec6faaee01415da9491fd8cbec34f63f241bc8323c24f656003453580786b98
54c28f3dbac648351d914a2a157ba34f503756380296d6d5e8e9c960447eb740845c6f07c4bd
8b4f0d5725b7e9ddc0a47acabb47fad1cbd7e27c424e8c6b71ccd860141c4a09183b3ec998bf
9c2d33b8438250ec1c5e1a33c787d30cf4c08124daf5bcbc5f21db8c 742e00208f2d by it and faces
When public key 04 be sent to equipment A.
410, equipment A calculates S=4^3%5=4;K=SHA1 (S)=a42c6cf1de3abf is calculated using SHA1 algorithm
dea9b95f34687cbbe9;It is decrypted using key K
91202ec6faaee01415da9491fd8cbec34f63f241bc8323c24f656003453580786b98
54c28f3dbac648351d914a2a157ba34f503756380296d6d5e8e9c960447eb740845c6f07c4bd
8b4f0d5725b7e9ddc0a47acabb47fad1cbd7e27c424e8c6b71ccd860141c4a09183b3ec998bf
9c2d33b8438250ec1c5e1a33c787d30cf4c08124daf5bcbc5f21db8c 742e00208f2d is obtained:
01
2804c0441052398b6c030e5016b62e34144852e97e68599099ec2ba25b77039f2289
3f832ca2b714c2f35c7ae1fe2b9ba5810ed7c640bdf32d24b691b948e3246b9f9bfaa3607d90
8f8985ea615be52d03c51b5865932faa6347ba8c012695b4cb83c0ce458e81ace6793f7b3205
4f3a007a50d7655b26957d68f098a2e454580f0f0f0f0f0f0f0f0f0f 0f0f0f0f0f, verifying signature are logical
It crosses.
Calculate the signature Sig=Sign (03 00 04)=
8af8a79111d21b1082a7d72147f7a19f223ab7109590b9c439c4b9a80b39af2b92d9
50316435f28c1fe9f158dccf14dab236ab6a9ba0b4492ac5cf1285c7286d95c1bb1fc2fb3540
8be8432d9cb29af3c9b4edc6abcc7408559e748ce98a44b9be5ecc0ff0bcc6501da1b1e1c8ae
8d481612ec23567bdbc876587594dde6ce79
It is encrypted using key K
00
8af8a79111d21b1082a7d72147f7a19f223ab7109590b9c439c4b9a80b39af2b92d9
50316435f28c1fe9f158dccf14dab236ab6a9ba0b4492ac5cf1285c7286d95c1bb1fc2fb3540
8be8432d9cb29af3c9b4edc6abcc7408559e748ce98a44b9be5ecc0ff0bcc6501da1b1e1c8ae
8d481612ec23567bdbc876587594dde6ce790f0f0f0f0f0f0f0f0f0f 0f0f0f0f0f is obtained:
2a42ce5d8245c9481473ba489e0e5fe5a26e343fd0728f7512a9ddc1db5fe110ede6
b6e9442e3e027d89bd242145318e4440f1920e3711dab298e5848584c0e1ebbfffaeb4e1d0a1
22d3556d9f059c25c0fc5adef0e278475786b15d8560eab9a9b262c58de24587519badbe62f6
F4ba88723a1776740d514ce635ee7f612c6f19555a4eeaf373750448 24821a21ea43, is sent to
Give equipment B.
411, equipment B is decrypted using key K
2a42ce5d8245c9481473ba489e0e5fe5a26e343fd0728f7512a9ddc1db5fe110ede6
b6e9442e3e027d89bd242145318e4440f1920e3711dab298e5848584c0e1ebbfffaeb4e1d0a1
22d3556d9f059c25c0fc5adef0e278475786b15d8560eab9a9b262c58de24587519badbe62f6
F4ba88723a1776740d514ce635ee7f612c6f19555a4eeaf373750448 24821a21ea43 is obtained:
00
8af8a79111d21b1082a7d72147f7a19f223ab7109590b9c439c4b9a80b39af2b92d9
50316435f28c1fe9f158dccf14dab236ab6a9ba0b4492ac5cf1285c7286d95c1bb1fc2fb3540
8be8432d9cb29af3c9b4edc6abcc7408559e748ce98a44b9be5ecc0ff0bcc6501da1b1e1c8ae
8d481612ec23567bdbc876587594dde6ce790f0f0f0f0f0f0f0f0f0f 0f0f0f0f0f, verifying signature are logical
It crosses, equipment B and equipment A have shared key K.
Second embodiment
Ground is similar with first embodiment, the parameter digit chosen in present embodiment is smaller, should make in practical application
Guarantee the safety of algorithm with bigger digit.In this example, pairing, the mark of equipment A are established between equipment A and equipment B
It is 00, equipment B's is identified as 01 (unless otherwise specified, following data is indicated with 16 system formats).G value 2, N value 5.
Hash algorithm uses MD5 algorithm, and Digital Signature Algorithm uses ECDSA algorithm, and temporary key is ECDH algorithm secret key.
401, equipment A initiates pairing request to equipment B.
402, equipment B generates random number 5 and is used as salt figure, generates random number 6 and is used as dynamic password, generates 2 conduct of random number
Temporary private, then MD5 (05 | 06) takes first character section to obtain x=8A, public key B=2^8A+2^2%5=3, and 05 03 are sent
Give equipment A.
403, equipment A receives the password 06 of user's input, calculates x=8A;It generates random number 3 and is used as temporary private,
Public key A=2^3%5=3;MD5 (03 | 03) take first character section to obtain u=AC;Calculate shared secret S=(03-2^8A) ^ (03
+ AC*8A) %5=1, use MD5 algorithm derivative key K=55a54008ad1ba589aa210d2629c1df41, calculating verification
Code M=MD5 (9e688c58a5487b8eaf69c9e1005ad08f | 05 | 03 | 03 |
5a54008ad1ba589aa210d2629c1df41)=12552e8715c6f9ee8a2183e8c33eb7f8, by 03 1255
2e8715c6f9ee8a2183e8c33eb7f8 is sent to equipment B.
404, equipment B calculates shared secret S=(03*4^AC) ^2%5=1, uses MD5 algorithm derivative key K=55a5
4008ad1ba589aa210d2629c1df41 calculates check code M '=12552e8715c6f9ee8a2183e8c33eb7f8,
It is identical as received M;Calculating check code M2=MD5 (03 | 12552e8715c6f9ee8a2183e8c33eb7f8 | 55a54008
M2 is sent to equipment A by ad1ba589aa210d2629c1df41)=acff8544a74516d28e4bbdc727241024.
405, equipment A calculates M2 '=acff8544a74516d28e4bbdc727241024 with same method, with M2 phase
Together.Generate ECC public private key pair, public key are as follows:
3049301306072a8648ce3d020106082a8648ce3d03010103320004cf62a2cd76c65e
f3af60e4b53408719cf9bfb58da01b9d38842e7de78b0dfc8cf7a7b349cdc71f3dda844a2944
671f14
Private key are as follows:
305f02010104186284531840613b006faf0764aef2fc22666231b5519ad37fa00a06
082a8648ce3d030101a13403320004cf62a2cd76c65ef3af60e4b53408719cf9bfb58da01b9d
38842e7de78b0dfc8cf7a7b349cdc71f3dda844a2944671f14
Use private key pair
00|3049301306072a8648ce3d020106082a8648ce3d03010103320004cf62a2cd76c
65ef3af60e4b53408719cf9bfb58da01b9d38842e7de78b0dfc8cf7a7b349cdc71f3dda844a2
944671f14
Signature obtains:
3035021900fc4b73226eef4a5bc506cce81db597be9a2c0d94df17f8fd021865944b
ee18bf68ed1e5dd3a48fbbe747818e2be4277261b0
It is encrypted using key K
00|3049301306072a8648ce3d020106082a8648ce3d03010103320004cf62a2cd76c
65ef3af60e4b53408719cf9bfb58da01b9d38842e7de78b0dfc8cf7a7b349cdc71f3dda844a2
944671f14|3035021900fc4b73226eef4a5bc506cce81db597be9a2c0d94df17f8fd02186594
4bee18bf68ed1e5dd3a48fbbe747818e2be4277261b0
It obtains:
90d46584f35c05ab65cc6cd9e655f4d0b6629e3b9a5505a4f77aa9d45807ece3cd69
fe01239a6c7724bf1b5070eafd2747131563b49492a23bf41bebf00211b6b39590be5565fefd
5b3905a7272eeed1d77e1ea8eeb9bef545ac4e43d32ffdbea2eb44bbc57c8577b91cb89b7715
cd69da98538de93908b0f2a5cc86edf883267486458dbc0686fe3ff584184a4e9cbb
Send it to equipment B.
406, equipment B decrypts to obtain using key K:
003049301306072a8648ce3d020106082a8648ce3d03010103320004cf62a2cd76c6
5ef3af60e4b53408719cf9bfb58da01b9d38842e7de78b0dfc8cf7a7b349cdc71f3dda844a29
44671f143035021900fc4b73226eef4a5bc506cce81db597be9a2c0d94df17f8fd021865944b
ee18bf68ed1e5dd3a48fbbe747818e2be4277261b0
After verifying signature, by equipment A mark 00 and public key
3049301306072a8648ce3d020106082a8648ce3d03010103320004cf62a2cd76c65e
f3af60e4b53408719cf9bfb58da01b9d38842e7de78b0dfc8cf7a7b349cdc71f3dda844a2944
671f14 is saved.Generate ECC public private key pair, public key are as follows:
3049301306072a8648ce3d020106082a8648ce3d03010103320004c7ae724b129490
5cc937e1bfb0c99340a629433475387066a0d81f57af281c961b01f6e2ee7a6183b12bc1d11f
7292c4
Private key are as follows:
305f0201010418fdced95b87ee50d1f79cb4a721623d0c3cc147fee2126f88a00a06
082a8648ce3d030101a13403320004c7ae724b1294905cc937e1bfb0c99340a6294334753870
66a0d81f57af281c961b01f6e2ee7a6183b12bc1d11f7292c4
Use private key pair
01|3049301306072a8648ce3d020106082a8648ce3d03010103320004c7ae724b129
4905cc937e1bfb0c99340a629433475387066a0d81f57af281c961b01f6e2ee7a6183b12bc1d
11f7292c4
Signature obtains:
303502190089c4f5cb26db9af36a45e796275d6b2bde67e6259cd80bc6021839646d
7e7b37123e9197885bf18c148f6f84b503791b19ce
It is encrypted using key K
01|3049301306072a8648ce3d020106082a8648ce3d03010103320004c7ae724b129
4905cc937e1bfb0c99340a629433475387066a0d81f57af281c961b01f6e2ee7a6183b12bc1d
11f7292c4|303502190089c4f5cb26db9af36a45e796275d6b2bde67e6259cd80bc602183964
6d7e7b37123e9197885bf18c148f6f84b503791b19ce
It obtains:
142ccc00a0f6fbcb48d0895108312ed6edd030bb875a5aa9804977e624c9be01a342
dadf97daa7601a0a8268ff90cfa5ec39a110c3f2cf5203a086c78473f44c9b6344a798f9caa3
aba3ec0ef05de6040ccff242f86dd4c59f0e9d830e7501c9c541a8781da4abe778a289b5bfee
d493d7b5f2f08816db330ffb0a639fc78a94ca421919d7193c9ed314a450d7b48c40
Send it to equipment A.
407, equipment A decrypts to obtain using key K:
013049301306072a8648ce3d020106082a8648ce3d03010103320004c7ae724b1294
905cc937e1bfb0c99340a629433475387066a0d81f57af281c961b01f6e2ee7a6183b12bc1d1
1f7292c4303502190089c4f5cb26db9af36a45e796275d6b2bde67e6259cd80bc6021839646d
7e7b37123e9197885bf18c148f6f84b503791b19ce
Verifying signature, by equipment B mark 01 and public key
3049301306072a8648ce3d020106082a8648ce3d03010103320004c7ae724b129490
5cc937e1bfb0c99340a629433475387066a0d81f57af281c961b01f6e2ee7a6183b12bc1d11f
7292c4 is saved.
So far, equipment A and equipment B complete pairing, and pair verification process is described below:
The ECC P192 curve in ECDH algorithm is used in present embodiment.
408, equipment A generates interim public private key pair, temporary public key:
3049301306072a8648ce3d020106082a8648ce3d030101033200040806482e610d2a
1955f3e8b1a7fb64e572497217cf0b64b07a5812533f30991ec1f4f1d5a982a73fcd880ca6ba
87b841
Temporary private:
305f02010104185d86ced608d5141560765157784f05300db7b6da6d1ac982a00a06
082a8648ce3d030101a134033200040806482e610d2a1955f3e8b1a7fb64e572497217cf0b64
b07a5812533f30991ec1f4f1d5a982a73fcd880ca6ba87b841
By temporary public key
3049301306072a8648ce3d020106082a8648ce3d030101033200040806482e610d2a
1955f3e8b1a7fb64e572497217cf0b64b07a5812533f30991ec1f4f1d5a982a73fcd880ca6ba
87b841
It is sent to equipment B.
409, equipment B generates interim public private key pair, temporary public key:
3049301306072a8648ce3d020106082a8648ce3d03010103320004cae168ec1b2d17
ddb15bcf970cc2bb3461d1014b5bf10e90b400d2c51e6187ddcd2fe4ddd0f852320f77a8877b
2fd38c
Temporary private:
305f0201010418468e4fbb4118a204a397980dba1450940963327a4ea33622a00a06
082a8648ce3d030101a13403320004cae168ec1b2d17ddb15bcf970cc2bb3461d1014b5bf10e
90b400d2c51e6187ddcd2fe4ddd0f852320f77a8877b2fd38c
Calculate shared secret S=
(305f0201010418468e4fbb4118a204a397980dba1450940963327a4ea33622a00a0
6082a8648ce3d030101a13403320004cae168ec1b2d17ddb15bcf970cc2bb3461d1014b5bf10
e90b400d2c51e6187ddcd2fe4ddd0f852320f77a8877b2fd38c)˙
(3049301306072a8648ce3d020106082a8648ce3d030101033200040806482e610d2
a1955f3e8b1a7fb64e572497217cf0b64b07a5812533f30991ec1f4f1d5a982a73fcd880ca6b
A87b841)=
C05284A68EAE44497D93D6CC2241595A6E156D947CC1F89ED31F96D7495B052ED008
B53A017F12B582C8924CDD42A586
Wherein, Fu Hao ˙ indicates the point multiplication operation in ECC algorithm;
K=is calculated using MD5 algorithm
MD5(C05284A68EAE44497D93D6CC2241595A6E156D947CC1F89ED31F96D7495B052E
D008B53A017F12B582C8924CDD42A586)=
87643663dbb2e3b90ac7e59580668a65;
Calculate the signature Sig=
Sign(3049301306072a8648ce3d020106082a8648ce3d03010103320004cae168ec1
b2d17ddb15bcf970cc2bb3461d1014b5bf10e90b400d2c51e6187ddcd2fe4ddd0f852320f77a
8877b2fd38c|01|
3049301306072a8648ce3d020106082a8648ce3d030101033200040806482e610d2a
1955f3e8b1a7fb64e572497217cf0b64b07a5812533f30991ec1f4f1d5a982a73fcd880ca6ba
87b841)=
303402183032a76a9aba849cc385147fc002fe78eb5198c27c83a6c202180dc4afba
b5b652cefac391f0ab59053edf722ab4036c6f25;
It is encrypted using key K
01
303402183032a76a9aba849cc385147fc002fe78eb5198c27c83a6c202180dc4afba
b5b652cefac391f0ab59053edf722ab4036c6f25
It obtains:
9781763338592ba879a610cda024753b8192f998bbaaf593510682f248871da049f1
Bb8b1c4fb450fd8a1e54980fc4869fcecc54bf17c2d75bfc280cf74e 102a,
By itself and temporary public key
3049301306072a8648ce3d020106082a8648ce3d03010103320004cae168ec1b2d17
ddb15bcf970cc2bb3461d1014b5bf10e90b400d2c51e6187ddcd2fe4ddd0f852320f77a8877b
2fd38c is sent to equipment A.
410, equipment A calculates S=
(305f02010104185d86ced608d5141560765157784f05300db7b6da6d1ac982a00a0
6082a8648ce3d030101a134033200040806482e610d2a1955f3e8b1a7fb64e572497217cf0b6
4b07a5812533f30991ec1f4f1d5a982a73fcd880ca6ba87b841)˙
(3049301306072a8648ce3d020106082a8648ce3d03010103320004cae168ec1b2d1
7ddb15bcf970cc2bb3461d1014b5bf10e90b400d2c51e6187ddcd2fe4ddd0f852320f77a8877
B2fd38c)=
C05284A68EAE44497D93D6CC2241595A6E156D947CC1F89ED31F96D7495B052ED008
B53A017F12B582C8924CDD42A586;
K=is calculated using MD5 algorithm
MD5(C05284A68EAE44497D93D6CC2241595A6E156D947CC1F89ED31F96D7495B052E
D008B53A017F12B582C8924CDD42A586)=87643663dbb2e3b90ac7e59580668a65;
It is decrypted using key K
9781763338592ba879a610cda024753b8192f998bbaaf593510682f248871da049f1
Bb8b1c4fb450fd8a1e54980fc4869fcecc54bf17c2d75bfc280cf74e 102a is obtained:
01
303402183032a76a9aba849cc385147fc002fe78eb5198c27c83a6c202180dc4afba
B5b652cefac391f0ab59053edf722ab4036c6f25, verifying signature pass through.
Calculate the signature Sig=
Sign(3049301306072a8648ce3d020106082a8648ce3d030101033200040806482e6
10d2a1955f3e8b1a7fb64e572497217cf0b64b07a5812533f30991ec1f4f1d5a982a73fcd880
ca6ba87b841|00|
3049301306072a8648ce3d020106082a8648ce3d03010103320004cae168ec1b2d17
ddb15bcf970cc2bb3461d1014b5bf10e90b400d2c51e6187ddcd2fe4ddd0f852320f77a8877b
2fd38c)=
303502190093244003af0a68b5a8382f6392cd47303b35f7adacf1854f02180dac06
5452db02fb6f74d7ec09cb262a38ad334b46526fd1
It is encrypted using key K
00
303502190093244003af0a68b5a8382f6392cd47303b35f7adacf1854f02180dac06
5452db02fb6f74d7ec09cb262a38ad334b46526fd1 is obtained:
73337415d21502fe5fb6bd403534b7c3bff9ff247eff5b802dfee57e3cf9fc5b23a4
A2a4b24f0195ba47b6d18d2765f3d51bb516cb31ef78e12eec43ed55 6c0f sends it to equipment B.
411, equipment B is decrypted using key K
73337415d21502fe5fb6bd403534b7c3bff9ff247eff5b802dfee57e3cf9fc5b23a4
A2a4b24f0195ba47b6d18d2765f3d51bb516cb31ef78e12eec43ed55 6c0f is obtained:
00
303502190093244003af0a68b5a8382f6392cd47303b35f7adacf1854f02180dac06
5452db02fb6f74d7ec09cb262a38ad334b46526fd1, verifying signature pass through, and equipment B and equipment A has shared close
Key K=87643663dbb2e3b90ac7e59580668a65.
Claims (20)
1. a kind of communication partner method is applied to the first equipment, this method comprises:
After sending pairing request to the second equipment, the second temporary public key is received from the second equipment;
The first temporary public key and the first temporary private are generated, and the dynamic password based on the first equipment of input generates among first
Value generates the second median based on the first temporary public key and the second temporary public key, raw based on the first median and the second median
At the first identifying code, the first temporary public key and the first identifying code are sent to the second equipment and carry out the first verifying;
After first is verified, public key is matched with the second devices exchange.
2. the method as described in claim 1, which is characterized in that before matching public key with the second devices exchange, this method is also
Include:
The second identifying code is received from the second equipment and carries out the second verifying, and the second verifying includes: based on the first temporary public key and the
At least one of two temporary public keys and the first identifying code generate third identifying code, and by third identifying code and the second identifying code
It is compared.
3. the method as described in claim 1, which is characterized in that
The generation of first median includes: to carry out predetermined operation based on the dynamic password to obtain the first operation values, by the first fortune
The predetermined portions of calculation value are as the first median;And/or
The generation of second median includes: to carry out predetermined operation based on the first temporary public key and the second temporary public key to obtain the second fortune
Calculation value, using the predetermined portions of the second operation values as the second median.
4. the method as described in claim 1, which is characterized in that the first temporary private was randomly generated, the first temporary public key
It is to be calculated based on the first temporary private.
5. method as claimed in claim 4, which is characterized in that the first temporary public key is based on the first temporary private and according to power
What at least one of operation and modular arithmetic operation were calculated.
6. the method as described in claim 1, which is characterized in that this method further includes receiving the first salt figure from the second equipment,
In, the first salt figure is also used when generating the first median, the second median and/or the first identifying code.
7. the method as described in claim 1, which is characterized in that generate the first verifying based on the first median and the second median
Code, comprising:
Based on the first median and the second middle-value calculating first key factor;
First key is generated according to the first key factor;
The first identifying code is generated based on first key.
8. the method for claim 7, which is characterized in that be based on the first median and the second middle-value calculating first key
The factor, comprising: calculated based on the first median and the second median and according to the operation of at least one of power operation and modular arithmetic
The first key factor.
9. method as claimed in claim 7 or 8, which is characterized in that be based on the first median and the second middle-value calculating first
Cryptographic key factor, comprising: faced based on the first median and the second median and the first temporary public key, the second temporary public key and first
When at least one of private key this three calculate the first key factor.
10. method as claimed in any one of claims 7-9, which is characterized in that this method further includes receiving from the second equipment
First salt figure, then it is described that first identifying code is generated based on first key, comprising: to be based on the first temporary public key, the second temporary public key
The first identifying code is generated at least one of the first salt figure and the first key.
11. the method for claim 7, which is characterized in that generate the first identifying code based on first key, comprising: be based on
First key and the first about definite value generate the first identifying code.
12. method as claimed in claim 11, which is characterized in that first about definite value be using engagement arithmetic at least one about
Determine what the factor was calculated.
13. method as claimed in claim 11, which is characterized in that first about definite value be to each of multiple agreement factors about
Determine after operation result is calculated using the first engagement arithmetic respectively in the factor, using the second engagement arithmetic to the operation result into
It is obtained after row processing.
14. the method for claim 7, which is characterized in that before matching public key with the second devices exchange, this method is also
Include:
The second identifying code is received from the second equipment and carries out the second verifying, and the second verifying includes: based on the first key and the
One identifying code generates third identifying code, and third identifying code is compared with the second identifying code.
15. method as claimed in claim 14, which is characterized in that generate third based on the first key and the first identifying code
Identifying code, comprising:
It is raw based at least one of the first temporary public key and the second temporary public key and the first key and the first identifying code
At third identifying code.
16. the method for claim 7, which is characterized in that when matching public key with the second devices exchange, with described first
Key encryption pairing public key.
17. a kind of communication partner method is applied to the first equipment characterized by comprising
Third temporary public key and third temporary private are generated, third temporary public key is sent to the second equipment, and from the second equipment
Receive pairing public key mark ciphertext and the 4th temporary public key;
The parameter of algorithm and agreement based on agreement calculates the second key, identifies ciphertext from the pairing public key using the second key
Pairing public key mark and the first check value are obtained, the parameter of the agreement includes third temporary private and the 4th temporary public key;
Third verifying is carried out to first check value using pairing public key corresponding with pairing public key mark;
After third is verified, data communication is carried out by communication key and the second equipment of second key.
18. method as claimed in claim 17, which is characterized in that before carrying out data communication with the second equipment, this method
Further include:
The second school is calculated to the data including the mark of the pairing public key of the first equipment using the pairing private key of the first equipment
Value is tested, is carried out with the second equipment is sent to after the mark of the pairing public key of second the first equipment of key pair and the encryption of the second check value
4th verification.
19. method as claimed in claim 18, which is characterized in that the data further include third temporary public key and/or the 4th
Temporary public key.
20. a kind of communication device, as the first equipment, comprising:
Memory is configured to store scheduled computer instruction;
Processor is configured to execute the scheduled computer instruction to realize as described in any one of claim 1-19
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910275903.3A CN110022320B (en) | 2019-04-08 | 2019-04-08 | Communication pairing method and communication device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910275903.3A CN110022320B (en) | 2019-04-08 | 2019-04-08 | Communication pairing method and communication device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110022320A true CN110022320A (en) | 2019-07-16 |
CN110022320B CN110022320B (en) | 2020-12-18 |
Family
ID=67190695
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910275903.3A Active CN110022320B (en) | 2019-04-08 | 2019-04-08 | Communication pairing method and communication device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110022320B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111314072A (en) * | 2020-02-21 | 2020-06-19 | 北京邮电大学 | Extensible identity authentication method and system based on SM2 algorithm |
CN112187832A (en) * | 2020-11-03 | 2021-01-05 | 北京指掌易科技有限公司 | Data transmission method and electronic equipment |
CN112529588A (en) * | 2020-12-30 | 2021-03-19 | 楚天龙股份有限公司 | Method and device for preventing hardware wallet from being maliciously paired |
CN112636910A (en) * | 2020-12-29 | 2021-04-09 | 北京深思数盾科技股份有限公司 | Method, device and system for generating and verifying temporary password |
CN113032815A (en) * | 2021-05-18 | 2021-06-25 | 杭州海康威视数字技术股份有限公司 | Key combination calculation management method, device and equipment |
WO2023212904A1 (en) * | 2022-05-06 | 2023-11-09 | Oppo广东移动通信有限公司 | Relay communication method and device |
Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1565103A (en) * | 2002-05-24 | 2005-01-12 | 索尼株式会社 | Information processing system and method, information processing apparatus and method, recording medium, and program |
CN101159549A (en) * | 2007-11-08 | 2008-04-09 | 西安西电捷通无线网络通信有限公司 | Bidirectional access authentication method |
CN101202623A (en) * | 2006-11-13 | 2008-06-18 | 韩国电子通信研究院 | Method of generating message authentication code using stream cipher and authentication/encryption and authentication/decryption methods using stream cipher |
CN101494640A (en) * | 2008-01-23 | 2009-07-29 | 华为技术有限公司 | Method for protecting movable IP routing optimizing signaling, system, node and hometown proxy |
CN101582906A (en) * | 2009-06-23 | 2009-11-18 | 中国人民解放军信息工程大学 | Key agreement method and device |
US20110088087A1 (en) * | 2008-05-27 | 2011-04-14 | Sign2Pass Technologies Ab | Method for authentication |
CN102035644A (en) * | 2009-09-29 | 2011-04-27 | 国基电子(上海)有限公司 | Primary key dynamic configuration system and method |
US20130046973A1 (en) * | 2011-08-17 | 2013-02-21 | Cleversafe, Inc. | Facilitating access of a dispersed storage network |
CN104955040A (en) * | 2014-03-27 | 2015-09-30 | 西安西电捷通无线网络通信股份有限公司 | Network authentication certification method and equipment |
CN105184553A (en) * | 2015-09-06 | 2015-12-23 | 宁波大学 | Movie theatre mobile payment method based on near field communication (NFC) |
CN105262662A (en) * | 2014-07-09 | 2016-01-20 | 美国博通公司 | Device pairing method and communication device |
CN105590040A (en) * | 2014-11-03 | 2016-05-18 | 索尼公司 | METHOD AND SYSTEM FOR DIGITAL RIGHTS MANAGEMENT of ENCRYPTED DIGITAL CONTENT |
CN107786572A (en) * | 2017-11-07 | 2018-03-09 | 苏州工业园区服务外包职业学院 | A kind of verification method of user identity, device and terminal |
CN108880783A (en) * | 2018-09-06 | 2018-11-23 | 成都三零嘉微电子有限公司 | It is a kind of to gang up against method for SM4 algorithm |
CN109286921A (en) * | 2018-09-25 | 2019-01-29 | 锐达互动科技股份有限公司 | A kind of portable more site-teaching identity identifying methods |
CN109617701A (en) * | 2019-01-23 | 2019-04-12 | 桂林航天工业学院 | Method for using the certification safety in electronic communication |
-
2019
- 2019-04-08 CN CN201910275903.3A patent/CN110022320B/en active Active
Patent Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1565103A (en) * | 2002-05-24 | 2005-01-12 | 索尼株式会社 | Information processing system and method, information processing apparatus and method, recording medium, and program |
CN101202623A (en) * | 2006-11-13 | 2008-06-18 | 韩国电子通信研究院 | Method of generating message authentication code using stream cipher and authentication/encryption and authentication/decryption methods using stream cipher |
CN101159549A (en) * | 2007-11-08 | 2008-04-09 | 西安西电捷通无线网络通信有限公司 | Bidirectional access authentication method |
CN101494640A (en) * | 2008-01-23 | 2009-07-29 | 华为技术有限公司 | Method for protecting movable IP routing optimizing signaling, system, node and hometown proxy |
US20110088087A1 (en) * | 2008-05-27 | 2011-04-14 | Sign2Pass Technologies Ab | Method for authentication |
CN101582906A (en) * | 2009-06-23 | 2009-11-18 | 中国人民解放军信息工程大学 | Key agreement method and device |
CN102035644A (en) * | 2009-09-29 | 2011-04-27 | 国基电子(上海)有限公司 | Primary key dynamic configuration system and method |
US20130046973A1 (en) * | 2011-08-17 | 2013-02-21 | Cleversafe, Inc. | Facilitating access of a dispersed storage network |
CN104955040A (en) * | 2014-03-27 | 2015-09-30 | 西安西电捷通无线网络通信股份有限公司 | Network authentication certification method and equipment |
CN105262662A (en) * | 2014-07-09 | 2016-01-20 | 美国博通公司 | Device pairing method and communication device |
CN105590040A (en) * | 2014-11-03 | 2016-05-18 | 索尼公司 | METHOD AND SYSTEM FOR DIGITAL RIGHTS MANAGEMENT of ENCRYPTED DIGITAL CONTENT |
CN105184553A (en) * | 2015-09-06 | 2015-12-23 | 宁波大学 | Movie theatre mobile payment method based on near field communication (NFC) |
CN107786572A (en) * | 2017-11-07 | 2018-03-09 | 苏州工业园区服务外包职业学院 | A kind of verification method of user identity, device and terminal |
CN108880783A (en) * | 2018-09-06 | 2018-11-23 | 成都三零嘉微电子有限公司 | It is a kind of to gang up against method for SM4 algorithm |
CN109286921A (en) * | 2018-09-25 | 2019-01-29 | 锐达互动科技股份有限公司 | A kind of portable more site-teaching identity identifying methods |
CN109617701A (en) * | 2019-01-23 | 2019-04-12 | 桂林航天工业学院 | Method for using the certification safety in electronic communication |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111314072A (en) * | 2020-02-21 | 2020-06-19 | 北京邮电大学 | Extensible identity authentication method and system based on SM2 algorithm |
CN112187832A (en) * | 2020-11-03 | 2021-01-05 | 北京指掌易科技有限公司 | Data transmission method and electronic equipment |
CN112636910A (en) * | 2020-12-29 | 2021-04-09 | 北京深思数盾科技股份有限公司 | Method, device and system for generating and verifying temporary password |
CN112529588A (en) * | 2020-12-30 | 2021-03-19 | 楚天龙股份有限公司 | Method and device for preventing hardware wallet from being maliciously paired |
CN113032815A (en) * | 2021-05-18 | 2021-06-25 | 杭州海康威视数字技术股份有限公司 | Key combination calculation management method, device and equipment |
WO2023212904A1 (en) * | 2022-05-06 | 2023-11-09 | Oppo广东移动通信有限公司 | Relay communication method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110022320B (en) | 2020-12-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109728909B (en) | Identity authentication method and system based on USBKey | |
CN110022320A (en) | A kind of communication partner method and communication device | |
CN100558035C (en) | A kind of mutual authentication method and system | |
CN103118027B (en) | The method of TLS passage is set up based on the close algorithm of state | |
EP2320621B1 (en) | Method for establishing cryptographic communications between a remote device and a medical device and system for carrying out the method | |
CN111835752A (en) | Lightweight authentication method based on equipment identity and gateway | |
CN107679847B (en) | Mobile transaction privacy protection method based on near field communication bidirectional identity authentication | |
CN103338215A (en) | Method for establishing TLS (Transport Layer Security) channel based on state secret algorithm | |
CN110020524B (en) | Bidirectional authentication method based on smart card | |
CN104754581A (en) | Public key password system based LTE wireless network security certification system | |
CN110635901B (en) | Local Bluetooth dynamic authentication method and system for Internet of things equipment | |
CN110912686B (en) | Method and system for negotiating secret key of security channel | |
JP2012235214A (en) | Encryption communication device and encryption communication system | |
CN104901935A (en) | Bilateral authentication and data interaction security protection method based on CPK (Combined Public Key Cryptosystem) | |
CN107682152B (en) | Group key negotiation method based on symmetric cipher | |
CN112104453A (en) | Anti-quantum computation digital signature system and signature method based on digital certificate | |
CN113630248A (en) | Session key negotiation method | |
CN115499250B (en) | Data encryption method and device | |
CN111416712B (en) | Quantum secret communication identity authentication system and method based on multiple mobile devices | |
CN105612728A (en) | Secured data channel authentication implying a shared secret | |
CN114172745A (en) | Internet of things security protocol system | |
CN113676448B (en) | Offline equipment bidirectional authentication method and system based on symmetric key | |
CN114650173A (en) | Encryption communication method and system | |
CN110266485A (en) | A kind of Internet of Things secure communication control method based on NB-IoT | |
CN114422205A (en) | Method for establishing data tunnel of network layer of CPU chip special for electric power |
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 | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20201028 Address after: Room 124, 1 / F, building 2, yard 9, jiaogezhuang street, Nanfaxin Town, Shunyi District, Beijing Applicant after: Beijing Wikipedia Technology Co.,Ltd. Address before: 100193, No. 5, building 5, east 10, East Hospital, No. 510 Wang Dong Road, Beijing, Haidian District Applicant before: BEIJING SENSE SHUDUN TECHNOLOGY Co.,Ltd. |
|
TA01 | Transfer of patent application right | ||
GR01 | Patent grant | ||
GR01 | Patent grant |