WO2018024242A1 - 一种安全通信方法和*** - Google Patents

一种安全通信方法和*** Download PDF

Info

Publication number
WO2018024242A1
WO2018024242A1 PCT/CN2017/095991 CN2017095991W WO2018024242A1 WO 2018024242 A1 WO2018024242 A1 WO 2018024242A1 CN 2017095991 W CN2017095991 W CN 2017095991W WO 2018024242 A1 WO2018024242 A1 WO 2018024242A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
information
response
value
timing
Prior art date
Application number
PCT/CN2017/095991
Other languages
English (en)
French (fr)
Inventor
李明
Original Assignee
李明
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN201610641429.8A external-priority patent/CN107688749B/zh
Priority claimed from CN201610640039.9A external-priority patent/CN107690145A/zh
Application filed by 李明 filed Critical 李明
Priority to EP17836423.8A priority Critical patent/EP3495980B1/en
Priority to US16/323,516 priority patent/US11159946B2/en
Priority to JP2018562175A priority patent/JP6698880B2/ja
Publication of WO2018024242A1 publication Critical patent/WO2018024242A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/606Protecting data by securing the transmission between two devices or processes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/10Integrity
    • H04W12/108Source integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/50Secure pairing of devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/60Context-dependent security
    • H04W12/63Location-dependent; Proximity-dependent
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Definitions

  • the present invention relates to the field of electronic technologies, and in particular, to a secure communication method and system.
  • the card reader In the card reading mechanism of the existing card reader, after the card reader interacts with the card information, after the card reader sends the command data to the card, the card reader will be within the preset frame waiting time (FWT). Waiting to receive card response data, and the data received within the FWT will be processed.
  • the third party can hijack and tamper with the response data sent by the card to the card reader, and then send the tampering response data to the card reader, or the third party can disguise as a card reader and hijack the real card.
  • the masquerading is a real card, and the response information is sent to the real card reader, that is, the identity information of the card is obtained remotely, and the card reader authorization is obtained.
  • the card reader handles the response data after the hijacking, which is easy to cause loss to the card user. Therefore, the card reader accepts the response data in the FWT, which brings an insecure factor to the information interaction between the card reader and the card.
  • the present invention is directed to solving one of the above problems.
  • the main object of the present invention is to provide a secure communication method
  • Another object of the present invention is to provide a secure communication system
  • Another object of the present invention is to provide another secure communication method
  • Another object of the present invention is to provide another secure communication system.
  • An aspect of the present invention provides a secure communication method, including: a first terminal sends a request message to a second terminal, where When the request information is sent, the first timing is started according to the preset timing mode, and the request information includes at least data to be processed; the second terminal receives the request information, and the second terminal obtains the response information according to the request information; the first terminal arrives at the first timing.
  • An aspect of the present invention provides a secure communication system, including: a first terminal, configured to send request information to a second terminal, and start a first timing according to a preset timing mode when the request information is sent, where the request information includes at least
  • the second terminal is configured to receive the request information, and obtain the response information according to the request information.
  • the first terminal is further configured to send the response notification information to the second terminal when the first timing reaches the first value, and respond to the notification information.
  • the second timing is started according to the preset timing mode; the second terminal is further configured to receive the response notification information, and the second terminal sends the response information to the first terminal; the first terminal is further configured to reach the second time in the second timing.
  • the response information is allowed to start, wherein the second value is the time required for the second terminal to receive the response notification information until the response message is sent.
  • a secure communication method and system are provided by the first terminal, the first terminal sends a response notification message to the second terminal, and the second terminal receives the response notification information.
  • the terminal sends the response information, and the time at which the first terminal receives the response information is controlled by the second terminal receiving the response notification information to the valid time threshold for sending the response information, so as to ensure that the external device cannot be falsified even if the response information is robbed and falsified.
  • the response information that is falsified after the terminal can receive the response information is sent to the first terminal, and the effect of the first terminal avoiding receiving the tampering response information is achieved, and the first terminal is also responded to after the request information is sent.
  • the waiting time of the information improves the security and efficiency of the information exchange between the first terminal and the second terminal.
  • Another aspect of the present invention provides another secure communication method, including: the first terminal sends the request information to the second terminal, and starts the first timing according to the preset timing mode when the request information is sent, the request information includes at least the waiting information. Processing the data; the second terminal receives the request information, and the second terminal obtains the response data according to the to-be-processed data in the request information; the first terminal sends the response notification information to the second terminal when the first timing reaches the first value, in response to the notification information When the sending is completed, the second timing is started according to the preset timing mode; the second terminal receives the response notification information, the second terminal performs the signature operation on the signature information, and obtains the signature data, and the second terminal sends the response information to the first terminal, where the signature information includes The response data and the second value are the sum of the time required by the second terminal to analyze the response notification information and the time required to perform the signature operation, the response information includes the information to be signed and the signature data; the first terminal receives the response information, Obtaining a third
  • Another aspect of the present invention provides another secure communication system, including: a first terminal, configured to send request information to a second terminal, and start a first timing according to a preset timing manner when the request information is sent, requesting information
  • the second terminal is configured to receive the request information, and the response information is obtained according to the to-be-processed data in the request information.
  • the first terminal is further configured to send the second terminal to the first terminal when the first timing reaches the first value.
  • Responding to the notification information when the response notification information is sent, the second timing is started according to the preset timing mode; the second terminal is further configured to receive the response notification information, perform signature operation on the signature information, obtain signature data, and send a response to the first terminal.
  • the information to be signed includes the response data and the second value.
  • the second value is the sum of the time required for the second terminal to analyze the response notification information and the time required to perform the signature operation, and the response information includes the information to be signed and the signature data.
  • a terminal which is further configured to receive response information and obtain a second timing obtained when the response information starts to be received. Three values; signature test data check operation, and a third value and the second value matches the checksum, and if the verification passes through the inspection check, it is determined that the response information in response to information security.
  • the first terminal sends a response notification message to notify the second terminal to send response information to the first terminal.
  • the terminal checks the signature data in the response information to ensure that the device that sends the response information is the second terminal and the response information has not been tampered with, and the first terminal determines whether the time obtained by the timing matches the time in the received response information.
  • the external device remotely robs the response information of the second terminal to be forwarded, so as to avoid receiving the hijacked or falsified response information, and shortens the waiting time of the response message after the first terminal sends the request information, thereby improving The security and efficiency of the interaction between the first terminal and the second terminal information.
  • FIG. 1 is a flowchart of a secure communication method according to Embodiment 1 of the present invention.
  • FIG. 3 is a structural block diagram of a secure communication system according to Embodiment 1 of the present invention.
  • FIG. 5 is a flowchart of another secure communication method according to Embodiment 2 of the present invention.
  • FIG. 1 is a flowchart of a secure communication method according to an embodiment of the present invention. the method includes:
  • Step 101 The first terminal sends the request information to the second terminal, and starts the first timing according to the preset timing mode when the request information is sent, and the request information includes at least the data to be processed;
  • the first terminal may be a reader, for example, a device such as a card reader, a computer, a tablet computer or a mobile phone; the second terminal may be a transponder, such as a smart card, an electronic signature tool key, or a key card. Equipment, mobile phone or ID card.
  • the communication manner adopted by the first terminal and the second terminal includes a short-range wireless communication manner.
  • the short-range wireless communication method may include a communication method that follows the following communication protocols: a Bluetooth communication protocol, an infrared IrDA communication protocol, an RFID communication protocol, a ZigBee communication protocol, an ultra-wideband (Ultra WideBand) communication protocol, and a short-range communication (NFC) communication. Protocol, WiMedia communication protocol, GPS communication protocol, DECT communication protocol, wireless 1394 communication protocol, ISO14443 protocol, ISO15693 protocol and dedicated wireless communication protocol.
  • communication protocol support The time required for data transmission at the maximum transmission distance is less than the time required for data to be tampered with by an external device.
  • the method before step 101, further includes the steps of: establishing, by the first terminal, the handshake communication with the second terminal, where the first terminal is a card reader, and the second terminal is a smart card or an ID card.
  • the method may further include: a card searching process of the first terminal and the second terminal.
  • the request information may be generated by the first terminal, or may be information generated by the first terminal and generated by an authentication device such as a background server.
  • the request information is generated by the first terminal, the risk that the request information is hijacked and falsified can be avoided, and the security of the request information is ensured.
  • the request information is generated by an authentication device such as a background server, the calculation amount of the first terminal is reduced. The authentication device is prevented from authenticating the falsified request information, thereby improving the security of information interaction.
  • Step 102 The second terminal receives the request information, and the second terminal obtains the response information according to the request information.
  • the second terminal performs processing according to the to-be-processed data in the request information, and obtains response data, where the response information includes at least response data.
  • the data to be processed and the response data may be a variety of information, for example, the data to be processed may be an authentication request, and the response data may be an authentication response response or the like.
  • the second terminal obtains the response information according to the request information, and the second terminal obtains the response data according to the to-be-processed data in the request information, and signs the signature data to obtain the signature data.
  • the signature data includes response data
  • the response information includes at least response data and signature data.
  • the first The second terminal can use the second terminal built-in private key to sign the response data, so that the first terminal can determine whether the real sender of the response information is the second terminal according to whether the verification of the signature data passes, thereby further ensuring the security of the response information. .
  • the request information further includes a random number; the second terminal obtains the response information according to the request information, and the second terminal obtains the response data according to the to-be-processed data in the request information, and the signature data is to be processed. Signing is performed to obtain signature data, and the data to be signed includes response data and a random number, and the response information includes at least response data and signature data.
  • the second terminal may use the second terminal built-in private key to sign the signature data, and the first terminal may determine whether the real sender of the response information is the second terminal according to whether the verification of the signature data passes.
  • the data to be signed includes the random number and the response data sent by the first terminal, so that the signature data of the information exchange between the first terminal and the second terminal is different, and the third party is prevented from intercepting the data of the previous information interaction. Perform a replay attack.
  • Step 103 The first terminal sends a response notification message to the second terminal when the first timing reaches the first value, and starts the second timing according to the preset timing mode when the response notification information is sent.
  • the first value is greater than or equal to the third value, where the third value is a time required by the second terminal to obtain response information according to the request information.
  • the third value may be pre-stored in the first terminal, or may be negotiated with the second terminal before the first terminal sends the request information to the second terminal, where the first terminal obtains a third value, optionally, the third value may be less than The frame waiting time in the existing communication protocol, so that the present embodiment can be compatible with the existing communication protocol, and the first terminal and the second terminal can normally communicate under the existing communication protocol.
  • the first terminal sends the response notification information to the second terminal after the time that the second terminal processes the processing information to obtain the response data or after the time, to ensure that the first terminal is to the second terminal.
  • the second terminal has obtained the response information, and avoids the communication failure or the response failure caused by the second terminal not receiving the response information when the first terminal sends the response notification information, thereby improving communication efficiency.
  • the first terminal and the second terminal may obtain only the third value once in a complete information interaction process, or may send each request information in the first terminal in a complete information interaction process.
  • the third value is obtained once before.
  • the third value can be obtained only once in a complete information interaction process, which can reduce the steps in the information interaction process and improve the communication efficiency.
  • the first terminal obtains the third value before sending each request information, which can improve the first terminal control response.
  • the accuracy of the notification information transmission time is further ensured to ensure communication security.
  • Step 104 The second terminal receives the response notification information, and the second terminal sends the response information to the first terminal.
  • Step 105 When the second timing reaches the effective threshold of the second value, the first terminal is allowed to start receiving the response information, where the second value is a time required by the second terminal to receive the response notification information and send the response information.
  • the effective threshold of the second value is [T, T+2t], where T is the second value, and T+2t is less than or equal to the first terminal communicating with the second terminal.
  • the frame waiting time specified by the communication protocol used at the time, T should also be smaller than the frame waiting time specified by the communication protocol used when the first terminal communicates with the second terminal, and t is the response notification information or the response information passes through the first terminal and the second
  • the communication protocol used by the terminal supports the maximum communication distance required
  • the required time for example, the communication protocol used when the first terminal communicates with the second terminal is ISO14443 or ISO15693. If the frame waiting time specified by the protocol is 30ms, the second value T should be less than 30ms, and the second value is valid.
  • the maximum value T+2t of the threshold should also be less than or equal to 30 ms to ensure that the first terminal receives the response information sent by the second terminal on the premise of complying with the protocol.
  • the time required for the second terminal to receive the response notification information and send the response information is different according to different types of the second terminal and the computing capability, and the computing power of the second terminal is stronger.
  • the smaller the value of the second value T is; the calculation method of t is: the maximum communication distance supported by the communication protocol adopted by the first terminal and the second terminal is L, and the signal transmission speed is C, then t L/C, t
  • the specific value may be carried in the factory information of the first terminal, or may be carried in the communication protocol used when the first terminal communicates with the second terminal; the preset threshold range that the first terminal is allowed to receive the response information shall be less than or Is equal to the sum of the time T required by the second terminal to respond to the notification information and the response information is received, the response notification information transmission time t and the response information transmission time t, when the distance between the first terminal and the second terminal is sufficiently close,
  • the value of t can be neglected, that is, the effective threshold of the second value should be greater than or equal to T and less than or equal to T+2t, and when the second terminal uses the communication protocol transmission The rate is fast enough, and the computing power of the second terminal is strong enough.
  • the values of T and t are both nanoseconds.
  • the second timing is smaller than the timing minimum unit of the first terminal, that is, the first terminal starts receiving the response information when the second timing reaches 0.
  • the time required for data transmission under the maximum transmission distance supported by the communication protocol is less than the time required for the data to be tampered with by the external device, and therefore, the falsified response information is sent to the first terminal.
  • the time will be greater than the effective threshold of the second value. Since the first terminal does not receive the response information exceeding the effective threshold of the second value, the first terminal will not receive the tampering response information.
  • the time at which the first terminal receives the response information is strictly calculated and controlled, which ensures the security of the response information and avoids the risk that the first terminal receives the tamper-received response information and processes it.
  • the embodiment may further include: Step 106: After receiving the response information, the first terminal performs verification on the signature data, if the verification is passed. Then, the response information is judged to be trust response information. The first terminal performs verification on the signature data, and can determine whether the real sender of the response information is the second terminal according to the result of the verification, thereby further improving communication security.
  • the second value may be in the presence of the first terminal, or the first terminal negotiates with the second terminal before sending the request information to the second terminal, where the first terminal obtains the first Two values.
  • the first terminal and the second terminal may obtain the second value only once in the process of processing a complete information interaction, or may be in the complete process of the first terminal in a complete information interaction process.
  • the second value is obtained once before each request message is sent. Only obtaining the second value once in a complete information interaction process can reduce the steps in the information interaction process and improve the communication rate.
  • the first terminal obtains the second value before sending each request information, which can improve the first terminal control response. The accuracy of the information receiving time further ensures communication security.
  • the first terminal determines whether the second value is less than a preset security threshold, and if the second value is less than the preset security threshold, performing step 101, if If the two values are greater than the preset security threshold, the first terminal selects another communication mode.
  • the second terminal since the second value is not the time taken by the second terminal to receive the response notification information and the response information is sent, but only an estimated time, when the estimation time is much larger than the real time, then it is possible Before the first timing of the terminal reaches the effective threshold of the second value, the second terminal sends the response information to the first terminal, and the first terminal cannot receive the response information, and the external device may rob the response information and tamper after When the external device sends the false response information to the first terminal, the second timing of the first terminal is still within the effective threshold of the second value, which brings risks to the data interaction. Therefore, the first terminal needs to preset a security threshold.
  • the solution adopts the scheme to balance the communication efficiency without affecting the security.
  • the second value is greater than the preset security gate. For other limits, use other safer solutions. That is, the first terminal selects the communication mode based on the time required for the second terminal to receive the response notification information to the time when the response message is sent, and the communication efficiency and security of the first terminal can be further improved.
  • the second value and the third value of the first terminal may be the same or different, for example, the second value and the third value are pre-stored in the first terminal; or, Before the terminal sends the request information to the second terminal, the terminal negotiates with the second terminal to obtain the second value and the third value; or the second value is pre-stored in the first terminal, and the first terminal sends the request to the second terminal. Before the information, the second terminal is negotiated to obtain a third value, and the second value is pre-stored in the first terminal; or the third value is pre-stored in the first terminal, before the first terminal sends the request information to the second terminal.
  • the manner of obtaining the second value and the third value may be adaptively changed according to the device type of the first terminal 301 and/or the second terminal 302, and the communication efficiency may be improved.
  • the second value and/or the third value pre-stored in the first terminal includes, but is not limited to, the following implementation manner:
  • the first terminal may be configured to have one or more The second value and/or the third value of the second terminal, before the first terminal sends the request information to the second terminal, acquiring the device model of the second terminal, and matching the correct second value and/or the third value;
  • the first terminal obtains the second value and/or the third value through other devices before communicating with the second terminal, such as downloading the second value and/or the third value matched by the second terminal through the network, or The user of the first terminal inputs a second value and/or a third value via the input device of the first terminal.
  • the first terminal negotiates with the second terminal to obtain a second value and/or a third value, including but not limited to the following implementation manners: mode 1, the first terminal generates a negotiation request and the first a random number is sent to the second terminal; the second terminal receives the negotiation request and the first random number, and uses the second terminal private key to sign the first random number, obtains the first random number signature data, and generates a second random number.
  • the first terminal Transmitting the first random number signature data, the second terminal certificate, and the second random number to the first terminal; the first terminal receives the first random number signature data, the second terminal certificate, and the second random number, respectively, to the first random number
  • the signature data and the second terminal certificate are verified, and if the verification is passed, the first terminal is used privately.
  • the key is used to sign the second random number, obtain the second random number signature data, and send the second random number signature data and the first terminal certificate to the second terminal; the second terminal receives the second random number signature data and the first terminal certificate And verifying the second random number signature data and the first terminal certificate respectively, and if the verification is passed, obtaining the second value and/or the third value, using the first terminal public key to perform the second value and/or the third value Encrypting, generating a second value ciphertext and/or a third value ciphertext and transmitting to the first terminal; the first terminal receiving the second value ciphertext and/or the third value ciphertext, using the first terminal private key pair The numerical ciphertext and/or the third numerical ciphertext is decrypted to obtain a second value and/or a third value.
  • the first terminal generates a negotiation request and a first random number, and the negotiation request, the first random number, and the first Sending a terminal certificate to the second terminal; the second terminal receives the negotiation request, the first random number, and the first terminal certificate, and verifies the first terminal certificate, and if the verification is passed, using the second terminal private key to perform the first random number
  • the first random number signature data is obtained, the second random number is generated, the second random number is encrypted by using the first terminal public key, the second random number ciphertext is obtained, and the second random number ciphertext and the second terminal certificate are obtained.
  • the first terminal receiving the second random number ciphertext, the second terminal certificate, and the first random number signature data, respectively performing the second terminal certificate and the first random number signature data Verification, if the verification is passed, the second random ciphertext is decrypted by using the first terminal private key to obtain a second random number, and the second random number is signed by using the first terminal private key to obtain a second random number signature.
  • the ciphertext, the second value ciphertext and/or the third value ciphertext is sent to the first terminal; the first terminal receives the second value ciphertext and/or the third value ciphertext, and uses the first transport key pair to the second
  • the value and/or the third value ciphertext is decrypted to obtain a second value and/or a third value.
  • the first terminal and the second terminal obtain a second value and/or a third value by negotiation, where the second value and/or the third value may be determined by the second terminal according to the type of the information interaction and the second terminal.
  • the calculation capability, the communication protocol used, and the like are calculated, and may also be pre-stored in the second terminal.
  • the first terminal starts the first timing according to the preset timing mode when the request information is sent, and the first terminal starts the second timing according to the preset timing manner when the response notification information is sent.
  • There may be multiple preset timing modes such as: mode one, the first terminal starts the first time using the built-in clock of the first terminal when the request information is sent; the first terminal uses the built-in clock of the first terminal when the response notification information is sent.
  • the effective threshold of the second value is [100 ⁇ m, 120 ⁇ m]
  • the first terminal is allowed to start using the second time when the second timing reaches the effective threshold of the second value.
  • the specific implementation manner of receiving the response information in the first frequency band is that the first terminal arrives in the second timing [100 ⁇ m, 120 ⁇ m]
  • the first terminal requests the transmission of the request information
  • the first terminal starts counting the number of cycles of the communication carrier; when the first terminal responds to the transmission of the notification information, the first terminal connects to the communication carrier.
  • the effective threshold of the second value represents a range of cycles, for example, when the second value is 100 cycles, the communication carrier adopts a communication protocol adopted by the first terminal and the second terminal.
  • the effective threshold of the second value is [100, 120] cycles, and in step 105, "the first terminal is valid at the second time to reach the second value.
  • the specific execution manner of allowing the use of the first frequency band to receive the response information is: the first terminal is allowed to start receiving the response information when the number of the second timed period reaches [100, 120]; In the third manner, the first terminal starts counting the number of pulses of the communication carrier by the first terminal when the request information is sent, and the first terminal sends the response notification information.
  • the first terminal starts counting the number of pulses of the communication carrier; in the present mode, the effective threshold of the second value represents a range of pulse numbers, for example, when the second value is 100 pulses, the communication carrier passes through the first terminal.
  • the change in the number of pulses is 10 pulses
  • the effective threshold of the second value is [100, 120] pulses
  • the first terminal is in the first
  • the specific execution manner of allowing the start of using the first frequency band to receive the response information is: the number of pulses of the first terminal in the second timing reaches [100, 120]
  • the effective threshold of the second value represents a phase difference Range of values, such as when the second value is the phase difference
  • the phase difference is ⁇
  • the effective threshold of the second value is In step 105, the specific execution manner of the first terminal receiving the response information when the second terminal is within the effective threshold of the second value is that the first terminal is in the second timing phase. Bad arrival When it is inside, it is allowed to start receiving response information.
  • the first timing and the second timing are performed by using the preset timing mode of the first mode to the third mode, and the timing method is simple, and the existing first terminal is not required to be greatly improved, and the first timing and the first timing mode are adopted. Second timing, because of the higher accuracy of the phase timing relative to the cycle or pulse timing, the response information is more secure.
  • the first terminal in the communication process between the first terminal and the second terminal, the first terminal always generates a communication carrier signal, and in the communication technology, the communication carrier signal is generated by the oscillator and is in communication.
  • the radio waves transmitted on the channel are modulated to transmit data, and the communication carrier signal is an unmodulated periodic oscillating signal.
  • the communication carrier signal may be a sine wave or a non-sinusoidal wave (such as a periodic pulse sequence).
  • the first terminal starts to record the first phase difference of the waveform phase of the communication carrier with respect to the first starting phase when the request information is transmitted, and the first initial phase
  • the first terminal sets the phase value of the current communication carrier signal to 0 when the request information is sent, and sets the 0
  • the value is used as the first initial phase, and then the phase value of the communication carrier signal is read in real time, so that the waveform phase of the communication carrier signal is obtained in real time with respect to the first phase difference of the first starting phase; or the first terminal transmits the request information.
  • the first phase difference of the waveform phase of the signal relative to the first starting phase The first terminal starts recording the phase difference of the waveform phase of the communication carrier with respect to the second starting phase when the request information is transmitted, and the second initial phase is the communication carrier of the first terminal when the response notification information is transmitted.
  • the implementation of the waveform phase is similar to the above implementation, and will not be specifically described herein.
  • the phase change speed of the communication carrier signal is positively correlated with the frequency of the communication carrier signal.
  • the X time and the number can be accurately recorded based on the phase change difference.
  • the time interval between when the terminal sends the request information for example, when the frequency of the communication carrier signal is ⁇ , the duration of one cycle is
  • the phase change of one cycle is 360°, then the time required for the phase of the communication carrier signal to change by 1° is It can be seen that the first terminal can greatly improve the timing accuracy by measuring the phase change of the communication carrier signal to detect the time interval compared to the period and the pulse passing through the communication carrier signal.
  • the first terminal sends the response notification information to the second terminal, and after receiving the response notification information, the second terminal sends the response information to the first terminal, and the first terminal controls the time for receiving the response information.
  • the second terminal receives the response notification information to the valid time threshold for sending the response information, and ensures that the external device cannot send the falsified response information to the time when the first terminal can receive the response information even if the response information is robbed and falsified.
  • the first terminal achieves the effect that the first terminal avoids receiving the tamper-received response information, and also shortens the waiting time of the first terminal to the response information after sending the request information, and improves the interaction between the first terminal and the second terminal information. Safety and efficiency.
  • the method embodiment shown in FIG. 2 is different from the method embodiment shown in FIG. 1 in that the first terminal and the second terminal use different frequency bands to communicate according to different information types of interaction, and other implementation processes are implemented by the foregoing method.
  • the same content will not be described in detail, and reference may be made to the related description of the method embodiment shown in FIG. 1 above.
  • FIG. 2 is a flowchart of another secure communication method according to an embodiment of the present invention, where the method includes:
  • Step 201 The first terminal sends the request information to the second terminal by using the first frequency band, and starts the first timing according to the preset timing mode when the request information is sent, and the request information includes at least the data to be processed;
  • Step 202 The second terminal receives the request information by using the first frequency band, and the second terminal obtains the response information according to the request information.
  • Step 203 The first terminal sends the response notification information to the second terminal by using the second frequency band when the first timing reaches the first value, and starts the second timing according to the preset timing mode when the response notification information is sent.
  • Step 204 The second terminal receives the response notification information by using the second frequency band, and the second terminal sends the response information to the first terminal.
  • Step 205 The first terminal is allowed to start receiving response information when the second timing reaches the effective threshold of the second value, where the second value is a time required for the second terminal to receive the response notification information until the response message is sent.
  • the first frequency band and the second frequency band are different frequency bands, for example, the first frequency band is 13.56 MHz frequency band, and the second frequency band is 2.4G frequency band, and the first terminal and the second terminal are both devices supporting dual frequency band communication. .
  • the first terminal and the second terminal adopt a method for transmitting/receiving response notification information in a frequency band, so that the third party cannot hijack the response notification information in the frequency band in which the request information is sent, and cannot be notified.
  • the correct time of the response information that is, the false response information cannot be used to attack the first terminal when the second timing of the first terminal reaches the effective time threshold, and the security of the communication device is ensured on the basis of ensuring communication security.
  • the secure communication system includes a first terminal 301 and a second terminal 302.
  • the first terminal 301 can be a reader, for example, For a card reader, a computer, a tablet or a mobile phone
  • the second terminal 302 can be a transponder, for example, a smart card, an electronic signature tool key, a key card, a mobile phone, or an ID card.
  • the secure communication system of this embodiment is used to perform the above-mentioned secure communication method.
  • the same content or similar processes are not described herein again, and only a brief description is as follows:
  • the first terminal 301 is configured to send the request information to the second terminal 302, and start the first timing according to the preset timing mode when the request information is sent, and the request information includes at least the data to be processed;
  • the second terminal 302 is configured to receive request information, and obtain response information according to the request information.
  • the first terminal 301 is further configured to: when the first timing reaches the first value, send the response notification information to the second terminal 302, and start the second timing according to the preset timing manner when the response notification information is sent;
  • the second terminal 302 is further configured to receive the response notification information, and the second terminal 302 sends the response information to the first terminal 301.
  • the first terminal 301 is further configured to allow to start receiving response information when the second timing reaches the effective threshold of the second value, where the second value is required by the second terminal 302 to receive the response notification information until the response information is sent. time.
  • the communication manner adopted by the first terminal and the second terminal includes: a short-range wireless communication mode.
  • the effective threshold of the second value is [T, T+2t], where T is the second value, and T+2t is less than or equal to the frame waiting time specified by the communication protocol used when the first terminal communicates with the second terminal.
  • t is the time required for the response notification information or the response information to support the maximum communication distance through the communication protocol adopted by the first terminal and the second terminal.
  • the first terminal is configured to send request information to the second terminal, where the first terminal is configured to use the first frequency
  • the second terminal is configured to receive the request information, where the second terminal is configured to receive the request information by using the first frequency band, and the first terminal is further configured to: when the timing reaches the first value, The second terminal sends the response notification information, and the first terminal is further configured to send the response notification information to the second terminal by using the second frequency band when the timing reaches the first value, and the second terminal is further configured to receive the response notification information, including The second terminal is further configured to receive the response notification information by using the second frequency band, where the second terminal is further configured to send the response information to the first terminal, where the second terminal is further configured to send the first frequency band to the first terminal.
  • the first terminal is further configured to allow to start receiving the response information when the second timing reaches the effective threshold of the second value, including: the first terminal, and the effective threshold for reaching the second value in the second timing Internally, it is allowed to start receiving response information using the first frequency band.
  • the first value is greater than or equal to the third value, where the third value is the time required for the second terminal to obtain the response information according to the request information; the second terminal prestores the second value, or the first terminal is further used to Before transmitting the request information to the second terminal, negotiating with the second terminal, the first terminal obtains the second value and the third value; the third terminal prestores the third value, or the first terminal is further used in the Before the second terminal sends the request information, the second terminal negotiates with the second terminal, and the first terminal obtains the third value.
  • the request information further includes a random number; the second terminal is further configured to obtain the response information according to the request information, and the second terminal is further configured to: obtain the response data according to the to-be-processed data in the request information, and sign the signature data.
  • the data to be signed includes the response data and the random number, and the response information includes at least the response data and the signature data; or the second terminal is further configured to obtain the response information according to the request information, where the second terminal is further used for Obtaining response data according to the to-be-processed data in the request information, signing the signature data to obtain signature data, the signature data includes response data, and the response information includes at least response data and signature data; the system further includes: the first terminal is further used for After the response information is received, the signature data is checked. If the verification is passed, the response information is determined to be trust response information.
  • the first terminal is configured to start the first timing according to the preset timing mode when the request information is sent, and the first terminal is configured to start using the first terminal built-in clock to start the first timing when the request information is sent.
  • the terminal is further configured to start the second timing according to the preset timing mode when the response notification information is sent, including: the first terminal is further configured to start the second timing by using the built-in clock of the first terminal when the response notification information is sent;
  • the first terminal is configured to start the first timing according to the preset timing mode when the request information is sent, and includes: the first terminal, where the first terminal starts calculating the number of cycles of the communication carrier when the request information is sent.
  • the first terminal is further configured to start the second timing according to the preset timing mode when the response notification information is sent, including: the first terminal is further configured to: when the response notification information is sent, the first terminal connects to the communication carrier Counting starts; wherein, during communication between the first terminal and the second terminal, the first terminal always generates a communication carrier; or
  • the first terminal is configured to start the first timing according to the preset timing mode when the request information is sent, and includes: the first terminal, configured to start calculating, by the first terminal, the number of pulses of the communication carrier when the request information is sent;
  • the first terminal is further configured to start the second timing according to the preset timing mode when the response notification information is sent, including: the first terminal is further configured to: when the response notification information is sent, the first terminal sends a pulse to the communication carrier.
  • Timing comprising: a first terminal, configured to: when the request information is sent, the first terminal starts to record a first phase difference of a waveform phase of the communication carrier with respect to the first start phase, where the first start phase is the first terminal in requesting information The waveform of the phase of the communication carrier when the transmission is completed; the first terminal is further configured to start the second timing according to the preset timing mode when the response notification information is sent, including: the first terminal is further configured to be used when the request information is sent.
  • the terminal starts to record the phase difference of the waveform phase of the communication carrier with respect to the second initial phase, and the second initial phase is the waveform phase of the communication carrier when the first terminal responds to the transmission of the notification information; wherein, in the first terminal and the During the communication process between the two terminals, the first terminal always generates a communication carrier.
  • the present invention provides a secure communication method and system.
  • the first terminal sends response notification information to the second terminal, and the second terminal sends the response notification information to the first terminal.
  • Sending the response information, the time at which the first terminal receives the response information is controlled by the second terminal receiving the response notification information to the valid time threshold for issuing the response information, and ensuring that the external device cannot be in the first terminal even if the response information is robbed and falsified
  • the response information after the tampering can be sent to the first terminal in the time that the response information can be received, and the effect of the first terminal avoiding receiving the tampering response information is achieved, and the response information of the first terminal after the request information is sent is also shortened.
  • the waiting time improves the security and efficiency of the interaction between the first terminal and the second terminal.
  • FIG. 4 is a flowchart of a secure communication method according to an embodiment of the present invention. the method includes:
  • Step 401 The first terminal sends the request information to the second terminal, and starts the first timing according to the preset timing mode when the request information is sent, and the request information includes at least the data to be processed;
  • the communication manner adopted by the first terminal and the second terminal includes a short-range wireless communication manner.
  • the method before step 401, further includes the steps of: establishing, by the first terminal, the handshake communication with the second terminal, where the first terminal is a card reader, and the second terminal is a smart card or an ID card.
  • the method may further include: a card searching process of the first terminal and the second terminal.
  • Step 402 The second terminal receives the request information, and the second terminal obtains response data according to the to-be-processed data in the request information.
  • the to-be-processed data and the response data may be a plurality of types of information.
  • the to-be-processed data may be an authentication request
  • the response data may be an authentication response response or the like.
  • Step 403 The first terminal sends a response notification message to the second terminal when the first timing reaches the first value, and starts the second timing according to the preset timing mode when the response notification information is sent.
  • the first value is greater than or equal to the fourth value, and the fourth value is based on Find the time required for the data to be processed in the message to get the response data.
  • the fourth value may be pre-stored in the first terminal, or may be negotiated with the second terminal before the first terminal sends the request information to the second terminal, where the first terminal obtains a fourth value, optionally, the fourth value may be less than The frame waiting time in the existing communication protocol, so that the present embodiment is compatible with the existing communication protocol, and the first terminal and the second terminal can normally communicate under the existing communication protocol.
  • the first terminal sends the response notification information to the second terminal after the time that the second terminal processes the processing information to obtain the response data or after the time, to ensure that the first terminal is to the second terminal.
  • the response notification information is sent, the second terminal has received the response data, and when the first terminal sends the response notification information, the response of the second terminal that has not received the response data fails or the verification of the third value does not pass.
  • the first terminal and the second terminal may obtain only the fourth value once in a complete information interaction process, or may send each request information in the first terminal in a complete information interaction process.
  • the fourth value is obtained once before. Only a fourth value is obtained in a complete information interaction process, which can reduce steps in the information interaction process and improve communication efficiency.
  • the first terminal obtains a fourth value before sending each request information, which can improve the first terminal control response.
  • the accuracy of the notification information transmission time is further ensured to ensure communication security.
  • the fourth value pre-stored in the first terminal includes, but is not limited to, the following implementation manner:
  • the first terminal may be configured to have a fourth value of the one or more second terminals at the time of leaving the factory. Before transmitting the request information to the second terminal, the first terminal acquires the device model of the second terminal and matches the correct fourth value.
  • the first terminal obtains the fourth device by using other devices before communicating with the second terminal. The value, such as downloading a fourth value matching the second terminal through the network, or the user of the first terminal inputs the fourth value through the input device of the first terminal.
  • the first terminal negotiates with the second terminal to obtain a fourth value, including but not limited to the following implementation manner:
  • the first manner the first terminal generates a negotiation request and a first random number, and sends the second random number to the second terminal.
  • the second terminal receives the negotiation request and the first random number, and uses the second terminal private key to sign the first random number, obtains the first random number signature data, generates a second random number, and uses the first random number signature data,
  • the second terminal certificate and the second random number are sent to the first terminal; the first terminal receives the first random number signature data, the second terminal certificate, and the second random number, and respectively verifies the first random number signature data and the second terminal certificate.
  • the second random number is signed by using the first terminal private key to obtain the second random number signature data, and the second random number signature data and the first terminal certificate are sent to the second terminal; the second terminal Receiving the second random number signature data and the first terminal certificate, respectively verifying the second random number signature data and the first terminal certificate, if both are verified, Taking the fourth value, encrypting the fourth value by using the first terminal public key, generating a fourth value ciphertext and transmitting it to the first terminal; the first terminal receiving the fourth value ciphertext, using the first terminal private key pair fourth The value ciphertext is decrypted to obtain a fourth value.
  • the first terminal generates a negotiation request and a first random number, and sends the negotiation request, the first random number, and the first terminal certificate to the second terminal; the second terminal receives the negotiation.
  • the fourth value may be calculated by the second terminal according to the type of information interaction, its own computing capability, the adopted communication protocol, and the like, or may be pre-existing in the second terminal.
  • Step 404 The second terminal receives the response notification information, and the second terminal performs the signature operation on the signature information to obtain the signature data, and the second terminal sends the response information to the first terminal, where the signature information includes the response data and the second value, and the second value
  • the second terminal analyzes the sum of the time required to respond to the notification information and the time required to perform the signing operation, and the response information includes the information to be signed and the signature data;
  • the second terminal may use the second terminal built-in private key to sign the signature information, so that the first terminal may determine the true transmission of the response information according to whether the verification of the signature data passes. Whether the user is the second terminal and judges whether the response information has been tampered with, further ensuring the security of the response information.
  • the time required for the second terminal to analyze the response notification information is the time required for the second terminal to estimate the response to the notification information; and the second terminal obtains the analysis response notification information by using the estimated manner.
  • Time required, the estimated time required for the device to analyze the response notification information may be pre-stored in the factory setting of the second terminal, or may be estimated by the second terminal according to the time required for the previous analysis response notification information, and the second terminal does not need to perform timing. The operation reduces the amount of calculation of the second terminal.
  • the second terminal starts the third timing according to the preset timing mode when the response notification information is received; the second terminal analyzes the response notification information, and obtains the response notification information when the analysis is completed.
  • the third time is obtained by analyzing the time required to respond to the notification information.
  • the second terminal uses the timing method to obtain the time required for analyzing the response notification information, and the second value is more accurate and the security is higher.
  • the second terminal may estimate the time required for the current signing operation according to the time required for the previous signing operation, and the estimated setting of the device for performing the signing operation may also be pre-stored in the factory setting of the second terminal. Take time, second The value includes the estimated time required to perform the signature operation, and the second value is more accurate and safer.
  • Step 405 The first terminal receives the response information, and obtains a third value obtained by the second timing when the response information starts to be received.
  • the first terminal performs the verification operation on the signature data, and performs a check on whether the third value and the second value match. If the check passes and the check passes, the response information is judged as the safety response information.
  • the first terminal performs the verification operation on the signature data, and can determine whether the second value in the response information has been tampered with, and can also determine whether the sender of the response information is a real second terminal, and avoid the external device. After the response information is intercepted, the response information is tampered with, and the first terminal receives the falsified response information and processes the information, thereby improving the communication security between the first terminal and the second terminal.
  • the specific operation method of the verification operation is a well-known technology in the art, and details are not described herein again. It should be noted that, in this embodiment, there is no sequence between the operation of performing the verification operation on the signature data by the first terminal and the verification of whether the third value and the second value are matched, and the verification may be completed first. For the signing operation, the verification operation can be completed first, or both operations can be completed at the same time.
  • whether the third value and the second value match are verified, and there may be multiple implementation manners, such as: mode 1, the first terminal determines whether the third value is in the second value. Within the effective threshold, the effective threshold of the second value is [T, T+2t], and if the third value is within the effective threshold of the second value, the check passes, if the third value is not within the effective threshold of the second value , the verification fails, wherein T is the second value, and t is the time required for the response notification information or the response information to support the maximum communication distance through the communication protocol adopted by the first terminal and the second terminal; Determining whether the second value is within the effective threshold of the third value, the effective threshold of the third value is [S-2t, S], and if the second value is within the effective threshold of the third value, the verification passes, if the second If the value is not within the effective threshold of the third value, the verification fails, where S is the third value, and t is the response notification information or the response information needs to be supported by the
  • the first terminal determines whether the difference between the third terminal and the second terminal is within a valid threshold, and the effective threshold is [0, 2t], and if the difference is within the effective threshold, the check passes, if the difference If the value is not within the effective threshold, the verification fails, where t is the time required for the response notification information or the response information to support the maximum communication distance through the communication protocol adopted by the first terminal and the second terminal.
  • t is the time required for the response notification information or the response information to support the maximum communication distance through the communication protocol adopted by the first terminal and the second terminal.
  • the second computing power of the second terminal is stronger, the second value T is smaller;
  • the effective threshold range of the second value should be less than or equal to the sum of the time required for the second terminal to analyze the response notification information and the time required to perform the signature operation, the response notification information transmission time t, and the response information transmission time t
  • the value of t is negligible, that is, the effective threshold of the second value should be greater than or equal to T and small Or equal to T + 2t.
  • the values of the second value and t are both nanoseconds, and the first terminal may actually receive
  • the third value is smaller than the second timing minimum unit of the first terminal, that is, the first terminal starts to receive the response information when the second timing reaches 0.
  • the time required for data transmission under the maximum transmission distance supported by the communication protocol is less than the time required for the data to be tampered with by the external device, and therefore, the falsified response information is sent to the first terminal.
  • the time will be greater than the effective threshold of the second value, that is, if the response information is tampered with by the external device, the third value will be greater than the effective threshold of the second value, and the first terminal can determine the response information as the dangerous response information.
  • the external device hijacks the response information of the second terminal in the remote location and forwards the response information to the first terminal, because the real transmission distance of the response information is greater than the communication protocol support.
  • the maximum distance, the real transmission time of the response information will also be greater than t, therefore, the third value will exceed the effective threshold range of the second value, and the first terminal can determine the response information as dangerous information. That is, the time at which the first terminal uses the received response information to check the time included in the response information can avoid the risk that the first terminal processes the information hijacked by the external device.
  • the first terminal starts the first timing according to the preset timing mode when the request information is sent, and the first terminal starts the second timing according to the preset timing manner when the response notification information is sent.
  • the second terminal may perform the third timing in a manner similar to the first timing or the second timing of the first terminal, for example, the first mode, when the second terminal responds to the notification information receiving.
  • the second terminal built-in clock to start the first timing; in the second mode, the second terminal starts to calculate the number of cycles of the communication carrier when the response notification information is completed; and the third terminal, when the response information is received by the second terminal
  • the second terminal starts counting the number of pulses of the communication carrier; in the fourth method, the second terminal starts recording the first phase difference value of the waveform phase of the communication carrier with respect to the first starting phase when the response information is received by the second terminal,
  • the initial phase is the waveform phase of the communication carrier when the first terminal finishes transmitting the request information;
  • the third timing is performed by using the preset timing mode of the first method, and the second terminal is required to be the terminal with the active crystal oscillator, adopting the second mode or the fourth mode.
  • the preset timing mode performs the third timing, and the second terminal is not required to be a terminal with active crystal oscillator, and the mode four is adopted.
  • the first terminal In the second mode to the fourth mode of the optional implementation manner, in the communication process between the first terminal and the second terminal, the first terminal always generates a communication carrier signal, and the second terminal always receives the communication carrier signal.
  • the first terminal starts to record the first phase difference of the waveform phase of the communication carrier with respect to the first starting phase when the request information is transmitted, and the first initial phase
  • the waveform of the communication carrier of the first terminal when the request information is sent refer to the related description in Embodiment 1, and details are not described herein again.
  • a fifth value is pre-stored in the first terminal, or the first terminal is in the Before transmitting the request information to the second terminal, the first terminal obtains a fifth value, and the fifth value is a time required for the second terminal to predict the reception of the response notification information until the response message is sent.
  • the first terminal determines whether the fifth value is greater than the security threshold, and the sixth value is the security threshold preset by the first terminal. If the fifth value is greater than the security threshold, step 401 is performed, and if the fifth value is less than the security threshold, Then the first terminal selects the following alternative communication methods:
  • Step A The first terminal sends the request information to the second terminal, and starts the first timing according to the preset timing mode when the request information is sent, the request information includes at least the data to be processed, and the second terminal receives the request information.
  • the second terminal obtains the response information according to the request information; in step C, the first terminal sends the response notification information to the second terminal when the first timing reaches the Mth value, and starts the second timing according to the preset timing mode when the response notification information is sent.
  • step D the second terminal receives the response notification information, and the second terminal sends the response information to the first terminal.
  • step E the first terminal is allowed to start receiving the response information when the second terminal reaches the effective threshold of the Nth value.
  • the Nth value is the time required for the second terminal to receive the response notification information until the response message is sent.
  • the Nth value is not the time taken by the second terminal to receive the response notification information and the response information is sent, but only an estimated time.
  • the estimation time is much longer than the real time, then the first timing of the first terminal is possible.
  • the second terminal sends the response information to the first terminal, and the first terminal cannot receive the response information, and the external device may falsely respond after the external device robs the response information and tampers.
  • the first terminal needs to preset a security threshold.
  • the Nth value is less than the preset security threshold, the alternative communication mode is adopted, and the communication efficiency is taken into consideration without affecting the security.
  • the communication method provided in this embodiment is adopted to improve security. That is, the first terminal selects the communication mode based on the time required for the second terminal to receive the response notification information to the time when the response message is sent, and the communication efficiency and security of the first terminal can be further improved.
  • the first terminal notifies the second terminal to send the response information by sending the response notification information, and the first terminal checks the signature data in the response information to ensure that the device that sends the response information is The second terminal does not tamper with the response information, and the first terminal determines whether the time obtained by the timeout matches the time in the received response information, and prevents the external device from remotely robbing the response information of the second terminal to forward, thereby avoiding receiving
  • the purpose of the hijacked or falsified response information also shortens the waiting time of the response information of the first terminal after the request information is sent, and improves the security and efficiency of the interaction between the first terminal and the second terminal.
  • the method shown in FIG. 4 is different from the method embodiment shown in FIG. 5 in the following: the first terminal and the second terminal use different frequency bands to communicate according to different information types of interaction, and other implementation processes are
  • the method embodiment shown in FIG. 4 is the same, and the same content is not described in detail. For details, refer to the related description of the method embodiment shown in FIG.
  • FIG. 5 is a flowchart of a secure communication method according to an embodiment of the present invention, where the method includes:
  • Step 501 The first terminal sends the request information to the second terminal by using the first frequency band, and starts the first timing according to the preset timing mode when the request information is sent, and the request information includes at least the data to be processed.
  • Step 502 The second terminal receives the request information by using the first frequency band, and the second terminal obtains the response data according to the to-be-processed data in the request information.
  • Step 503 The first terminal sends the response notification information to the second terminal by using the second frequency band when the first timing reaches the first value, and starts the second timing according to the preset timing mode when the response notification information is sent.
  • Step 504 The second terminal receives the response notification information by using the second frequency band, and the second terminal performs a signature operation on the signature information to obtain signature data, and the second terminal sends the response information to the first terminal by using the first frequency band, where the information to be signed includes the response data. And a second value, where the second value is a sum of a time required by the second terminal to analyze the response notification information and a time required to perform the signing operation, and the response information includes the information to be signed and the signature data;
  • Step 505 The first terminal receives the response information by using the first frequency band, and obtains a third value obtained by the second timing when the response information starts to be received.
  • the first terminal performs the verification operation on the signature data, and performs the third value and the second value. Whether the matching is performed for verification, if the verification is passed and the verification is passed, the response information is judged to be security response information.
  • the first frequency band and the second frequency band are different frequency bands, for example, the first frequency band is 13.56 MHz frequency band, and the second frequency band is 2.4G frequency band, and the first terminal and the second terminal are both devices supporting dual frequency band communication. .
  • the first terminal and the second frequency band adopt a method for transmitting/receiving response notification information in a frequency band, so that the third party cannot hijack the response notification information in the frequency band in which the request information is sent, and cannot Knowing the correct time for sending the response information, that is, the false response information cannot be used to attack the first terminal when the second timing of the first terminal reaches the preset threshold range, and the timing cannot be started after obtaining the response notification information to obtain the second value.
  • the security of communication equipment is guaranteed.
  • the embodiment provides a secure communication system, which includes a first terminal and a second terminal.
  • the secure communication system of this embodiment is used to execute the secure communication method in the method embodiment shown in FIG. 4 or 5.
  • the content or similar process will not be described here, but only briefly described as follows:
  • the first terminal is configured to send the request information to the second terminal, and start the first timing according to the preset timing mode when the request information is sent, the request information includes at least data to be processed, and the second terminal is configured to receive the request information, according to The data to be processed in the request information is sent with the response data; the first terminal is further configured to send the response notification information to the second terminal when the first timing reaches the first value, and start according to the preset timing mode when the response notification information is sent.
  • the second terminal is further configured to receive the response notification information, perform signature operation on the signature information, obtain signature data, and send response information to the first terminal, where the signature information includes response data and a second value, and the second value is The second terminal analyzes the sum of the time required to respond to the notification information and the time required to perform the signature operation, and the response information includes the information to be signed and the signature data; the first terminal, The method is further configured to receive the response information, obtain a third value obtained by the second timing when the response information starts to be received, perform a verification operation on the signature data, and check whether the third value and the second value match, if the check passes And if the verification passes, the response information is judged to be security response information.
  • the communication manner adopted by the first terminal and the second terminal includes: a short-range wireless communication mode.
  • the first terminal is further configured to check whether the third value and the second value match, the first terminal further configured to determine whether the third value is within an effective threshold of the second value, and the effective threshold of the second value It is [T, T+2t], where T is the second value, and t is the time required for the response notification information or the response information to support the maximum communication distance through the communication protocol adopted by the first terminal and the second terminal.
  • the second terminal is further configured to analyze a time required for the response notification information to be a time required for the second terminal to estimate the response to the notification information; or the second terminal is further configured to: according to the preset timing when the response notification information is received The mode starts the third timing; the second terminal analyzes the response notification information, and obtains the time required for the analysis response notification information obtained by the third timing when the response notification information is analyzed.
  • the first terminal is configured to send the request information to the second terminal, where the first terminal is configured to send the request information to the second terminal by using the first frequency band, and the second terminal is configured to receive the request information, where the second terminal is used by the second terminal.
  • Receiving the request information by using the first frequency band the first terminal is further configured to send the response notification information to the second terminal when the timing reaches the first value, the first terminal is further configured to use the second frequency band when the timing reaches the first value
  • the second terminal sends the response notification information, and the second terminal is further configured to receive the response notification information, where the second terminal is further configured to receive the response notification information by using the second frequency band, where the second terminal is further configured to send the response information to the first terminal, where The second terminal is further configured to send the response information to the first terminal by using the first frequency band, where the first terminal is further configured to receive the response information, where the first terminal is further configured to receive the response information by using the first frequency band.
  • the first value is greater than or equal to the fourth value
  • the fourth value is a time required for the second terminal to obtain the response data according to the to-be-processed data in the request information; the fourth terminal prestores the fourth value, or the first terminal
  • the method is further configured to negotiate with the second terminal before sending the request information to the second terminal, where the first terminal obtains the fourth value.
  • the first terminal is configured to start the first timing according to the preset timing mode when the request information is sent, and the first terminal is configured to start using the first terminal built-in clock to start the first timing when the request information is sent.
  • the terminal is further configured to start the second timing according to the preset timing mode when the response notification information is sent, including: the first terminal is further configured to start the second timing by using the built-in clock of the first terminal when the response notification information is sent;
  • the first terminal is configured to start the first timing according to the preset timing mode when the request information is sent, and includes: the first terminal, where the first terminal starts calculating the number of cycles of the communication carrier when the request information is sent.
  • the first terminal is further configured to start the second timing according to the preset timing mode when the response notification information is sent, including: the first terminal is further configured to: when the response notification information is sent, the first terminal connects to the communication carrier Counting starts; wherein, during communication between the first terminal and the second terminal, the first terminal always generates a communication carrier; or , A first terminal, according to a preset message has been sent when requesting The first mode is started, and the first terminal is configured to start counting, when the request information is sent, the number of pulses of the communication carrier by the first terminal, and the first terminal is further configured to: The design time mode starts the second timing, including: the first terminal is further configured to start calculating the number of pulses of the communication carrier by the first terminal when the response notification information is sent; wherein, the communication process is performed between the first terminal and the second terminal The first terminal always generates a communication carrier; or the first terminal is configured to start the first timing according to the preset timing mode when the request information is sent, including: the first terminal, configured to be first when
  • the first terminal After completion, the first terminal starts to record the phase difference of the waveform phase of the communication carrier with respect to the second initial phase, and the second initial phase is the waveform phase of the communication carrier when the first terminal responds to the transmission of the notification information;
  • the first terminal During communication between a terminal and the second terminal, the first terminal always generates a communication carrier.
  • the present invention provides a secure communication method and system.
  • the first terminal sends a response notification information to notify the second terminal to send response information to the first terminal, and the first terminal responds to the information.
  • the signature data in the verification is performed to ensure that the device that sends the response information is the second terminal and the response information has not been tampered with, and the first terminal determines whether the time obtained by the timing matches the time in the received response information, and avoids remote operation of the external device.
  • the response information of the second terminal is captured and forwarded to avoid receiving the hijacked or tampered response information, and the waiting time of the response message after the first terminal sends the request information is shortened, and the first terminal is improved. Security and efficiency of interaction with the second terminal information.
  • portions of the invention may be implemented in hardware, software, firmware or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
  • each functional unit in each embodiment of the present invention may be integrated into one processing component, or each unit may exist physically separately, or two or more units may be integrated into one component.
  • the above integrated components can be implemented in the form of hardware or in the form of software functional components.
  • the integrated components, if implemented in the form of software functional components and sold or used as separate products, may also be stored in a computer readable storage medium.
  • the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

