WO2014026570A1 - 一种双向密钥的切换方法及实现装置 - Google Patents

一种双向密钥的切换方法及实现装置 Download PDF

Info

Publication number
WO2014026570A1
WO2014026570A1 PCT/CN2013/081157 CN2013081157W WO2014026570A1 WO 2014026570 A1 WO2014026570 A1 WO 2014026570A1 CN 2013081157 W CN2013081157 W CN 2013081157W WO 2014026570 A1 WO2014026570 A1 WO 2014026570A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
new
new key
update message
original
Prior art date
Application number
PCT/CN2013/081157
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
Application filed by 西安西电捷通无线网络通信股份有限公司 filed Critical 西安西电捷通无线网络通信股份有限公司
Priority to KR1020157006242A priority Critical patent/KR101816371B1/ko
Priority to US14/420,342 priority patent/US10263771B2/en
Publication of WO2014026570A1 publication Critical patent/WO2014026570A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0822Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using key encryption key
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • H04L63/061Network architectures or network communication protocols for network security for supporting key management in a packet data network for key exchange, e.g. in peer-to-peer networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0825Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using asymmetric-key encryption or public key infrastructure [PKI], e.g. key signature or public key certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0891Revocation or update of secret information, e.g. encryption key update or rekeying
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/041Key generation or derivation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/043Key management, e.g. using generic bootstrapping architecture [GBA] using a trusted network node as an anchor
    • H04W12/0433Key management protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/047Key management, e.g. using generic bootstrapping architecture [GBA] without using a trusted network node as an anchor
    • H04W12/0471Key exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/24Key scheduling, i.e. generating round keys or sub-keys for block encryption

