WO2011017847A1 - 交换密钥的方法及设备 - Google Patents

交换密钥的方法及设备 Download PDF

Info

Publication number
WO2011017847A1
WO2011017847A1 PCT/CN2009/073263 CN2009073263W WO2011017847A1 WO 2011017847 A1 WO2011017847 A1 WO 2011017847A1 CN 2009073263 W CN2009073263 W CN 2009073263W WO 2011017847 A1 WO2011017847 A1 WO 2011017847A1
Authority
WO
WIPO (PCT)
Prior art keywords
random number
key
onu
unit
password
Prior art date
Application number
PCT/CN2009/073263
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 PCT/CN2009/073263 priority Critical patent/WO2011017847A1/zh
Priority to CN200980154790.6A priority patent/CN102239661B/zh
Publication of WO2011017847A1 publication Critical patent/WO2011017847A1/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/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
    • H04L9/0841Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these involving Diffie-Hellman or related key agreement protocols
    • H04L9/0844Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these involving Diffie-Hellman or related key agreement protocols with user authentication or key authentication, e.g. ElGamal, MTI, MQV-Menezes-Qu-Vanstone protocol or Diffie-Hellman protocols using implicitly-certified keys

Definitions

  • the present invention relates to communication technologies, and in particular, to a method and device for exchanging keys. Background technique
  • GPON Gigabit-capable Passive Optical Networks
  • OLT Optical Line Terminal
  • ODN Optical Distribution Network
  • ONU Optical Network Unit
  • the OLT is a GPON central office device that manages, monitors, and maintains the entire GPON system; the ONU is a GPON remote device that is responsible for user and service access functions; the ODN consists of fiber optics and one or more passive optical splitters (POS, Passive Optical Splitter) is a passive optical device that provides an optical channel between the OLT and the ONU.
  • the OLT is connected to one or more ONUs through an ODN to form a so-called point-to-multipoint (P2MP, Point to Multi-Point) topology.
  • the structure is from the OLT to the ONU in the downlink direction (DS, Downstream), and from the ONU to the OLT in the uplink direction (US, UpStream).
  • the GPON remote device can be roughly divided into ONU and ONT, and will not be distinguished in the following. For ONU.
  • GPON International Standard G.984.3 defines the OLT's method for ONU authentication, which specifically implements key exchange between the OLT and the ONU through physical layer management and maintenance (PLOAM) messages.
  • PLOAM physical layer management and maintenance
  • the inventors have found that in the prior art, since the existing GPON standard is established under the condition that both the uplink node and the intermediate node are secure, and the existing PLOAM message and the GPON transmission convergence layer are (GTC, GPON Transmission Convergence) The headers are in clear text, and these messages transmit important information such as SN (Serial Number), Password, Key, etc., so the key cannot be guaranteed. Security. Summary of the invention The embodiment of the invention provides a method and a device for exchanging keys to improve the security of the OLT and the ONU.
  • the embodiment of the present invention first provides a method for exchanging a key, including: an optical line terminal and an optical network unit respectively generate a random number; the optical line terminal and the optical network unit respectively send the generated random number to the other party; the optical line The terminal and the optical network unit calculate the key using the HMAC function, the agreed password, and the random number generated by both parties.
  • the embodiment of the present invention further provides another method for exchanging a key, including: generating a first random number and transmitting the first random number to a peer device; and receiving a second random number provided by the peer device; The password, the first random number, and the second random number pre-agreed with the peer device are used to calculate a key by using an HMAC function.
  • the embodiment of the present invention further provides a PON device, including: a random number generating unit, configured to generate a first random number; a sending unit, configured to send the first random number to a peer device; and a receiving unit, configured to receive a second random number sent by the peer device; a calculating unit, configured to calculate a key by using an HMAC function according to a password, a first random number, and a second random number agreed with the peer device.
  • a PON device including: a random number generating unit, configured to generate a first random number; a sending unit, configured to send the first random number to a peer device; and a receiving unit, configured to receive a second random number sent by the peer device; a calculating unit, configured to calculate a key by using an HMAC function according to a password, a first random number, and a second random number agreed with the peer device.
  • the embodiment of the present invention further provides another PON device, including: a random number generating unit, configured to generate a first random number; a public value generating unit, configured to generate a first public value according to the first random number; And the receiving unit is configured to receive a second public value that is sent by the peer device, where the second public value is the peer device Generating according to the generated second random number; a calculating unit, configured to calculate the key using the HMAC function, the agreed password, and the random number and the public value generated by both parties.
  • the method and device for exchanging keys provided by the embodiment of the present invention generate a random number by the OLT and the ONU, respectively, and send the random number to the other party; and obtain a key by using an HMAC function, an agreed password, and a random number generated by both parties.
  • a random number is generated by the OLT and the ONU, respectively, and a public value is generated according to the random number; the public value is sent to the other party; and the key is calculated using the HMAC function, the agreed secret code, and the random number and the public value generated by both parties. Therefore, the security of the key between the OLT and the ONU can be ensured, thereby improving the security of the communication between the OLT and the ONU.
  • 1 is a flow chart of a method for exchanging keys according to an embodiment of the present invention
  • 2 is another flow chart of a method for exchanging keys according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a process of exchanging keys between an OLT and an ONU according to an embodiment of the present invention
  • FIG. 4 is another schematic diagram of a process of exchanging keys between an OLT and an ONU according to an embodiment of the present invention
  • FIG. 6 is another schematic diagram of the process of exchanging keys between the OLT and the ONU in the embodiment of the present invention
  • FIG. 7 is a schematic structural diagram of a PON device according to an embodiment of the present invention.
  • FIG. 8 is another schematic structural diagram of a PON device according to an embodiment of the present invention. detailed description
  • a random number is generated by the OLT and the ONU respectively; the random number is sent to the other party; and the key is calculated by using an HMAC function, an agreed password, and a random number generated by both parties.
  • a random number is generated by the OLT and the ONU, respectively, and a public value is generated according to the random number; the public value is sent to the other party; and the key is calculated using the HMAC function, the agreed password, and the random number and the public value generated by the two parties.
  • HMAC Information Authentication Code
  • HMAC(K,M) H( K ⁇ opad, H(K ⁇ ipad, M) );
  • K is a 512-bit symmetric key (if the length is not enough to complement 0 after K)
  • is a hash function
  • opad is a 512-bit constant 0x5c5c...5c
  • ipad is a 512-bit constant 0x3636...36
  • M is information .
  • the output length of the HMAC function is equal to the output length of the hash function. For example, if H is SHA-1, the output length of the HMAC is 160 bits.
  • the ipad and opad used by the HMAC function can greatly reduce the similarity between the internal and external hashed keys (K10 ipad and K10 opad), thereby improving security. HMAC has also proven to be a good pseudo-random function.
  • Step 101 The OLT and the ONU respectively generate a random number.
  • Step 102 The OLT and the ONU respectively send the generated random number to the other party;
  • Step 103 The OLT and the ONU calculate the key by using an HMAC function, an agreed password, and a random number generated by both parties.
  • the OLT and the ONU can respectively use the agreed password, N_T, ONU_ID, and N-U as
  • the key of the HMAC function is calculated as the key key, where N-T is the first random number generated by the optical line terminal, N-U is the second random number generated by the ONU, and the ONU ID is the identifier of the ONU.
  • the agreed password may be: a serial number SN or a password PW specified in the PON standard.
  • the OLT and the ONU may encrypt the random number before sending the generated random number to the other party, for example, using AES (Advanced Encryption Standard, Advanced). Encryption standard) algorithm encryption. After receiving the encrypted random number sent by the other party, the OLT and the ONU decrypt the random number.
  • the key for encrypting and decrypting the random number may be SN or PW.
  • N-T is a random number generated by the optical line terminal
  • N—U is the random number generated by the PON remote device.
  • the OLT and the ONU may encrypt the random number before transmitting the generated random number to the other party.
  • the two parties can separately encrypt the random number generated by the other party's public key, and then provide the encrypted random number to the other party; the OLT and the ONU further adopt themselves after receiving the encrypted random number sent by the other party.
  • the private key decrypts the random number.
  • the following steps may be further included in the embodiment of the present invention:
  • the OLT and the ONU use the HMAC function and the calculated key to verify the key, and send the verification result to the other party.
  • the optical line terminal and the PON remote device use the same formula and The verification result determines whether the other party's key is the same as its own key.
  • a random number is generated by the OLT and the ONU respectively;
  • the random number is sent to the other party;
  • the key is obtained by using the HMAC function, the agreed password, and the random number generated by both parties, thereby ensuring the security of the key between the OLT and the ONU, thereby improving the security of the communication between the OLT and the ONU.
  • FIG. 2 another flowchart of the method for exchanging keys in the embodiment of the present invention includes the following steps:
  • q is a prime number divisible by p-1
  • g is the original root of p
  • p is a prime number
  • g h A ⁇ (pl)/q ⁇ mod p
  • h is an arbitrary integer between l ⁇ h ⁇ pl .
  • Step 202 The OLT and the ONU respectively send the first public value X_T and the second public value X_U to the other party;
  • Step 203 The OLT and the ONU calculate the key by using an HMAC function, an agreed password, and a random number and a public value generated by both parties.
  • the ONU may calculate the obtained key by using the agreed password, X_T, ONU_ID, X_U, X_T A ⁇ N_U ⁇ mod p as parameters of the HMAC function; the OLT may assign the agreed password, X_U, XT, ONU_ID, X – U A ⁇ N— T ⁇ mod p is used as a parameter of the HMAC function to calculate the key.
  • the ONU ID is the identifier of the ONU.
  • the agreed password may be a serial number SN or a password PW specified in the PON standard; or may be a pre-shared key
  • the OLT and the ONU calculate the key error, and the following may further include the following in the embodiment of the present invention.
  • the OLT and the ONU respectively generate random numbers, and according to The random number generates a public value; the public value is sent to the other party; the key is calculated by using the HMAC function, the agreed password, and the random number and the public value generated by both parties, thereby ensuring the security of the key between the OLT and the ONU. , thereby improving the security of OLT and ONU communication.
  • FIG. 3 it is a schematic diagram of a process of exchanging keys between an OLT and an ONU in the embodiment of the present invention.
  • Step 301. The OLT generates a first random number N_T;
  • Step 302. The OLT encrypts the first random number N-T by using the AES, and the encrypted key uses a short-term password pre-agreed by the OLT and the ONU, such as SN or PW;
  • Step 303 The OLT sends the encrypted N-T to the ONU.
  • Step 304 The ONU uses the short-bit password to decrypt the received encrypted N-T using the short-bit password to obtain the first random number N_T;
  • Step 305 The ONU generates a second random number N_U;
  • Step 306 The ONU encrypts the second random number N-U by using the AES, and the encrypted key may also adopt the short-bit password, that is, SN or PW;
  • Step 307. The ONU sends the encrypted N-U to the OLT;
  • Step 308. The OLT uses the short-bit password to unpack the received encrypted N-U to obtain the second random number N-U;
  • HMAC PW, N_T, ONU_ID, N_U
  • Step 312. The ONU sends the calculated RSP_U to the OLT;
  • Step 315 The OLT sends the calculated RSP_T to the ONU;
  • Steps 317-318 The OLT and ONU delete N-T and N-U, respectively.
  • the sequence of the foregoing steps is not limited.
  • the foregoing step 311 may be before the step 309
  • the step 314 may be before the step 313, and the step 317 may be before the step 316. And so on, no longer here - for example.
  • the PW used in each of the above formulas may be replaced by SN, and the order of the parameters used by the HMAC may be different combinations.
  • the OLT and the ONU respectively generate a random number; the random number is sent to the other party; and the key is calculated by using the HMAC function, the agreed password, and the random number generated by both parties, thereby ensuring The security of the key between the OLT and the ONU improves the security of the OLT and ONU communication.
  • FIG. 4 it is another schematic diagram of the process of exchanging keys between the OLT and the ONU in the embodiment of the present invention.
  • Step 403. The OLT generates a first random number N_T;
  • Step 404 The OLT sends the N-T to the ONU.
  • Step 405. The ONU generates a second random number N_U;
  • Step 406 The ONU sends the N-U to the OLT;
  • Step 408 The OLT calculates the OLT key key1 by using the same formula; Step 409 ⁇
  • Step 410 Send the calculated RSP_U to the OLT
  • HMAC PSK, N- ⁇ , ⁇ -U, ONU-ID, keyl
  • Step 413 The OLT sends the calculated RSP_T to the ONU.
  • Steps 415-416 The OLT and ONU delete N-T and N-U, respectively.
  • the sequence of the foregoing steps is not limited.
  • the foregoing step 412 may be before the step 411, and the step 415 may also be before the step 414. And so on, no longer here - for example.
  • different combinations of the parameters used by the HMAC in the above formulas may be used.
  • the OLT and the ONU respectively generate a random number; the random number is sent to the other party; and the key is calculated by using the HMAC function, the agreed password, and the random number generated by both parties, thereby ensuring The security of the key between the OLT and the ONU improves the security of the OLT and ONU communication.
  • an asymmetric encryption method is used to encrypt part of the data communicated between the OLT and the ONU.
  • the OLT has its own private key and the public key of each ONU, and the ONU has its own private key and the public key of the OLT.
  • FIG. 5 it is another schematic diagram of the process of exchanging keys between the OLT and the ONU in the embodiment of the present invention.
  • Step 501 The OLT generates a first random number N_T;
  • Step 502. The OLT encrypts the N-T with the public key of the ONU, and sends the encrypted N-T to the ONU. Step 503.
  • the ONU generates a second random number N_U;
  • Step 504. The ONU decrypts the received encrypted N-T with the private key to obtain the first random number N_T;
  • Step 506 The ONU encrypts the N-U with the public key of the OLT, and sends the encrypted N-U to the OLT. Step 507. After receiving the encrypted N-U, the OLT decrypts it with its own private key. Obtaining the first random number N_U;
  • Step 512 The ONU sends the calculated RSP_U to the OLT;
  • Step 515 The OLT sends the calculated RSP_T to the ONU.
  • Steps 517-518 The OLT and ONU delete N-T and N-U, respectively.
  • the sequence of the foregoing steps is not limited.
  • the step 514 may be before the step 513, and the step 517 may be before the step 516. And so on, no longer here - for example.
  • the order of the parameters used by HMAC can be used in different combinations. It can be seen that, in the method for exchanging keys in the embodiment of the present invention, the OLT and the ONU respectively generate a random number; the random number is sent to the other party; and the key is calculated by using the HMAC function, the agreed password, and the random number generated by both parties, thereby ensuring The security of the key between the OLT and the ONU improves the security of the OLT and ONU communication.
  • This embodiment uses the Diffie-Hellman key exchange protocol to enable two users to securely exchange a secret key for later encryption.
  • the effectiveness of the Diffie-Hellman key exchange algorithm depends on the difficulty of computing the discrete logarithm.
  • the discrete logarithm can be defined as follows: First, the original root of a prime number p is defined, and all integer roots from 1 to p-1 are generated for each power, that is, if a is an original root of the prime number p, Then the values alt mod p, a2 mod p, ap-1 mod p are different integers, and all integers from 1 to p-1 are composed in some arrangement.
  • the Diffie-Hellman algorithm is used to encrypt part of the data between the OLT and the ONU, and the key exchange is implemented between the OLT and the ONU through the operation of the single unit.
  • FIG. 6 another schematic diagram of the process of exchanging keys between the OLT and the ONU in the embodiment of the present invention is shown.
  • Step 603. The OLT sends the X-T to the ONU.
  • Step 604 The ONU generates a second random number N_U ⁇ [1, q-1 ];
  • Step 606. The ONU sends the X-U to the OLT;
  • Step 610 The ONU sends the RSP_U to the OLT;
  • Step 613 The OLT sends the RSP_T to the ONU.
  • Steps 615-616 The OLT and ONU delete N-T and N-U, respectively.
  • the sequence of the foregoing steps is not limited.
  • the foregoing step 612 may be before the step 611, and the step 615 may be before the step 614. Such as this, no longer here - an example.
  • parameter PSK in the above HMAC function may be replaced by SN or PW.
  • HMAC order of the parameters used by HMAC can also be used in different combinations.
  • a random number is generated by the OLT and the ONU, respectively, and a public value is generated according to the random number; the public value is sent to the other party; the HMAC function, the agreed password, and the random number generated by both parties are used. And the public value is calculated to get the key.
  • the security of the keys between the ONUs improves the security of the OLT and ONU communications.
  • the storage medium such as a ROM/RAM, a magnetic disk, an optical disk, or the like, is read from a storage medium.
  • the embodiment of the invention further provides a PON device, as shown in FIG. 7, which is a schematic structural diagram of the PON device.
  • the PON device 700 includes:
  • a random number generating unit 701, configured to generate a first random number
  • the sending unit 702 is configured to send the first random number to the peer device that communicates with the self;
  • the receiving unit 703 is configured to receive the second random number that is sent by the peer device;
  • the calculating unit 704 is configured to calculate a key by using an HMAC function, an agreed password agreed with the other party, and first and second random numbers generated by the two parties.
  • the device may be an ONU or an OLT.
  • the peer device is an ONU; and when the PON device is an ONU, the peer device is
  • the calculating unit 703 is specifically configured to use an agreed password, N_T, ONU ID,
  • N-U calculates the key key, where N_T is the random number generated by the OLT, N—U is the random number generated by the ONU, and the ONU—ID is the ONU identifier.
  • the first random number and the second random number may refer to N-T and N-U respectively; of course, when the PON device is an ONU, the first random number and the second random number
  • the numbers can refer to N-U and N-T, respectively.
  • the agreed password may be: a serial number SN or a password PW specified in the standard.
  • the device may further include: an encryption unit and a decryption unit (not shown).
  • the encryption unit is configured to: before the sending unit 703 sends the random number to the peer device, encrypt the random number by using an AES algorithm; and the decrypting unit is configured to receive the The encrypted random number sent by the peer device received by the unit 703 is decrypted.
  • the key for encrypting and decrypting the random number may be the SN or PW.
  • the agreed password may also be a shared key calculated by using a formula.
  • K ) N—T ® N— U , where N—T is the random number generated by the optical line terminal, and N—U is the random number generated by the PON remote device.
  • the device may further comprise: an encryption unit and a decryption unit (not shown).
  • the encryption unit is configured to encrypt the random number by using a public key of the peer device before sending the random number to the peer device, where the decryption unit is used in the receiving unit 703 After receiving the encrypted random number sent by the peer device, the random number is decrypted by using its own private key.
  • the process of exchanging keys between the ONU and the OLT can refer to the flowchart shown in FIG. 5.
  • the random number is generated and the random number is sent to the other party; the key is calculated by using the HMAC function, the agreed password, and the random number generated by the two parties, thereby ensuring the key between the OLT and the ONU.
  • Security which in turn improves the security of OLT and ONU communications.
  • the PON device may further include: a verification unit and a determination unit (not shown).
  • the verification unit is configured to use the HMAC function and the calculated key to verify the key; the sending unit is further configured to send the verification result obtained by the verification unit to the peer device; The receiving unit is further configured to receive the verification result provided by the peer device; the determining unit determines whether the key of the peer device is related to the user by using the same formula and the verification result received by the receiving unit The keys are the same.
  • FIG. 8 it is another schematic structural diagram of a PON device according to an embodiment of the present invention.
  • the PON device 800 includes:
  • a random number generating unit 801 configured to generate a first random number
  • a public value generating unit 802 configured to generate a first public value according to the first random number
  • a sending unit 803, configured to send the first public value to a peer device that communicates with itself
  • a receiving unit 804, configured to: Receiving a second public value sent by the peer device, where the second disclosure value is generated by the peer device according to the second random number generated by the peer device;
  • the calculating unit 805 is configured to calculate a key by using an HMAC function, an agreed password, and a random number and a public value generated by both parties.
  • the PON device may be an OLT, and correspondingly, the other party that communicates with the PON device is an ONU.
  • the random number generating unit 801 is specifically configured to generate a random number N_T ⁇ [1]
  • the PON device may also be an ONU, and correspondingly, the other party that communicates with the PON device is an OLT.
  • the random number generating unit 801 is specifically configured to generate a random number N_U ⁇ [I. q-1 ];
  • the calculation unit ⁇ 5 is specifically used to calculate the key by using the agreed password, X_T, ONU ID, X_U, X_T A ⁇ N_U ⁇ mod p as parameters of the HMAC function;
  • the ONU—ID is the identifier of the ONU.
  • the PON device of the embodiment of the present invention generates a public value by generating a random number, and generates a public value according to the random number; and sends the public value to the other party; and calculates a key by using an HMAC function, an agreed password, and a random number and a public value generated by both parties. Therefore, the security of the key between the OLT and the ONU can be ensured, thereby improving the security of communication between the OLT and the ONU.
  • the PON device may further include: a verification unit and a determination unit (not shown).
  • the verification unit is configured to use the HMAC function and the calculated key to verify the key; the sending unit is further configured to send the verification result obtained by the verification unit to the peer device; the receiving unit And determining, by the determining unit, the same formula and the verification result received by the receiving unit, determining whether the key of the peer device is the same as the key of the peer device. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Description