一种安全通信方法和***,该方法包括:第一终端向第二终端发送请求信息,在请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据(101);第二终端接收请求信息,第二终端根据请求信息得到响应信息(102);第一终端在第一计时到达第一数值时向第二终端发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时(103);第二终端接收响应通知信息,第二终端向第一终端发送响应信息(104);第一终端在第二计时到达第二数值的有效阈值内时,允许开始接收响应信息,其中,第二数值为第二终端接收响应通知信息完毕至发出响应信息所需要的时间(105)。

Description

一种安全通信方法和***
相关申请的交叉引用
本申请要求李明于2016年8月5日提交中国专利局、申请号为201610641429.8、发明名称为“一种安全通信方法和***”的中国专利申请的优先权,以及李明于2016年8月5日提交中国专利局、申请号为201610640039.9、发明名称为“一种安全通信方法和***”的中国专利申请的优先权。
技术领域
本发明涉及一种电子技术领域,尤其涉及一种安全通信方法和***。
背景技术
在现有读卡器的读卡机制中,读卡器与卡片的信息交互时读卡器向卡片发送指令数据之后,读卡器会在预设的帧等待时间(Frame Waiting Time,FWT)内等待接收卡片响应数据,且在FWT之内接收到的数据均会处理。在这种情况下,第三方可以将卡片向读卡器发送的响应数据劫持并篡改,再将篡改后的响应数据发送至读卡器,或者,第三方可以伪装为读卡器,劫持真实卡片的响应信息后,伪装为真实卡片将响应信息发送至真实读卡器,即远程获取卡片的身份信息,获得读卡器授权,如果该劫持后的响应数据可以在FWT内被读卡器接收,读卡器即处理该劫持后的响应数据,容易造成卡片用户的损失,因此,读卡器在FWT内接受响应数据的方案,为读卡器与卡片的信息交互带来了不安全因素。
因此,本技术领域亟需一种新的技术方案解决以上问题。
发明内容
本发明旨在解决上述问题之一。
本发明的主要目的在于提供一种安全通信方法;
本发明的另一目的在于提供一种安全通信***;
本发明的另一目的在于提供另一种安全通信方法;
本发明的另一目的在于提供另一种安全通信***。
为达到上述目的,本发明的技术方案具体是这样实现的:
本发明一方面提供了一种安全通信方法,包括:第一终端向第二终端发送请求信息,在 请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据;第二终端接收请求信息,第二终端根据请求信息得到响应信息;第一终端在第一计时到达第一数值时向第二终端发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时;第二终端接收响应通知信息,第二终端向第一终端发送响应信息;第一终端在第二计时到达第二数值的有效阈值内时,允许开始接收响应信息,其中,第二数值为第二终端接收响应通知信息完毕至发出响应信息所需要的时间。
本发明一方面还提供了一种安全通信***,包括:第一终端,用于向第二终端发送请求信息,在请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据;第二终端,用于接收请求信息,根据请求信息得到响应信息;第一终端,还用于在第一计时到达第一数值时向第二终端发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时;第二终端,还用于接收响应通知信息,第二终端向第一终端发送响应信息;第一终端,还用于在第二计时到达第二数值的有效阈值内时,允许开始接收响应信息,其中,第二数值为第二终端接收响应通知信息完毕至发出响应信息所需要的时间。
由上述本发明提供的技术方案可以看出,本发明一方面提供的一种安全通信方法与***,第一终端向第二终端发送响应通知信息,第二终端在接受到响应通知信息后向第一终端发送响应信息,第一终端将接收响应信息的时间控制在第二终端接收响应通知信息至发出响应信息的有效时间阈值内,保障外部设备即便劫取到响应信息并篡改,也无法在第一终端可以接收响应信息的时间内将篡改后的响应信息发送至第一终端,达到了第一终端避免接收篡改后的响应信息的效果,同时也缩短了第一终端在发出请求信息后对响应信息的等待时间,提高了第一终端与第二终端信息交互的安全性和效率。
本发明另一方面还提供了另一种安全通信方法,包括:第一终端向第二终端发送请求信息,在请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据;第二终端接收请求信息,第二终端根据请求信息中的待处理数据得到响应数据;第一终端在第一计时到达第一数值时向第二终端发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时;第二终端接收响应通知信息,第二终端对待签名信息进行签名操作,得到签名数据,第二终端向第一终端发送响应信息,待签名信息包括响应数据和第二数值,第二数值为第二终端分析响应通知信息所需时间与预估进行签名操作所需时间之和,响应信息包括待签名信息和签名数据;第一终端接收响应信息,获得响应信息开始接收时的第二计时得到的第三数值;第一终端对签名数据进行验签操作,并对第三数值与第二数值是否匹配进行校验,如果验签通过且校验通过,则判断响应信息为安全响应信息。
本发明的另一方面还提供了另一种安全通信***,包括:第一终端,用于向第二终端发送请求信息,在请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据;第二终端,用于接收请求信息,根据请求信息中的待处理数据得到响应数据;第一终端,还用于在第一计时到达第一数值时向第二终端发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时;第二终端,还用于接收响应通知信息,对待签名信息进行签名操作,得到签名数据,向第一终端发送响应信息,待签名信息包括响应数据和第二数值,第二数值为第二终端分析响应通知信息所需时间与预估进行签名操作所需时间之和,响应信息包括待签名信息和签名数据;第一终端,还用于接收响应信息,获得响应信息开始接收时的第二计时得到的第三数值;对签名数据进行验签操作,并对第三数值与第二数值是否匹配进行校验,如果验签通过且校验通过,则判断响应信息为安全响应信息。
由上述本发明提供的技术方案可以看出,本发明另一方面提供了另一种安全通信方法与***,第一终端采用发送响应通知信息的方式通知第二终端向其发送响应信息,第一终端对响应信息中的签名数据进行验签,确保发送响应信息的设备为第二终端且响应信息没有被篡改,第一终端判断其计时得到的时间与接收到的响应信息中的时间是否匹配,避免外部设备远程劫取到第二终端的响应信息进行转发,达到避免接收被劫持或篡改过的响应信息的目的,同时也缩短了第一终端在发出请求信息后对响应信息的等待时间,提高了第一终端与第二终端信息交互的安全性和效率。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他附图。
图1为本发明实施例1提供的一种安全通信方法的流程图;
图2为本发明实施例1提供的另一种安全通信方法的流程图;
图3为本发明实施例1提供的一种安全通信***的结构框图;
图4为本发明实施例2提供的一种安全通信方法的流程图;
图5为本发明实施例2提供的另一种安全通信方法的流程图。
具体实施方式
下面结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明的实 施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明的保护范围。
下面将结合附图对本发明实施例作进一步地详细描述。
实施例1
图1示出了本发明实施例提供的一种安全通信方法的流程图;该方法包括:
步骤101,第一终端向第二终端发送请求信息,在请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据;
其中,第一终端可以是读取器,例如,可以是读卡器、电脑、平板电脑或手机等设备;第二终端可以是应答器,例如可以是智能卡、电子签名工具key、key卡合一设备、手机或身份证等设备。
在本实施例的一个可选实施方式中,第一终端与第二终端采用的通信方式包括短距离无线通信方式。其中,短距离无线通信方式可以包括遵循如下通信协议的通信方式:蓝牙通信协议、红外IrDA通信协议、RFID通信协议、ZigBee通信协议、超宽频(Ultra WideBand)通信协议、短距通信(NFC)通信协议、WiMedia通信协议、GPS通信协议、DECT通信协议、无线1394通信协议、ISO14443协议、ISO15693协议和专用无线通信协议,当然,未来有可能出现的以下通信协议等同于上述通信协议:通信协议支持的最大传输距离下数据传输所需时间小于数据被外部设备篡改所需时间。
在本实施例的一个可选实施方式中,在步骤101之前,还可以包括第一终端与第二终端建立握手通讯等步骤,当第一终端为读卡器,第二终端为智能卡或身份证时,还可以包括,第一终端与第二终端的寻卡流程。
在本实施例中,请求信息可以是第一终端生成的,也可以是第一终端接收的由后台服务器等认证设备生成的信息。当请求信息是由第一终端生成时,可避免请求信息被劫持篡改的风险,确保请求信息的安全性,当请求信息是由后台服务器等认证设备生成时,减少了第一终端的运算量,避免认证设备对被篡改的请求信息进行认证,提高了信息交互的安全性。
步骤102,第二终端接收请求信息,第二终端根据请求信息得到响应信息;
在本实施例的一个可选实施方式中,第二终端根据请求信息中的待处理数据进行处理,得到响应数据,响应信息中至少包括响应数据。待处理数据和响应数据可以是多种信息,例如,待处理数据可以是身份验证请求,响应数据可以是身份验证应答响应等内容。
在本实施例的一个可选实施方式中,第二终端根据请求信息得到响应信息,包括,第二终端根据请求信息中的待处理数据得到响应数据,对待签名数据进行签名,得到签名数据,待签名数据包括响应数据,响应信息至少包括响应数据和签名数据。本可选实施方式中,第 二终端可使用第二终端内置私钥对响应数据进行签名,使得第一终端可根据签名数据的验签是否通过来判断响应信息的真实发送者是否为第二终端,进一步保障响应信息的安全性。
在本实施例的一个可选实施方式中,请求信息中还包括随机数;第二终端根据请求信息得到响应信息,包括,第二终端根据请求信息中的待处理数据得到响应数据,对待签名数据进行签名,得到签名数据,待签名数据包括响应数据和随机数,响应信息至少包括响应数据和签名数据。本可选实施方式中,第二终端可使用第二终端内置私钥对待签名数据进行签名,第一终端可根据签名数据的验签是否通过,来判断响应信息的真实发送者是否为第二终端,待签名数据中包括第一终端发送的随机数和响应数据,可以使得第一终端与第二终端每次信息交互的签名数据均不相同,避免第三方在截取到前次信息交互的数据后进行重放攻击。
步骤103,第一终端在第一计时到达第一数值时向第二终端发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时;
在本实施例的一个可选实施方式中,第一数值大于或等于第三数值,第三数值为第二终端根据请求信息得到响应信息所需要的时间。第三数值可以预存在第一终端中,也可以在第一终端向第二终端发送请求信息之前,与第二终端进行协商,第一终端得到第三数值,可选地,第三数值可以小于现有通信协议中的帧等待时间,以便本实施方式可以兼容现有通信协议,保障在现有通信协议下,第一终端与第二终端可正常通信。在本可选实施方式中,第一终端在第二终端对待处理信息进行处理得到响应数据所需要的时间或该时间之后向第二终端发送响应通知信息,可确保在第一终端向第二终端发送响应通知信息时,第二终端已得到响应信息,避免第一终端发送响应通知信息时,第二终端尚未得到响应信息而导致的通信失败或响应失败,提高通信效率。可选地,第一终端与第二终端可以在处理一个完整的信息交互流程中仅获取一次第三数值,也可以是在第一终端在一个完整的信息交互流程中,在发送每一个请求信息之前均获取一次第三数值。一个完整的信息交互流程中仅获取一次第三数值,可以减少信息交互流程中的步骤,提高通信效率,第一终端发送每一个请求信息之前均获取一次第三数值,可以提高第一终端控制响应通知信息发送时间的精确程度,进一步保障通信安全。
步骤104,第二终端接收响应通知信息,第二终端向第一终端发送响应信息;
步骤105,第一终端在第二计时到达第二数值的有效阈值内时,允许开始接收响应信息,第二数值为第二终端接收响应通知信息并发出响应信息所需要的时间;
在本实施例的一个可选实施方式中,第二数值的有效阈值为[T,T+2t],其中,T为第二数值,T+2t小于或等于第一终端与第二终端进行通信时采用的通信协议规定的帧等待时间,T也应当小于第一终端与第二终端进行通信时采用的通信协议规定的帧等待时间,t为响应通知信息或响应信息经过第一终端与第二终端采用的通信协议支持最大通信距离所需 要的时间,例如,第一终端与第二终端进行通信时采用的通信协议为ISO14443或ISO15693,如果协议规定的帧等待时间为30ms,则第二数值T应当小于30ms,且第二数值的有效阈值的最大值T+2t也应当小于或等于30ms,才能确保第一终端在符合协议规定的前提下接收到第二终端发送的响应信息。在本可选实施方式中,第二终端接收响应通知信息并发出响应信息所需的时间根据第二终端的类型的不同以及计算能力等因素的不同而不同,第二终端的计算能力越强,第二数值T的取值越小;t的计算方法为:第一终端与第二终端采用的通信协议支持的最大通信距离为L,信号传输速度为C,则t=L/C,t的具体取值可以携带在第一终端的出厂信息中,也可以携带在第一终端与第二终端进行通信时采用的通信协议中;第一终端允许接收响应信息的预设阈值范围,应当小于或等于第二终端响应通知信息接收完毕并发出响应信息所需要的时间T、响应通知信息传输时间t与响应信息传输时间t之和,当第一终端与第二终端之间的距离足够近时,t的取值可以忽略不计,即第二数值的有效阈值应当大于或等于T且小于或等于T+2t,并且,当第二终端采用的通信协议传输速率足够快,第二终端的计算能力足够强,第一终端与第二终端的距离足够近时,T与t的取值均为纳秒级,可能存在第一终端实际接收到响应信息时,第二计时小于第一终端的计时最小单位的情况,即第一终端在第二计时达到0时,开始接收响应信息。
在本技术方案中,在短距离无线通信的情况下,通信协议支持的最大传输距离下数据传输所需时间小于数据被外部设备篡改所需时间,因此,篡改后的响应信息发送至第一终端的时间将大于第二数值的有效阈值,由于第一终端并不会接收超过第二数值的有效阈值的响应信息,第一终端将不会接收到篡改后的响应信息。即将第一终端接收响应信息的时间进行严格计算并控制,可确保响应信息的安全性,避免第一终端接收到篡改后的响应信息并处理的风险。
在本发明的一个可选实施方式中,当响应信息包括签名数据时,本实施例还可以包括:步骤106,第一终端对响应信息接收完毕后,对签名数据进行验签,如果验签通过,则判断响应信息为信任响应信息。第一终端对签名数据进行验签,可根据验签结果判断响应信息的真实发送者是否为第二终端,进一步提高通信安全。
在本实施例的一个可选实施方式中,第二数值可以与存在第一终端中,或者,第一终端在向第二终端发送请求信息之前,与第二终端进行协商,第一终端得到第二数值。
作为本发明的一个可选实施方式,第一终端与第二终端可以在处理一个完整的信息交互流程中仅获取一次第二数值,也可以是在第一终端在一个完整的信息交互流程中,在发送每一个请求信息之前均获取一次第二数值。一个完整的信息交互流程中仅获取一次第二数值,可以减少信息交互流程中的步骤,提高通信速率,第一终端发送每一个请求信息之前均获取一次第二数值,可以提高第一终端控制响应信息接收时间的精确度,进一步保障通信安全。
在本实施例的一个可选实施方式中,在步骤101之前,第一终端判断第二数值是否小于预设安全门限值,如果第二数值小于预设安全门限值,则执行步骤101,如果第二数值大于预设安全门限值,则第一终端选择其他通信方式。在实施例中,由于第二数值并不是第二终端真实的接收响应通知信息并发出响应信息所占用的时间,而仅是一个估算时间,当估算时间远大于真实时间时,那么有可能在第一终端的第一计时达到第二数值的有效阈值之前,第二终端将响应信息发送至第一终端,而第一终端无法接收到响应信息,也可能存在外部设备劫取到响应信息并篡改之后,外部设备将虚假响应信息发送至第一终端时,第一终端的第二计时仍第二数值的有效阈值内的情况,为数据交互带来风险。因此,第一终端需要预设一个安全门限值,当第二数值小于预设安全门限值时,采用本方案,在不影响安全性的前提下,兼顾通信效率,当第二数值大于预设安全门限值时,采用其他安全性更高的方案。即第一终端基于第二终端接收响应通知信息完毕至发出响应信息所需要的时间选择通信方式,可进一步提高第一终端的通信效率和安全性。
作为本发明的一个可选实施方式,第一终端的第二数值与第三数值的获取方式可以相同也可以不同,如:第二数值与第三数值均预存在第一终端中;或者,第一终端在向第二终端发送请求信息之前,与第二终端进行协商,得到第二数值和第三数值;或者,第二数值预存在第一终端中,第一终端在向第二终端发送请求信息之前,与第二终端进行协商,得到第三数值,而第二数值预存在第一终端中;或者,第三数值预存在第一终端中,第一终端在向第二终端发送请求信息之前,与第二终端进行协商,得到第二数值,而第三数值预存在第一终端中。第二数值与第三数值的获取方式可根据第一终端301和/或第二终端302的设备类型进行适应性的变化,可提高通信效率。
在本实施例的可选实施方式中,第一终端中预存有第二数值和/或第三数值包括但不限于以下实施方式:方式一,第一终端可以在出厂时已设置有一种或多种第二终端的第二数值和/或第三数值,第一终端在向第二终端发送请求信息之前,获取第二终端的设备型号,匹配出正确的第二数值和/或第三数值;方式二,第一终端在与第二终端进行通信之前,通过其他设备获得第二数值和/或第三数值,如通过网络下载与第二终端匹配的第二数值和/或第三数值,或第一终端的使用者通过第一终端的输入设备输入第二数值和/或第三数值。
在本实施例的可选实施方式中,第一终端与第二终端进行协商得到第二数值和/或第三数值,包括但不限于以下实施方式:方式一,第一终端生成协商请求和第一随机数并发送至第二终端;第二终端接收协商请求和第一随机数,使用第二终端私钥对第一随机数进行签名,获得第一随机数签名数据,生成第二随机数,将第一随机数签名数据、第二终端证书和第二随机数发送至第一终端;第一终端接收第一随机数签名数据、第二终端证书和第二随机数,分别对第一随机数签名数据和第二终端证书进行验证,如果均验证通过,则使用第一终端私 钥对第二随机数进行签名,获得第二随机数签名数据,将第二随机数签名数据和第一终端证书发送至第二终端;第二终端接收第二随机数签名数据和第一终端证书,分别对第二随机数签名数据和第一终端证书进行验证,如果均验证通过,获取第二数值和/或第三数值,使用第一终端公钥对第二数值和/或第三数值进行加密,生成第二数值密文和/或第三数值密文并发送至第一终端;第一终端接收第二数值密文和/或第三数值密文,使用第一终端私钥对第二数值密文和/或第三数值密文进行解密,获得第二数值和/或第三数值;方式二,第一终端生成协商请求和第一随机数,将协商请求、第一随机数和第一终端证书发送至第二终端;第二终端接收协商请求、第一随机数和第一终端证书,验证第一终端证书,如果验证通过,使用第二终端私钥对第一随机数进行签名,获得第一随机数签名数据,生成第二随机数,使用第一终端公钥对第二随机数进行加密,获得第二随机数密文,将第二随机数密文、第二终端证书和第一随机数签名数据发送至第一终端;第一终端接收第二随机数密文、第二终端证书和第一随机数签名数据,分别对第二终端证书和第一随机数签名数据进行验证,如果均验证通过,则使用第一终端私钥对第二随机数密文进行解密,得到第二随机数,使用第一终端私钥对第二随机数进行签名,得到第二随机数签名数据,生成第三随机数,使用第二终端公钥对第三随机数进行加密,得到第三随机数密文,按照预设规则对第二随机数和第三随机数进行处理,获得第一传输密钥,将第二随机数签名数据和第三随机数密文发送至第二终端;第二终端接收第二随机数签名数据和第三随机数密文,分别对第二随机数签名数据进行验证,如果均验证通过,使用第二终端私钥对第三随机数密文进行解密,获得第三随机数,按照预设规则对第二随机数和第三随机数进行处理,获得第二传输密钥;获取第二数值和/或第三数值,使用第二传输密钥对第二数值和/或第三数值进行加密,获得第二数值密文和/或第三数值密文,将第二数值密文和/或第三数值密文发送至第一终端;第一终端接收第二数值密文和/或第三数值密文,使用第一传输密钥对第二数值和/或第三数值密文进行解密,获得第二数值和/或第三数值。
在以上可选实施方式中,第一终端与第二终端通过协商得到第二数值和/或第三数值,第二数值和/或第三数值可以由第二终端根据信息交互的类型和其自身的计算能力、采用的通信协议等信息进行计算得到,也可以预存在第二终端中。
在本发明的一个可选实施方式中,第一终端在请求信息发送完毕时根据预设计时方式开始第一计时,第一终端在响应通知信息发送完毕时根据预设计时方式开始第二计时,可以有多种预设计时方式,如:方式一,第一终端在请求信息发送完毕时使用第一终端内置时钟开始第一计时;第一终端在响应通知信息发送完毕时使用第一终端内置时钟开始第二计时;在本方式中,第二数值的有效阈值表示的是一个时间范围,如当第二数值为100μm,响应通知信息或响应信息经过第一终端与第二终端采用的通信协议支持最大通信距离所需要的时 间为10μm时,第二数值的有效阈值为[100μm,120μm],步骤105中“第一终端在第二计时到达第二数值的有效阈值内时,允许开始使用所述第一频段接收所述响应信息”的具体执行方式为,第一终端在第二计时到达[100μm,120μm]内时,允许开始接收响应信息;方式二,第一终端在请求信息发送完毕时第一终端对通信载波的周期个数开始计算;第一终端在响应通知信息发送完毕时第一终端对通信载波的周期个数开始计算;在本方式中,第二数值的有效阈值表示的是一个周期个数范围,如当第二数值为100个周期,通信载波经过第一终端与第二终端采用的通信协议支持最大通信距离所产生的周期个数变化值为10个周期时,第二数值的有效阈值为[100,120]个周期,步骤105中“第一终端在第二计时到达第二数值的有效阈值内时,允许开始使用所述第一频段接收所述响应信息”的具体执行方式为,第一终端在第二计时的周期个数到达[100,120]内时,允许开始接收响应信息;方式三,第一终端在请求信息发送完毕时第一终端对通信载波的脉冲个数开始计算;第一终端在响应通知信息发送完毕时第一终端对通信载波的脉冲个数开始计算;在本方式中,第二数值的有效阈值表示的是一个脉冲个数范围,如当第二数值为100个脉冲,通信载波经过第一终端与第二终端采用的通信协议支持最大通信距离所产生的脉冲个数变化值为10个脉冲时,第二数值的有效阈值为[100,120]个脉冲,步骤105中“第一终端在第二计时到达第二数值的有效阈值内时,允许开始使用所述第一频段接收所述响应信息”的具体执行方式为,第一终端在第二计时的脉冲个数到达[100,120]内时,允许开始接收响应信息;方式四,第一终端在请求信息发送完毕时第一终端开始记录通信载波的波形相位相对于第一起始相位的第一相位差值,第一起始相位为第一终端在请求信息发送完毕时通信载波的波形相位;第一终端在请求信息发送完毕时第一终端开始记录通信载波的波形相位相对于第二起始相位的相位差值,第二起始相位为第一终端在响应通知信息发送完毕时通信载波的波形相位;在本方式中,第二数值的有效阈值表示的是一个相位差值范围,如当第二数值为相位差为
Figure PCTCN2017095991-appb-000001
通信载波经过第一终端与第二终端采用的通信协议支持最大通信距离所产生的相位差为θ时,第二数值的有效阈值为
Figure PCTCN2017095991-appb-000002
步骤105中“第一终端在第二计时到达第二数值的有效阈值内时,允许开始使用所述第一频段接收所述响应信息”的具体执行方式为,第一终端在第二计时的相位差到达
Figure PCTCN2017095991-appb-000003
内时,允许开始接收响应信息。采用方式一至方式三的预设计时方式进行第一计时和第二计时,计时方法简单,无须对现有的第一终端进行较大改进,采用方式四的预设计时方式进行第一计时和第二计时,由于相对于周期或脉冲计时,相位计时的精度较高,响应信息更加安全。本可选实施方式的方式二至方式四中,在第一终端与第二终端通信过程中,第一终端始终产生通信载波信号,在通信技术上,通信载波信号是由振荡器产生并在通讯信道上传输的电波,被调制后用来传送数据,通信载波信号为未受调制的周期性振荡信号,通信载波信号可以是正弦波,也可以是非正弦波(如周期性脉冲序列)。
下面针对上述可选实施方式的方式四中的,“第一终端在请求信息发送完毕时第一终端开始记录通信载波的波形相位相对于第一起始相位的第一相位差值,第一起始相位为第一终端在请求信息发送完毕时通信载波的波形相位”的具体实现方案进行简要说明:第一终端在请求信息发送完毕时,将当前通信载波信号的相位值设置为0,并将该0值作为第一起始相位,之后实时读取通信载波信号的相位值,从而实时获得通信载波信号的波形相位相对于第一起始相位的第一相位差值;或者,第一终端在请求信息发送完毕时,利用第一终端内部的示波元件检测当前的通信载波相位,并将当前的通信载波相位设置为第一起始相位,之后开始实时检测通信载波信号的相位差值变化,从而实时获得通信载波信号的波形相位相对于第一起始相位的第一相位差值。“第一终端在请求信息发送完毕时第一终端开始记录通信载波的波形相位相对于第二起始相位的相位差值,第二起始相位为第一终端在响应通知信息发送完毕时通信载波的波形相位”的实现方案与上述实现方案相似,在此不再进行具体说明。
通信载波信号的相位变化速度与通信载波信号的频率正相关,通过检测某一X时刻通信载波信号的相位相对于第一起始相位的变化差值,能够基于相位变化差值精确记录X时刻与第一终端发送完毕请求信息时刻之间的时间间隔,例如,当通信载波信号的频率为ν时,其一个周期的持续时间为
Figure PCTCN2017095991-appb-000004
一个周期的相位变化为360°,那么通信载波信号相位变化1°所需要的时间为
Figure PCTCN2017095991-appb-000005
可见,第一终端通过测量通信载波信号相位变化来检测时间间隔相较于通过通信载波信号的周期和脉冲,能够大大提升计时精度。
本实施例提供的安全通信方法,第一终端向第二终端发送响应通知信息,第二终端在接受到响应通知信息后向第一终端发送响应信息,第一终端将接收响应信息的时间控制在第二终端接收响应通知信息至发出响应信息的有效时间阈值内,保障外部设备即便劫取到响应信息并篡改,也无法在第一终端可以接收响应信息的时间内将篡改后的响应信息发送至第一终端,达到了第一终端避免接收篡改后的响应信息的效果,同时也缩短了第一终端在发出请求信息后对响应信息的等待时间,提高了第一终端与第二终端信息交互的安全性和效率。
图2所示的方法实施例与上述图1所示的方法实施例区别在于,第一终端与第二终端根据交互的信息类别不同,采用不同的频段进行通信,其他实现过程均与上述方法实施例相同,相同内容不再进行详述,可参见上述图1示出方法实施例的相关描述。
图2示出了本发明实施例提供的另一种安全通信方法的流程图,该方法包括:
步骤201,第一终端使用第一频段向第二终端发送请求信息,在请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据;
步骤202,第二终端使用第一频段接收请求信息,第二终端根据请求信息得到响应信息;
步骤203,第一终端在第一计时到达第一数值时使用第二频段向第二终端发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时;
步骤204,第二终端使用第二频段接收响应通知信息,第二终端向第一终端发送响应信息;
步骤205,第一终端在第二计时到达第二数值的有效阈值内时,允许开始接收响应信息,其中,第二数值为第二终端接收响应通知信息完毕至发出响应信息所需要的时间。
在本实施例中,第一频段与第二频段是不同的频段,例如第一频段为13.56MHZ频段,第二频段为2.4G频段,第一终端与第二终端均为支持双频段通讯的设备。
本实施例在实施例1的基础上,第一终端和第二终端采用更换频段发送/接收响应通知信息的方法,使得第三方在发送请求信息的频段内无法劫持到响应通知信息,无法获知发送响应信息的正确时间,即无法使用虚假响应信息在第一终端第二计时达到有效时间阈值范围内时攻击第一终端,在保障通信安全的基础上,保障了通信设备的安全。
本实施例提供一种安全通信***,如图3所示,该安全通讯***包括第一终端301和第二终端302,本实施例中,第一终端301可以是读取器,例如,可以是读卡器、电脑、平板电脑或手机等设备,第二终端302可以是应答器,例如,可以是智能卡、电子签名工具key、key卡合一设备、手机或身份证等设备。
本实施例的安全通信***用于执行上述安全通信方法,该***中的功能实现可参见上述方法中的相关描述,相同内容或类似流程在此不再赘述,仅进行简要说明如下:
第一终端301,用于向第二终端302发送请求信息,在请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据;
第二终端302,用于接收请求信息,根据请求信息得到响应信息;
第一终端301,还用于在第一计时到达第一数值时向第二终端302发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时;
第二终端302,还用于接收响应通知信息,第二终端302向第一终端301发送响应信息;
第一终端301,还用于在第二计时到达第二数值的有效阈值内时,允许开始接收响应信息,其中,第二数值为第二终端302接收响应通知信息完毕至发出响应信息所需要的时间。
此外,第一终端与第二终端采用的通信方式包括:短距离无线通信方式。
此外,第二数值的有效阈值为[T,T+2t],其中,T为第二数值,T+2t小于或等于第一终端与第二终端进行通信时采用的通信协议规定的帧等待时间,t为响应通知信息或响应信息经过第一终端与第二终端采用的通信协议支持最大通信距离所需要的时间。
此外,第一终端,用于向第二终端发送请求信息,包括,第一终端,用于使用第一频 段向第二终端发送请求信息;第二终端,用于接收请求信息,包括,第二终端,用于使用第一频段接收请求信息;第一终端,还用于在计时到达第一数值时向第二终端发送响应通知信息,包括,第一终端,还用于在计时到达第一数值时使用第二频段向第二终端发送响应通知信息;第二终端,还用于接收响应通知信息,包括,第二终端,还用于使用第二频段接收响应通知信息;第二终端,还用于向第一终端发送响应信息,包括,第二终端,还用于使用第一频段向第一终端发送响应信息;第一终端,还用于在第二计时到达第二数值的有效阈值内时,允许开始接收响应信息,包括,第一终端,还用于在第二计时到达第二数值的有效阈值内时,允许开始使用第一频段接收响应信息。
此外,第一数值大于或等于第三数值,第三数值为第二终端根据请求信息得到响应信息所需要的时间;第一终端中预存有第二数值,或者,第一终端,还用于在向第二终端发送请求信息之前,与第二终端进行协商,第一终端得到第二数值和第三数值;第一终端中预存有第三数值,或者,第一终端,还用于在向第二终端发送请求信息之前,与第二终端进行协商,第一终端得到第三数值。
此外,请求信息中还包括随机数;第二终端,还用于根据请求信息得到响应信息,包括,第二终端,还用于根据请求信息中的待处理数据得到响应数据,对待签名数据进行签名,得到签名数据,待签名数据包括响应数据和随机数,响应信息至少包括响应数据和签名数据;或者,第二终端,还用于根据请求信息得到响应信息,包括,第二终端,还用于根据请求信息中的待处理数据得到响应数据,对待签名数据进行签名,得到签名数据,待签名数据包括响应数据,响应信息至少包括响应数据和签名数据;***还包括,第一终端,还用于对响应信息接收完毕后,对签名数据进行验签,如果验签通过,则判断响应信息为信任响应信息。
此外,第一终端,用于在请求信息发送完毕时根据预设计时方式开始第一计时,包括:第一终端,用于在请求信息发送完毕时使用第一终端内置时钟开始第一计时;第一终端,还用于在响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:第一终端,还用于在响应通知信息发送完毕时使用第一终端内置时钟开始第二计时;或者,第一终端,用于在请求信息发送完毕时根据预设计时方式开始第一计时,包括:第一终端,用于在请求信息发送完毕时第一终端对通信载波的周期个数开始计算;第一终端,还用于在响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:第一终端,还用于在响应通知信息发送完毕时第一终端对通信载波的周期个数开始计算;其中,在第一终端和第二终端进行通信过程中,第一终端始终产生通信载波;或者,第一终端,用于在请求信息发送完毕时根据预设计时方式开始第一计时,包括:第一终端,用于在请求信息发送完毕时第一终端对通信载波的脉冲个数开始计算;第一终端,还用于在响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:第一终端,还用于在响应通知信息发送完毕时第一终端对通信载波的脉冲 个数开始计算;其中,在第一终端和第二终端进行通信过程中,第一终端始终产生通信载波;或者,第一终端,用于在请求信息发送完毕时根据预设计时方式开始第一计时,包括:第一终端,用于在请求信息发送完毕时第一终端开始记录通信载波的波形相位相对于第一起始相位的第一相位差值,第一起始相位为第一终端在请求信息发送完毕时通信载波的波形相位;第一终端,还用于在响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:第一终端,还用于在请求信息发送完毕时第一终端开始记录通信载波的波形相位相对于第二起始相位的相位差值,第二起始相位为第一终端在响应通知信息发送完毕时通信载波的波形相位;其中,在第一终端和第二终端进行通信过程中,第一终端始终产生通信载波。
由上述本发明提供的技术方案可以看出,本发明提供了一种安全通信方法与***,第一终端向第二终端发送响应通知信息,第二终端在接受到响应通知信息后向第一终端发送响应信息,第一终端将接收响应信息的时间控制在第二终端接收响应通知信息至发出响应信息的有效时间阈值内,保障外部设备即便劫取到响应信息并篡改,也无法在第一终端可以接收响应信息的时间内将篡改后的响应信息发送至第一终端,达到了第一终端避免接收篡改后的响应信息的效果,同时也缩短了第一终端在发出请求信息后对响应信息的等待时间,提高了第一终端与第二终端信息交互的安全性和效率。
实施例2
图4示出了本发明实施例提供的一种安全通信方法的流程图;该方法包括:
步骤401,第一终端向第二终端发送请求信息,在请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据;
在本实施例的一个可选实施方式中,第一终端与第二终端采用的通信方式包括短距离无线通信方式。
在本实施例的一个可选实施方式中,在步骤401之前,还可以包括第一终端与第二终端建立握手通讯等步骤,当第一终端为读卡器,第二终端为智能卡或身份证时,还可以包括,第一终端与第二终端的寻卡流程。
步骤402,第二终端接收请求信息,第二终端根据请求信息中的待处理数据得到响应数据;
在本实施例中,待处理数据和响应数据可以是多种信息,例如,待处理数据可以是身份验证请求,响应数据可以是身份验证应答响应等内容。
步骤403,第一终端在第一计时到达第一数值时向第二终端发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时;
在本实施例的一个可选实施方式中,第一数值大于或等于第四数值,第四数值为根据请 求信息中的待处理数据得到响应数据所需要的时间。第四数值可以预存在第一终端中,也可以在第一终端向第二终端发送请求信息之前,与第二终端进行协商,第一终端得到第四数值,可选地,第四数值可以小于现有通信协议中的帧等待时间,以便本实施方式兼容现有通信协议,保障在现有通信协议下,第一终端与第二终端可正常通信。在本可选实施方式中,第一终端在第二终端对待处理信息进行处理得到响应数据所需要的时间或该时间之后向第二终端发送响应通知信息,可确保在第一终端向第二终端发送响应通知信息时,第二终端已得到响应数据,避免第一终端发送响应通知信息时,第二终端尚未得到响应数据而导致的响应失败或第三数值对第二数值的校验无法通过,提高通信效率。可选地,第一终端与第二终端可以在处理一个完整的信息交互流程中仅获取一次第四数值,也可以是在第一终端在一个完整的信息交互流程中,在发送每一个请求信息之前均获取一次第四数值。一个完整的信息交互流程中仅获取一次第四数值,可以减少信息交互流程中的步骤,提高通信效率,第一终端发送每一个请求信息之前均获取一次第四数值,可以提高第一终端控制响应通知信息发送时间的精确程度,进一步保障通信安全。
在上述可选实施方式中,第一终端中预存有第四数值包括但不限于以下实施方式:方式一,第一终端可以在出厂时已设置有一种或多种第二终端的第四数值,第一终端在向第二终端发送请求信息之前,获取第二终端的设备型号,匹配出正确的第四数值;方式二,第一终端在与第二终端进行通信之前,通过其他设备获得第四数值,如通过网络下载与第二终端匹配的第四数值,或第一终端的使用者通过第一终端的输入设备输入第四数值。
在上述可选实施方式中,第一终端与第二终端进行协商得到第四数值,包括但不限于以下实施方式:方式一,第一终端生成协商请求和第一随机数并发送至第二终端;第二终端接收协商请求和第一随机数,使用第二终端私钥对第一随机数进行签名,获得第一随机数签名数据,生成第二随机数,将第一随机数签名数据、第二终端证书和第二随机数发送至第一终端;第一终端接收第一随机数签名数据、第二终端证书和第二随机数,分别对第一随机数签名数据和第二终端证书进行验证,如果均验证通过,则使用第一终端私钥对第二随机数进行签名,获得第二随机数签名数据,将第二随机数签名数据和第一终端证书发送至第二终端;第二终端接收第二随机数签名数据和第一终端证书,分别对第二随机数签名数据和第一终端证书进行验证,如果均验证通过,获取第四数值,使用第一终端公钥对第四数值进行加密,生成第四数值密文并发送至第一终端;第一终端接收第四数值密文,使用第一终端私钥对第四数值密文进行解密,获得第四数值;方式二,第一终端生成协商请求和第一随机数,将协商请求、第一随机数和第一终端证书发送至第二终端;第二终端接收协商请求、第一随机数和第一终端证书,验证第一终端证书,如果验证通过,使用第二终端私钥对第一随机数进行签名,获得第一随机数签名数据,生成第二随机数,使用第一终端公钥对第二随机数进行加 密,获得第二随机数密文,将第二随机数密文、第二终端证书和第一随机数签名数据发送至第一终端;第一终端接收第二随机数密文、第二终端证书和第一随机数签名数据,分别对第二终端证书和第一随机数签名数据进行验证,如果均验证通过,则使用第一终端私钥对第二随机数密文进行解密,得到第二随机数,使用第一终端私钥对第二随机数进行签名,得到第二随机数签名数据,生成第三随机数,使用第二终端公钥对第三随机数进行加密,得到第三随机数密文,按照预设规则对第二随机数和第三随机数进行处理,获得第一传输密钥,将第二随机数签名数据和第三随机数密文发送至第二终端;第二终端接收第二随机数签名数据和第三随机数密文,分别对第二随机数签名数据进行验证,如果均验证通过,使用第二终端私钥对第三随机数密文进行解密,获得第三随机数,按照预设规则对第二随机数和第三随机数进行处理,获得第二传输密钥;获取第四数值,使用第二传输密钥对第四数值进行加密,获得第四数值密文,将第四数值密文发送至第一终端;第一终端接收第四数值密文,使用第一传输密钥对第四数值密文进行解密,获得第四数值。
在以上可选实施方式中,第四数值可以由第二终端根据信息交互的类型和其自身的计算能力、采用的通信协议等信息进行计算得到,也可以预存在第二终端中。
步骤404,第二终端接收响应通知信息,第二终端对待签名信息进行签名操作,得到签名数据,第二终端向第一终端发送响应信息,待签名信息包括响应数据和第二数值,第二数值为第二终端分析响应通知信息所需时间与预估进行签名操作所需时间之和,响应信息包括待签名信息和签名数据;
在本实施例中,本可选实施方式中,第二终端可使用第二终端内置私钥对待签名信息进行签名,使得第一终端可根据签名数据的验签是否通过来判断响应信息的真实发送者是否为第二终端,并判断响应信息是否已被篡改,进一步保障响应信息的安全性。
在本实施例的一个可选实施方式中,第二终端分析响应通知信息所需时间为第二终端预估分析响应通知信息所需时间;第二终端采用预估的方式得到分析响应通知信息所需时间,第二终端的出厂设置中可以预存预估的该设备分析响应通知信息所需时间,也可由第二终端根据前次分析响应通知信息所需时间进行估算得到,第二终端无需进行计时操作,减轻了第二终端的计算量。
在本实施例的一个可选实施方式中,第二终端在响应通知信息接收完毕时根据预设计时方式开始第三计时;第二终端对响应通知信息进行分析,获得响应通知信息分析完毕时的第三计时得到的分析响应通知信息所需时间。第二终端采用计时的方式得到分析响应通知信息所需时间,第二数值较为精准,安全性更高。
在本实施例中,第二终端可根据前次进行签名操作所需时间进行估算得到本次进行签名操作所需时间,第二终端的出厂设置中也可预存预估的该设备进行签名操作所需时间,第二 数值中包括预估进行签名操作所需时间,第二数值更加精准,安全性更高。
步骤405,第一终端接收响应信息,获得响应信息开始接收时的第二计时得到的第三数值;第一终端对签名数据进行验签操作,并对第三数值与第二数值是否匹配进行校验,如果验签通过且校验通过,则判断响应信息为安全响应信息。
在本实施例中,第一终端对签名数据进行验签操作,可判断响应信息中的第二数值是否已被篡改,还可判断响应信息的发送者是否为真实的第二终端,避免外部设备截获响应信息后对响应信息进行篡改,第一终端收到篡改后的响应信息并进行处理的情况,提高了第一终端与第二终端的通信安全。验签操作的具体操作方法为本领域的公知技术,在此不再赘述。需要说明的是,在本实施例中,第一终端对签名数据进行验签操作的操作,与对第三数值与第二数值是否匹配进行校验的操作之间没有先后顺序,可以先完成验签操作,可以先完成校验操作,也可以两操作同时完成。
在本实施例的一个可选实施方式中,对第三数值与第二数值是否匹配进行校验,可以有多种实施方式,如:方式一,第一终端判断第三数值是否在第二数值的有效阈值内,第二数值的有效阈值为[T,T+2t],若第三数值在第二数值的有效阈值内,则校验通过,若第三数值不在第二数值的有效阈值内,则校验不通过,其中,T为第二数值,t为响应通知信息或响应信息经过第一终端与第二终端采用的通信协议支持最大通信距离所需要的时间;方式二,第一终端判断第二数值是否在第三数值的有效阈值内,第三数值的有效阈值为[S-2t,S],若第二数值在第三数值的有效阈值内,则校验通过,若第二数值不在第三数值的有效阈值内,则校验不通过,其中,S为第三数值,t为响应通知信息或响应信息经过第一终端与第二终端采用的通信协议支持最大通信距离所需要的时间;方式三,第一终端判断第三终端与第二终端的差值是否在有效阈值内,有效阈值为[0,2t],若差值在有效阈值内,则校验通过,若差值不在有效阈值内,则校验不通过,其中,t为响应通知信息或响应信息经过第一终端与第二终端采用的通信协议支持最大通信距离所需要的时间。下面以上述实施方式中的方式一为例,对有效阈值的取值进行说明:第二终端分析响应通知信息所需时间与预估进行签名操作所需时间之和根据第二终端的类型的不同以及计算能力等因素的不同而不同,第二终端的计算能力越强,第二数值T的取值越小;t的计算方法为:第一终端与第二终端采用的通信协议支持的最大通信距离为L,信号传输速度为C,则t=L/C,t的具体取值可以携带在第一终端的出厂信息中,也可以携带在第一终端与第二终端进行通信时采用的通信协议中;第二数值的有效阈值范围,应当小于或等于第二终端分析响应通知信息所需时间与预估进行签名操作所需时间之和T、响应通知信息传输时间t与响应信息传输时间t之和,当第一终端与第二终端之间的距离足够近时,t的取值可以忽略不计,即第二数值的有效阈值应当大于或等于T且小于或等于T+2t。需要说明的是,在本实施例中,当第一终端与第二终端采用的 通信协议传输速率足够快,第二终端的计算能力足够强,第一终端与第二终端的距离足够近时,第二数值与t的取值均为纳秒级,可能存在第一终端实际接收到响应信息时,第三数值小于第一终端的第二计时最小单位的情况,即第一终端在第二计时达到0时,开始接收响应信息。
在本技术方案中,在短距离无线通信的情况下,通信协议支持的最大传输距离下数据传输所需时间小于数据被外部设备篡改所需时间,因此,篡改后的响应信息发送至第一终端的时间将大于第二数值的有效阈值,即若响应信息被外部设备篡改,第三数值将大于第二数值的有效阈值,第一终端可将响应信息判断为危险响应信息。若第一终端与第二终端的真实距离超过通信协议所支持距离,外部设备将异地的第二终端的响应信息进行劫持后转发至第一终端,由于响应信息的真实传输距离将大于通信协议支持的最大距离,响应信息真实传输时间也将大于t,因此,第三数值将超出第二数值的有效阈值范围,第一终端可将响应信息判断为危险信息。即将第一终端使用接收到响应信息的时间校验包含在响应信息中的时间,可避免第一终端对被外部设备劫持的信息进行处理的风险。
在本发明的一个可选实施方式中,第一终端在请求信息发送完毕时根据预设计时方式开始第一计时,第一终端在响应通知信息发送完毕时根据预设计时方式开始第二计时,可以有多种预设计时方式,具体可参见实施例1中的相关描述,在此不再赘述。
在步骤404的可选实施方式中,第二终端也可采用与第一终端进行第一计时或第二计时相似方式进行第三计时,如:方式一,第二终端在响应通知信息接收完毕时使用第二终端内置时钟开始第一计时;方式二,第二终端在响应通知信息接收完毕时第二终端对通信载波的周期个数开始计算;方式三,第二终端在响应通知信息接收完毕时第二终端对通信载波的脉冲个数开始计算;方式四,第二终端在响应通知信息接收完毕时第二终端开始记录通信载波的波形相位相对于第一起始相位的第一相位差值,第一起始相位为第一终端在请求信息发送完毕时通信载波的波形相位;采用方式一的预设计时方式进行第三计时,要求第二终端为有源有晶振的终端,采用方式二或方式四的预设计时方式进行第三计时,无须要求第二终端为有源有晶振的终端,采用方式四的预设计时方式进行第三计时,相对于周期或脉冲计时,相位计时的精度较高,响应信息更加安全。本可选实施方式的方式二至方式四中,在第一终端与第二终端通信过程中,第一终端始终产生通信载波信号,第二终端始终接收通信载波信号。
下面针对上述可选实施方式的方式四中的,“第一终端在请求信息发送完毕时第一终端开始记录通信载波的波形相位相对于第一起始相位的第一相位差值,第一起始相位为第一终端在请求信息发送完毕时通信载波的波形相位”的具体实现方案具体可参见实施例1中的相关描述,在此不再赘述。
在本实施例的一个可选实施方式中,第一终端中预存有第五数值,或者,第一终端在 向第二终端发送请求信息之前,与第二终端进行协商,第一终端得到第五数值,第五数值为第二终端预估接收响应通知信息完毕至发出响应信息所需时间。第一终端判断第五数值是否大于安全门限值,第六数值为第一终端预设的安全门限值,如果第五数值大于安全门限值,则执行步骤401,如果第五数值小于安全门限值,则第一终端选择以下备选通信方式:
步骤A,第一终端向第二终端发送请求信息,在请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据;步骤B,第二终端接收请求信息,第二终端根据请求信息得到响应信息;步骤C,第一终端在第一计时到达第M数值时向第二终端发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时;步骤D,第二终端接收响应通知信息,第二终端向第一终端发送响应信息;步骤E,第一终端在第二计时到达第N数值的有效阈值内时,允许开始接收响应信息,其中,第N数值为第二终端接收响应通知信息完毕至发出响应信息所需要的时间。
由备选通信方式可以看出,在备选通信方式中,第二终端无需计时,第一终端也无需对响应信息进行验签等操作,备选通信方式效率更好,但备选方式中由于第N数值并不是第二终端真实的接收响应通知信息并发出响应信息所占用的时间,而仅是一个估算时间,当估算时间远大于真实时间时,那么有可能在第一终端的第一计时达到第N数值的有效阈值之前,第二终端将响应信息发送至第一终端,而第一终端无法接收到响应信息,也可能存在外部设备劫取到响应信息并篡改之后,外部设备将虚假响应信息发送至第一终端时,第一终端的第二计时仍第N数值的有效阈值内的情况,为数据交互带来安全风险。因此,第一终端需要预设一个安全门限值,当第N数值小于预设安全门限值时,采用备选通信方式,在不影响安全性的前提下,兼顾通信效率,当第N数值大于预设安全门限值时,采用本实施例提供的通信方式,提高安全性。即第一终端基于第二终端接收响应通知信息完毕至发出响应信息所需要的时间选择通信方式,可进一步提高第一终端的通信效率和安全性。
本实施例提供的安全通信方法,第一终端采用发送响应通知信息的方式通知第二终端向其发送响应信息,第一终端对响应信息中的签名数据进行验签,确保发送响应信息的设备为第二终端且响应信息没有被篡改,第一终端判断其计时得到的时间与接收到的响应信息中的时间是否匹配,避免外部设备远程劫取到第二终端的响应信息进行转发,达到避免接收被劫持或篡改过的响应信息的目的,同时也缩短了第一终端在发出请求信息后对响应信息的等待时间,提高了第一终端与第二终端信息交互的安全性和效率。
图4示出的方法本实施例与下文中图5示出的方法实施例的区别在于:第一终端与第二终端根据交互的信息类别不同,采用不同的频段进行通信,其他实现过程均与图4示出的方法实施例相同,相同内容不再进行详述,可参见图4示出的方法实施例的相关描述。
图5示出了本发明实施例提供的一种安全通信方法的流程图,该方法包括:
步骤501,第一终端使用第一频段向第二终端发送请求信息,在请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据;
步骤502,第二终端使用第一频段接收请求信息,第二终端根据请求信息中的待处理数据得到响应数据;
步骤503,第一终端在第一计时到达第一数值时使用第二频段向第二终端发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时;
步骤504,第二终端使用第二频段接收响应通知信息,第二终端对待签名信息进行签名操作,得到签名数据,第二终端使用第一频段向第一终端发送响应信息,待签名信息包括响应数据和第二数值,第二数值为第二终端分析响应通知信息所需时间与预估进行签名操作所需时间之和,响应信息包括待签名信息和签名数据;
步骤505,第一终端使用第一频段接收响应信息,获得响应信息开始接收时的第二计时得到的第三数值;第一终端对签名数据进行验签操作,并对第三数值与第二数值是否匹配进行校验,如果验签通过且校验通过,则判断响应信息为安全响应信息。
在本实施例中,第一频段与第二频段是不同的频段,例如第一频段为13.56MHZ频段,第二频段为2.4G频段,第一终端与第二终端均为支持双频段通讯的设备。
本实施例在图1示出方法的基础上,第一终端和第二频段采用更换频段发送/接收响应通知信息的方法,使得第三方在发送请求信息的频段内无法劫持到响应通知信息,无法获知发送响应信息的正确时间,即无法使用虚假响应信息在第一终端第二计时达到预设阈值范围内时攻击第一终端,也无法在获得响应通知信息后开始计时以获得第二数值,在保障通信安全的基础上,保障了通信设备的安全。
本实施例提供一种安全通信***,该安全通讯***包括第一终端和第二终端,本实施例的安全通信***用于执行图4或5示出的方法实施例中的安全通信方法,相同内容或类似流程在此不再赘述,仅进行简要说明如下:
第一终端,用于向第二终端发送请求信息,在请求信息发送完毕时根据预设计时方式开始第一计时,请求信息中至少包括待处理数据;第二终端,用于接收请求信息,根据请求信息中的待处理数据得到响应数据;第一终端,还用于在第一计时到达第一数值时向第二终端发送响应通知信息,在响应通知信息发送完毕时根据预设计时方式开始第二计时;第二终端,还用于接收响应通知信息,对待签名信息进行签名操作,得到签名数据,向第一终端发送响应信息,待签名信息包括响应数据和第二数值,第二数值为第二终端分析响应通知信息所需时间与预估进行签名操作所需时间之和,响应信息包括待签名信息和签名数据;第一终端, 还用于接收响应信息,获得响应信息开始接收时的第二计时得到的第三数值;对签名数据进行验签操作,并对第三数值与第二数值是否匹配进行校验,如果验签通过且校验通过,则判断响应信息为安全响应信息。
此外,第一终端与第二终端采用的通信方式包括:短距离无线通信方式。
此外,第一终端还用于对第三数值与第二数值是否匹配进行校验,包括:第一终端还用于判断第三数值是否在第二数值的有效阈值内,第二数值的有效阈值为[T,T+2t],其中,T为第二数值,t为响应通知信息或响应信息经过第一终端与第二终端采用的通信协议支持最大通信距离所需要的时间。
此外,第二终端,还用于分析响应通知信息所需时间为第二终端预估分析响应通知信息所需时间;或者,第二终端,还用于在响应通知信息接收完毕时根据预设计时方式开始第三计时;第二终端对响应通知信息进行分析,获得响应通知信息分析完毕时的第三计时得到的分析响应通知信息所需时间。
此外,第一终端用于向第二终端发送请求信息,包括,第一终端用于使用第一频段向第二终端发送请求信息;第二终端用于接收请求信息,包括,第二终端用于使用第一频段接收请求信息;第一终端还用于在计时到达第一数值时向第二终端发送响应通知信息,包括,第一终端还用于在计时到达第一数值时使用第二频段向第二终端发送响应通知信息;第二终端还用于接收响应通知信息,包括,第二终端还用于使用第二频段接收响应通知信息;第二终端还用于向第一终端发送响应信息,包括,第二终端还用于使用第一频段向第一终端发送响应信息;第一终端还用于接收响应信息,包括,第一终端还用于使用第一频段接收响应信息。
此外,第一数值大于或等于第四数值,第四数值为第二终端根据请求信息中的待处理数据得到响应数据所需要的时间;第一终端中预存有第四数值,或者,第一终端还用于在向第二终端发送请求信息之前,与第二终端进行协商,第一终端得到第四数值。
此外,第一终端,用于在请求信息发送完毕时根据预设计时方式开始第一计时,包括:第一终端,用于在请求信息发送完毕时使用第一终端内置时钟开始第一计时;第一终端,还用于在响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:第一终端,还用于在响应通知信息发送完毕时使用第一终端内置时钟开始第二计时;或者,第一终端,用于在请求信息发送完毕时根据预设计时方式开始第一计时,包括:第一终端,用于在请求信息发送完毕时第一终端对通信载波的周期个数开始计算;第一终端,还用于在响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:第一终端,还用于在响应通知信息发送完毕时第一终端对通信载波的周期个数开始计算;其中,在第一终端和第二终端进行通信过程中,第一终端始终产生通信载波;或者,第一终端,用于在请求信息发送完毕时根据预设 计时方式开始第一计时,包括:第一终端,用于在请求信息发送完毕时第一终端对通信载波的脉冲个数开始计算;第一终端,还用于在响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:第一终端,还用于在响应通知信息发送完毕时第一终端对通信载波的脉冲个数开始计算;其中,在第一终端和第二终端进行通信过程中,第一终端始终产生通信载波;或者,第一终端,用于在请求信息发送完毕时根据预设计时方式开始第一计时,包括:第一终端,用于在请求信息发送完毕时第一终端开始记录通信载波的波形相位相对于第一起始相位的第一相位差值,第一起始相位为第一终端在请求信息发送完毕时通信载波的波形相位;第一终端,还用于在响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:第一终端,还用于在请求信息发送完毕时第一终端开始记录通信载波的波形相位相对于第二起始相位的相位差值,第二起始相位为第一终端在响应通知信息发送完毕时通信载波的波形相位;其中,在第一终端和第二终端进行通信过程中,第一终端始终产生通信载波。
由上述本发明提供的技术方案可以看出,本发明提供了一种安全通信方法与***,第一终端采用发送响应通知信息的方式通知第二终端向其发送响应信息,第一终端对响应信息中的签名数据进行验签,确保发送响应信息的设备为第二终端且响应信息没有被篡改,第一终端判断其计时得到的时间与接收到的响应信息中的时间是否匹配,避免外部设备远程劫取到第二终端的响应信息进行转发,达到避免接收被劫持或篡改过的响应信息的目的,同时也缩短了第一终端在发出请求信息后对响应信息的等待时间,提高了第一终端与第二终端信息交互的安全性和效率。
本实施例2仅对与实施例1相区别的部分进行详细描述,其余相似部分不再赘述,具体可以参见实施例1中的相关描述。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的组件、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行***执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。
此外,在本发明各个实施例中的各功能单元可以集成在一个处理组件中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个组件中。上述集成的组件既可以采用硬件的形式实现,也可以采用软件功能组件的形式实现。所述集成的组件如果以软件功能组件的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。
上述提到的存储介质可以是只读存储器,磁盘或光盘等。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在不脱离本发明的原理和宗旨的情况下在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。本发明的范围由所附权利要求及其等同限定。