Definitions

  • the invention relates to a Chinese patent which is submitted to the Chinese Patent Office on August 13, 2012, the application number is 201210286523.8, and the invention name is "a two-way key switching method and implementation device" Priority of the application, the entire contents of which are incorporated herein by reference.
  • TECHNICAL FIELD The present invention relates to the field of keys, and in particular, to a method and an apparatus for switching a bidirectional key.
  • the key In order to prevent illegal users from obtaining the key by analyzing the intercepted data packets, and then obtaining communication data or tombstone the communication data, the key needs to be updated frequently. There are many ways to update the key, but many key update mechanisms only solve the problem of how the two parties get the new key. It does not involve how the sender and the receiver can switch between the old and new keys. Generally, when the two parties switch to the new key, there is a pre-existence. Once the handover is improper, the receiver may not be able to de-protect the communication packet sent by the sender.
  • the present invention provides a method and an implementation apparatus for switching a bidirectional key, which enables a receiver to correctly protect a communication packet transmitted by a sender.
  • the invention provides the following solutions:
  • a method for switching a two-way key comprising:
  • the first key switching process is: setting the original key sending direction to be unavailable and sending the new key Set to be available; where N ⁇ n ⁇ l, where N is the total number of recipients corresponding to the sender;
  • the either end selects a valid key according to the protection identifier of the data sent by the peer end to perform de-protection;
  • the second key switching process is initiated after the first end successfully deprotects the data sent by the peer end with the new key, and the second key switching process is: setting the original key receiving direction Not available.
  • the present invention also provides an apparatus for implementing bidirectional key switching, the apparatus comprising: a first key obtaining unit, configured to obtain a new key;
  • a first key update unit configured to: after obtaining the new key, and before estimating or determining that the at least n peers obtain the new key, setting a new key sending direction to be unavailable and setting a new key receiving direction Is available, and keeps the original key sending direction available and keeps the original key receiving direction available;
  • the first key switching unit is configured to obtain or determine at least n of the opposite ends after obtaining the new key After the new key is described, and the first key switching process is started before the original key expires, the first key switching process is: setting the original key sending direction to be unavailable and sending the new key The direction is set to be available, where N ⁇ n ⁇ l, where N is the total number of recipients corresponding to the sender;
  • the protection unit is configured to protect the data sent to the peer end by using the original key after setting the new key sending direction to be unavailable and keeping the original key sending direction available, and setting the original key sending direction to be unavailable and setting the new secret After the key sending direction is available, the data sent to the peer end is protected by the new key; and the protection is performed;
  • a second key switching unit configured to start a second key switching process after the first successful de-protection with the new key, where the second key switching process is: setting the original key receiving direction to be unavailable use.
  • the present invention further provides an apparatus for implementing bidirectional key switching, the apparatus comprising: a second key obtaining unit, configured to obtain, according to a first key update message sent when a peer first obtains a new key The new key, the first key update message includes new key information; a second key update unit, configured to: when the new key is obtained, set a new key sending direction to be unavailable and set a new key receiving direction to be available, and keep the original key sending direction available and maintain the original key receiving direction And a third key switching unit, configured to start a first key switching process at a second time interval after obtaining the new key according to the first key update message, where the first key switching process is performed For: setting the original key sending direction to be unavailable and setting the new key sending direction to be available;
  • the protection unit is configured to protect the data sent to the peer end by using the original key after setting the new key sending direction to be unavailable and keeping the original key sending direction available, and setting the original key sending direction to be unavailable and setting the new secret After the key sending direction is available, the data sent to the peer end is protected by the new key; and the protection is performed;
  • a fourth key switching unit configured to start a second key switching process after the first successful de-protection with the new key, where the second key switching process is: setting the original key receiving direction to be unavailable And wherein the second time interval is not greater than a remaining validity period of the original key.
  • the invention sets a new key sending direction to be unavailable when obtaining a new key through any end of the communication link, and performs key switching after estimating or determining that the opposite end obtains a new key, and sets the new key sending direction to be available.
  • the original key transmission direction is set to be unavailable, which avoids the situation that any end receives the communication data packet protected by the new key by the opposite end before obtaining the new key, and thus cannot be deprotected.
  • either end obtains a new key it sets the new key and the original key to receive the direction. This ensures that the communication packet and the peer that can be protected by the original end can be switched to the new key.
  • the communication packet protected by the new key is deprotected. It can be seen that the present invention solves the problem that the protection communication data packet sent by the opposite end cannot be deprotected by limiting the switching order of the keys in the sending direction and the receiving direction at either end.
  • FIG. 1 is a schematic flow chart of a method according to Embodiment 1 of the present invention.
  • FIG. 2 is a schematic flow chart of a method according to Embodiment 2 of the present invention.
  • Embodiment 3 is a schematic flow chart of a method according to Embodiment 3 of the present invention.
  • Embodiment 4 is a schematic flow chart of a first method according to Embodiment 4 of the present invention.
  • Figure 5 is a structural diagram of a device according to Embodiment 5 of the present invention.
  • FIG. 6 is a structural diagram of a device provided in Embodiment 7 of the present invention.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. example. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention are within the scope of the present invention.
  • the key is divided into a one-way key and a two-way key, wherein the two-way key is used to protect data between the two communicating parties, and refers to data sent by the entity to the opposite entity.
  • the key that performs the encryption or compute integrity check and the key that the entity decrypts or verifies the integrity check from the data received from the peer entity are the same key.
  • a one-way key is only used to protect data in one direction. It refers to the key that the entity encrypts or calculates the integrity check data sent to the peer entity and the entity decrypts the data received from the peer entity.
  • the keys that verify the integrity check are different keys.
  • the embodiment of the present invention only introduces the switching of the two-way key.
  • a method for switching a bidirectional key includes the following steps: S11. After obtaining a new key, either end of the communication link obtains or determines at least n peers. Before the new key, set the new key sending direction to be unavailable and set the new key receiving direction to be available, and keep the original key sending direction available and keep the original key receiving direction available.
  • the key in the present invention refers to a key used to protect the transmitted data, that is, to encrypt or calculate the integrity check, and to deprotect, i.e., decrypt, or verify the integrity check of the received data.
  • both ends of the communication link are mutually opposite and opposite ends.
  • the key used to protect the transmitted data and the key to deprotect the received data are the same.
  • the two parties are the entity A and the entity B. If the key used by the entity A to protect the data sent to the entity B is 1, the key that the entity A deprotects the data received from the entity B is also 1.
  • the key sending direction is usable, which means that the data can be protected by using the key, and the key sending direction is unavailable, which means that the data cannot be protected by using the key; the key receiving direction is available to mean that the key can be utilized. Deprotecting the data and not using the key receiving direction means that the data cannot be deprotected by using this key.
  • the peer may not have obtained the new key. If the new key is sent directly, the peer may not be able to protect the new key. The communication packet is deprotected. Therefore, in the present invention, setting a new key transmission direction is not available after obtaining a new key at either end. At this point, the end still uses the original key to protect the data sent to the peer.
  • the protection identifier refers to information such as a key identifier or a key index, and is used to identify which key the data to protect the data is.
  • a key switching process is: setting the original key sending direction to be unavailable and setting the new key sending direction to be available.
  • step S11 it is known that any new terminal can set the new key receiving direction as long as the new key is obtained. Therefore, after estimating or determining that the opposite end obtains the new key, the new key of the opposite end is simultaneously estimated or determined in the receiving direction. Available, therefore, the peer can deprotect the communication packet with the new key at any later time. In other words, either end can perform key switching at any later time, and the data is performed with the new key. protection.
  • the any one end selects a valid key according to the protection identifier of the data sent by the peer end. Unprotected.
  • the peer may perform the first key switch and protect the data with the new key. It is also possible that the peer has not performed the first key switch and still uses the original key.
  • the data is protected.
  • the protection identifier of the data received from the peer end can be detected at either end, and the corresponding key is selected according to the protection identifier for deprotection. Specifically, when it is determined that the key protected by the data is the original key according to the protection identifier, the original key is selected to be deprotected, and when the key protected by the data is determined to be a new key according to the protection identifier, the new key is selected to be protected. .
  • the second key switching process is initiated after the first session is successfully de-protected with the new key, and the second key switching process is: setting the original key receiving direction to be unavailable.
  • the first time that the new key is successfully de-protected indicates that the peer has already performed key switching. At this time, either end can perform key switching, that is, the original key receiving direction is unavailable.
  • the communication packet that is successfully deprotected with the new key for the first time is not necessarily the first data protected by the peer with the new key. package.
  • the first key switch can be performed only after the new key is obtained and the valid key is selected to deprotect the data, so that the second key switch is performed after the successful de-protection. Therefore, for one end, in the above steps, S12 and S13 are after step S11, and after step S14, after step S13, there is no sequential relationship between steps S12 and S13.
  • the two-way key switching method is described in detail by taking the two ends of the communication link as entity eight and entity B, the original key as KeyO, and the new key as Keyl.
  • tx indicates the transmission direction
  • rx indicates the reception direction
  • both entity A and entity B are in the original key sending direction and the receiving direction usable state.
  • the data sent by entity A to entity B and entity A protect the data received from entity B using the original key KeyO
  • the data sent by entity B to entity A and entity B use the original key KeyO for the data received from entity A. protection.
  • entity A and entity B perform a key update procedure, which ensures that entity A and entity B obtain the new key Key1. It needs to be clear that in the process, the moment when entity A obtains the new key Key1 The time T12 at which Tll and entity B obtain the new key Key1 may be different.
  • entity A performs an operation of setting a new key sending direction to be unavailable and setting a receiving direction to be available (at the same time, entity A keeps the original key sending direction available and the original key receiving direction available), and thereafter, entity A sends The data to the entity B is still protected by the original key KeyO, and the data received from the entity B can be deprotected by selecting the original key or the new key according to the protection identifier of the data.
  • entity B performs the operation of setting the new key sending direction to be unavailable, and setting the new key receiving direction to be available (at the same time, entity B also keeps the original key sending direction available and the original key receiving direction available).
  • entity B also keeps the original key sending direction available and the original key receiving direction available.
  • the data sent by entity B to entity A is still protected by the original key KeyO, and the data received from entity A can be deprotected by selecting the original key or the new key according to the protection identifier of the data.
  • entity A has presumed or determined that entity B has obtained a new key, that is, entity B is available in the direction in which the new key is received, and entity A performs the first key switch, that is, performs a setting of a new key, and the direction in which the key is sent is available, and Set the operation of the original key KeyO sending direction is not available. Then, if entity A needs to send a data packet to entity B, it uses the new key Keyl to protect the data packet and send it to entity B.
  • entity B has presumed or determined that entity A has obtained a new key, that is, entity A is available in the new key receiving direction, and entity B initiates the first key switching, that is, performing setting of a new key, Keyl sending direction is available, and Set the operation of the original key KeyO sending direction is not available. Then, if entity B needs to send a data packet to entity A, the data packet is protected by the new key Key1 and sent to entity A.
  • the order in which the entity A and the entity B obtain the new key is indefinite, so the order of the first key switch T2 and T3 is not fixed.
  • entity A determines that the data is protected with a new key according to the identifier of the detected data, so the new key Key1 is selected to deprotect the data from entity B, and the second key is started after the first successful deprotection.
  • the switching process that is, the operation of setting the original KeyO receiving direction is not available.
  • the time T4 is after the time T3.
  • the entity B determines that the data is protected by the new key according to the identifier of the detected data, so the new key Key1 is selected to deprotect the data from the entity A, and the second key is started after the first successful deprotection.
  • the operation of setting the original key KeyO reception direction is unavailable.
  • the moment when the entity B is correctly de-protected must be after the new key transmission direction of the entity A is available, that is, after the entity A performs the first key handover, therefore, the time T5 is after the time T2.
  • entity A and entity B have completed the key switch. After that, entity A is in a state in which the new key transmission direction and the reception direction are available, and entity B is in a state in which the new key transmission direction and the reception direction are available.
  • the time at which the first key switching process is initiated after determining or determining that the peer obtains the new key may be earlier than the correct deprotection of the end, or may be later than the correct end.
  • the entity B successfully deprotects the first time from the entity A, the data protected by the new key Key1, the T5 time is earlier than the entity B, and the first key switching process is started, that is, setting The new key sending direction is available, and the T3 time when the original key sending direction is unavailable is set. Since the successful de-protection means that the entity A has been protected with the new key before the time T5, the entity B can determine that the entity A has obtained at this time. The new key, so the entity B can start the first key switching process at the same time as the second key switching process is started at time T5. Of course, entity B can also choose to wait until T3 to start the first key switching process.
  • Unicast refers to a single entity sending communication data to a single entity.
  • Multicast refers to a single entity sending communication data to at least two entities.
  • the communication link At either end, the first key switching process needs to be initiated after estimating or determining that all peers obtain a new key.
  • the end of the new key can be presumed or determined whether the new key is obtained by the peer, and after the presumption or determination, the first key switching process is started before the original key expires.
  • the peer end can determine, according to the received first key update message, that the other end that sent the message, that is, the one that obtained the new key first has obtained the new key, therefore, the peer end can obtain the update message according to the first key.
  • the first key switching process is initiated before the original key expires. Specifically, the peer end may start the first key handover process at a second time interval after obtaining the new key according to the first key update message, where the second time interval is not greater than the remaining validity period of the original key.
  • the peer when the second time interval is zero, the peer directly starts the first key switching process after obtaining the new key according to the first key update message, and the peer does not need to perform setting a new key. The operation in which the sending direction is not available.
  • the third embodiment of the present invention provides the following methods for starting the first key switching process according to different presumption methods:
  • the end that obtains the new key first initiates the key handoff process after the first time interval after transmitting the first key update message.
  • the first time interval is greater than the transmission delay of the first key update message to the opposite end.
  • the transmission of data on the communication link takes a certain amount of time. Considering that data transmission suffers from transmission delay due to factors such as transmission distance and transmission bandwidth, the prior art determines the delay time of data transmission. When it is greater than this delay time, the data is considered to have been transmitted to the opposite end. Therefore, in the present invention, when the time is greater than the delay time of the first key update message reaching the opposite end, it can be estimated that the peer obtains the message, thereby estimating that the peer obtains the new key.
  • FIG. 3 shows a specific implementation manner in which the first key to obtain a new key is obtained by using the above method to estimate the peer to obtain a new key, and the first key to obtain the new key and the opposite end to initiate the first key switching.
  • entity A is the first end of the new key:
  • Entity A obtains the new key Key1 at time T11 and performs the operation of setting the Key1 sending direction to be unavailable, and the Keyl receiving direction is available (while keeping the KeyO sending direction and the receiving direction available), constructing and transmitting the first key update message to the entity B. .
  • Entity B receives this message at time T12, according to which the new key Keyl is obtained, and the operation of setting the Keyl transmission direction is unavailable, and the Keyl reception direction is available (while, the KeyO transmission direction and the reception direction are kept available).
  • Entity A initiates the first key switch at time T2, and sets the Keyl send direction to be available.
  • the KeyO send direction is set to unavailable.
  • the time interval between the T2 time and the T11 time is set to be greater than the transmission delay of the first key update message to the entity B. Therefore, T2 is definitely greater than the T12 time.
  • the entity B obtains the first key update message at time T12 to obtain a new key, and determines that the entity A obtains the new key based on the first key update message, and the entity B starts at the second time interval T3.
  • the Keyl sending direction is set to be available, and the KeyO sending direction is set to unavailable.
  • the second time interval may be zero, and entity B starts the first key switching process at time T12. At this time, entity B does not need to perform an operation to set the new key sending direction to be unavailable.
  • entity A successfully deprotects the data sent by entity B with the new key for the first time at time T4, and then starts the second key handover process, and entity B successfully de-protects entity A with the new key for the first time at time T5.
  • the second key switching process is initiated.
  • the first key obtaining process starts the first key switching process at the time when the data of the first data frame number is sent to the peer end, where the first data frame number is set by the end of obtaining the new key first.
  • the first key update message is sent to the peer.
  • one end of the new key can be presumed that when the data of the first data frame number is sent to the opposite end, the opposite end has obtained the new key according to the first key update message.
  • data is transmitted in a fixed frame format, and the data frame number is used to indicate the sequence number of the transmitted data frame.
  • the data frame number is usually incremented during data transmission. For example, in the data communication between entity A and entity B; the data frame number maintained by the data sent by entity A to entity B is recorded as the data frame number of A; the data frame number maintained by the data sent by entity B to entity A is recorded as B.
  • Data frame number; A data frame number does not correspond to B data frame number, but entity A and entity B need to maintain their own data frame number and the current value of the other party's data frame number, that is, the data frame of A needs to be recorded.
  • the current value of the number and the current value of the data frame number of B The entity A receives the data from the entity B, and the data frame number of the B carried by the data cannot be smaller than the current value of the data frame number of the B recorded by A; To the data from entity A, the data frame number of A carried by the data cannot be smaller than the current value of the data frame number of A recorded by B.
  • the first data frame number is greater than the current value of the data frame number of the end at which the new key is first obtained, that is, is greater than the one used to obtain the new key before the first key update message is sent.
  • the maximum value of the data frame number is greater than the current value of the data frame number of the end at which the new key is first obtained, that is, is greater than the one used to obtain the new key before the first key update message is sent.
  • the transmission sequence number is the first data frame number.
  • the time interval between the time of the data and the time at which the first key update message is sent is greater than the transmission delay of the first key update message.
  • the current value of the data frame number when the first key obtaining the first key update message is sent is 60.
  • the time T2 is the time at which the data having the first data frame number is transmitted
  • the time T12 is the time at which the first key update message arrives at the entity B.
  • the setting of the first data frame number needs to be greater than 60; and if one end of the current network that obtains the new key within the transmission delay of the first key update message can send 20 data frames to the opposite end, the first data frame number
  • the arrival time must be greater than T12, and entity B can already deprotect it with the new key.
  • the peer end can accurately learn, according to the first data frame number in the first key update message, data of the data that is first protected by the new key at the end that obtains the new key first.
  • the frame number is the first data frame number.
  • the peer can select a valid key to deprotect according to the data frame number of the received data. Specifically, when the data frame number of the received data is the first data frame number or greater than the first data frame number, the new key is selected for protection, otherwise, the original key is selected for protection.
  • the data frame numbers can also be designed in descending order. Contrary to the incremental situation, entity A receives data from entity B, and the data frame number carried by the data cannot be greater than the current value of the data frame number of B recorded by A; the corresponding first data frame number is set at the time of setting The current value of the data frame number that is smaller than the one that first obtains the new key, that is, the minimum value of the data frame number used by the end that first obtained the new key before sending the first key update message.
  • the first data frame number may not be sent to the peer end.
  • the first key exchange process is initiated after the new key is obtained by the opposite end, and the first key acquisition process can also start the first time after determining that the opposite end obtains the new key.
  • Embodiment 4 of the present invention shows a specific method for starting a first key switching process based on determining that a peer obtains a new key by first obtaining a new key: After the peer obtains the new key according to the first key update message, the peer generates a second key update message.
  • the end that obtains the new key determines that the peer obtains the new key according to the second key update message.
  • the end that obtains the new key first starts the first key switching process after receiving the second key update message.
  • the first key switching process may be started at a third time interval after receiving the second key update message.
  • the peer end may start the first key handover process at the second time interval after obtaining the first key update message, as in the third embodiment, or may send the second key update message.
  • the first key switching process is started at the fourth time interval, and the first key switching process may also be initiated when the data of the second data frame number is sent until the end of the new key is obtained.
  • the third time interval and the fourth time interval are not greater than a remaining validity period of the original key.
  • the second data frame number is set by the peer end and sent to the one end of the first new key by the second key update message; the second data frame number is set to be larger than the data of the peer end
  • the current value of the frame number is the maximum value of the data frame number used before the second key update message is sent.
  • entity A is one end of obtaining a new key:
  • T0, Til, and ⁇ 12, ⁇ 4, ⁇ 5 are the same operations as those in Figure 3.
  • T12 after the entity ⁇ knows the new key Key1 according to the received first key update message, constructs a second key update message and sends it to the entity ⁇ , and has informed the entity A that it has obtained the new secret. Key Keyl.
  • entity A receives the second key update message and determines from this that entity B has obtained the new key Key1.
  • the entity A starts the first key switching process, and sets the new key Key1 sending direction to be available. Set the original key KeyO send direction to unavailable.
  • the T2 time is not greater than the remaining validity period of the original key KeyO.
  • the third time interval may be zero.
  • the entity A starts the first key switching process at the time T13 when the second key update message is received.
  • the first key can be started at the time T3 of the second time interval (the time interval between the time T12 and the time T3 is the second time interval) at the distance T12 as in the method shown in FIG.
  • the first key handover procedure may also be initiated when the data of the second data frame number (the second data frame number is not less than the data frame number when the second key update message is sent) is sent to the entity A.
  • the entity B starts the first key when sending the first data sent after the second key update message. Switching process.
  • the second data frame number is sent to the entity eight by using the second key update message.
  • any end of the communication link may be configured to send a key update request message to the peer before obtaining the new key, to inform the peer that the local end has not obtained the new key, thereby starting Key update process.
  • the first key to obtain the new key will send the first key update message to the peer according to the key request update message when the new key is obtained.
  • the first key update message in the above embodiment may have various forms.
  • the first key update message is a ciphertext generated by the one end obtaining the new key and protecting the new key by using the shared information of both parties.
  • the peer can obtain the new key directly after de-protecting the shared information of both parties.
  • the ciphertext is directly generated for the protection of 1 and the new key 1 can be obtained directly after the peer is deprotected.
  • the shared information of the two parties may be the original key, or a key shared by both parties for the key update process to protect the new key or public and private key information of both parties.
  • the first key obtained by the new key protects the new key by using the public key of the opposite end and its own private key; the peer uses the new key first.
  • the public key at one end and its own private key deprotect the received key.
  • the original key in order to protect the forward security of the key, is generally not used to protect the new key during the key update process.
  • the first key update message may also be the one that obtains the new key first using the shared information.
  • the key algorithm is agreed at each end of the communication link, and then one end of the new key is obtained first.
  • a new key is calculated according to the agreed key algorithm and the first parameter described above.
  • the peer deprotects the new key information, the first parameter is obtained, and then the new key is calculated according to the agreed key algorithm and the first parameter.
  • the first key update message may further be a second parameter used to generate a new key; the two parties calculate the new key by using a second parameter and a shared key of both parties through an agreed algorithm.
  • the shared key of both parties may be the original key or a key shared by both parties for the key update process.
  • the second parameter may be protected and transmitted.
  • the foregoing first parameter or the second parameter has multiple specific forms, such as data obtained from a code book, and of course, based on higher security considerations, a new secret may be obtained first.
  • a first random number generated by one end of the key the end generates a new key according to the first random number, and sends the first random number to the peer end, and the peer end calculates a new key accordingly.
  • both ends of the communication link may also generate a new key in combination with the random number generated by the peer end.
  • the new key information is a ciphertext generated by the third-parameter protection by using the shared information of the peer and the peer, and the third parameter is a parameter for generating the new key.
  • the one that obtains the new key first can obtain the new key by using the agreed key algorithm, the third parameter, and the second random number generated by the peer.
  • the peer deprotects the new key information to obtain the third parameter.
  • the peer obtains the new key using an agreed key algorithm, the third parameter, and the second random number generated by itself.
  • the new key information is a fourth parameter;
  • the fourth parameter is a parameter used to calculate the new key together with the shared key of the first obtained new key and the shared key of the opposite end;
  • one end of the new key is obtained by using an agreed key algorithm, the shared key, and the fourth parameter.
  • the number and the third random number generated by the peer end obtain the new key.
  • the peer obtains the new key by using an agreed key algorithm, the shared key, the fourth parameter, and a third random number generated by the peer.
  • the peer sends a third random number or a fourth random number to the end of the new key by using the key update request message.
  • the third parameter or the fourth parameter has multiple specific forms, such as data obtained from the password book, based on higher security considerations, or may be generated by the first end of the new key. random number.
  • the second key update message in the foregoing embodiment of the present invention is a message that the peer end uses to inform the end that obtains the new key first that the user has obtained the new key. Therefore, the message may not include the new key. Information, such as sending a notification message like "Get New Key".
  • the peer may set a new key in the second key update message, such as Obtain a new key 5", so that the end of the new key can be used to verify that the new key of the peer is correct.
  • the second key update message may carry the ciphertext generated by the peer to encrypt the new key by using the shared information of the end with the new key first, in order to avoid the interception of the new key.
  • the ciphertext generated by encrypting the first parameter received from the first key update message by using the shared information of the end with the new key first is also carried.
  • the entity A is used as the first end to obtain the new key
  • the entity B is used as the opposite end as an example. It is easy to understand, in practical applications, When entity B first obtains a new key, entity B performs the operation of entity A in the above example, the entity
  • A can perform the operation of entity B in the above example.
  • the new key becomes the current key of the end, but at this time the end saves both the original key and the new key, in order to avoid subsequent
  • the new key and the original key may be appropriately processed after the first key switch and the second key switch to update the old and new keys.
  • the new key can be stored in the fixed storage area of the current key. This allows the current key to be determined directly from the storage location during the next update. Alternatively, either end can directly delete the original key after starting the key switching process, so that only one key is saved, and no distinction is needed.
  • either end will indicate that the identity of the current key points to the new key. This allows the current key to be determined directly based on the identity.
  • Embodiment 5 of the present invention further provides an apparatus for implementing the above bidirectional key switching.
  • the device specifically includes:
  • the first key obtaining unit 11 is configured to obtain a new key.
  • the key in the present invention refers to a key used to protect the transmitted data, that is, to encrypt or calculate the integrity check, to deprotect the received data, that is, to decrypt or verify the integrity check.
  • the key used by either end of the communication link for protecting the transmitted data and the key for deprotecting the received data are the same. For example, suppose the two parties are the entity A and the entity B. If the key used by the entity A to protect the data sent to the entity B is 1, the key that the entity A deprotects the data received from the entity B is also 1.
  • the first key update unit 12 is configured to: after obtaining the new key, and before estimating or determining that the at least n peers obtain the new key, set a new key sending direction to be unavailable and set a new key to receive The direction is available, and the original key sending direction is kept available and the original key receiving direction is available; so that the peer end starts after the original key expires after estimating or determining that the first key obtaining unit obtains the new key
  • the first key switching process sets the original key transmission direction to be unavailable and sets the new key transmission direction to be available.
  • the key sending direction is usable, which means that the data can be protected by using the key, and the key sending direction is unavailable, which means that the data cannot be protected by using the key; the key receiving direction is available to mean that the key can be utilized. Deprotecting the data, the key receiving direction is not available means that the data cannot be deprotected by using this key.
  • the peer may not have obtained the new key. If the first key update unit 12 directly sets the direction in which the new key is sent, the opposite end It is possible that the communication packets of the new key protection cannot be deprotected. Therefore, in the present invention, after the first key obtaining unit 11 obtains the new key, the first key updating unit 12 first sets the new key transmitting direction to be unavailable. At this time, when there is data to be sent to the peer, the protection unit 14 of the device will still be protected by the original key. The data sent.
  • the first key switching unit 13 is configured to: after obtaining the new key, after estimating or determining that the at least n the opposite end obtains the new key, and starting the first key switching before the original key fails a process of setting the original key transmission direction to be unavailable and setting the new key transmission direction to be usable; wherein N ⁇ n ⁇ l, where N is the total of the recipients corresponding to the sender Quantity.
  • N is the total of the recipients corresponding to the sender Quantity.
  • the new key receiving direction is set, that is, the received data can be deprotected with the new key. Therefore, the first key switching unit 13 obtains the reference in the presumption or determination of the opposite end. After the new key is described, it is presumed or determined that the new key can be deprotected by the peer. Therefore, the first key switching process can be initiated. At this time, the protection unit 14 of the device protects the data to be sent with the new key. .
  • the use of the key has a certain period of time, and therefore, the first key switching unit 13 also needs to initiate the first key switching process before the original key expires.
  • the key is deprotected.
  • the new key and the original key at the deprotection unit 15 are available. At this time, it is necessary to select a valid key deprotection according to the protection identifier of the received data. Specifically, when the protection identifier indicates that the data is protected by the original key, the original key is selected to be deprotected. When the protection flag indicates that the data is protected with a new key, select the new key to protect.
  • the deprotecting unit selects the new key to protect.
  • the second key switching unit 16 is configured to start the second key switching process after the first successful deprotection with the new key, that is, set the original key receiving direction to be unavailable.
  • the first successful de-protection with the new key indicates that the peer has performed key switching.
  • the second key switching unit 16 can perform key switching after the first successful de-protection with the new key, that is, setting The original key receiving direction is not available.
  • unicast refers to a single entity sending communication data to a single entity.
  • Multicast refers to a single entity sending communication data to at least two entities.
  • the first key The key switching unit 13 is configured to start the first key switching process after estimating or determining that all the peers obtain the new key.
  • the first key obtaining unit may obtain a new key before the peer end, or may obtain a new key later from the opposite end.
  • the means for initiating the key switch when estimating or determining the new key is available in various specific forms.
  • Embodiment 6 of the present invention provides the following devices for starting the first key switching process after the peer is preliminarily obtained the new key by estimating the new key:
  • the first key update message sending unit is configured to send the first key update message to the peer end when the new key is obtained before the peer end.
  • the first key update message includes new key information.
  • the peer can obtain a new key according to the new key information in the first key update message.
  • the first key switching unit is specifically configured to start a first key switching process at a first time interval after sending the first key update message.
  • the first time interval is greater than the transmission delay of the first key update message.
  • the transmission of data takes a certain amount of time. Considering that data transmission suffers from transmission delay due to factors such as transmission distance and transmission bandwidth, the prior art determines the delay time of data transmission. When it is greater than this delay, the data is considered to have been transmitted to the opposite end. Therefore, in the present invention, when the time is greater than the first key update message reaches the peer delay, it can be estimated that the peer obtains the message, thereby estimating that the peer obtains the new key.
  • the first key update message sending unit is configured to send the first key update message to the peer end when the new key is obtained before the peer end.
  • the first key update message includes new key information.
  • the peer can obtain a new key according to the new key information in the first key update message.
  • the first key switching unit is specifically configured to set a first data frame number and send a serial number to The first key switching process is initiated by the data of the data frame number to the time of the opposite end.
  • the first data frame number is greater than a maximum data frame number used before the first key update message is sent, a time when the data of the first data frame number is sent, and a time when the first key update message is sent.
  • the interval is greater than the transmission delay of the first key update message to the peer.
  • data is transmitted in a frame format, and the data frame number is used to indicate the order of the frames in which the transmitted data is located.
  • Setting a first data frame number that is greater than a maximum data frame number used before sending the first key update message, and a time interval between a time when the data of the first data frame number is sent and a time when the first key update message is sent is greater than
  • the first key update message arrives at the opposite end of the transmission delay. Then, it can be presumed that when the data of the first data frame number is transmitted to the opposite end, the opposite end has obtained the new key according to the first key update message.
  • the first key switching unit is specifically configured to start a first key switching process at a second time interval after receiving the second key update message.
  • the second key update message is returned by the peer after obtaining the new key according to the first key update message.
  • the second time interval is not greater than the remaining validity period of the original key.
  • the peer sends a key update request message before the new key is obtained.
  • the first key update message sending unit is configured to send the first key update message to the peer according to the key update request message.
  • the apparatus further includes a new key unit for utilizing the shared information with the peer end
  • the new key information is generated for the new key protection.
  • the first new key information is directly generated by the protection of the first key, and then the peer can directly obtain the new key by using the shared information to protect the new key information.
  • the apparatus may further include a first parameter unit, configured to utilize The shared information of the peer end generates new key information for the first parameter protection, where the first parameter is a parameter for generating the new key, such as the first announcement master key NMK.
  • the first key obtaining unit is specifically configured to obtain the new key by using an agreed key algorithm and the first parameter.
  • the new key information is a second parameter, where the second parameter is a parameter used to calculate the new key together with the shared key of the opposite end.
  • the first key obtaining unit is specifically configured to obtain the new key by using the agreed key algorithm, the second parameter, and the shared key when the new key information is the second parameter. .
  • the first parameter or the second parameter has multiple specific forms, such as data obtained from the password book.
  • the first random number unit of the device may also be generated. A random number.
  • the above shared information may be an original key shared by both parties, a key dedicated to the key update process to protect the new key, or public and private key information of both parties.
  • the new key is protected and deprotected using the public and private keys of both parties
  • the new key is protected by the public key of the peer and its private key.
  • the peer uses the public key of the other end and its own private key to deprotect the received key.
  • the original key in order to protect the forward security of the key, is generally not used to protect the new key during the key update process.
  • the two parties may also generate a new key in combination with the random number generated by the peer end.
  • the device further includes a third parameter unit, configured to generate the new key information by using the shared information with the peer to protect the third parameter, where the third parameter is used to generate the new The parameters of the key.
  • the first key obtaining unit is specifically configured to obtain the new key by using an agreed key algorithm, the third parameter, and a second random number generated by the peer end;
  • the first key obtaining unit is configured to: when the new key information is a fourth parameter, use an agreed key algorithm, the fourth parameter, a shared key with the peer, and the pair The third random number generated by the terminal obtains the new key, where the fourth parameter is a parameter used for calculating the new key together with the shared key of the opposite end.
  • the second random number or the third random number is generated by the peer end and included in the key update request message.
  • the third parameter and the fourth parameter have multiple specific forms, such as Therefore, the data obtained from the codebook, of course, based on the consideration of higher security, may also be the fourth random number generated by the fourth random number unit of the apparatus.
  • the second key update message mentioned in the above device is a message used by the peer to inform that it has obtained a new key. Therefore, the message may not include information related to the new key, such as sending a message similar to "new The message "key”.
  • the peer in order to facilitate verification of whether the new key acquired by the peer is correct, the peer may set a new key in the second key update message, such as "a new key 5 has been obtained". This will verify that the new key of the peer is correct at the same time. Because the new key is included, in order to avoid being intercepted during transmission, the peer can use the shared information of both parties to protect the new key in the second key update message.
  • the second key update message may carry the ciphertext generated by the peer end using the shared information to protect the new key, or may carry the secret generated by the peer using the shared information to protect the relevant parameters received from the first key update message. Text.
  • the new key becomes the current key, but the original key and the new key are saved in the device at the same time.
  • the new key and the original key may be appropriately processed after key switching to distinguish between the old and new keys.
  • the device further includes:
  • the current key storage unit is configured to store the new key in a fixed storage area of the current key after starting the first key switching process and the second key switching process;
  • the original key deleting unit is configured to delete the original key after starting the first key switching process and the second key switching process;
  • the current key identification unit is configured to point the identifier indicating the current key to the new key after starting the first key handover process and the second key handover process.
  • the seventh embodiment of the present invention further provides a device for bidirectional key switching.
  • the device includes:
  • the second key obtaining unit 21 is configured to obtain the new key according to the first key update message sent when the peer first obtains the new key; the first key update message includes new key information.
  • a second key update unit 22 configured to set a new key sending direction when the new key is obtained Not available and setting a new key receiving direction available, and keeping the original key sending direction available and keeping the original key receiving direction available; so that the peer obtains the new in the second key obtaining unit by estimating or determining
  • the first key switching process is initiated before the original key expires, the original key sending direction is set to be unavailable, and the new key sending direction is set to be available.
  • the protection unit 24 of the device still protects the data to be transmitted with the original key.
  • the third key switching unit 23 is configured to start a first key switching process at a second time interval after obtaining the new key according to the first key update message, and set the original key sending direction Is unavailable and sets the new key transmission direction to be available; so that the peer initiates the second key handover process after successfully deprotecting the received data with the new key for the first time, and the original key is The receiving direction is set to be unavailable; wherein, when the peer obtains the new key, setting a new key sending direction is unavailable and setting a new key receiving direction to be available, and selecting an effective secret according to the protection identifier of the received data. The key is deprotected. At this time, when there is data to be sent to the peer, the protection unit 24 of the device protects the data to be transmitted with the new key.
  • the second time interval is not greater than a remaining validity period of the original key.
  • the peer when the second time interval is zero, the peer directly starts the first key switching process after obtaining the new key according to the first key update message, and the peer does not need to perform setting a new key.
  • the fourth key switching unit 26 is configured to start the second key switching process after successfully deprotecting the new key for the first time, that is, set the original key receiving direction to be unavailable.
  • the device further includes: a message that the first key obtaining unit has obtained the new key, and the device further includes:
  • a second key update message sending unit configured to send a second key update message to the peer end after obtaining the new key according to the first key update message; so that the peer end is according to the second secret
  • the key update message determines that the second key obtaining unit obtains the new key.
  • the third key switching unit is specifically configured to be used after sending the second key update message.
  • the first key switching process is initiated at a time interval of three times; or, the second data frame number is set and the first key switching process is initiated at a time when the data of the second data frame number is sent to the opposite end.
  • the third time interval is not greater than the remaining validity period of the original key.
  • the second data frame number is included in the second key update message; the second data frame number is set to be greater than a maximum data frame number used before the second key update message is sent.
  • the apparatus further includes:
  • a key update request message sending unit configured to send a key update request message to the peer end before obtaining the new key; so that the peer end first obtains a new key according to the key update request message
  • the first key update message is described.
  • the manner in which the second key obtaining unit obtains the new key is different for the form of the new key information in the first key update message.
  • the second key obtaining unit is specifically used for utilizing The shared information obtains the new key after deprotecting the new key information.
  • the second key obtaining unit is specifically used for Deriving the new key information to obtain the first parameter and obtaining the new key by using the agreed key algorithm and the first parameter;
  • the first parameter is a parameter used to generate the new key, Such as the first announcement master key NMK and so on.
  • the second key obtaining unit is specifically configured to use the agreed key algorithm, the second parameter, and the shared secret with the other end of the communication link.
  • the key obtains the new key;
  • the second parameter is a parameter for calculating the new key together with the shared key.
  • the first parameter or the second parameter has multiple specific forms, such as data obtained from a code book, and may be generated by the peer end based on consideration of higher security. A random number.
  • both parties may also A new key is generated in conjunction with the random number generated by the device.
  • the device further includes: a second random number unit, configured to generate a second random number; and the second key obtaining unit is specifically configured to: when the new key information is used and communicated by the peer end When the shared information at the other end of the link is ciphertext protected by the third parameter, the new key information is deprotected to obtain the third parameter, and the agreed key algorithm, the third parameter, and the first Obtaining the new key by two random numbers; the third parameter is a parameter used to generate the new key;
  • the apparatus further includes a third random number unit, configured to generate the third random number
  • the second key obtaining unit is specifically configured to: when the new key information is a fourth parameter, use an agreed key algorithm, the fourth parameter, and a shared key with the other end of the communication link
  • the third random number obtains the new key
  • the fourth parameter is a parameter for calculating the new key together with a shared key at the other end of the communication link.
  • the third parameter or the fourth parameter has multiple specific forms, such as data obtained from a code book, and may be a fourth random number generated by the opposite end based on consideration of higher security. .
  • the second random number and the third random number are included in the key update request message.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