交换密钥的方法及设备
技术领域
本发明涉及通信技术, 具体涉及一种交换密钥的方法及设备。 背景技术
吉比特无源光网络( GPON, Gigabit-capable Passive Optical Networks ) 技 术是新一代宽带无源光综合接入标准, 具有高带宽、 高效率、 大覆盖范围、 用 户接口丰富等众多优点,被大多数运营商视为实现接入网业务宽带化、 综合化 改造的理想技术。 GPON系统由光线路终端 (OLT, Optical Line Terminal ), 光分配网络( ODN , Optical Distribution Network )和光网络单元( ONU , Optical Network Unit )组成。 OLT为 GPON局端设备, 负责管理、 监控和维护整个 GPON系统; ONU为 GPON远端设备, 负责用户和业务的接入功能; ODN由 光纤和一个或多个无源光分路器(POS, Passive Optical Splitter )等无源光器 件组成, 在 OLT和 ONU间提供光通道; OLT通过 ODN连接到一个或多个 ONU, 以形成所谓的点对多点 (P2MP, Point to Multi-Point )拓朴结构, 从 OLT到 ONU为下行方向( DS, Downstream ) ,从 ONU到 OLT为上行方向( US, UpStream )„ GPON远端设备可大致分为 ONU和 ONT两种, 在后面将不做区 分, 统称为 ONU。
GPON的国际标准 G.984.3中定义了 OLT对 ONU认证的方法, 其具体是 通过物理层操作管理维护 ( PLOAM, Physical Layer OAM ) 消息实现 OLT与 ONU之间的密钥交换。
在实现本发明的过程中, 发明人发现在现有技术中, 由于 GPON现有标 准是在 4叚设上行节点和中间节点都安全的情况下制定的,而且现有 PLOAM消 息和 GPON传输汇聚层( GTC, GPON Transmission Convergence )头部都是采 用明文的形式, 而这些消息中传输了 SN ( Serial Number, 序列号)、 Password (密码)、 Key (密钥)等重要信息, 因此无法保证密钥的安全性。 发明内容 本发明实施例提供一种交换密钥的方法及设备,以提高 OLT和 ONU的安 全性。
本发明实施例首先提供一种交换密钥的方法, 包括: 光线路终端和光网络 单元分别产生随机数;所述光线路终端和光网络单元分别将其产生的随机数发 送给对方; 所述光线路终端和光网络单元使用 HMAC函数、 约定密码以及双 方产生的随机数计算得到密钥。
本发明实施例还提供另一种交换密钥的方法, 包括: 生成第一随机数并将 所述第一随机数发送给对端设备;接收所述对端设备提供的第二随机数; 根据 与所述对端设备预先约定的密码、 第一随机数和第二随机数, 利用 HMAC函 数计算出密钥。
本发明实施例还提供一种 PON设备, 包括: 随机数产生单元, 用于产生 第一随机数; 发送单元, 用于将所述第一随机数发送给对端设备; 接收单元, 用于接收所述对端设备发送的第二随机数; 计算单元, 用于根据与所述对端设 备约定的密码、 第一随机数和第二随机数, 利用 HMAC函数计算出密钥。
本发明实施例还提供另一种 PON设备, 包括: 随机数产生单元, 用于产 生第一随机数; 公开值生成单元, 用于根据所述第一随机数生成第一公开值; 发送单元, 用于将所述第一公开值发送给与自己通信的对端设备; 接收单元, 用于接收所述对端设备发送的第二公开值,其中所述第二公开值为所述对端设 备根据其产生的第二随机数生成; 计算单元, 用于使用 HMAC函数、 约定密 码以及双方产生的随机数和公开值计算得到密钥。
本发明实施例提供的交换密钥的方法及设备,由 OLT和 ONU分别产生随 机数, 并将所述随机数发送给对方; 使用 HMAC函数、 约定密码以及双方产 生的随机数计算得到密钥。 或者, 由 OLT和 ONU分别产生随机数, 并根据所 述随机数生成公开值; 将所述公开值发送给对方; 使用 HMAC函数、 约定密 码以及双方产生的随机数和公开值计算得到密钥。从而可以保证 OLT和 ONU 之间密钥的安全性, 进而提高 OLT和 ONU通信的安全性。 附图说明
图 1是本发明实施例交换密钥的方法的一种流程图; 图 2是本发明实施例交换密钥的方法的另一种流程图;
图 3是本发明实施例中 OLT和 ONU交换密钥过程的一种示意图; 图 4是本发明实施例中 OLT和 ONU交换密钥过程的另一种示意图; 图 5是本发明实施例中 OLT和 ONU交换密钥过程的另一种示意图; 图 6是本发明实施例中 OLT和 ONU交换密钥过程的另一种示意图; 图 7是本发明实施例 PON设备的一种结构示意图;
图 8是本发明实施例 PON设备的另一种结构示意图。 具体实施方式
为了使本技术领域的人员更好地理解本发明实施例的方案,下面结合附图 和实施方式对本发明实施例作进一步的详细说明。
本发明实施例交换密钥的方法及设备, 由 OLT和 ONU分别产生随机数; 将所述随机数发送给对方; 使用 HMAC函数、 约定密码以及双方产生的随机 数计算得到密钥。 或者, 由 OLT和 ONU分别产生随机数, 并根据所述随机数 生成公开值; 将所述公开值发送给对方; 使用 HMAC函数、 约定密码以及双 方产生的随机数和公开值计算得到密钥。 由此,可以保证 OLT和 ONU之间密 钥的安全性, 从而提高 OLT和 ONU通信的安全性。
HMAC是一个结合了哈希函数 (例如 MD5, SHA-1)和对称密钥的 MAC(信 息认证码) 函数。 它的计算方式可以如下:
HMAC(K,M) = H( K©opad, H(K©ipad, M) );
其中, K是 512bit对称密钥 (如果长度不够在 K后面补 0), Η是哈希函数, opad是 512bit的常数 0x5c5c...5c, ipad是 512bit的常数 0x3636...36, M是信 息。
HMAC函数的输出长度等于哈希函数的输出长度,例如,如果 H是 SHA- 1 , 那么 HMAC的输出长度是 160bit。 HMAC函数所用的 ipad和 opad可以使得 内外两次哈希的密钥 (K㊉ ipad和 K㊉ opad)之间的相似性大大降低,从而提高安 全性。 HMAC也已被证明是一个好的伪随机函数。
如图 1所示, 是本发明实施例交换密钥的方法的一种流程图, 包括以下步 骤: 步骤 101 , OLT和 ONU分别产生随机数;
步骤 102, OLT和 ONU分别将其产生的随机数发送给对方;
步骤 103 , OLT和 ONU分别使用 HMAC函数、 约定密码以及双方产生的 随机数计算得到密钥。
具体地, OLT和 ONU可以分别将约定密码、 N— T、 ONU— ID、 N— U作为
HMAC函数的参数, 计算得到密钥 key, 其中, N—T为光线路终端产生的第一 随机数, N— U为 ONU产生的第二随机数, ONU ID为 ONU的标识。
在本发明实施例中, 所述约定密码可以是: PON标准中规定的序列号 SN 或密码 PW。在这种情况下, 为了进一步保证数据传输的安全性, OLT和 ONU 在将各自产生的随机数发送给对方之前,可以先对所述随机数进行加密,比如, 使用 AES ( Advanced Encryption Standard, 高级加密标准)算法加密。 OLT和 ONU在接收到对方发送的加密的随机数后, 对所述随机数进行解密。 其中, 对所述随机数加密和解密的密钥可以是 SN或 PW。
在本发明实施例中 , 所述约定密码还可以是: 预共享密钥 /^¾:= _1 @ _2㊉…㊉ 其中 t/— HAMCO PW AT ^ c , C为常量。
在本发明实施例中,所述约定密码还可以是: 利用公式 _0 = N_r © N _[/ 计算得到的共享密钥 K—0, 其中, N—T为光线路终端产生的随机数, N— U为 PON远端设备产生的随机数。 在这种情况下, 为了进一步保证数据传输的安 全性, OLT和 ONU在将各自产生的随机数发送给对方之前, 可以对所述随机 数进行加密。 比如, 双方可以分别采用对方的公钥对自己产生的所述随机数加 密, 再将加密后的随机数提供给对方; OLT和 ONU在接收到对方发送的被加 密的随机数后, 进一步采用自己的私钥对所述随机数进行解密。
为了进一步保证 OLT和 ONU得到的密钥的正确性,防止各自发送给对方 的随机数被墓改而导致 OLT和 ONU计算得到的密钥错误,在本发明实施例中 还可进一步包括以下步骤: OLT和 ONU分别使用 HMAC函数以及计算得到 密钥对所述密钥进行验证, 并将验证结果发送给对方; 光线路终端和 PON远 端设备收到对方的验证结果后,利用相同的公式及所述验证结果确定对方的密 钥是否与自己的密钥相同。
本发明实施例交换密钥的方法, 由 OLT和 ONU分别产生随机数; 将所述 随机数发送给对方; 使用 HMAC函数、 约定密码以及双方产生的随机数计算 得到密钥, 从而可以保证 OLT和 ONU之间密钥的安全性, 进而提高 OLT和 ONU通信的安全性。
如图 2所示,是本发明实施例交换密钥的方法的另一种流程图, 包括以下 步骤:
步骤 201 , OLT和 ONU分别产生随机数, 并根据所述随机数生成公开值; 具体地, OLT生成第一随机数 N_T≡ [1, q-1 ] ,并根据公式 X_T = gA {N T} mod p生成第一公开值 X_T; ONU产生第二随机数 N_U e [1, q-1 ] , 并根据 公式 X_U = gA{N_U} mod p生成第二公开值 X_U;
其中, q是能被 p-1整除的质数, g是 p的原根, p为质数, g = hA{(p-l)/q} mod p, h为 l<h<p-l之间的任意整数。
步骤 202, OLT和 ONU分别将所述第一公开值 X— T、第二公开值 X— U发 送给对方;
步骤 203 , OLT和 ONU分别使用 HMAC函数、 约定密码以及双方产生的 随机数和公开值计算得到密钥。
具体地, ONU可以将约定密码、 X_T、 ONU_ID、 X_U、 X_TA{N_U} mod p作为 HMAC函数的参数,计算得到密钥; OLT可以将约定密码、 X— U、 X T, ONU— ID、 X— UA{N— T} mod p作为 HMAC函数的参数, 计算得到密钥。 其中, ONU ID为 ONU的标识。
在本发明实施例中, 所述约定密码可以是 PON标准中规定的序列号 SN 或密码 PW ; 还可以是预共享密钥 A^ = t/ _l ® t/ _2 © ...© [/ _c , 其中 U _ i = HAMC(i) (PW, SN), \ < i < c , C为常量。
同样, 为了进一步保证 OLT和 ONU得到的密钥的正确性, 防止各自发送 给对方的随机数被墓改而导致 OLT和 ONU计算得到的密钥错误,在本发明实 施例中还可进一步包括以下步骤: OLT和 ONU分别使用 HMAC函数以及计 算得到密钥对所述密钥进行验证, 并将验证结果发送给对方; 光线路终端和 PON远端设备收到对方的验证结果后, 利用相同的公式及所述验证结果确定 对方的密钥是否与自己的密钥相同。
本发明实施例交换密钥的方法, 由 OLT和 ONU分别产生随机数, 并根据 所述随机数生成公开值; 将所述公开值发送给对方; 使用 HMAC函数、 约定 密码以及双方产生的随机数和公开值计算得到密钥, 从而可以保证 OLT 和 ONU之间密钥的安全性, 进而提高 OLT和 ONU通信的安全性。
下面分别详细举例进一步说明本发明实施例中 OLT和 ONU交换密钥的过 程。
1. 基于短位密码的模式
如图 3所示,是本发明实施例中 OLT和 ONU交换密钥过程的一种示意图。 步骤 301. OLT产生一个第一随机数 N— T;
步骤 302. OLT使用 AES对所述第一随机数 N— T进行加密, 加密的密钥 使用 OLT和 ONU预先约定的短位密码, 比如 SN或者 PW;
步骤 303. OLT将加密后的 N— T发给 ONU;
步骤 304. ONU使用所述短位密码将接收到的加密后的 N— T使用所述短 位密码解开, 以得到所述第一随机数 N—T;
步骤 305. ONU产生一个第二随机数 N— U;
步骤 306. ONU使用 AES对所述第二随机数 N— U进行加密,加密的密钥 也可采用所述短位密码, 即 SN或者 PW;
步骤 307. ONU将加密后的 N— U发送给 OLT;
步骤 308. OLT使用所述短位密码将接收到的加密后的 N—U解开, 以得 到所述第二随机数 N— U;
步骤 309. OLT使用公式 key = HMAC(PW,N— T,ONU— ID,N— U)计算 OLT 密钥 keyl ;
步骤 310. ONU利用相同的公式计算 ONU密钥 key 2=
HMAC(PW,N_T,ONU_ID,N_U);
步骤 311. ONU根据 RSP_U= HMAC(PW,N_T,N_U,ONU_ID,key2)进行计 算以对其计算得到的密钥 key 2进行验证, 得到验证结果 RSP— U;
步骤 312. ONU将计算得到的 RSP— U发送给 OLT;
步骤 313. OLT利用相同的公式 RSP— U=
HMAC(PW,N— Τ,Ν— U,ONU— ID,keyl)进行计算,如果计算结果与收到的 RSP— U 相同, 则认为 ONU与 OLT的密钥相同; 步骤 314. OLT根据 RSP_T= HMAC(PW,N— Τ,Ν— U,key,ONU— ID)对其计算 得到的密钥 key 1进行验证, 得到验证结果 RSP— T;
步骤 315. OLT将计算得到的 RSP— T发送给 ONU;
步骤 316. ONU利用相同的公式 RSP— T= HMAC(PW,N_T,N_U, ONU— ID, key2)进行计算, 如果计算结果与收到的 RSP— T相同, 则认为 OLT与 ONU的 密钥相同;
步骤 317-318. OLT和 ONU分别删除 N— T和 N— U。
需要说明的是, 在本发明实施例中, 并不限定上述一些步骤的先后顺序, 比如上述步骤 311可以在步骤 309之前, 步骤 314可以在步骤 313之前, 步骤 317也可以位于步骤 316之前。 诸如此类, 在此不再——举例说明。 另外, 上 述各公式中所使用的 PW也可以由 SN来代替, HMAC所使用参数的顺序也可 以使用不同的组合。
可见, 本发明实施例交换密钥的方法, 由 OLT和 ONU分别产生随机数; 将所述随机数发送给对方; 使用 HMAC函数、 约定密码以及双方产生的随机 数计算得到密钥, 从而可以保证 OLT和 ONU之间密钥的安全性, 进而提高 OLT和 ONU通信的安全性。
2. 基于长位密码的模式
如图 4所示,是本发明实施例中 OLT和 ONU交换密钥过程的另一种示意 图。
步骤 401-402. OLT和 ONU分别通过公式 A^ = t/ _l ® t/ _2 © ... © [/ _c计算 预共享密钥 PSK, 其中 [/— ^ HAMCW PHM ^^ c , C为一个常量, 优选值大 于 1000;
步骤 403. OLT产生一个第一随机数 N— T;
步骤 404. OLT将 N— T发送给 ONU;
步骤 405. ONU产生一个第二随机数 N_U;
步骤 406. ONU将 N— U发送给 OLT;
步骤 407. ONU利用公式 key = HMAC(PSK,N— T,ONU— ID,N— U)计算 ONU 密钥 key 2;
步骤 408. OLT利用相同的公式计算 OLT密钥 keyl ; 步骤 409· ONU根据 RSP_U= HMAC(PSK,N_T,N_U,ONU_ID, key2)进行计 算以对其计算得到的密钥 key2进行验证, 得到验证结果 RSP— U;
步骤 410. 将计算得到的 RSP— U发送给 OLT;
步骤 411. OLT利用相同的公式 RSP— U=
HMAC(PSK,N— Τ,Ν— U,ONU— ID,keyl)进行计算,如果计算结果与收到的 RSP— U 相同, 则认为 ONU与 OLT的密钥相同;
步骤 412. OLT根据 RSP_T= HMAC(PSK,N_T,N_U,ONU_ID, keyl)进行计 算以对其计算得到的密钥 keyl进行验证, 得到验证结果 RSP— T;
步骤 413. OLT将计算得到的 RSP— T发送给 ONU;
步骤 414. ONU利用相同的公式 RSP— T= HMAC(PSK,N_T,N_U,ONU_ID, key2)进行计算, 如果计算结果与收到的 RSP— T相同, 则认为 OLT与 ONU的 密钥相同;
步骤 415-416. OLT和 ONU分别删除 N— T和 N— U。
需要说明的是, 在本发明实施例中, 并不限定上述一些步骤的先后顺序, 比如上述步骤 412可以在步骤 411之前, 步骤 415也可以位于步骤 414之前。 诸如此类, 在此不再——举例说明。 另外, 上述各公式中 HMAC所使用参数 的顺序也可以使用不同的组合。
可见, 本发明实施例交换密钥的方法, 由 OLT和 ONU分别产生随机数; 将所述随机数发送给对方; 使用 HMAC函数、 约定密码以及双方产生的随机 数计算得到密钥, 从而可以保证 OLT和 ONU之间密钥的安全性, 进而提高 OLT和 ONU通信的安全性。
3. 基于共享密钥的模式
在该实施例中,采用非对称加密方法来加密 OLT和 ONU之间通信的部分 数据, OLT有自己的私钥和各个 ONU的公钥,而且 ONU有自己的私钥和 OLT 的公钥。
如图 5所示,是本发明实施例中 OLT和 ONU交换密钥过程的另一种示意 图。
步骤 501. OLT产生一个第一随机数 N—T;
步骤 502. OLT用 ONU的公钥加密 N— T,并将加密后的 N— T发送给 ONU; 步骤 503. ONU产生一个第二随机数 N_U;
步骤 504. ONU用私钥解开接收到的被加密的 N— T, 以得到所述第一随机 数 N— T;
步骤 505. ONU根据 _0 = N _r ® N _[/计算共享密钥 K— 0;
步骤 506. ONU用 OLT的公钥加密 N— U,并将加密后的 N— U发送给 OLT; 步骤 507. OLT接收到加密后的 N— U后, 用自己的私钥对其进行解密以获 得所述第一随机数 N— U;
步骤 508. OLT根据 _0 = N _r ® N _[/计算共享密钥 K— 0;
步骤 509. ONU利用公式 key2 = HMAC(K— 0,N— T,ONU— ID,N— U)计算 ONU 密钥 key2;
步骤 510. OLT利用相同的公式 key 1= HMAC(K— 0,N— T,ONU— ID,N— U)计 算 OLT密钥 keyl ;
步骤 511· ONU根据 RSP_U= HMAC(PSK,N_T,N_U,ONU_ID, key2)进行计 算以对其计算得到的密钥 key2进行验证, 得到验证结果 RSP— U;
步骤 512. ONU将计算得到的 RSP— U发送给 OLT;
步骤 513. OLT利用相同的公式 RSP— U= HMAC(K_0,N_T,ONU_ID,N_U, keyl)进行计算, 如果计算结果与收到的 RSP— U相同, 则认为 ONU与 OLT的 密钥相同;
步骤 514. OLT根据 RSP_T= HMAC(PSK,N_T,N_U,ONU_ID, keyl)进行计 算以对其计算得到的密钥 keyl进行验证, 得到验证结果 RSP— T;
步骤 515. OLT将计算得到的 RSP— T发送给 ONU;
步骤 516. ONU利用相同的公式 RSP— T= HMAC(PSK,N_T,N_U,ONU_ID, key2)进行计算, 如果计算结果与收到的 RSP— T相同, 则认为 OLT与 ONU的 密钥相同;
步骤 517-518. OLT和 ONU分别删除 N— T和 N— U。
需要说明的是, 在本发明实施例中, 并不限定上述一些步骤的先后顺序, 比如上述步骤 514可以在步骤 513之前, 步骤 517可以位于步骤 516之前。诸 如此类, 在此不再——举例说明。 同样, HMAC 所使用参数的顺序也可以使 用不同的组合。 可见, 本发明实施例交换密钥的方法, 由 OLT和 ONU分别产生随机数; 将所述随机数发送给对方; 使用 HMAC函数、 约定密码以及双方产生的随机 数计算得到密钥, 从而可以保证 OLT和 ONU之间密钥的安全性, 进而提高 OLT和 ONU通信的安全性。
4. 基于 Diffie-HellMAN的模式
本实施例采用 Diffie-Hellman密钥交换协议可以使两个用户安全地交换一 个秘密密钥以便用于以后的 4艮文加密。 Diffie-Hellman密钥交换算法的有效性 依赖于计算离散对数的难度。 具体地, 可以如下定义离散对数: 首先定义一个 质数 p的原根, 为其各次幂产生从 1 到 p-1的所有整数根, 也就是说, 如果 a 是质数 p的一个原根, 那么数值 al mod p, a2 mod p, ap-1 mod p 各不相同的整数, 并且以某种排列方式组成了从 1到 p-1的所有整数。 对于 一个整数 b和质数 p的一个原根 a,可以找到唯一的指数 i,使得 b = ai mod p, 其中 0≤i≤ (p-l) , 指数 i称为 b的以 a为基数的模 p的离散对数或者指数, 该值被记为 inda, p(b)。
在本发明实施例中, 采用 Diffie-Hellman算法来加密 OLT和 ONU之间通 信的部分数据, OLT和 ONU之间通过筒单的运算实现密钥的交换。
如图 6所示,是本发明实施例中 OLT和 ONU交换密钥过程的另一种示意 图。
步骤 601. OLT产生一个第一随机数 N_T ≡ [1, q-1 ] , 其中 q是一个能被 p-1整除的质数, p为一个质数, g是 p的原根, g = hA{(p-l)/q} mod p, 其中 h 为 l<h<p-l之间的任意整数;
步骤 602. OLT根据 N_T计算出第一公开值 X_T, 即 X_T = gA{N_T} mod p;
步骤 603. OLT将 X— T发送给 ONU;
步骤 604· ONU产生一个第二随机数 N_U≡ [1, q-1 ];
步骤 605. ONU根据 N_U计算出第二公开值 X_U,即 X_U = gA{N_U} mod p;
步骤 606. ONU将 X— U发送给 OLT;
步骤 607· OLT根据 keyl = HMAC(PSK,X_T,ONU_ID,X_U,X_UA{N_T} mod p)计算出 OLT密钥 keyl ;
步骤 608· ONU根据 key = HMAC(PSK,X_T,ONU_ID,X_U,X_TA{N_U} mod p)计算出 ONU密钥 key2;
步骤 609. ONU 根据公式 RSP— U= HMAC(PSK,X_T,ONU_ID, key2,X_U,X_TA{N_U} mod p)对其计算得到的密钥 key2进行验证, 得到验证 结果 RSP— U;
步骤 610. ONU将 RSP— U发送给 OLT;
步骤 611. OLT 使用相同的公式 RSP— U= HMAC(PSK,X_T,ONU_ID, keyl,X_U,X_UA{N_T} mod p)进行计算计算, 如果计算结果与收到的 RSP— U 相同, 则认为 ONU与 OLT的密钥相同;
步 骤 612. OLT 根 据 RSP— T= HMAC(PSK,X_T, keyl ,ONU_ID,X_U,X_UA {N T} mod p对计算得到的密钥进行验证, 得到验证 结果 RSP— T;
步骤 613. OLT将 RSP— T发送给 ONU;
步骤 614. ONU 使用 相 同 的 公式 RSP— T= HMAC(PSK,X_T, key2,ONU_ID,X_U,X_TA {N_U} mod p 进行计算, 如果计算结果与收到的 RSP T相同, 则认为 OLT与 ONU的密钥相同;
步骤 615-616. OLT和 ONU分别删除 N— T和 N— U。
需要说明的是, 在本发明实施例中, 并不限定上述一些步骤的先后顺序, 比如上述步骤 612可以在步骤 611之前, 步骤 615可以位于步骤 614之前。诸 如此类, 在此不再——举例说明。
另外, 上述 HMAC函数中的参数 PSK也可以由 SN或 PW来代替。
同样, HMAC所使用参数的顺序也可以使用不同的组合。
本发明实施例交换密钥的方法, 由 OLT和 ONU分别产生随机数, 并根据 所述随机数生成公开值; 将所述公开值发送给对方; 使用 HMAC函数、 约定 密码以及双方产生的随机数和公开值计算得到密钥。 从而可以保证 OLT 和
ONU之间密钥的安全性, 进而提高 OLT和 ONU通信的安全性。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤 是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于一计算机可 读取存储介质中, 所述的存储介质, 如: ROM/RAM、 磁碟、 光盘等。
本发明实施例还提供一种 PON设备,如图 7所示,是该 PON设备的一种 结构示意图。
在该实施例中, 所述 PON设备 700包括:
随机数产生单元 701 , 用于产生第一随机数;
发送单元 702, 用于将所述第一随机数发送给与自己通信的对端设备; 接收单元 703 , 用于接收所述对端设备发送的第二随机数;
计算单元 704, 用于使用 HMAC函数、 与所述对方约定的约定密码以及 双方产生的第一、 第二随机数计算得到密钥。
在具体应用中, 所述设备可以是 ONU或 OLT, 当所述 PON设备为 OLT 时, 所述对端设备为 ONU; 而当所述 PON设备为 ONU时, 所述对端设备为
OLT。 相应地, 所述计算单元 703 , 具体用于将约定密码, N— T, ONU ID,
N—U作为 HMAC函数的参数, 计算得到密钥 key, 其中, N— T为 OLT产生的 随机数, N— U为 ONU产生的随机数, ONU— ID为所述 ONU标识。 应当理解, 所述第一、 第二随机数中引入的 "第一"、 "第二"仅是为了便于区分, 当所述
PON设备为 OLT时,所述第一随机数和第二随机数可以分别是指 N— T和 N— U; 当然, 当所述 PON设备为 ONU时, 所述第一随机数和第二随机数可以分别 是指 N— U和 N— T。
在本发明实施例中, 所述约定密码可以是: ΡΟΝ标准中规定的序列号 SN 或密码 PW。 相应地, 为了进一步保证所述约定密码的安全性, 所述设备还可 进一步包括: 加密单元和解密单元(未图示)。 其中, 所述加密单元, 用于在 所述发送单元 703将所述随机数发送给所述对端设备之前,对所述随机数使用 AES算法加密; 所述解密单元, 用于对所述接收单元 703接收到的所述对端 设备发送的加密的随机数进行解密。优选地,对所述随机数加密和解密的密钥 可以是所述 SN或 PW。 ONU和 OLT交换密钥的过程可参照图 3所示流程图。
在本发明 实施例 中 , 所述约定密码还可以是预共享密钥 PSK = U _ \ ® U _ 2 ® ... ® U _ c , 其中 t/ _ = ¾4Μ< ω (ΡΗΜ),1≤ ≤ί^ , C为常量。 ONU 和 OLT交换密钥的过程可参照图 4所示流程图。
在本发明实施例中,所述约定密码还可以是利用公式计算得到的共享密钥 K ) = N—T ® N— U , 其中, N—T为光线路终端产生的随机数, N— U为 PON远 端设备产生的随机数。 相应地, 为了进一步保证所述约定密码的安全性, 所述 设备还可进一步包括: 加密单元和解密单元(未图示)。 其中, 所述加密单元, 用于将所述随机数发送给对端设备之前,用所述对端设备的公钥对所述随机数 加密; 所述解密单元, 用于在所述接收单元 703接收到所述对端设备发送的加 密的随机数后, 用自己的私钥对所述随机数进行解密。 ONU和 OLT交换密钥 的过程可参照图 5所示流程图。
可见, 本发明实施例 PON设备,产生随机数并将所述随机数发送给对方; 使用 HMAC函数、 约定密码以及双方产生的随机数计算得到密钥, 从而可以 保证 OLT和 ONU之间密钥的安全性, 进而提高 OLT和 ONU通信的安全性。
为了进一步保证密钥的正确性, 在本发明另一实施例中, 所述 PON设备 还可进一步包括: 验证单元和判断单元(未图示)。
所述验证单元, 用于使用 HMAC函数以及计算得到密钥对所述密钥进行 验证; 所述发送单元,还用于将所述验证单元得到的验证结果发送给所述对端 设备; 所述接收单元, 还用于接收所述对端设备提供的验证结果; 所述判断单 元, 利用相同的公式及所述接收单元接收到的验证结果, 确定所述对端设备的 密钥是否与自己的密钥相同。
如图 8所示, 是本发明实施例 PON设备的另一种结构示意图。
在该实施例中, 所述 PON设备 800包括:
随机数产生单元 801 , 用于产生第一随机数;
公开值生成单元 802, 用于根据所述第一随机数生成第一公开值; 发送单元 803 , 用于将所述第一公开值发送给与自己通信的对端设备; 接收单元 804, 用于接收所述对端设备发送的第二公开值, 其中所述第二 公开值为所述对端设备根据其产生的第二随机数生成;
计算单元 805, 用于使用 HMAC函数、 约定密码以及双方产生的随机数 和公开值计算得到密钥。
在本发明实施例中, 所述 PON设备可以是 OLT, 相应的, 与所述 PON设 备通信的对方为 ONU。
在这种情况下,所述随机数产生单元 801 ,具体用于生成随机数 N—T ≡ [1 q-1 ]; 所述公开值生成单元 802, 具体用于根据公式 X T = gA{N_T} mod p生 成公开值 X— T; 其中, q是能被 ρ-1整除的质数, g是 p的原根, p为质数, g = hA{(p-l)/q} modp, h为 l<h<p-l之间的任意整数; 所述计算单元 δθ5, 具体 用于将约定密码, X_U, X T, ONU ID, X_UA{N_T} mod p作为 HMAC函 数的参数, 计算得到密钥; 其中, ONU— ID为 ONU的标识。
在本发明实施例中, 所述 PON设备还可以是 ONU,相应的, 与所述 PON 设备通信的对方为 OLT。
在这种情况下,所述随机数产生单元 801,具体用于产生随机数 N—U ≡ [I. q-1 ]; 所述公开值生成单元 802, 具体用于根据公式 X_U = gA{N_U} mod p生 成公开值 N—U; 其中, q是能被 p-1整除的质数, g是 p的原根, p为质数, g = hA{(p-l)/q} modp, h为 l<h<p-l之间的任意整数; 所述计算单元 δθ5, 具体 用于将约定密码, X_T, ONU ID, X_U, X_TA{N_U} mod p作为 HMAC函 数的参数, 计算得到密钥; 其中, ONU— ID为 ONU的标识。
在本发明实施例中, 所述约定密码可以是: PON标准中规定的序列号 SN 或 密码 PW; 或者预共 享 密钥 PSK = U _1®U _2®...®U _c , 其 中 U_i = HAMC(i) (PW, SN l≤i<c , C为大于 1000的常量。
本发明实施例 PON设备, 通过产生随机数, 并根据所述随机数生成公开 值; 将所述公开值发送给对方; 使用 HMAC函数、 约定密码以及双方产生的 随机数和公开值计算得到密钥,从而可以保证 OLT和 ONU之间密钥的安全性, 进而提高 OLT和 ONU通信的安全性。
为了进一步保证密钥的正确性, 在本发明另一实施例中, 所述 PON设备 还可进一步包括: 验证单元和判断单元(未图示)。
所述验证单元, 用于使用 HMAC函数以及计算得到密钥对所述密钥进行 验证;所述发送单元,还用于将所述验证单元得到的验证结果发送给对端设备; 所述接收单元, 还用于接收所述对端设备的验证结果; 所述判断单元, 利用相 同的公式及所述接收单元接收到的验证结果,确定所述对端设备的密钥是否与 自己的密钥相同。 密钥交换的详细过程可参照图 6所示流程图。
以上对本发明实施例进行了详细介绍,本文中应用了具体实施方式对本发 明进行了阐述, 以上实施例的说明只是用于帮助理解本发明的方法及设备; 同 时, 对于本领域的一般技术人员, 依据本发明的思想, 在具体实施方式及应用 范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims

权 利 要 求
1、 一种交换密钥的方法, 其特征在于, 包括:
光线路终端和光网络单元分别产生随机数;
所述光线路终端和光网络单元分别将其产生的随机数发送给对方; 所述光线路终端和光网络单元使用 HMAC函数、 约定密码以及双方产生 的随机数计算得到密钥。
2、 根据权利要求 1所述的方法, 其特征在于, 所述使用 HMAC函数、 约 定密码以及双方产生的随机数计算得到密钥包括:
将约定密码, N— T, ONU ID, N— U作为 HMAC函数的参数, 利用所述 HMAC函数计算得到密钥, 其中, N—T为光线路终端产生的随机数, N— U为 光网络单元产生的随机数, ONU— ID为所述光网络单元的标识。
3、 根据权利要求 1所述的方法, 其特征在于, 所述约定密码为: 光线路终端和光网络单元预先约定的序列号 SN或密码 PW; 或者 利用公式 Α^ = ί/_1®ί/_2©...©[/_ί^+算得到的预共享密钥 PSK, 其中 U_i = HAMC(i) (PW, SN), l<i<c , C为常量; 或者
利用公式 _0 = N_r©N_ [/计算得到的共享密钥 K— 0, 其中 N— T和 N— U 分别为所述光线路终端和光网络单元生成的随机数。
4、 根据权利要求 3所述的方法, 其特征在于, 当所述约定密码为光线路 终端和光网络单元预先约定的序列号 SN或密码 PW时,
所述方法还包括:
所述光线路终端和光网络单元在分别将所述随机数发送给对方之前,对其 产生的随机数使用 AES算法进行加密;
所述光线路终端和光网络单元接收到对方发送的加密的随机数后,利用所 述约定密码对其接收的随机数进行解密。
5、 根据权利要求 3所述的方法, 其特征在于, 当所述约定密码为共享密 钥 K— 0时, 所述方法还包括:
所述光线路终端和光网络单元在将所述随机数发送给对方之前,分别用对 方的公钥对其产生的随机数进行加密;
所述光线路终端和光网络单元再接收到对方发送的加密的随机数后,用自 己的私钥对其接收到的随机数进行解密。
6、 根据权利要求 1至 5任一项所述的方法, 其特征在于, 还包括: 光线路终端和光网络单元分别使用 HMAC函数以及计算得到密钥对所述 密钥进行验证, 并将验证结果发送给对方;
光线路终端和光网络单元收到对方的验证结果后,利用相同的公式及所述 验证结果确定对方的密钥是否与自己的密钥相同。
7、 根据权利要求 1或 3所述的方法, 其特征在于, 还包括:
所述光线路终端根据公式 X— T = gA{N_T} mod p生成第一公开值 X— T,其 中 N— T为其生成的随机数;
所述光网络单元根据公式 X_U = gA {N_U} mod p生成第二公开值 X_U , 其中 Ν— U为其生成的随机数;
其中, q是能被 p-1整除的质数, g是 p的原根, p为质数, g = hA{(p-l)/q} mod p, h为 l<h<p-l之间的任意整数。
8、 根据权利要求 7所述的方法, 其特征在于, 所述光线路终端和光网络 单元使用 HMAC函数、 约定密码以及双方产生的随机数计算得到密钥的步骤 包括:
光线路终端将约定密码、 X— U、 X T, ONU— ID , X— UA{N— T} mod p作为 HMAC函数的参数, 计算得到光线路终端密钥,
光网络单元将约定密码、 X_T、 ONU_ID、 X_U、 X_TA{N_U} mod p作为 HMAC函数的参数, 计算得到光网络单元密钥,
其中,Ν— T 和 N—U分别为光线路终端和光网络单元产生的随机数, X U 和 X— Τ分别为光线路终端和光网络单元生成的公开值、 ONU— ID为所述光网 络单元的标识。
9、 一种交换密钥的方法, 其特征在于, 包括:
生成第一随机数并将所述第一随机数发送给对端设备;
接收所述对端设备提供的第二随机数;
根据与所述对端设备预先约定的密码、 第一随机数和第二随机数, 利用 HMAC函数计算出密钥。
10、 根据权利要求 9所述的方法, 其特征在于, 所述预先约定的密码为: 预先约定的序列号 SN或密码 PW; 或者
利用公式 Α^ = ί/_1®ί/_2©...©[/_ί^+算得到的预共享密钥 PSK, 其中 U_i = HAMC(i) (PW, SN), l<i<c , C为常量; 或者
利用公式 _0 = N_r©N_ [/计算得到的共享密钥 K— 0, 其中 N— T和 N— U 分别为所述第一随机数和第二随机数。
11、 根据权利要求 9或 10所述的方法, 其特征在于, 所述利用 HMAC函 数进行计算以得到密钥包括:
将预先约定的密码、第一随机数、对端设备的标识、第二随机数作为 HMAC 函数的参数, 利用所述 HMAC函数进行计算, 并将所述 HMAC函数的计算结 果作为所述密钥。
12、 根据权利要求 11所述的方法, 其特征在于, 还包括:
使用 HMAC函数以及计算得到密钥对所述密钥进行验证, 并将验证结果 发送给所述对端设备, 以使所述对端设备根据所述验证结果确定密钥是否正 确。
13、 一种 PON设备, 其特征在于, 包括:
随机数产生单元, 用于产生第一随机数;
发送单元, 用于将所述第一随机数发送给对端设备;
接收单元, 用于接收所述对端设备发送的第二随机数;
计算单元, 用于根据与所述对端设备约定的密码、第一随机数和第二随机 数, 利用 HMAC函数计算出密钥。
14、 根据权利要求 13所述的设备, 其特征在于, 所述计算单元, 具体用 于将所述约定的密码、 第一随机数、 所述对端设备的标识、 所述第二随机数作 为 HMAC函数的参数, 利用所述 HMAC函数进行计算, 并将所述 HMAC函 数的计算结果作为所述密钥。
15、 根据权利要求 13或 14所述的设备, 其特征在于, 所述约定密码为所 述 PON设备与所述对端设备预先约定的序列号 SN或密码 PW,且所述设备还 包括:
加密单元,用于在将所述第一随机数发送给所述对端设备之前,使用 AES 算法对所述第一随机数加密; 解密单元, 用于在接收到所述对端设备发送的被加密的第二随机数后, 采 用所述约定密码对所述第二随机数进行解密。
16、 根据权利要求 13或 14所述的设备, 其特征在于, 所述约定密码为利 用 _0 = N_r ® N _[/计算得到的共享密钥 K— 0, 其中, N— T 为所述第一随机 数, N— U为所述第二随机数, 且所述设备还包括:
加密单元, 用于将所述第一随机数发送给对方之前, 用对端设备的公钥对 所述第一随机数加密;
解密单元, 用于接收到所述对端设备发送的被加密的第二随机数后, 用所 述 PON设备的私钥对所述第二随机数进行解密。
17、 根据权利要求 13至 16任一项所述的设备, 其特征在于, 还包括: 验证单元,用于使用 HMAC函数以及计算得到密钥对所述密钥进行验证; 所述发送单元,还用于将所述验证单元得到的验证结果发送给所述对端设 备;
所述接收单元,还用于从所述对端设备接收所述对端设备对其计算得到的 密钥进行验证计算得到的验证结果;
判断单元,还用于根据所述接收单元接收到的验证结果,确定所述对端设 备的密钥是否与所述 PON设备计算得到的密钥相同。
18、 一种 PON设备, 其特征在于, 包括:
随机数产生单元, 用于产生第一随机数;
公开值生成单元, 用于根据所述第一随机数生成第一公开值;
发送单元, 用于将所述第一公开值发送给与自己通信的对端设备; 接收单元, 用于接收所述对端设备发送的第二公开值, 其中所述第二公开 值为所述对端设备根据其产生的第二随机数生成;
计算单元, 用于使用 HMAC函数、 约定密码以及双方产生的随机数和公 开值计算得到密钥。
PCT/CN2009/073263 2009-08-14 2009-08-14 交换密钥的方法及设备 WO2011017847A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2009/073263 WO2011017847A1 (zh) 2009-08-14 2009-08-14 交换密钥的方法及设备
CN200980154790.6A CN102239661B (zh) 2009-08-14 2009-08-14 交换密钥的方法及设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2009/073263 WO2011017847A1 (zh) 2009-08-14 2009-08-14 交换密钥的方法及设备

Publications (1)

Publication Number Publication Date
WO2011017847A1 true WO2011017847A1 (zh) 2011-02-17

Family

ID=43585854

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/073263 WO2011017847A1 (zh) 2009-08-14 2009-08-14 交换密钥的方法及设备

Country Status (2)

Country Link
CN (1) CN102239661B (zh)
WO (1) WO2011017847A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447380A (zh) * 2014-09-28 2016-03-30 上海贝尔股份有限公司 一种pon网络系统中客户端代码完整性检测方法及装置
CN106161416A (zh) * 2015-05-20 2016-11-23 中兴通讯股份有限公司 一种实现数据传输的方法及光通道传输设备
CN107277078A (zh) * 2017-08-22 2017-10-20 南京晓庄学院 一种家庭网关数据通讯加密方法
WO2019100217A1 (zh) * 2017-11-21 2019-05-31 深圳市汇顶科技股份有限公司 生物识别信息传输建立方法、装置、系统及存储介质
CN111416824A (zh) * 2020-03-23 2020-07-14 阳光凯讯(北京)科技有限公司 一种网络接入认证控制系统

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739660B (zh) * 2012-06-16 2015-07-08 华南师范大学 一种单点登录系统的密钥交换方法
JP6609212B2 (ja) * 2016-03-29 2019-11-20 Kddi株式会社 暗号化通信チャネル確立システム、方法、プログラム及びコンピュータ読取り可能なプログラム記録媒体
CN111786773B (zh) * 2020-06-24 2022-10-18 重庆邮电大学 一种基于md5校验和aes加密的twdm-pon系统物理层安全方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060129814A1 (en) * 2004-12-10 2006-06-15 Eun Jee S Authentication method for link protection in Ethernet Passive Optical Network
CN101072094A (zh) * 2006-05-14 2007-11-14 华为技术有限公司 一种pon系统中密钥协商的方法和系统
CN101073221A (zh) * 2004-12-07 2007-11-14 韩国电子通信研究院 在以太网无源光网络上分发密钥的方法
CN101247220A (zh) * 2008-03-14 2008-08-20 中兴通讯股份有限公司 一种无源光网络系统密钥交换的方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101073221A (zh) * 2004-12-07 2007-11-14 韩国电子通信研究院 在以太网无源光网络上分发密钥的方法
US20060129814A1 (en) * 2004-12-10 2006-06-15 Eun Jee S Authentication method for link protection in Ethernet Passive Optical Network
CN101072094A (zh) * 2006-05-14 2007-11-14 华为技术有限公司 一种pon系统中密钥协商的方法和系统
CN101247220A (zh) * 2008-03-14 2008-08-20 中兴通讯股份有限公司 一种无源光网络系统密钥交换的方法

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447380A (zh) * 2014-09-28 2016-03-30 上海贝尔股份有限公司 一种pon网络系统中客户端代码完整性检测方法及装置
CN106161416A (zh) * 2015-05-20 2016-11-23 中兴通讯股份有限公司 一种实现数据传输的方法及光通道传输设备
WO2016184240A1 (zh) * 2015-05-20 2016-11-24 中兴通讯股份有限公司 一种实现数据传输的方法及光通道传输设备
CN107277078A (zh) * 2017-08-22 2017-10-20 南京晓庄学院 一种家庭网关数据通讯加密方法
WO2019100217A1 (zh) * 2017-11-21 2019-05-31 深圳市汇顶科技股份有限公司 生物识别信息传输建立方法、装置、系统及存储介质
US11245531B2 (en) 2017-11-21 2022-02-08 Shenzhen GOODIX Technology Co., Ltd. Method, apparatus and system for establishing biometric identification information transmission and storage medium
CN111416824A (zh) * 2020-03-23 2020-07-14 阳光凯讯(北京)科技有限公司 一种网络接入认证控制系统

Also Published As

Publication number Publication date
CN102239661B (zh) 2013-09-25
CN102239661A (zh) 2011-11-09

Similar Documents

Publication Publication Date Title
JP4944886B2 (ja) 展性攻撃に対して改良された安全性を有する技術(これに限定されない)を含む非ワンタイムパッド暗号で暗号化した署名鍵を用いた、暗号認証、及び/又は共有暗号鍵の設定
US9032209B2 (en) Optical network terminal management control interface-based passive optical network security enhancement
US9515825B2 (en) Method for password based authentication and apparatus executing the method
WO2011017847A1 (zh) 交换密钥的方法及设备
CN103763356A (zh) 一种安全套接层连接的建立方法、装置及系统
CN110999202A (zh) 用于对数据进行高度安全、高速加密和传输的计算机实现的系统和方法
CN113676448B (zh) 一种基于对称秘钥的离线设备双向认证方法和系统
WO2011017848A1 (zh) 无源光网络设备的认证方法及装置
GB2543359A (en) Methods and apparatus for secure communication
Byun et al. Efficient and provably secure client-to-client password-based key exchange protocol
CN109274489B (zh) 一种在twdm-pon系统下的认证密钥协商方法
Sujatha et al. Optimal adaptive genetic algorithm based hybrid signcryption algorithm for information security
KR20010008102A (ko) 안전한 디피-헬만형 키 합의 프로토콜 구현 방법
Boyd et al. Password-based protocols
Yin et al. Secure authentication scheme for 10 Gbit/s Ethernet passive optical networks
Raghuvamshi et al. Verifier-based Password Authenticated 3P-EKE Protocol using PCLA Keys
Sumanth et al. Confidence Analysis of a Solo Sign-On Device for Distributed Computer Networks
Zhu et al. An efficient client-to-client password-authenticated key exchange resilient to server compromise
Li et al. Research on Downstream Encryption Scheme Based on Timestamp in GEPON Network
Yin et al. AN INTEGRATED SECURITY SCHEME FOR 10 GBIT/S ETHERNET PASSIVE OPTICAL NETWORKS
Manganaro et al. Design of a Password-Based EAP Method
TA et al. A New Approach for Fast Transmission to Remote Cooperative Groups with a New Key Paradigm using Voice Authentication

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 200980154790.6

Country of ref document: CN

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

Ref document number: 09848177

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09848177

Country of ref document: EP

Kind code of ref document: A1