Claims (16)

  1. 一种安全通信方法,其特征在于,包括:
    第一终端向第二终端发送请求信息,在所述请求信息发送完毕时根据预设计时方式开始第一计时,所述请求信息中至少包括待处理数据;
    所述第二终端接收所述请求信息,所述第二终端根据所述请求信息得到响应信息;
    所述第一终端在第一计时到达第一数值时向所述第二终端发送响应通知信息,在所述响应通知信息发送完毕时根据预设计时方式开始第二计时;
    所述第二终端接收所述响应通知信息,所述第二终端向所述第一终端发送所述响应信息;
    所述第一终端在第二计时到达第二数值的有效阈值内时,允许开始接收所述响应信息,其中,所述第二数值为所述第二终端接收所述响应通知信息完毕至发出响应信息所需要的时间。
  2. 根据权利要求1所述的方法,其特征在于,所述第一终端与所述第二终端采用的通信方式包括:短距离无线通信方式。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第二数值的有效阈值为[T,T+2t],其中,所述T为第二数值,所述T+2t小于或等于所述第一终端与所述第二终端进行通信时采用的通信协议规定的帧等待时间,所述t为所述响应通知信息或所述响应信息经过所述第一终端与所述第二终端采用的通信协议支持最大通信距离所需要的时间。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,
    所述第一终端向第二终端发送请求信息,包括,所述第一终端使用第一频段向第二终端发送请求信息;
    所述第二终端接收所述请求信息,包括,所述第二终端使用所述第一频段接收所述请求信息;
    所述第一终端在计时到达第一数值时向所述第二终端发送响应通知信息,包括,所述第一终端在计时到达第一数值时使用所述第二频段向所述第二终端发送响应通知信息;
    所述第二终端接收所述响应通知信息,包括,所述第二终端使用所述第二频段接收所述响应通知信息;
    所述第二终端向所述第一终端发送响应信息,包括,所述第二终端使用所述第一频段向所述第一终端发送响应信息;
    所述第一终端在第二计时到达第二数值的有效阈值内时,允许开始接收所述响应信 息,包括,所述第一终端在第二计时到达第二数值的有效阈值内时,允许开始使用所述第一频段接收所述响应信息。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,
    所述第一数值大于或等于第三数值,所述第三数值为所述第二终端根据所述请求信息得到响应信息所需要的时间;
    所述第一终端中预存有所述第二数值,或者,所述第一终端在向所述第二终端发送请求信息之前,与所述第二终端进行协商,所述第一终端得到所述第二数值;
    所述第一终端中预存有所述第三数值,或者,所述第一终端在向所述第二终端发送请求信息之前,与所述第二终端进行协商,所述第一终端得到所述第三数值。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,
    所述第二终端根据所述请求信息得到响应信息,包括,所述第二终端根据所述请求信息中的待处理数据得到响应数据,对待签名数据进行签名,得到签名数据,所述待签名数据包括所述响应数据,所述响应信息至少包括响应数据和所述签名数据;
    或者,
    所述请求信息中还包括随机数;所述第二终端根据所述请求信息得到响应信息,包括,所述第二终端根据所述请求信息中的待处理数据得到响应数据,对待签名数据进行签名,得到签名数据,所述待签名数据包括所述响应数据和所述随机数,所述响应信息至少包括响应数据和所述签名数据;
    所述方法还包括,
    所述第一终端对所述响应信息接收完毕后,对所述签名数据进行验签,如果验签通过,则判断所述响应信息为信任响应信息。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,
    所述第一终端在所述请求信息发送完毕时根据预设计时方式开始第一计时,包括:所述第一终端在所述请求信息发送完毕时使用第一终端内置时钟开始第一计时;所述第一终端在所述响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:所述第一终端在所述响应通知信息发送完毕时使用第一终端内置时钟开始第二计时;
    或者,
    所述第一终端在所述请求信息发送完毕时根据预设计时方式开始第一计时,包括:所述第一终端在所述请求信息发送完毕时所述第一终端对通信载波的周期个数开始计算;所述第一终端在所述响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:所述第一终端在所述响应通知信息发送完毕时所述第一终端对通信载波的周期个数开始计算;其中,在所述第一终端和所述第二终端进行通信过程中,所述第一终端始终 产生所述通信载波;
    或者,
    所述第一终端在所述请求信息发送完毕时根据预设计时方式开始第一计时,包括:所述第一终端在所述请求信息发送完毕时所述第一终端对通信载波的脉冲个数开始计算;所述第一终端在所述响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:所述第一终端在所述响应通知信息发送完毕时所述第一终端对通信载波的脉冲个数开始计算;其中,在所述第一终端和所述第二终端进行通信过程中,所述第一终端始终产生所述通信载波;
    或者,
    所述第一终端在所述请求信息发送完毕时根据预设计时方式开始第一计时,包括:所述第一终端在所述请求信息发送完毕时所述第一终端开始记录通信载波的波形相位相对于第一起始相位的第一相位差值,所述第一起始相位为所述第一终端在所述请求信息发送完毕时所述通信载波的波形相位;所述第一终端在所述响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:所述第一终端在所述请求信息发送完毕时所述第一终端开始记录通信载波的波形相位相对于第二起始相位的相位差值,所述第二起始相位为所述第一终端在所述响应通知信息发送完毕时所述通信载波的波形相位;其中,在所述第一终端和所述第二终端进行通信过程中,所述第一终端始终产生所述通信载波。
  8. 一种安全通信***,其特征在于,包括:如所述权利要求1-7任一项中的所述第一终端和所述第二终端,所述第一终端和所述第二终端执行所述权利要求1-7中的任一项所述的安全通信方法。
  9. 一种安全通信方法,其特征在于,包括:
    第一终端向第二终端发送请求信息,在所述请求信息发送完毕时根据预设计时方式开始第一计时,所述请求信息中至少包括待处理数据;
    所述第二终端接收所述请求信息,所述第二终端根据所述请求信息中的待处理数据得到响应数据;
    所述第一终端在第一计时到达第一数值时向所述第二终端发送响应通知信息,在所述响应通知信息发送完毕时根据预设计时方式开始第二计时;
    所述第二终端接收所述响应通知信息,所述第二终端对所述待签名信息进行签名操作,得到签名数据,所述第二终端向所述第一终端发送响应信息,所述待签名信息包括所述响应数据和第二数值,所述第二数值为所述第二终端分析所述响应通知信息所需时间与预估进行所述签名操作所需时间之和,所述响应信息包括所述待签名信息和所述签 名数据;
    所述第一终端接收所述响应信息,获得所述响应信息开始接收时的所述第二计时得到的第三数值;所述第一终端对所述签名数据进行验签操作,并对所述第三数值与所述第二数值是否匹配进行校验,如果验签通过且校验通过,则判断所述响应信息为安全响应信息。
  10. 根据权利要求9所述的方法,其特征在于,所述第一终端与所述第二终端采用的通信方式包括:短距离无线通信方式。
  11. 根据权利要求9或10所述的方法,其特征在于,所述对所述第三数值与所述第二数值是否匹配进行校验,包括:
    所述第一终端判断所述第三数值是否在所述第二数值的有效阈值内,所述第二数值的有效阈值为[T,T+2t],其中,所述T为第二数值,所述t为所述响应通知信息或所述响应信息经过所述第一终端与所述第二终端采用的通信协议支持最大通信距离所需要的时间。
  12. 根据权利要求9-11任一项所述的方法,其特征在于,包括:
    所述第二终端分析所述响应通知信息所需时间为所述第二终端预估分析所述响应通知信息所需时间;或者,
    所述第二终端在所述响应通知信息接收完毕时根据预设计时方式开始第三计时;所述第二终端对所述响应通知信息进行分析,获得所述响应通知信息分析完毕时的所述第三计时得到的所述分析所述响应通知信息所需时间。
  13. 根据权利要求9-12任一项所述的方法,其特征在于,
    所述第一终端向第二终端发送请求信息,包括,所述第一终端使用第一频段向第二终端发送请求信息;
    所述第二终端接收所述请求信息,包括,所述第二终端使用所述第一频段接收所述请求信息;
    所述第一终端在计时到达第一数值时向所述第二终端发送响应通知信息,包括,所述第一终端在计时到达第一数值时使用所述第二频段向所述第二终端发送响应通知信息;
    所述第二终端接收所述响应通知信息,包括,所述第二终端使用所述第二频段接收所述响应通知信息;
    所述第二终端向所述第一终端发送响应信息,包括,所述第二终端使用所述第一频段向所述第一终端发送响应信息;
    所述第一终端接收所述响应信息,包括,所述第一终端使用所述第一频段接收所述 响应信息。
  14. 根据权利要求9-13任一项所述的方法,其特征在于,
    所述第一数值大于或等于第四数值,所述第四数值为所述第二终端根据所述请求信息中的待处理数据得到响应数据所需要的时间;
    所述第一终端中预存有所述第四数值,或者,所述第一终端在向所述第二终端发送请求信息之前,与所述第二终端进行协商,所述第一终端得到所述第四数值。
  15. 根据权利要求9-14任一项所述的方法,其特征在于,
    所述第一终端在所述请求信息发送完毕时根据预设计时方式开始第一计时,包括:所述第一终端在所述请求信息发送完毕时使用第一终端内置时钟开始第一计时;所述第一终端在所述响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:所述第一终端在所述响应通知信息发送完毕时使用第一终端内置时钟开始第二计时;
    或者,
    所述第一终端在所述请求信息发送完毕时根据预设计时方式开始第一计时,包括:所述第一终端在所述请求信息发送完毕时所述第一终端对通信载波的周期个数开始计算;所述第一终端在所述响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:所述第一终端在所述响应通知信息发送完毕时所述第一终端对通信载波的周期个数开始计算;其中,在所述第一终端和所述第二终端进行通信过程中,所述第一终端始终产生所述通信载波;
    或者,
    所述第一终端在所述请求信息发送完毕时根据预设计时方式开始第一计时,包括:所述第一终端在所述请求信息发送完毕时所述第一终端对通信载波的脉冲个数开始计算;所述第一终端在所述响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:所述第一终端在所述响应通知信息发送完毕时所述第一终端对通信载波的脉冲个数开始计算;其中,在所述第一终端和所述第二终端进行通信过程中,所述第一终端始终产生所述通信载波;
    或者,
    所述第一终端在所述请求信息发送完毕时根据预设计时方式开始第一计时,包括:所述第一终端在所述请求信息发送完毕时所述第一终端开始记录通信载波的波形相位相对于第一起始相位的第一相位差值,所述第一起始相位为所述第一终端在所述请求信息发送完毕时所述通信载波的波形相位;所述第一终端在所述响应通知信息发送完毕时根据预设计时方式开始第二计时,包括:所述第一终端在所述请求信息发送完毕时所述第一终端开始记录通信载波的波形相位相对于第二起始相位的相位差值,所述第二起始 相位为所述第一终端在所述响应通知信息发送完毕时所述通信载波的波形相位;其中,在所述第一终端和所述第二终端进行通信过程中,所述第一终端始终产生所述通信载波。
  16. 一种安全通信***,其特征在于,包括:如所述权利要求9-15任一项中的所述第一终端和所述第二终端,所述第一终端和所述第二终端执行所述权利要求9-15中的任一项所述的安全通信方法。