一种双向密钥的切换方法及实现装置。其中,方法包括:通信链路中的任一端在获得新密钥时设置新密钥发送方向不可用并设置新密钥接收方向可用;所述任一端在推定或确定至少n个对端获得了所述新密钥后,原密钥失效前启动第一密钥切换过程,将所述原密钥发送方向设置为不可用并将所述新密钥发送方向设置为可用;其中,N≥n≥1,N为所述发送方对应的接收方的总数量;所述任一端根据所述对端发送数据的保护标识选择有效的密钥进行解保护;所述任一端在第一次用所述新密钥成功解保护所述数据后启动第二密钥切换过程,将原密钥接收方向设置为不可用。本发明通过限定通信链路上各端进行密钥切换的顺序,保证了任一端都能够正确解保护对端发送的数据。

Description

一种双向密钥的切换方法及实现装置 本申请要求于 2012 年 8 月 13 日提交中国专利局、 申请号为 201210286523.8、 发明名称为"一种双向密钥的切换方法及实现装置"的中国专 利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域 本发明涉及密钥领域, 特别是涉及一种双向密钥的切换方法及实现装置。
背景技术
为防止通信网络中的通信数据被非法者窃听或被非法者墓改, 在无线网 络、 无源光网络和电力线通信网络等, 甚至是有线网络中, 研究者们普遍采用 密钥来保护通信数据的安全性,通过保护来保证通信数据的机密性,通过计算 完整性校验值来保证数据的完整性。这些用于保护数据安全性的机制中,都需 要数据的发送方和接收方知晓密钥。
为防止非法用户通过分析截获的数据包得到密钥,进而获取通信数据或者 对通信数据进行墓改, 密钥需要经常更新。 密钥的更新方式有很多, 但很多密 钥更新机制仅解决了通信双方如何得到新密钥的问题,并没有涉及发送方和接 收方如何进行新旧密钥的切换问题。一般来说,通信双方切换到新密钥的时刻 有先有后, 一旦切换不当, 接收方可能无法解保护发送方发送的通信数据包。
发明内容
本发明提供了一种双向密钥的切换方法及实现装置,能够使接收方正确解 保护发送方发送的通信数据包。
本发明提供了如下方案:
一种双向密钥的切换方法, 所述方法包括:
通信链路中的任一端在获得新密钥后,且在推定或确定至少 n个对端获得 了所述新密钥前,设置新密钥发送方向不可用并设置新密钥接收方向可用, 以 及保持原密钥发送方向可用并保持原密钥接收方向可用;
在获得所述新密钥后,所述任一端在推定或确定至少 n个对端获得了所述 新密钥后,且在原密钥失效前启动第一密钥切换过程, 所述第一密钥切换过程 为: 将所述原密钥发送方向设置为不可用并将所述新密钥发送方向设置为可 用; 其中, N≥n≥l , 其中 N为所述发送方对应的接收方的总数量;
所述任一端根据所述对端发送数据的保护标识选择有效的密钥进行解保 护;
所述任一端在第一次用所述新密钥成功解保护所述对端发送的数据后启 动第二密钥切换过程, 所述第二密钥切换过程为: 将原密钥接收方向设置为不 可用。
本发明还提供了一种用于实现双向密钥切换的装置, 所述装置包括: 第一密钥获得单元, 用于获得新密钥;
第一密钥更新单元, 用于在获得新密钥后,且在推定或确定至少 n个对端 获得了所述新密钥前, 设置新密钥发送方向不可用并设置新密钥接收方向可 用, 以及保持原密钥发送方向可用并保持原密钥接收方向可用; 第一密钥切换 单元, 用于获得所述新密钥后,在推定或确定至少 n个所述对端获得了所述新 密钥后,且在原密钥失效前启动第一密钥切换过程,所述第一密钥切换过程为: 将所述原密钥发送方向设置为不可用并将所述新密钥发送方向设置为可用,其 中, N≥n≥l , 其中 N为所述发送方对应的接收方的总数量;
保护单元,用于在设置新密钥发送方向不可用并保持原密钥发送方向可用 后, 利用原密钥保护发送至所述对端的数据,在设置原密钥发送方向不可用并 设置新密钥发送方向可用后, 利用所述新密钥保护发送至所述对端的数据; 解保护;
第二密钥切换单元,用于在第一次用所述新密钥成功解保护后启动第二密 钥切换过程, 所述第二密钥切换过程为: 将原密钥接收方向设置为不可用。
本发明还提供了一种用于实现双向密钥切换的装置, 所述装置包括: 第二密钥获得单元,用于根据对端在先获得新密钥时发送的第一密钥更新 消息获得所述新密钥, 所述第一密钥更新消息包括新密钥信息; 第二密钥更新单元, 用于在获得所述新密钥时,设置新密钥发送方向不可 用并设置新密钥接收方向可用,以及保持原密钥发送方向可用并保持原密钥接 收方向可用; 第三密钥切换单元, 用于在根据所述第一密钥更新消息获得所述 新密钥后的第二时间间隔时刻启动第一密钥切换过程,所述第一密钥切换过程 为: 将所述原密钥发送方向设置为不可用并将所述新密钥发送方向设置为可 用;
保护单元,用于在设置新密钥发送方向不可用并保持原密钥发送方向可用 后, 利用原密钥保护发送至所述对端的数据,在设置原密钥发送方向不可用并 设置新密钥发送方向可用后, 利用所述新密钥保护发送至所述对端的数据; 解保护;
第四密钥切换单元,用于在第一次用所述新密钥成功解保护后启动第二密 钥切换过程, 所述第二密钥切换过程为: 将原密钥接收方向设置为不可用; 其中, 所述第二时间间隔不大于所述原密钥的剩余有效期。
本发明通过通信链路的任一端在获得新密钥时设置新密钥发送方向不可 用, 并在推定或确定对端获得新密钥后进行密钥切换,将新密钥发送方向设置 为可用,原密钥发送方向设置为不可用,避免了任一端在获得新密钥前接收到 对端用新密钥保护的通信数据包,从而无法解保护的情况。 而任一端在获得新 密钥时设置该新密钥和原密钥接收方向均可用,保证了任一端能够对对端发送 的原密钥保护的通信数据包和对端切换为新密钥后用新密钥保护的通信数据 包进行解保护。可见, 本发明通过限定任一端发送方向和接收方向上密钥的切 换顺序, 解决了无法解保护对端发送的保护通信数据包的问题。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例中所需要使用的附图作筒单地介绍, 显而易见地, 下面描述中的附图仅仅是 本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的 前提下, 还可以根据这些附图获得其他的附图。 图 1是本发明实施例一提供的方法流程示意图;
图 2是本发明实施例二提供的方法流程示意图;
图 3是本发明实施例三提供的方法流程示意图;
图 4是本发明实施例四提供的第一方法流程示意图;
图 5是本发明实施例五提供的装置结构图;
图 6是本发明实施例七提供的装置结构图。 具体实施方式 下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员所获得的所有其 他实施例, 都属于本发明保护的范围。
需要说明的是, 现有的通信技术中, 密钥分为单向密钥和双向密钥, 其中 双向密钥用于保护通信双方之间的数据,是指实体对发送给对端实体的数据进 行加密或计算完整性校验的密钥和该实体对接收到来自对端实体的数据进行 解密或验证完整性校验的密钥是同一个密钥。单向密钥仅用于保护一个方向的 数据,是指实体对发送给对端实体的数据进行加密或计算完整性校验的密钥和 该实体对接收到来自对端实体的数据进行解密或验证完整性校验的密钥是不 同的密钥。
本发明实施例仅对双向密钥的切换进行介绍。
参见图 1 ,为本发明实施例一提供的双向密钥的切换方法,包括以下步骤: Sll、 通信链路中的任一端在获得新密钥后, 且在推定或确定至少 n个对 端获得所述新密钥前, 设置新密钥发送方向不可用并设置新密钥接收方向可 用, 以及保持原密钥发送方向可用并保持原密钥接收方向可用。
本发明中的密钥是指用以对发送的数据进行保护即加密或计算完整性校 验, 以及对接收的数据进行解保护即解密或验证完整性校验的密钥。
本发明中通信链路的两端互为本端和对端。 其中, 对于任一端而言, 用于 对发送的数据进行保护的密钥和对接收的数据进行解保护的密钥是相同的。比 如, 假设通信双方为实体 A和实体 B, 如果实体 A用于对发送到实体 B的数据进 行保护的密钥为 1 ,那么实体 A对从实体 B接收到的数据进行解保护的密钥也是 1。
本发明中密钥发送方向可用是指可利用此密钥对数据进行保护,密钥发送 方向不可用是指不能利用此密钥对数据进行保护;密钥接收方向可用是指可利 用此密钥对数据解保护,密钥接收方向不可用是指不能利用此密钥对数据解保 护。
对通信链路的任一端来说,在获得新密钥时,对端有可能还未获得新密钥, 若直接设置新密钥发送方向可用,那么对端有可能无法对新密钥保护的通信数 据包进行解保护。 因此, 本发明中, 在任一端获得新密钥后先设置新密钥发送 方向不可用。 此时该端仍旧用原密钥保护发送给对端的数据。
在现有技术中,在每端可以保存多个密钥, 并根据接收的数据的保护标识 选择相应的密钥进行解保护。 本发明中,保护标识是指密钥标识或密钥索引等 信息, 用于标识对数据进行保护的密钥是哪一个密钥。
对本发明中的任一端来讲, 不一定能确定对端何时进行密钥的切换,通过 设置任一端原密钥和新密钥的接收方向同时可用,保证了任一端能够对对端发 送的不论是用原密钥保护的数据还是用新密钥保护的数据都能进行解保护。
512、 在获得所述新密钥后, 所述任一端在推定或确定至少 n个对端获得 了所述新密钥后,且在原密钥失效前启动第一密钥切换过程, 所述第一密钥切 换过程为: 设置所述原密钥发送方向不可用并设置所述新密钥发送方向可用。 其中, N≥n≥l , 其中 N为所述发送方对应的接收方的总数量。
根据步骤 S11知道,任一端只要获得了新密钥就会设置新密钥接收方向可 用,因此在推定或确定对端获得了新密钥后就同时推定或确定了对端的新密钥 在接收方向可用, 所以,对端在之后的任一时刻就可以用新密钥对通信数据包 进行解保护, 换言之, 任一端在之后的任一时刻都可以进行密钥切换, 用新密 钥对数据进行保护。
密钥的使用具有一定的期限, 因此, 本发明中任一端还需在原密钥失效前 启动第一密钥切换过程。
513、 所述任一端根据所述对端发送数据的保护标识选择有效的密钥进行 解保护。
任一端在设置新密钥接收方向可用后, 对端可能进行了第一密钥切换, 用 新密钥对数据进行保护,也有可能对端还未进行第一密钥切换,仍用原密钥对 数据进行保护, 此时, 任一端可检测从对端接收的数据的保护标识, 根据保护 标识选择对应的密钥进行解保护。具体的, 当根据保护标识确定对数据保护的 密钥是原密钥时,选择原密钥解保护, 当根据保护标识确定对数据保护的密钥 是新密钥时, 选择新密钥解保护。
S14、 所述任一端在第一次用所述新密钥成功解保护后启动第二密钥切换 过程, 所述第二密钥切换过程为: 设置原密钥接收方向不可用。
第一次用新密钥成功解保护表明对端已经进行了密钥切换, 此时,任一端 可对应的进行密钥切换, 即设置原密钥接收方向不可用。
通信的过程中常会出现丟包的情况, 因此, 对任一端来说, 第一次用新密 钥成功解保护的通信数据包不一定是对端发送的第一个用新密钥保护的数据 包。
对通信链路中的一端来说,只有在获得新密钥后才能进行第一密钥切换并 选择有效的密钥对数据解保护,从而在成功解保护后进行第二密钥切换。因此, 对一端来讲上述步骤中 S12、 S13在步骤 S11之后,步骤 S14在步骤 S13之后, 步骤 S12、 S13之间没有先后关系。
在本发明实施例二中, 以通信链路的两端分别为实体八、 实体 B, 原密钥 为 KeyO, 新密钥为 Keyl为例, 对双向密钥切换方法进行了详尽的描述。 为描 述方便, 在以下示例中, tx表示发送方向, rx表示接收方向, enable= 1表示 可用, enable =0表示不可用; 如 KeyO.rx.enable =1 表示对应实体原密钥接收 方向可用; Keyl.rx.enable =0表示对应实体新密钥接收方向不可用。
参见图 2,在 TO时刻, 实体 A和实体 B均处于原密钥发送方向和接收方向可 用状态。 实体 A发送到实体 B的数据和实体 A对从实体 B接收的数据使用原密钥 KeyO进行保护,实体 B发送到实体 A的数据和实体 B对从实体 A接收的数据使用 原密钥 KeyO进行保护。
T1时刻, 实体 A和实体 B执行密钥更新过程, 此过程确保实体 A和实体 B获 得新密钥 Keyl。 需要明确的是, 在该过程中, 实体 A获得新密钥 Keyl的时刻 Tll和实体 B获得新密钥 Keyl的时刻 T12可能不同。 其中, 在 T11时刻, 实体 A 执行设置新密钥发送方向不可用并设置接收方向可用的操作(同时, 实体 A保 持原密钥发送方向可用以及原密钥接收方向可用), 此后, 实体 A发送至实体 B 的数据仍使用原密钥 KeyO进行保护, 而对从实体 B接收的数据可以根据数据的 保护标识选择原密钥或新密钥进行解保护。 在 T12时刻, 实体 B执行设置新密 钥发送方向不可用, 设置新密钥接收方向可用的操作(同时, 实体 B也保持原 密钥发送方向可用以及原密钥接收方向可用)。 在后续的过程中, 实体 B发送 至实体 A的数据仍使用原密钥 KeyO进行保护, 而对从实体 A接收的数据可以根 据数据的保护标识选择原密钥或新密钥进行解保护。
T2时刻, 实体 A已经推定或确定实体 B获得了新密钥, 即实体 B在新密钥 接收方向可用, 实体 A执行第一密钥切换, 即, 执行设置新密钥 Keyl发送方向 可用, 并设置原密钥 KeyO发送方向不可用的操作。 之后若实体 A需要发送数据 包给实体 B, 则使用新密钥 Keyl对数据包进行保护后发送给实体 B。
T3时刻, 实体 B已经推定或确定实体 A获得了新密钥, 即实体 A在新密钥 接收方向可用, 实体 B启动第一密钥切换, 即, 执行设置新密钥 Keyl发送方向 可用, 并设置原密钥 KeyO发送方向不可用的操作。 之后若实体 B需要发送数据 包给实体 A, 则使用新密钥 Keyl对数据包进行保护后发送给实体 A。
在实际应用中, 实体 A和实体 B获得新密钥的先后顺序不定, 所以两者执 行第一密钥切换的时刻 T2和 T3的先后顺序并不定。
T4时刻, 实体 A根据检测的数据的标识确定数据为用新密钥保护, 因此选 择新密钥 Keyl对来自实体 B的数据进行解保护, 并在第一次成功解保护后启动 第二密钥切换过程, 即, 执行设置原 KeyO接收方向不可用的操作。
实体 A正确解保护的时刻必然是在实体 B的新密钥发送方向可用之后, 即 实体 B执行第一密钥切换之后, 因此, T4时刻在 T3时刻之后。
T5时刻, 实体 B根据检测的数据的标识确定数据为用新密钥保护, 因此选 择新密钥 Keyl对来自实体 A的数据进行解保护,并在第一次成功解保护后启动 第二密钥切换过程, 执行设置原密钥 KeyO接收方向不可用的操作。 实体 B正确解保护的时刻必然是在实体 A的新密钥发送方向可用之后, 即 实体 A执行第一密钥切换之后, 因此, T5时刻在 T2时刻之后。
至此, 实体 A和实体 B都完成了密钥切换。 之后, 实体 A处于新密钥发送 方向和接收方向可用的状态, 实体 B处于新密钥发送方向和接收方向可用的状 态。
需要说明的是,对于同一端来讲, 其推定或确定对端获得了新密钥后启动 第一密钥切换过程的时刻可能早于该端正确解保护的时刻,也可能晚于该端正 确解保护的时刻。 以图 2中实体 B为例, 则 T3时刻可能早于 T5时刻, 也可 能晚于 T5时刻。
在本发明的另一实施例中, 若实体 B第一次成功解保护来自实体 A的用 新密钥 Keyl保护的数据的 T5时刻早于实体 B计划启动第一密钥切换过程, 即, 设置新密钥发送方向可用, 设置原密钥发送方向不可用的 T3时刻, 因为 成功解保护意味着实体 A在 T5时刻之前已经用新密钥保护,则实体 B可以确 定实体 A此时已经获得了新密钥,故实体 B可以在 T5时刻启动第二密钥切换 过程的同时, 启动第一密钥切换过程。 当然, 实体 B也可以选择等到 T3时刻 再启动第一密钥切换过程。
在通信网络中,存在单播和多播两种通信方式。其中单播是指单一实体送 通信数据至单一实体。 多播是指单一实体发送通信数据至至少两个实体。
其中,在多播的情况下,用于接收数据的多个实体不一定同时获得新密钥, 为保证上述的多个实体都能正确解保护,在本发明的优选实施例中,通信链路 上的任一端需要在推定或确定所有的对端获得新密钥后启动第一密钥切换过 程。
本发明中, 通信链路上的各端获得新密钥的方法有多种。 其中的一种是, 当一端先于对端获得新密钥时,先获得新密钥的一端会发送第一密钥更新消息 至对端, 以便对端根据第一密钥更新消息获得新密钥。
此时,先获得新密钥的一端和对端都获得了新密钥, 因此都会执行设置新 密钥发送方向不可用, 新密钥接收方向可用的操作。
发送第一密钥更新消息后,先获得新密钥的一端可推定或确定对端是否获 得了新密钥, 并在推定或确定后, 原密钥失效前启动第一密钥切换过程。 而对端根据接收的第一密钥更新消息就能够确定发送该消息的另一端即 先获得新密钥的一端已经获得了新密钥, 因此,对端可以在根据第一密钥更新 消息获得新密钥后, 原密钥失效前启动第一密钥切换过程。 具体的, 对端可在 根据第一密钥更新消息获得新密钥后的第二时间间隔时刻启动第一密钥切换 过程, 其中第二时间间隔不大于原密钥的剩余有效期。
需要说明的是, 当该第二时间间隔为零时,对端在根据第一密钥更新消息 获得新密钥后直接启动第一密钥切换过程, 此时,对端无需执行设置新密钥发 送方向不可用的操作。
本发明中,先获得新密钥的一端推定对端获得新密钥的方式有多种。本发 明实施例三提供了先获得新密钥的一端根据不同的推定方式启动第一密钥切 换过程的以下几种方法:
方法一
先获得新密钥的一端在发送第一密钥更新消息后的第一时间间隔后启动 密钥切换过程。 其中第一时间间隔大于第一密钥更新消息到达对端的传输延 迟。
通信链路上数据的传输需要一定的时间。考虑到数据传输因为受到传输距 离、传输带宽等因素的影响会出现传输延迟,现有技术确定了数据传输的延迟 时间。 当大于这一延迟时间时, 认为数据已经传输至对端。 因此, 本发明中, 当时间大于第一密钥更新消息到达对端的延迟时间时,可以推定对端获得了此 消息, 从而推定对端获得了新密钥。
图 3示出了先获得新密钥的一端采用上述方法一推定对端获得新密钥时, 先获得新密钥的一端和对端启动第一密钥切换的一种具体实现方式,在该方式 中, 实体 A为先获得新密钥的一端:
实体 A在 T11时刻获得新密钥 Keyl后执行设置 Keyl发送方向不可用, Keyl接收方向可用的操作 (同时, 保持 KeyO发送方向和接收方向可用), 构 造并发送第一密钥更新消息至实体 B。 实体 B于 T12时刻接收到此消息, 据 此获得新密钥 Keyl , 并执行设置 Keyl发送方向不可用, Keyl接收方向可用 的操作 (同时, 保持 KeyO发送方向和接收方向可用)。
实体 A在 T2时刻启动第一密钥切换, 将 Keyl发送方向设置为可用, 将 KeyO发送方向设置为不可用。 其中, T2时刻与 T11时间的时间间隔设置为大 于第一密钥更新消息到达实体 B的传输延迟, 因此, T2肯定大于 T12时刻。
实体 B于 T12时刻获得第一密钥更新消息从而获得新密钥, 并基于该第 一密钥更新消息确定实体 A获得了新密钥,在之后的第二时间间隔时刻 T3时 刻实体 B启动第一密钥切换过程, 将 Keyl发送方向设置为可用, 将 KeyO发 送方向设置为不可用。
当然, 第二时间间隔时刻可以为零, 实体 B在 T12时刻启动第一密钥切 换过程。 此时, 实体 B无需执行设置新密钥发送方向不可用的操作。
之后,实体 A在 T4时刻第一次用新密钥成功解保护实体 B发送的数据后, 启动第二密钥切换过程, 实体 B在 T5时刻第一次用新密钥成功解保护实体 A 发送的数据后, 启动第二密钥切换过程。
方法二
先获得新密钥的一端在发送序列号为第一数据帧号的数据至对端的时刻 启动第一密钥切换过程; 其中, 所述第一数据帧号由先获得新密钥的一端设置 且通过第一密钥更新消息发送至对端。
据此先获得新密钥的一端可以推定在第一数据帧号的数据被发送至对端 时, 对端已根据第一密钥更新消息获得了新密钥。
在通信中,数据是按照固定的帧格式传输的,数据帧号用以表示传输的数 据帧的序列号, 在数据传输过程中数据帧号通常是递增的。 比如实体 A和实 体 B的数据通信中; 实体 A发往实体 B的数据所维持的数据帧号记做 A的数 据帧号; 实体 B发往实体 A的数据所维持的数据帧号记 B的数据帧号; A的 数据帧号和 B的数据帧号没有对应关系, 但实体 A和实体 B需要同时维持自 身的数据帧号和对方的数据帧号的当前值, 即需要记录 A的数据帧号当前值 以及 B的数据帧号当前值; 实体 A收到来自实体 B的数据, 其数据所携带的 B的数据帧号不能小于 A所记录的 B的数据帧号的当前值; 实体 B收到来自 实体 A的数据,其数据所携带的 A的数据帧号不能小于 B所记录的 A的数据 帧号的当前值。
因此,在本发明中, 第一数据帧号大于先获得新密钥的一端的数据帧号的 当前值,即大于先获得新密钥的一端在发送第一密钥更新消息之前所使用过的 数据帧号的最大值。
另夕卜,为保证先获得新密钥的一端在发送第一数据帧号的数据的时刻已经 能够推定对端获得了新密钥, 在本发明中,发送序列号为第一数据帧号的数据 的时刻与发送第一密钥更新消息的时刻之间的时间间隔要大于第一密钥更新 消息的传输延迟。据此先获得新密钥的一端可以推定在第一数据帧号的数据被 发送至对端时, 对端已根据第一密钥更新消息获得了新密钥。
仍以图 3为例,假设所述先获得新密钥的一端在发送第一密钥更新消息时 的数据帧号的当前值为 60。 T2时刻为发送具有第一数据帧号的数据的时刻, T12时刻为第一密钥更新消息到达实体 B的时刻。第一数据帧号的设置需要大 于 60; 且若当前网络中在第一密钥更新消息的传输延迟内先获得新密钥的一 端可以发送 20个数据帧给对端, 则第一数据帧号的设置至少是 60+20=80, 因 此可以设置第一数据帧号为 100。 显而易见的, 当数据帧号为 100的数据被发 送至实体 B时, 到达时刻一定大于 T12, 此时实体 B已经可以对其用新密钥 解保护。
需要说明的是, 在上述方法二中, 对端根据第一密钥更新消息中的第一数 据帧号可以准确的获知先获得新密钥的一端第一次用新密钥保护的数据的数 据帧号即为第一数据帧号。此时,对端可以根据接收的数据的数据帧号选择有 效的密钥进行解保护。具体的, 当接收的数据的数据帧号为第一数据帧号或大 于第一数据帧号时, 选择新密钥解保护, 否则, 选择原密钥解保护。
当然, 在具体实施时, 数据帧号也可以按照递减的顺序设计。 与递增的情 况相反, 实体 A收到来自实体 B的数据, 其数据所携带的数据帧号不能大于 A所记录的 B的数据帧号的当前值; 对应的第一数据帧号在设置时要小于先 获得新密钥的一端的数据帧号的当前值,即小于先获得新密钥的一端在发送第 一密钥更新消息之前所使用过的数据帧号的最小值。
在本发明的另一实施例中,先获得新密钥的一端也可不将第一数据帧号发 送至对端。与先获得新密钥的一端在推定对端获得了新密钥后启动第一密钥切 换过程相对应,先获得新密钥的一端还可以在确定对端获得了新密钥后启动第 一密钥切换过程。本发明实施例四示出了先获得新密钥的一端基于确定对端获 得新密钥而启动第一密钥切换过程的具体方法: 对端在根据上述第一密钥更新消息获得新密钥后, 生成第二密钥更新消 息。
先获得新密钥的一端根据第二密钥更新消息确定对端获得了新密钥。 先获得新密钥的一端在接收到第二密钥更新消息后启动第一密钥切换过 程。具体的, 可以是在接收到所述第二密钥更新消息后的第三时间间隔时刻启 动第一密钥切换过程。 此时, 对端既可以同实施例三中一样, 在获得第一密钥 更新消息后的第二时间间隔时刻启动第一密钥切换过程,也可以发送所述第二 密钥更新消息后的第四时间间隔时刻启动第一密钥切换过程,还可以在发送第 二数据帧号的数据至先获得新密钥的一端时启动第一密钥切换过程。
其中,所述第三时间间隔和所述第四时间间隔不大于所述原密钥的剩余有 效期。
所述第二数据帧号由所述对端设置并通过所述第二密钥更新消息发送至 所述先获得新密钥的一端;所述第二数据帧号的设置大于所述对端的数据帧号 的当前值即在发送所述第二密钥更新消息前使用的数据帧号的最大值。
参见图 4, 先获得新密钥的一端通过对端发送的第二密钥更新消息确定对 端获得了新密钥时,先获得新密钥的一端和对端启动第一密钥切换过程的具体 实现方式, 在该方式中, 实体 A为先获得新密钥的一端:
其中, T0、 Til和 Τ12、 Τ4、 Τ5时刻实体 Α和实体 Β执行同图 3中一样 的操作。 除此之外, 在 T12时刻, 实体 Β根据接收到的第一密钥更新消息获 知新密钥 Keyl后, 构造第二密钥更新消息并发送至实体 Α, 已告知实体 A自 己获得了新密钥 Keyl。
T13时刻实体 A接收到第二密钥更新消息并据此确定实体 B获得了新密 钥 Keyl。
在距 T13时刻第三时间间隔的 T2时刻 (T13时刻与 T2时刻之间的时间 间隔为第三时间间隔), 实体 A启动第一密钥切换过程, 将新密钥 Keyl发送 方向设置为可用, 将原密钥 KeyO发送方向设置为不可用。 其中, T2时刻不大 于原密钥 KeyO的剩余有效期。
当然, 第三时间间隔可以为零, 此时实体 A在接收到第二密钥更新消息 的 T13时刻启动第一密钥切换过程。 对于实体 B来讲, 既可以同图 3中所示方法一样, 在距离 T12时刻第二 时间间隔的 T3时刻( T12时刻与 T3时刻之间的时间间隔为第二时间间隔)启 动第一密钥切换过程,也可以在发送第二数据帧号(第二数据帧号不小于发送 第二密钥更新消息时的数据帧号 )的数据至实体 A时启动第一密钥切换过程。 比如, 发送第二密钥更新消息时的数据帧号为 97, 第二数据帧号设置为 98, 那么实体 B在发送第二密钥更新消息后发送的第一个数据时启动第一密钥切 换过程。 其中, 该第二数据帧号通过第二密钥更新消息发送至实体八。
在本发明的优选实施例中,可设置通信链路上的任一端在获得新密钥前发 送密钥更新请求消息至对端, 以告知对端其本端还未获得新密钥,从而启动密 钥更新过程。这样,先获得新密钥的一端在获得新密钥时就会根据密钥请求更 新消息发送第一密钥更新消息至对端。
上述实施例中的第一密钥更新消息可以具有多种形式。
比如,第一密钥更新消息是先获得新密钥的一端利用双方的共享信息对新 密钥保护后生成的密文。对端利用双方的共享信息解保护后即可直接获得新密 钥。
如新密钥为 1时, 直接对 1保护生成密文, 那么对端解保护后就可直接得 到新密钥 1。
双方的共享信息可以是原密钥,也可以是双方共享的一个专门用于密钥更 新过程保护新密钥的密钥或者是双方的公私钥信息。
当使用双方的公私钥对新密钥进行保护和解保护时,先获得新密钥的一端 利用对端的公钥和自己的的私钥对新密钥进行保护;对端利用先获得新密钥的 一端的公钥和自己的私钥对收到的密钥进行解保护。
在具体实施时, 为保护密钥的前向安全, 一般在密钥更新过程中不使用原 密钥保护新密钥这种方式。
为避免第一密钥更新消息在传输过程中被截获从而导致新密钥泄露,在本 发明的一个优选实施例中,第一密钥更新消息还可以是先获得新密钥的一端利 用共享信息对第一参数保护后生成的密文,其中第一参数是先获得新密钥的一 端和对端用以计算新密钥的参数, 如第一通告主密钥。
具体应用时,在通信链路的各端约定密钥算法, 然后先获得新密钥的一端 根据约定的密钥算法和上述第一参数计算出新密钥。对端对新密钥信息解保护 后获得第一参数, 然后根据约定的密钥算法和上述第一参数计算出新密钥。
在该方式下, 即便第一密钥更新消息被他人获知,他人也无法直接得到对 应的新密钥。
在本发明的具体实施例中,第一密钥更新消息还可以是用于生成新密钥的 第二参数;双方利用第二参数以及双方的共享密钥通过约定的算法计算得到新 密钥。双方的共享密钥可以是原密钥,也可以是双方共享的一个用于密钥更新 过程的密钥。
在该方式下, 因为双方的共享密钥是其他人不知的,故第二参数虽然以明 文形式发送, 其他人因为不知道双方的共享密钥, 也无法计算得到新密钥。
当然, 在本发明的优选实施例中, 为提高安全性, 还可以对第二参数保护 后发送。
在本发明的具体实施例中, 上述第一参数或第二参数具有多种具体形式, 比如可以是从密码本中获取的数据, 当然基于更高安全性的考虑,还可以为先 获得新密钥的一端生成的第一随机数, 该端根据第一随机数生成新密钥, 并将 该第一随机数发送至对端, 对端据此计算获得新密钥。
为进一步体现双发协商产生新密钥,在本发明的优选实施例中,通信链路 的两端还可结合对端生成的随机数生成新密钥。
比如,新密钥信息为先获得新密钥的一端利用自身和所述对端的共享信息 对第三参数保护生成的密文; 所述第三参数为用于生成所述新密钥的参数。
则先获得新密钥的一端可以利用约定的密钥算法、所述第三参数以及所述 对端生成的第二随机数获得所述新密钥。
所述对端对所述新密钥信息解保护获得所述第三参数。
所述对端利用约定的密钥算法、所述第三参数以及自身生成的所述第二随 机数获得所述新密钥。
再比如,新密钥信息为第四参数; 所述第四参数为用于与所述先获得新密 钥的一端和所述对端的共享密钥一起计算得到所述新密钥的参数;
则先获得新密钥的一端利用约定的密钥算法、所述共享密钥、所述第四参 数以及所述对端生成的第三随机数获得所述新密钥。
所述对端利用约定的密钥算法、所述共享密钥、所述第四参数以及所述对 端生成的第三随机数获得所述新密钥。
其中,对端通过密钥更新请求消息发送第三随机数或第四随机数至先获得 新密钥的一端。
本发明中, 第三参数或第四参数具有多种具体形式, 比如可以是从密码本 中获取的数据,基于更高安全性的考虑,也可以是先获得新密钥的一端生成的 第四随机数。本发明上述实施例中的第二密钥更新消息是对端用于向先获得新 密钥的一端告知自己已经获得了新密钥的消息, 因此, 该消息中可不包括跟新 密钥相关的信息, 比如发送类似 "已获得新密钥"的告知消息。
当然,在本发明的优选实施例中, 为方便先获得新密钥的一端验证对端获 取的新密钥是否正确, 对端可在第二密钥更新消息中设置新密钥, 比如"已获 得新密钥 5", 这样先获得新密钥的一端就可以同时验证对端的新密钥是否正 确。
因为包括新密钥的相关信息, 为避免在传输过程中被截获, 第二密钥更新 消息可以携带对端利用与先获得新密钥的一端的共享信息对新密钥加密生成 的密文,当然也可以携带对端利用与先获得新密钥的一端的共享信息对从第一 密钥更新消息中接收的第一参数加密生成的密文。
需要说明的是, 在本发明的具体实施方式中, 均是以实体 A为先获得新 密钥的一端, 以实体 B 为对端为例进行说明的, 容易理解的, 在实际的应用 中, 当实体 B先获得新密钥时, 实体 B执行上述示例中实体 A的操作, 实体
A执行上述示例中实体 B的操作即可。
在任一端执行完第一密钥切换和第二密钥切换后,新密钥就成为了该端的 当前密钥,但此时该端同时保存了原密钥和新密钥, 为避免在后续再次更新的 时候无法准确确定当前密钥,在本发明的优选实施例中, 可在第一密钥切换和 第二密钥切换后将新密钥和原密钥进行适当处理, 以对新旧密钥进行区分。 具 体处理方法有如下几种:
任一端在启动密钥切换过程后, 可将新密钥存储在当前密钥的固定存储 区。 这样在进行下次更新时, 可直接根据存储位置确定当前密钥。 或者, 任一端在启动密钥切换过程后, 可直接删除原密钥, 这样就只保存 了一个密钥, 不必进行区分。
再或者,任一端将指示当前密钥的标识指向新密钥。这样根据标识就可直 接确定当前密钥。
对应上述方法,本发明实施例五还提供了一种用于实现上述双向密钥切换 的装置。
参见图 5 , 该装置具体包括:
第一密钥获得单元 11 , 用于获得新密钥。
本发明中的密钥是指用以对发送的数据进行保护即加密或计算完整性校 验, 对接收的数据进行解保护即解密或验证完整性校验的密钥。
因为是双向密钥,所以本发明中通信链路中的任一端用于对发送的数据进 行保护的密钥和对接收的数据进行解保护的密钥是相同的。 比如,假设通信双 方为实体 A和实体 B, 如果实体 A用于对发送到实体 B的数据进行保护的密钥为 1 , 那么实体 A对从实体 B接收到的数据进行解保护的密钥也是 1。
第一密钥更新单元 12, 用于在获得新密钥后, 且在推定或确定至少 n个 对端获得了所述新密钥前,设置新密钥发送方向不可用并设置新密钥接收方向 可用, 以及保持原密钥发送方向可用并保持原密钥接收方向可用; 以便对端在 推定或确定所述第一密钥获得单元获得了所述新密钥后,原密钥失效前启动第 一密钥切换过程,将所述原密钥发送方向设置为不可用并将所述新密钥发送方 向设置为可用。
本发明中密钥发送方向可用是指可利用此密钥对数据加保护,密钥发送方 向不可用是指不能利用此密钥对数据加保护;密钥接收方向可用是指可利用此 密钥对数据解保护, 密钥接收方向不可用是指不能利用此密钥对数据解保护。
对通信链路的任一端来说,在获得新密钥时,对端有可能还未获得新密钥, 若第一密钥更新单元 12直接设置该端新密钥发送方向可用, 那么对端有可能 无法对新密钥保护的通信数据包进行解保护。 因此, 本发明中, 在第一密钥获 得单元 11获得新密钥后,第一密钥更新单元 12先设置新密钥发送方向不可用。 此时在有数据需要发送给对端时, 该装置的保护单元 14仍会用原密钥保护要 发送的数据。
第一密钥切换单元 13 , 用于获得所述新密钥后, 在推定或确定至少 n个 所述对端获得了所述新密钥后,且在原密钥失效前启动第一密钥切换过程,即, 将所述原密钥发送方向设置为不可用并将所述新密钥发送方向设置为可用;其 中, N≥n≥l , 其中 N为所述发送方对应的接收方的总数量。 所述对端在获得 所述新密钥时设置新密钥发送方向不可用并设置新密钥接收方向可用,并根据 接收的数据的保护标识选择有效的密钥进行解保护。
对端在获得新密钥后会设置新密钥接收方向可用,即可以用新密钥解保护 接收的数据, 因此, 第一密钥切换单元 13 , 在推定或确定所述对端获得了所 述新密钥后, 就推定或确定了对端可用新密钥解保护, 因此, 可以启动第一密 钥切换过程, 此时, 该装置的保护单元 14会用新密钥保护要发送的数据。
密钥的使用具有一定的期限, 因此, 第一密钥切换单元 13还需在原密钥 失效前启动第一密钥切换过程。 钥进行解保护。
在设置了新密钥接收方向可用后, 解保护单元 15处的新密钥和原密钥均 可用, 此时需要根据接收的数据的保护标识选择有效的密钥解保护。 具体的, 当保护标识表示数据是用原密钥保护的时, 选择原密钥解保护。 当保护标识表 示数据是用新密钥保护的时, 选择新密钥解保护。
在启动第二密钥切换过程后, 原密钥接收方向不可同, 此时, 解保护单元 选择新密钥解保护。
第二密钥切换单元 16, 用于在第一次用所述新密钥成功解保护后启动第 二密钥切换过程, 即, 将原密钥接收方向设置为不可用。
第一次用新密钥成功解保护表明对端已经进行了密钥切换, 此时, 第二密 钥切换单元 16可在第一次用新密钥成功解保护后进行密钥切换, 即设置原密 钥接收方向不可用。
通信的过程中常会出现丟包的情况, 因此, 第一次用新密钥成功解保护的 通信数据包不一定是对端发送的第一个用新密钥保护的数据包。 在通信网络中,存在单播和多播两种通信方式。其中单播是指单一实体发 送通信数据至单一实体。 多播是指单一实体发送通信数据至至少两个实体。
其中,在多播的情况下,用于接收数据的多个实体不一定同时获得新密钥, 为保证上述的多个实体都能正确解保护,在本发明的优选实施例中, 第一密钥 切换单元 13 , 用于在推定或确定所有的对端获得新密钥后启动第一密钥切换 过程。
本发明中, 第一密钥获得单元可能先于对端获得新密钥,也可能后于对端 获得新密钥。 当先于对端获得新密钥时, 用以在推定或确定对端获得新密钥时 启动密钥切换的装置有多种具体形式。
本发明实施例六提供了用于在先获得新密钥时推定对端获得新密钥后,启 动第一密钥切换过程的以下几种装置:
装置一
第一密钥更新消息发送单元, 用于在先于对端获得新密钥时,发送第一密 钥更新消息至对端。 该第一密钥更新消息中包括新密钥信息。 此时, 对端可根 据第一密钥更新消息中的新密钥信息获得新密钥。
所述第一密钥切换单元,具体用于在发送第一密钥更新消息后的第一时间 间隔时刻启动第一密钥切换过程。其中, 第一时间间隔大于第一密钥更新消息 的传输延迟。
数据的传输需要一定的时间。 考虑到数据传输因为受到传输距离、传输带 宽等因素的影响会出现传输延迟,现有技术确定了数据传输的延迟时间。 当大 于这一延迟时, 认为数据已经传输至对端。 因此, 本发明中, 当时间大于第一 密钥更新消息到达对端延迟时, 可以推定对端获得了此消息,从而推定对端获 得了新密钥。
装置二
第一密钥更新消息发送单元, 用于在先于对端获得新密钥时,发送第一密 钥更新消息至对端。 该第一密钥更新消息中包括新密钥信息。 此时, 对端可根 据第一密钥更新消息中的新密钥信息获得新密钥。
所述第一密钥切换单元,具体用于设置第一数据帧号并在发送序列号为第 一数据帧号的数据至所述对端的时刻启动第一密钥切换过程。
其中,第一数据帧号大于在发送所述第一密钥更新消息前所使用过的最大 数据帧号,发送第一数据帧号的数据的时刻与发送第一密钥更新消息的时刻的 时间间隔大于第一密钥更新消息到达对端的传输延迟。
在通信中,数据是按照帧格式传输的,数据帧号用以表示传输的数据所在 帧的顺序。设置第一数据帧号大于发送所述第一密钥更新消息前所使用过的最 大数据帧号,发送第一数据帧号的数据的时刻与发送第一密钥更新消息的时刻 的时间间隔大于第一密钥更新消息到达对端的传输延迟。则可以推定在第一数 据帧号的数据被发送至对端时, 对端已根据第一密钥更新消息获得了新密钥。
本发明中在先获得新密钥并在确定对端获得新密钥时启动密钥切换的装 置也有多种。 常用的装置如下:
所述第一密钥切换单元,具体用于在接收到第二密钥更新消息后的第二时 间间隔时刻启动第一密钥切换过程。其中, 所述第二密钥更新消息是所述对端 在根据所述第一密钥更新消息获得所述新密钥后返回的。 其中, 第二时间间隔 不大于所述原密钥的剩余有效期。
在本发明的优选实施例中, 对端在获得新密钥前会发送密钥更新请求消 息。此时第一密钥更新消息发送单元, 具体用于根据密钥更新请求消息发送所 述第一密钥更新消息至所述对端。
为保证发送到对端的第一密钥更新消息中的新密钥信息的安全性,在本发 明的具体实施例中, 该装置还包括新密钥单元, 用于利用与所述对端的共享信 息对所述新密钥保护生成所述新密钥信息。
比如, 新密钥为 1时, 直接对 1保护生成第一新密钥信息, 那么对端利用 共享信息解保护新密钥信息后就可直接得到新密钥 1.
或者, 为避免第一密钥更新消息在传输过程中被截获从而导致新密钥泄 露, 在本发明的一个优选实施例中, 该装置可以是还包括第一参数单元, 用于 利用与所述对端的共享信息对第一参数保护生成新密钥信息, 其中, 第一参数 为用于生成所述新密钥的参数, 比如第一通告主密钥 NMK。 此时, 第一密钥 获得单元, 具体用于利用约定的密钥算法和所述第一参数获得所述新密钥。 又或者, 新密钥信息为第二参数, 其中, 所述第二参数为用于与所述对端 的共享密钥一起计算得到所述新密钥的参数。 此时, 第一密钥获得单元, 具体 用于当所述新密钥信息为第二参数时, 利用约定的密钥算法、所述第二参数和 所述共享密钥获得所述新密钥。
其中, 上述第一参数或第二参数具有多种具体形式, 比如可以是从密码本 中获取的数据, 当然基于更高安全性的考虑,还可以是该装置的第一随机数单 元生成的第一随机数。
上述共享信息可以是双方共享的原密钥、一个专门用于密钥更新过程保护 新密钥的密钥或者是双方的公私钥信息。
当使用双方的公私钥对新密钥进行保护和解保护时,利用对端的公钥和自 己的私钥对新密钥进行保护。此时对端利用另一端的公钥和自己的私钥对收到 的密钥进行解保护。
在具体实施时, 为保护密钥的前向安全, 一般在密钥更新过程中不使用原 密钥保护新密钥的方式。
为进一步体现双发协商产生新密钥,在本发明的优选实施例中, 双方还可 结合对端生成的随机数生成新密钥。
具体的, 所述装置还包括第三参数单元, 用于利用与所述对端的共享信息 对第三参数保护生成所述新密钥信息, 其中, 所述第三参数为用于生成所述新 密钥的参数。 此时, 所述第一密钥获得单元, 具体用于利用约定的密钥算法、 所述第三参数以及所述对端生成的第二随机数获得所述新密钥;
或,
所述第一密钥获得单元,具体用于当所述新密钥信息为第四参数时, 利用 约定的密钥算法、所述第四参数、与所述对端的共享密钥以及所述对端生成的 第三随机数获得所述新密钥, 其中, 所述第四参数为用于与所述对端的共享密 钥一起计算得到所述新密钥的参数。
其中,所述第二随机数或所述第三随机数由所述对端生成并包括在所述密 钥更新请求消息中。
本发明的具体实施例中, 第三参数、 第四参数具有多种具体形式, 比如可 以是从密码本中获得的数据, 当然, 基于更高安全性的考虑, 也可以是该装置 的第四随机数单元生成的第四随机数。
上述装置中提到的第二密钥更新消息是对端用于告知其已经获得了新密 钥的消息, 因此, 该消息中可不包括跟新密钥相关的信息, 比如发送类似 "已 获得新密钥 "的告知消息。
当然,在本发明的优选实施例中,为方便验证对端获取的新密钥是否正确, 对端可在第二密钥更新消息中设置新密钥, 比如"已获得新密钥 5", 这样就可 以同时验证对端的新密钥是否正确。 因为包括新密钥, 为避免在传输过程中被 截获, 对端可利用双方的共享信息对第二密钥更新消息中的新密钥进行保护。 例如, 第二密钥更新消息可以携带对端利用共享信息对新密钥保护生成的密 文,也可以携带对端利用共享信息对从第一密钥更新消息中接收的相关参数保 护生成的密文。
在进行密钥切换后,新密钥就成为了当前密钥,但此时装置中同时保存了 原密钥和新密钥, 为避免在后续再次更新的时候无法准确确定当前密钥,在本 发明的优选实施例中, 可在密钥切换后将新密钥和原密钥进行适当处理, 以对 新旧密钥进行区分。 对应的, 所述装置还包括:
当前密钥存储单元或原密钥删除单元或当前密钥标识单元;
所述当前密钥存储单元,用于在启动第一密钥切换过程和第二密钥切换过 程后, 将所述新密钥存储在当前密钥的固定存储区;
所述原密钥删除单元,用于在启动第一密钥切换过程和第二密钥切换过程 后, 删除原密钥;
所述当前密钥标识单元,用于在启动第一密钥切换过程和第二密钥切换过 程后, 将指示当前密钥的标识指向所述新密钥。
对应上述方法, 本发明实施例七还提供了一种用于双向密钥切换的装置, 参见图 6, 该装置包括:
第二密钥获得单元 21 , 用于根据对端在先获得新密钥时发送的第一密钥 更新消息获得所述新密钥; 所述第一密钥更新消息包括新密钥信息。
第二密钥更新单元 22, 用于在获得所述新密钥时, 设置新密钥发送方向 不可用并设置新密钥接收方向可用,以及保持原密钥发送方向可用并保持原密 钥接收方向可用;以便所述对端在推定或确定所述第二密钥获得单元获得了所 述新密钥后,原密钥失效前启动第一密钥切换过程,将所述原密钥发送方向设 置为不可用并将所述新密钥发送方向设置为可用。此时在有数据需要发送给对 端时, 该装置的保护单元 24仍会用原密钥保护要发送的数据。
第三密钥切换单元 23 , 用于在根据所述第一密钥更新消息获得所述新密 钥后的第二时间间隔时刻启动第一密钥切换过程,将所述原密钥发送方向设置 为不可用并将所述新密钥发送方向设置为可用;以便所述对端在第一次用所述 新密钥成功解保护接收的数据后启动第二密钥切换过程,将原密钥接收方向设 置为不可用; 其中, 所述对端在获得所述新密钥时设置新密钥发送方向不可用 并设置新密钥接收方向可用,并根据接收的数据的保护标识选择有效的密钥进 行解保护。 此时在有数据需要发送给对端时, 该装置的保护单元 24会用新密 钥保护要发送的数据。
其中, 所述第二时间间隔不大于所述原密钥的剩余有效期。
需要说明的是, 当该第二时间间隔为零时,对端在根据第一密钥更新消息 获得新密钥后直接启动第一密钥切换过程, 此时,对端无需执行设置新密钥发 送方向不可用的操作。 进行解保护。
第四密钥切换单元 26, 用于在第一次用所述新密钥成功解保护后启动第 二密钥切换过程, 即, 将原密钥接收方向设置为不可用。
在本发明的优选实施例中,为告知先获得新密钥的一端第二密钥获得单元 已经获得新密钥的消息, 所述装置还包括:
第二密钥更新消息发送单元,用于在根据所述第一密钥更新消息获得所述 新密钥后发送第二密钥更新消息至所述对端;以便所述对端根据第二密钥更新 消息确定所述第二密钥获得单元获得了所述新密钥。
此时, 第三密钥切换单元, 具体用于在发送所述第二密钥更新消息后的第 三时间间隔时刻启动第一密钥切换过程; 或,用于设置第二数据帧号并在发送 第二数据帧号的数据至所述对端的时刻启动第一密钥切换过程。
其中, 所述第三时间间隔不大于所述原密钥的剩余有效期。
所述第二数据帧号包括在所述第二密钥更新消息中;所述第二数据帧号的 设置大于在发送所述第二密钥更新消息前使用的最大数据帧号。
在本发明的另一优选实施例中, 该装置还包括:
密钥更新请求消息发送单元,用于在获得新密钥前发送密钥更新请求消息 至所述对端;以便所述对端在先获得新密钥时根据所述密钥更新请求消息发送 所述第一密钥更新消息。
针对第一密钥更新消息中新密钥信息的形式不同,第二密钥获得单元获得 新密钥的方式也不相同。
比如,当所述新密钥信息为所述对端利用与通信链路另一端的共享信息对 所述新密钥保护后的密文时, 所述第二密钥获得单元, 具体用于利用共享信息 对所述新密钥信息解保护后获得所述新密钥。
再比如,当所述新密钥信息为所述对端利用与通信链路另一端的共享信息 对第一参数保护后的密文时, 所述第二密钥获得单元, 具体用于对所述新密钥 信息解保护获得所述第一参数并利用约定的密钥算法和所述第一参数获得所 述新密钥; 所述第一参数为用于生成所述新密钥的参数, 如第一通告主密钥 NMK等。
还比如, 当所述新密钥信息为第二参数时, 所述第二密钥获得单元, 具体 用于利用约定的密钥算法、所述第二参数和与通信链路另一端的共享密钥获得 所述新密钥; 所述第二参数为用于与共享密钥一起计算得到所述新密钥的参 数。
在本发明的具体实施例中, 上述第一参数或第二参数具有多种具体形式, 比如可以是从密码本中获得的数据,基于更高安全性的考虑,也可以为对端生 成的第一随机数。
为进一步体现双发协商产生新密钥,在本发明的优选实施例中, 双方还可 结合该装置生成的随机数生成新密钥。
具体的, 所述装置还包括: 第二随机数单元, 用于生成第二随机数; 所述第二密钥获得单元,具体用于当所述新密钥信息为所述对端利用与通 信链路另一端的共享信息对第三参数保护后的密文时,对所述新密钥信息解保 护获得所述第三参数并利用约定的密钥算法、所述第三参数以及所述第二随机 数获得所述新密钥; 所述第三参数为用于生成所述新密钥的参数;
或,
所述装置还包括第三随机数单元, 用于生成所述第三随机数;
所述第二密钥获得单元, 具体用于当所述新密钥信息为第四参数时, 利用 约定的密钥算法、所述第四参数、与通信链路另一端的共享密钥以及所述第三 随机数获得所述新密钥;所述第四参数为用于与通信链路另一端的共享密钥一 起计算得到所述新密钥的参数。
其中, 所述第三参数或所述第四参数具有多种具体形式, 比如可以是从密 码本中获得的数据,基于更高安全性的考虑也可以是所述对端生成的第四随机 数。 所述第二随机数、 所述第三随机数包括在所述密钥更新请求消息中。 值得 注意的是, 本发明的方法与本发明的装置相对应, 因此对装置部分不再详述, 相关部分参见方法实施例即可。 以上对本发明实施例进行了详细介绍, 本文中 应用了具体实施方式对本发明进行了阐述,以上实施例的说明只是用于帮助理 解本发明的装置及方法; 同时, 对于本领域的一般技术人员, 依据本发明的思 想, 在具体实施方式及应用范围上均会有改变之处, 综上所述, 本说明书内容 不应理解为对本发明的限制。