PCT/CN2017/095991 2016-08-05 2017-08-04 一种安全通信方法和*** WO2018024242A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP17836423.8A EP3495980B1 (en) 2016-08-05 2017-08-04 Method and system for secure communication
US16/323,516 US11159946B2 (en) 2016-08-05 2017-08-04 Method and system for secure communication
JP2018562175A JP6698880B2 (ja) 2016-08-05 2017-08-04 安全通信方法及びシステム

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201610641429.8 2016-08-05
CN201610641429.8A CN107688749B (zh) 2016-08-05 2016-08-05 一种安全通信方法和***
CN201610640039.9 2016-08-05
CN201610640039.9A CN107690145A (zh) 2016-08-05 2016-08-05 一种安全通信方法和***

Publications (1)

Publication Number Publication Date
WO2018024242A1 true WO2018024242A1 (zh) 2018-02-08

Family

ID=61073505

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/095991 WO2018024242A1 (zh) 2016-08-05 2017-08-04 一种安全通信方法和***

Country Status (4)

Country Link
US (1) US11159946B2 (zh)
EP (1) EP3495980B1 (zh)
JP (1) JP6698880B2 (zh)
WO (1) WO2018024242A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10872144B1 (en) * 2017-12-07 2020-12-22 Ent. Services Development Corporation Lp Systems and methods for secure processing of data streams having differing security level classifications
CN115001542B (zh) * 2022-07-28 2022-11-08 深圳市汇顶科技股份有限公司 近场通信的方法和近场通信设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1271420A2 (en) * 2001-06-29 2003-01-02 Alps Electric Co., Ltd. Passive entry with anti-theft function
CN102034063A (zh) * 2009-09-28 2011-04-27 西门子(中国)有限公司 调整连续波传输时间的方法及读写器
CN102754106A (zh) * 2009-12-23 2012-10-24 原子能和辅助替代能源委员会 非接触射频通信中的保护方法
CN102882683A (zh) * 2012-09-26 2013-01-16 南京三宝科技股份有限公司 一种可同步的rfid安全认证方法

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004320477A (ja) * 2003-04-16 2004-11-11 Canon Inc ネットワークシステムの制御方法
JP2007534042A (ja) * 2003-10-08 2007-11-22 ステファン・ヨズ・エングベアウ プライバシ強化技術を利用して通信を確立する方法及びシステム
CA2624191A1 (en) * 2005-09-28 2007-04-05 Visa International Service Association Device, system and method for reducing an interaction time for a contactless transaction
JP4847085B2 (ja) * 2005-09-29 2011-12-28 パナソニック株式会社 無線通信方法及び無線通信端末装置
KR101544629B1 (ko) * 2008-02-19 2015-08-17 인터디지탈 패튼 홀딩스, 인크 안전하고 신뢰성있는 시간 기술을 위한 방법 및 장치
EP2247024B1 (en) * 2009-04-30 2015-08-19 Nxp B.V. Determining the validity of a connection between a reader and a transponder
JP5594182B2 (ja) * 2011-02-23 2014-09-24 株式会社日本自動車部品総合研究所 スマートシステム
FR2974962B1 (fr) * 2011-05-02 2013-10-18 Ask Sa Procede et dispositif de modulation en amplitude d'un signal electromagnetique emis par un systeme d'emission/reception sans contact
CN105205666B (zh) * 2014-06-17 2019-10-25 ***股份有限公司 基于蓝牙的面对面支付方法及***

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1271420A2 (en) * 2001-06-29 2003-01-02 Alps Electric Co., Ltd. Passive entry with anti-theft function
CN102034063A (zh) * 2009-09-28 2011-04-27 西门子(中国)有限公司 调整连续波传输时间的方法及读写器
CN102754106A (zh) * 2009-12-23 2012-10-24 原子能和辅助替代能源委员会 非接触射频通信中的保护方法
CN102882683A (zh) * 2012-09-26 2013-01-16 南京三宝科技股份有限公司 一种可同步的rfid安全认证方法