Claims

权 利 要 求
1、 一种双向密钥的切换方法, 其特征在于, 所述方法包括:
通信链路中的任一端在获得新密钥后,且在推定或确定至少 n个对端获得 了所述新密钥前,设置新密钥发送方向不可用并设置新密钥接收方向可用, 以 及保持原密钥发送方向可用并保持原密钥接收方向可用;
在获得所述新密钥后,所述任一端在推定或确定至少 n个对端获得了所述 新密钥后,且在原密钥失效前启动第一密钥切换过程, 所述第一密钥切换过程 为: 将所述原密钥发送方向设置为不可用并将所述新密钥发送方向设置为可 用, 其中, N≥n≥l , 其中 N为所述发送方对应的接收方的总数量;
所述任一端根据所述对端发送数据的保护标识选择有效的密钥进行解保 护;
所述任一端在第一次用所述新密钥成功解保护所述对端发送的数据后启 动第二密钥切换过程, 所述第二密钥切换过程为: 将原密钥接收方向设置为不 可用。
2、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括: 先获得所述新密钥的一端发送第一密钥更新消息至所述对端,所述第一密 钥更新消息包括新密钥信息;
则所述对端获得新密钥具体为:
所述对端 ^据所述第一密钥更新消息获得所述新密钥。
3、 根据权利要求 2所述的方法, 其特征在于,
所述任一端在推定或确定至少 n个对端获得了所述新密钥后,且在原密钥 失效前启动第一密钥切换过程具体为:
所述先获得所述新密钥的一端在发送第一密钥更新消息后的第一时间间 隔时刻启动第一密钥切换过程;
所述对端在根据所述第一密钥更新消息获得所述新密钥后的第二时间间 隔时刻启动第一密钥切换过程;
或, 所述任一端在推定或确定至少 n个对端获得了所述新密钥后,且在原密钥 失效前启动第一密钥切换过程具体为:
所述先获得所述新密钥的一端在发送第一数据帧号的数据至所述对端的 时刻启动第一密钥切换过程;
所述对端在根据所述第一密钥更新消息获得所述新密钥后的第二时间间 隔时刻启动第一密钥切换过程;
其中, 所述第一时间间隔大于所述第一密钥更新消息的传输延迟; 所述第一数据帧号由所述先获得新密钥的一端设置且大于所述先获得新 密钥的一端在发送所述第一密钥更新消息前所使用的数据帧号的最大值,发送 第一数据帧号的数据的时刻与发送第一密钥更新消息的时刻之间的时间间隔 要大于第一密钥更新消息的传输延迟;
所述第二时间间隔不大于所述原密钥的剩余有效期。
4、 根据权利要求 2所述的方法, 其特征在于, 所述方法还包括: 所述对端在根据所述第一密钥更新消息获得所述新密钥后,发送第二密钥 更新消息至所述先获得所述新密钥的一端;
则所述任一端在推定或确定至少 n个对端获得了所述新密钥后,且在原密 钥失效前启动第一密钥切换过程具体为:
所述先获得所述新密钥的一端在接收到所述第二密钥更新消息后的第三 时间间隔时刻启动第一密钥切换过程;
所述对端在发送所述第二密钥更新消息后的第四时间间隔时刻启动第一 密钥切换过程;
或,
所述任一端在推定或确定至少 n个对端获得了所述新密钥后,且在原密钥 失效前启动第一密钥切换过程具体为:
所述先获得所述新密钥的一端在接收到所述第二密钥更新消息后的第三 时间间隔时刻启动第一密钥切换过程;
所述对端在发送第二数据帧号的数据至所述先获得所述新密钥的一端的 时刻启动第一密钥切换过程;
其中,所述第三时间间隔和所述第四时间间隔都不大于所述原密钥的剩余 有效期;
所述第二数据帧号由所述对端设置并通过所述第二密钥更新消息发送至 所述先获得新密钥的一端,所述第二数据帧号的设置大于所述对端在发送所述 第二密钥更新消息前所使用的数据帧号的最大值。
5、 根据权利要求 2所述的方法, 其特征在于, 所述方法还包括: 所述任一端在获得所述新密钥前发送密钥更新请求消息至所述对端; 则所述先获得所述新密钥的一端发送第一密钥更新消息至所述对端具体 为:
所述先获得所述新密钥的一端在获得所述新密钥时根据所述密钥更新请 求消息发送所述第一密钥更新消息至所述对端。
6、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括: 所述任一端在启动第一密钥切换过程和第二密钥切换过程后,所述任一端 将新密钥存储在当前密钥的固定存储区或删除原密钥或将指示当前密钥的标 识指向所述新密钥。
7、 一种用于实现双向密钥切换的装置, 其特征在于, 所述装置包括: 第一密钥获得单元, 用于获得新密钥;
第一密钥更新单元, 用于在获得新密钥后,且在推定或确定至少 n个对端 获得了所述新密钥前, 设置新密钥发送方向不可用并设置新密钥接收方向可 用, 以及保持原密钥发送方向可用并保持原密钥接收方向可用; 第一密钥切换 单元, 用于获得所述新密钥后,在推定或确定至少 n个所述对端获得了所述新 密钥后,且在原密钥失效前启动第一密钥切换过程,所述第一密钥切换过程为: 将所述原密钥发送方向设置为不可用并将所述新密钥发送方向设置为可用,其 中, N≥n≥l , 其中 N为所述发送方对应的接收方的总数量;
保护单元,用于在设置新密钥发送方向不可用并保持原密钥发送方向可用 后, 利用原密钥保护发送至所述对端的数据,在设置原密钥发送方向不可用并 设置新密钥发送方向可用后, 利用所述新密钥保护发送至所述对端的数据; 解保护;
第二密钥切换单元,用于在第一次用所述新密钥成功解保护后启动第二密 钥切换过程, 所述第二密钥切换过程为: 将原密钥接收方向设置为不可用。
8、 根据权利要求 7所述的装置, 其特征在于, 所述装置还包括: 第一密钥更新消息发送单元, 用于在先于所述对端获得所述新密钥时,发 送第一密钥更新消息至所述对端,以便所述对端根据所述第一密钥更新消息获 得所述新密钥, 所述第一密钥更新消息包括新密钥信息。
9、 根据权利要求 8所述的装置, 其特征在于,
所述第一密钥切换单元,具体用于在所述第一密钥更新消息发送单元发送 第一密钥更新消息后的第一时间间隔时刻启动第一密钥切换过程; 或,
所述第一密钥切换单元,具体用于设置第一数据帧号并在所述第一密钥更 新消息发送单元发送第一数据帧号的数据至所述对端的时刻启动第一密钥切 换过程; 其中, 所述第一时间间隔大于所述第一密钥更新消息的传输延迟, 所 述第一数据帧号大于发送所述第一密钥更新消息前所使用的数据帧号的最大 值,发送第一数据帧号的数据的时刻与发送第一密钥更新消息的时刻之间的时 间间隔要大于第一密钥更新消息的传输延迟。
10、 根据权利要求 8所述的装置, 其特征在于, 第一密钥切换单元, 具体 用于在接收到第二密钥更新消息后的第二时间间隔时刻启动第一密钥切换过 程, 其中, 所述第二密钥更新消息是所述对端在根据所述第一密钥更新消息获 得所述新密钥后返回的;
其中, 所述第二时间间隔不大于所述原密钥的剩余有效期。
11、 根据权利要求 8所述的装置, 其特征在于, 所述第一密钥更新消息发 送单元,具体用于根据密钥更新请求消息发送所述第一密钥更新消息至所述对 端; 其中, 所述密钥更新请求消息是所述对端在获得所述新密钥前发送的。
12、 根据权利要求 7所述的装置, 其特征在于, 所述装置还包括: 当前密钥存储单元、 原密钥删除单元和当前密钥标识单元中的任意一个, 其中,
所述当前密钥存储单元,用于在启动第一密钥切换过程和第二密钥切换过 程后, 将所述新密钥存储在当前密钥的固定存储区;
所述原密钥删除单元,用于在启动第一密钥切换过程和第二密钥切换过程 后, 删除原密钥;
所述当前密钥标识单元,用于在启动第一密钥切换过程和第二密钥切换过 程后, 将指示当前密钥的标识指向所述新密钥。
13、 一种用于实现双向密钥切换的装置, 其特征在于, 所述装置包括: 第二密钥获得单元,用于根据对端在先获得新密钥时发送的第一密钥更新 消息获得所述新密钥, 所述第一密钥更新消息包括新密钥信息;
第二密钥更新单元, 用于在获得所述新密钥时,设置新密钥发送方向不可 用并设置新密钥接收方向可用,以及保持原密钥发送方向可用并保持原密钥接 收方向可用; 第三密钥切换单元, 用于在根据所述第一密钥更新消息获得所述 新密钥后的第二时间间隔时刻启动第一密钥切换过程,所述第一密钥切换过程 为: 将所述原密钥发送方向设置为不可用并将所述新密钥发送方向设置为可 用;
保护单元,用于在设置新密钥发送方向不可用并保持原密钥发送方向可用 后, 利用原密钥保护发送至所述对端的数据,在设置原密钥发送方向不可用并 设置新密钥发送方向可用后, 利用所述新密钥保护发送至所述对端的数据; 解保护;
第四密钥切换单元,用于在第一次用所述新密钥成功解保护后启动第二密 钥切换过程, 所述第二密钥切换过程为: 将原密钥接收方向设置为不可用; 其中, 所述第二时间间隔不大于所述原密钥的剩余有效期。
14、 根据权利要求 13所述的装置, 其特征在于, 所述装置还包括: 第二密钥更新消息发送单元,用于在根据所述第一密钥更新消息获得所述 新密钥后发送第二密钥更新消息至所述先获得新密钥的一端;则所述第三密钥 切换单元,具体用于在发送所述第二密钥更新消息后的第三时间间隔时刻启动 第一密钥切换过程;
或, 所述第三密钥切换单元, 具体用于设置第二数据帧号并在发送第二数 据帧号的数据至所述对端的时刻启动第一密钥切换过程;
其中, 所述第三时间间隔不大于所述原密钥的剩余有效期;
所述第二数据帧号大于在发送所述第二密钥更新消息前所使用的数据帧 号的最大值。
15、 根据权利要求 13所述的装置, 其特征在于, 所述装置还包括: 密钥更新请求消息发送单元,用于在获得新密钥前发送密钥更新请求消息 至所述对端,以便所述对端在先获得新密钥时根据所述密钥更新请求消息发送 所述第一密钥更新消息。
PCT/CN2013/081157 2012-08-13 2013-08-09 一种双向密钥的切换方法及实现装置 WO2014026570A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020157006242A KR101816371B1 (ko) 2012-08-13 2013-08-09 양방향 키 전환 방법 및 구현 기기
US14/420,342 US10263771B2 (en) 2012-08-13 2013-08-09 Two-way key switching method and implementation device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210286523.8 2012-08-13
CN201210286523.8A CN103595527B (zh) 2012-08-13 2012-08-13 一种双向密钥的切换方法及实现装置

Publications (1)

Publication Number Publication Date
WO2014026570A1 true WO2014026570A1 (zh) 2014-02-20

Family

ID=50085521

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/081157 WO2014026570A1 (zh) 2012-08-13 2013-08-09 一种双向密钥的切换方法及实现装置

Country Status (4)

Country Link
US (1) US10263771B2 (zh)
KR (1) KR101816371B1 (zh)
CN (1) CN103595527B (zh)
WO (1) WO2014026570A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106936794B (zh) * 2015-12-30 2021-01-08 阿里巴巴集团控股有限公司 一种用于更改秘钥的方法、装置及设置秘钥的方法、装置
CN107483186A (zh) * 2017-08-01 2017-12-15 南京东屋电气有限公司 密钥更新方法、装置及存储介质
CN111866872B (zh) * 2019-04-29 2023-06-02 华为技术有限公司 一种通信方法及装置
CN110690967B (zh) * 2019-12-11 2021-03-02 杭州字节信息技术有限公司 一种不依赖于服务端安全的即时通信密钥确立方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030849A (zh) * 2006-03-01 2007-09-05 华为技术有限公司 多基站间实现组播密钥同步的方法及***
CN101197663A (zh) * 2008-01-03 2008-06-11 中兴通讯股份有限公司 一种吉比特无源光网络加密业务的保护方法
US7526092B2 (en) * 2002-03-08 2009-04-28 Atheros Communications, Inc. Rekey operation with multiplexing capability
CN101466020A (zh) * 2007-12-17 2009-06-24 上海爱信诺航芯电子科技有限公司 一种数字内容格式的解密处理方法
CN102104870A (zh) * 2009-12-21 2011-06-22 英特尔公司 用于高吞吐量无线通信的在减少分组丢失情况下进行密钥重置的无线设备和方法

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7418596B1 (en) * 2002-03-26 2008-08-26 Cellco Partnership Secure, efficient, and mutually authenticated cryptographic key distribution
US8195940B2 (en) * 2002-04-05 2012-06-05 Qualcomm Incorporated Key updates in a mobile wireless system
CN100440775C (zh) * 2002-10-31 2008-12-03 华为技术有限公司 一种加密通讯方法和装置
US7990998B2 (en) * 2004-12-22 2011-08-02 Qualcomm Incorporated Connection setup using flexible protocol configuration
US20080263647A1 (en) * 2006-07-21 2008-10-23 General Electric Company System and Method For Providing Network Device Authentication
CN101488854B (zh) * 2008-01-18 2011-11-09 华为技术有限公司 一种无线射频识别***认证方法和设备
CN100581169C (zh) * 2008-08-21 2010-01-13 西安西电捷通无线网络通信有限公司 一种基于单播会话密钥的组播密钥分发方法及其更新方法
CN101958898B (zh) * 2010-09-28 2013-10-30 中国科学院研究生院 一种移动WiMAX网络中EAP认证快速切换方法
US8781132B2 (en) * 2012-03-19 2014-07-15 Motorola Solutions, Inc. Method and device for managing encrypted group rekeying in a radio network link layer encryption system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7526092B2 (en) * 2002-03-08 2009-04-28 Atheros Communications, Inc. Rekey operation with multiplexing capability
CN101030849A (zh) * 2006-03-01 2007-09-05 华为技术有限公司 多基站间实现组播密钥同步的方法及***
CN101466020A (zh) * 2007-12-17 2009-06-24 上海爱信诺航芯电子科技有限公司 一种数字内容格式的解密处理方法
CN101197663A (zh) * 2008-01-03 2008-06-11 中兴通讯股份有限公司 一种吉比特无源光网络加密业务的保护方法
CN102104870A (zh) * 2009-12-21 2011-06-22 英特尔公司 用于高吞吐量无线通信的在减少分组丢失情况下进行密钥重置的无线设备和方法