Also Published As

Publication number Publication date
US20190200217A1 (en) 2019-06-27
EP3495980A4 (en) 2020-04-01
US11159946B2 (en) 2021-10-26
EP3495980A1 (en) 2019-06-12
JP2019527866A (ja) 2019-10-03
EP3495980B1 (en) 2020-11-25
JP6698880B2 (ja) 2020-05-27

Similar Documents

Publication Publication Date Title
JP7213967B2 (ja) アクセス制御のためのシステム、方法及び装置
CN114466361A (zh) 通过安全范围检测修改安全状态
US10404475B2 (en) Method and system for establishing a secure communication tunnel
US9549322B2 (en) Methods and systems for authentication of a communication device
US10609552B2 (en) System and method for data communication protection
WO2018024241A1 (zh) 一种数据通信方法及***
WO2018024242A1 (zh) 一种安全通信方法和***
WO2018176670A1 (zh) 一种无线通信的握手方法及设备
EP2824603A2 (en) System and method for authenticating public keys
CN107690133B (zh) 一种数据通信方法及***
CN107689946B (zh) 一种数据通讯方法及数据通讯***
WO2023024623A1 (zh) 基于超宽带的鉴权方法、设备、***和存储介质
CN107688749B (zh) 一种安全通信方法和***
CN107688760B (zh) 一种数据通讯方法及数据通讯***
CN107690143B (zh) 一种数据通信方法及***
WO2018024251A1 (zh) 一种数据通信方法及***
CN107688761B (zh) 一种数据通讯方法及数据通讯***
CN107690142B (zh) 一种数据通信方法及***

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2018562175

Country of ref document: JP

Kind code of ref document: A

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17836423

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2017836423

Country of ref document: EP

Effective date: 20190305