Also Published As

Publication number Publication date
US20150222427A1 (en) 2015-08-06
KR101816371B1 (ko) 2018-01-08
US10263771B2 (en) 2019-04-16
CN103595527A (zh) 2014-02-19
CN103595527B (zh) 2016-12-21
KR20150042262A (ko) 2015-04-20

Similar Documents

Publication Publication Date Title
KR101019300B1 (ko) 애드 혹 무선 네트워크에서 인증 키 요소의 보안 처리를 위한 방법 및 시스템
US7526092B2 (en) Rekey operation with multiplexing capability
US7760885B2 (en) Method of distributing encryption keys among nodes in mobile ad hoc network and network device using the same
US20100091993A1 (en) Wireless communication device and encryption key updating method
KR20090051268A (ko) 애드 혹 무선 네트워크의 노드들 간의 보안 연계 확립 방법 및 장치
CN101309503A (zh) 无线切换方法、基站及终端
WO2011041962A1 (zh) 一种支持合法监听的端到端会话密钥协商方法和***
WO2014026523A1 (zh) 一种单向密钥的切换方法及实现装置
WO2007121669A1 (fr) Procédé, dispositif et système pour établir une connexion hertzienne
WO2006136090A1 (fr) Procede permettant d'empecher une attaque de repetition et procede permettant d'assurer la non repetition de numero de sequence de message
KR101421259B1 (ko) 스위치 장비들 사이에서 보안 연결을 확립하는 방법 및 시스템
WO2014026570A1 (zh) 一种双向密钥的切换方法及实现装置
WO2007000100A1 (fr) Procédé d’identification de message de gestion d’exécution inversée
JP2007110487A (ja) Lanシステムおよびその通信方法
WO2013083082A1 (zh) 一种通信方法、装置
WO2009109133A1 (zh) 恢复连接的方法和装置
WO2017032298A1 (zh) 密钥分发和接收方法、密钥管理中心、第一和第二网元
WO2011134293A1 (zh) 一种局域网节点间安全连接建立方法及***
JP2023015282A (ja) 第2の通信装置
WO2018126783A1 (zh) 一种密钥传输方法及装置、计算机存储介质
WO2011134291A1 (zh) 一种节点间密钥的建立方法、***及装置
KR20100092371A (ko) 트래픽 카운트 키 및 키 카운트 관리 방법 및 장치
WO2010094185A1 (zh) 安全切换方法及***
WO2012072053A1 (zh) 非确认模式下的上行加密参数同步方法和设备
WO2011134292A1 (zh) 一种节点间通信密钥的建立方法、***及装置

Legal Events

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

Ref document number: 13829269

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14420342

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20157006242

Country of ref document: KR

Kind code of ref document: A

122 Ep: pct application non-entry in european phase

Ref document number: 13829269

Country of ref document: EP

Kind code of ref document: A1