WO2024045680A1 - 一种设备认证方法和相关设备 - Google Patents

一种设备认证方法和相关设备 Download PDF

Info

Publication number
WO2024045680A1
WO2024045680A1 PCT/CN2023/092507 CN2023092507W WO2024045680A1 WO 2024045680 A1 WO2024045680 A1 WO 2024045680A1 CN 2023092507 W CN2023092507 W CN 2023092507W WO 2024045680 A1 WO2024045680 A1 WO 2024045680A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
parameter
plc
authentication
request message
Prior art date
Application number
PCT/CN2023/092507
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 华为技术有限公司
Publication of WO2024045680A1 publication Critical patent/WO2024045680A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B3/00Line transmission systems
    • H04B3/54Systems for transmission via power distribution lines
    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • 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/40Network security protocols

Definitions

  • This application relates to the field of communication technology, and in particular, to a device authentication method and related equipment.
  • Power line communication is a communication method that uses power lines to transmit data and voice signals.
  • the PLC-based network structure may include a PLC gateway and at least one PLC domain, where each PLC domain includes multiple PLC devices. If you want to enable a PLC device to communicate with other PLC devices in the PLC domain, you need to first authenticate and register the PLC device through interaction with the PLC gateway to achieve network access. Generally, PLC equipment is registered first and then certified. Through registration, the PLC device obtains the assigned password (PW), and then the PLC device and PLC gateway authenticate based on the PW to complete network access.
  • PW assigned password
  • a relay device is required to complete the transmission. Since the message has no confidentiality or integrity protection during the transmission process, the relay device It is prone to identity forgery or tampering, man-in-the-middle attacks, and losses such as user information leakage.
  • Embodiments of this application provide a device authentication method and related equipment, which are used to authenticate newly connected devices to the network.
  • the first aspect of this application provides a device authentication method.
  • the first device first obtains the multifunctional semantic device tag on the second device, and the multifunctional semantic device tag includes a self-verification device identification.
  • the authentication request message includes the first parameter
  • the first device calculates the first parameter based on the preset hash function to obtain the first hash value. If the first parameter is modified, the first hash value is not equal to the self-verification device identification.
  • the first device determines that the second device has passed the authentication, thereby avoiding the relay device from being prone to identity forgery or tampering, and achieving man-in-the-middle attacks. This avoids losses such as user information leakage.
  • the first parameter includes a one-time password OTP and a positive integer Ni
  • the first hash value is equal to hash Ni (OTP), where hash() represents the preset hash function, If either OTP or Ni is modified, the first hash value is not equal to the self-verifying device identification. Only when either OTP or Ni has not been modified, can the first hash value be equal to the self-verification device identification, thereby avoiding the relay device from being prone to identity forgery or tampering, achieving man-in-the-middle attacks, and thus avoiding losses such as user information leakage.
  • the first parameter is the first public key PKa
  • the first hash value is hash(PKa)
  • hash() represents the preset hash function
  • the first The public key and the first private key SKa are a paired public and private key pair
  • the second device has the first private key SKa
  • the first hash value is consistent with the self-verification device identification. etc., thus avoiding the possibility of identity forgery or tampering in relay equipment and man-in-the-middle attacks, thereby avoiding losses such as user information leakage.
  • the authentication request message also includes a first signature Sig(Ska,M), and the first device verifies the Sig(Ska,M) based on the first public key PKa, If the verification is passed, the first device performs the step of determining that the second device has passed the authentication, thereby ensuring the integrity of the authentication request message.
  • the multi-functional semantic device tag also includes the ciphertext of the network identification code
  • the authentication request message also includes the ciphertext of the symmetric key
  • the first device is based on a preset ciphertext policy.
  • the attribute base determines the second private key SKb; the first device uses the second private key to decrypt the ciphertext of the symmetric key to obtain the plaintext of the symmetric key; the first device uses the second private key to decrypt the ciphertext of the symmetric key. Decrypt the ciphertext of the network identification code using the plaintext of the key to obtain the plaintext of the network identification code. This ensures that the clear text of the network identification code can only be obtained with the permission of the second device, and also ensures that the relay device or third-party device cannot obtain the clear text of the network identification code.
  • the first device calculates a second parameter based on the preset hash function to obtain a second hash value, where the second parameter includes the plain text of the network identification code;
  • the first device sends an authentication response message to the second device, where the authentication response message includes the second hash value. So that the second device can verify the legitimacy of the first device based on the second hash value.
  • the authentication response message also includes a second public key PKb and a second signature Sig(SKb,M'), where M' is the authentication request message in addition to the Sig(SKb, All information except M'), the Sig(SKb,M') represents the signature of the M' based on the second private key SKb, the second private key SKb and the second public key PKb are matched public-private key pair, thus ensuring the integrity of the authentication response message.
  • the authentication request message further includes a first key negotiation parameter
  • the first device generates a session key based on the first key negotiation parameter and the plain text of the network identification code, so The session key is used to communicate with the second device.
  • secure communication between the first device and the second device is achieved.
  • the authentication response message also includes a second key agreement parameter
  • the first device generates the second key agreement parameter based on the plain text of the network identification code, so that it can be based on the second key agreement parameter.
  • Key agreement parameters generate session keys.
  • the authentication response message also includes the ciphertext of the device's network identity, and the ciphertext of the device's network identity is obtained by encrypting the plaintext of the device's network identity with the session key, so
  • the device network identification is an identification assigned by the first device to the second device. Then, the second device can access the network based on the device's network identification.
  • the second aspect of this application provides a device authentication method.
  • the second device generates an associated self-verification device identification and a first parameter, wherein the first parameter is processed based on a preset hash function. By calculation, the self-verification device identification can be obtained.
  • the second device sends an authentication request message to the first device, where the authentication request message includes a first parameter. If the first parameter is modified, the first hash value is not equal to the self-verification device identification.
  • the first device determines that the second device has passed the authentication, thereby avoiding the relay device from being prone to identity forgery or tampering, and achieving man-in-the-middle attacks. This avoids losses such as user information leakage.
  • the first parameter includes a one-time key OTP and a positive integer Ni
  • the second device generates a random number ID_Seed and sets N, where N is a positive integer greater than 1; the second device is based on The default one
  • the hash function performs N iterative calculations on the ID_Seed, and the obtained value is used as the self-verification device identification; the second device performs i iterative calculations on the ID_Seed based on the preset hash function, and the obtained value
  • the first hash value be equal to the self-verification device identification, thereby avoiding the relay device from being prone to identity forgery or tampering, achieving man-in-the-middle attacks, and thus avoiding losses such as user information leakage.
  • the first parameter is the first public key PKa
  • the first hash value is hash(PKa)
  • hash() represents the preset hash function
  • the first The public key and the first private key SKa are a paired public and private key pair.
  • the second device has the first private key SKa. Only then can the first hash value be equal to the self-verification device identification, thereby avoiding the possibility of relay devices being easily present. Identity forgery or tampering enables man-in-the-middle attacks, thereby avoiding losses such as user information leakage.
  • the authentication request message also includes a first signature Sig(Ska,M), where M is all information in the authentication request message except the Sig(Ska,M);
  • the second device signs the M based on the first private key SKa to obtain the first signature Sig(Ska,M). This ensures the integrity of the authentication request message.
  • the authentication request message also includes the ciphertext of the symmetric key
  • the second device obtains the plaintext of the network identification code
  • the second device encrypts the network identification based on the plaintext of the symmetric key.
  • the plaintext of the code is used to obtain the ciphertext of the network identification code;
  • the second device determines the second public key PKb based on the preset ciphertext policy attribute base;
  • the second device uses the second public key PKb to encrypt all
  • the plain text of the symmetric key is obtained to obtain the cipher text of the symmetric key; thereby ensuring that the plain text of the network identification code can only be obtained with the permission of the second device, and ensuring that the relay device or third-party device cannot obtain the network identification The clear text of the code.
  • the second device receives an authentication response message sent by the first device, and the authentication response message includes a second hash value; the second device is based on the preset hash value.
  • the function calculates the plain text of the network identification code to obtain a third hash value; if the third hash value is equal to the second hash value, the second device determines that the first device passes Certification. So that the second device can verify the legitimacy of the first device based on the second hash value.
  • the authentication response message also includes the second public key PKb and the second signature Sig(SKb,M'), where M' is the authentication request message in addition to the Sig( All information except SKb,M'), the Sig(SKb,M') represents the signature of the M' based on the second private key SKb; the second device signs the M' based on the second public key PKb. Verify the second signature Sig(SKb,M'); if the verification passes, perform the step of the second device determining that the first device has passed the authentication. This ensures the integrity of the authentication response message.
  • the authentication response message also includes a second key negotiation parameter
  • the second device generates a session key based on the second key negotiation parameter and the plain text of the network identification code, so The session key is used to communicate with the first device.
  • secure communication between the first device and the second device is achieved.
  • the authentication request message also includes a first key negotiation parameter X
  • the second device generates the first key negotiation parameter based on the plain text of the network identification code, so that it can be based on the first A key agreement parameter to generate a session key.
  • the authentication response message also includes the ciphertext of the device's network identity, and the ciphertext of the device's network identity is obtained by encrypting the plaintext of the device's network identity with the session key, so The above device is identified on the network as The identity assigned by the first device to the second device; after the second device generates a session key based on the second key negotiation parameter Y and the plain text of the network identification code, the second device generates a session key based on The session key decrypts the ciphertext of the device's network identification and obtains the plaintext of the device's network identification. Then, the second device can access the network based on the device's network identification.
  • the third aspect of this application provides a device authentication method.
  • the first device first obtains a multifunctional semantic device label on the second device, and the multifunctional semantic device label includes a self-verification device identification.
  • the authentication request message includes the first parameter, and the first device can calculate the first parameter based on the preset hash function to obtain the first hash value. If the first parameter is modified, the first hash value is not equal to the self-verification device identification.
  • the first device determines that the second device has passed the authentication, thereby avoiding the relay device from being prone to identity forgery or tampering, and achieving man-in-the-middle attacks. This avoids losses such as user information leakage.
  • a fourth aspect of the present application provides a communication device, which is configured to perform the method performed by the first device in any of the foregoing first aspects.
  • a fifth aspect of the present application provides a communication device, which is configured to perform the method performed by the first device in any of the foregoing second aspects.
  • a sixth aspect of the present application provides a communication system, including: a first device and a second device, wherein the first device is used to perform the method described in any one of the foregoing first aspects; the second device For performing the method described in any one of the aforementioned second aspects.
  • a seventh aspect of the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores instructions that, when run on a computer, cause the computer to execute the above-mentioned first aspect, second aspect, or third aspect. any one of the methods.
  • An eighth aspect of the present application provides a computer program product.
  • the computer program product includes computer execution instructions, and the computer execution instructions are stored in a computer-readable storage medium; at least one processor of the device can read the instructions from the computer-readable storage medium.
  • Computer-executed instructions are executed by at least one processor to cause the device to implement the method described in any one of the above-mentioned first aspect, second aspect, or third aspect.
  • a ninth aspect of the present application provides a communication device, which may include at least one processor, a memory, and a communication interface. At least one processor is coupled with memory and communication interfaces. The memory is used to store instructions, at least one processor is used to execute the instructions, and the communication interface is used to communicate with other communication devices under the control of at least one processor. When executed by at least one processor, the instruction causes at least one processor to execute the method described in any one of the foregoing first aspect, second aspect, or third aspect.
  • a tenth aspect of the present application provides a chip system.
  • the chip system includes a processor and is configured to support the implementation of the functions involved in the method described in any one of the above-mentioned first aspect, second aspect, or third aspect.
  • the chip system may also include a memory for saving necessary program instructions and data.
  • the chip system may be composed of chips, or may include chips and other discrete devices.
  • Figure 1-1 is a schematic diagram of a PLC-based network structure provided by the embodiment of the present application.
  • Figure 1-2 is a schematic structural diagram of the first PLC domain provided by the embodiment of the present application.
  • Figure 2-1 is a schematic flow chart of a device authentication method provided by an embodiment of the present application.
  • Figure 2-2 is a schematic diagram of a multifunctional semantic device identification in an embodiment of the present application.
  • FIG. 2-3 is a schematic flow chart of the PLC device executing HASH i (input) in the embodiment of this application:
  • Figures 2-4 are schematic diagrams of multi-functional semantic device tags in embodiments of the present application.
  • Figure 2-5 is a schematic flow chart of PLC equipment accessing the network in the embodiment of this application.
  • Figure 3 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • Figure 4 is another schematic structural diagram of a communication device provided by an embodiment of the present application.
  • Figure 5 is a schematic structural diagram of a communication system provided by an embodiment of the present application.
  • Figure 6 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • Embodiments of this application provide a device authentication method and related equipment, which are used to authenticate newly connected devices to the network.
  • the embodiments of the present application can be applied to a PLC-based network structure, which includes a PLC gateway and at least one PLC domain.
  • the network structure 100 includes a PLC gateway 110, a first PLC domain 120 and a second PLC domain 130.
  • the network structure 100 may include a fire protection system, a low-voltage power line Internet of Things system, a building control system, a visual access control system, etc., which are not limited here.
  • one PLC domain can include multiple PLC devices.
  • the first PLC domain 120 includes PLC devices 121-126.
  • the connection between the PLC devices 121 to 126 may be copper wires, low-voltage power lines or twisted pairs, etc., in order to facilitate the transmission of carrier signals encoded based on PLC technology.
  • multiple PLC devices can communicate in three communication modes: point-to-pint mode (PM), centralized mode (CM), unified mode (UM) ).
  • PM mode PLC devices communicate in a point-to-point manner, and a direct signal flow is established between two PLC devices through the medium.
  • the PLC device 122 and the PLC device 123 communicate directly through the medium.
  • CM mode indirect communication between PLC devices can only be achieved through one of the PLC devices as the domain access point.
  • PLC device 122 and PLC device 124 communicate indirectly through PLC device 123 (domain access point).
  • UM mode indirect communication is achieved between two PLC devices through relay devices.
  • PLC device 122 and PLC device 126 communicate indirectly through PLC device 125 (relay device).
  • PLC gateway interacts for authentication and registration to achieve network access.
  • PLC equipment is registered first and then certified.
  • PW assigned password
  • a relay device is required to complete the transmission. Since the message has no confidentiality or integrity protection during the transmission process, the relay device It is prone to identity forgery or tampering, man-in-the-middle attacks, and losses such as user information leakage.
  • PLC device 122 and PLC device 126 communicate indirectly through PLC device 127 (relay device).
  • PLC device 127 forwards the message between PLC device 127 and PLC gateway 110. Since there is no security channel, the PLC device 127 can conduct a man-in-the-middle attack.
  • this application proposes a device authentication method and related equipment for authenticating newly added devices to the network.
  • the first device first obtains the multifunctional semantic device tag on the second device, and the multifunctional semantic device tag includes a self-verification device identification.
  • the authentication request message includes the first parameter
  • the first device calculates the first parameter based on the preset hash function to obtain the first hash value. If the first parameter is modified, the first hash value is not equal to the self-verification device identification.
  • the first device determines that the second device has passed the authentication, thereby avoiding the relay device from being prone to identity forgery or tampering, and achieving man-in-the-middle attacks. This avoids losses such as user information leakage.
  • the PLC device is used as the second device and the PLC gateway is used as the first device as an example for explanation.
  • the technical solutions of the embodiments of this application can be applied to PLC equipment and PLC gateways.
  • Both PLC equipment and PLC gateways have built-in PLC security authentication modules.
  • the PLC equipment and PLC gateway are respectively based on the built-in PLC security authentication module.
  • the module implements the methods of the embodiments of this application.
  • the technical solution of this application can be applied to the aforementioned PLC-based network structure, and can also be applied to any other network structure (such as smart homes, smart grids, Wi-Fi networks, etc.), such as dumb terminals. Or devices that need offline operation can be connected to the network to achieve low-cost and efficient results. It should be noted that since there are periodic MAP frames in the PLC-based network structure that allocate network access time windows for PLC devices that are not connected to the network, for other network structures, devices that are not connected to the network can be based on the network structure that is ready to access the network before accessing the network. Under the mechanism of the existing protocol, time synchronization and network access authentication triggering are completed.
  • a device authentication method proposed in the embodiment of this application includes:
  • PLC equipment is programmed with multi-functional semantic device identification.
  • the multi-functional semantic device identification includes the plain text of the self-verification device identification and the network identification code.
  • the multi-functional semantic device identification of device a is Dev IDa, including the self-authenticating device identification (SAIDa) and the plain text of the network identification code ( ⁇ a).
  • the self-verification device identification is generated by the PLC device and can be generated based on a symmetric password or an asymmetric password.
  • the network identification code is generated by the manufacturer, and each PLC device has a unique network identification code.
  • Method 1 Generate self-verification device identification based on symmetric key logic.
  • the PLC device can generate a random number ID_Seed and preset the standard verification times N. Then, the PLC device performs hash transformation on ID_Seed N times, and the result is used as the self-verification device identification.
  • FIG. 2-3 a schematic flow chart for executing HASH i (input) (i is a positive integer between 1 and N) for a PLC device:
  • the initial value of the input (input) is ID_seed.
  • Method 2 Generate self-verification device identification based on asymmetric key logic.
  • the second device may generate a first public key PKa and a first private key SKa, and the first public key PKa and the first private key SKa are a matching public-private key pair. Then, the second device calculates the first public key PKa based on the preset hash function, and the obtained value serves as the self-verification device identification.
  • the logic of the asymmetric key may be based on elliptic curves.
  • the PLC device can be set with a symmetric key.
  • the symmetric key is used to encrypt the plain text of the network identification code to obtain the cipher text of the network identification code; the symmetric key is also used to encrypt the cipher text of the network identification code. Decrypt to obtain the plain text of the network identification code.
  • the multi-functional semantic device tag of PLC equipment includes the cipher text of the self-verification device identification and network identification code. It should be noted that the multi-function semantic device tag of the PLC device is public, and the PLC gateway or any device can obtain the multi-function semantic device tag of the PLC device.
  • the multifunctional semantic device label can be a string (multiple numbers, English and punctuation marks, or a mixture thereof), a serial number, a barcode or a QR code, or other forms, which are not limited here.
  • the length of the self-verification device identifier depends on the selection of the hash algorithm. Generally, SHA-256 can ensure its security, so the length of the self-verification device identifier is 256 bits.
  • the length of the ciphertext of the network ID depends on the length of the plaintext of the network ID and the length of the key used. Generally, the length of the plain text of the network identification code is 96 bits. GCM-AES-128 is used to encrypt the plain text of the network identification code.
  • each version corresponds to a different code element structure (number of code elements).
  • the code element refers to The square black and white dots that make up the QR code, the black dots represent binary 1, and the white dots represent binary 0.
  • L1 is a 21 ⁇ 21 matrix, with 152 bits available;
  • L2 is a 25 ⁇ 25 matrix, with 272 bits available;
  • L3 is a 29 ⁇ 29 matrix, with 440 bits available;
  • L4 is a 29 ⁇ 29 matrix, available 640 bits. Then, excluding the amount of data required for positioning patterns, functional data, etc., the capacity of L3 (440 bits) or higher can meet the 384-bit capacity requirement of the above-mentioned multi-functional semantic device tag.
  • the PLC gateway obtains the multifunctional semantic device tag on the PLC device.
  • the PLC gateway can obtain the multi-functional semantic device tag burned in the PLC device. It should be noted that the multi-functional semantic device label can be displayed on the PLC device.
  • the PLC gateway or any device can obtain the multi-functional semantic device label from the PLC device and obtain the ciphertext of the self-verification device identification and network identification code.
  • the PLC gateway can obtain the information in the QR code or barcode by scanning the code to obtain the multifunctional semantics Device label.
  • the multi-functional semantic device tag can also be a string or a serial number, and the user can input the string or serial number on the PLC gateway.
  • the PLC device can also send multi-functional semantic device tags to the PLC gateway through communication. There are no limitations here.
  • the PLC device sends an authentication request message to the PLC gateway, where the authentication request message carries the first parameter.
  • the domain master node in the PLC domain (one of the multiple PLC devices in the PLC domain can be configured as the domain master node) can periodically broadcast the MAP Frames, PLC devices can detect MAP frames through the medium. If the PLC device detects the MAP frame, that is, the PLC domain is discovered, the PLC device can initiate authentication with the PLC gateway to achieve network access, thereby making the PLC device become a PLC device of the PLC domain. If the PLC device does not discover the PLC domain, the PLC device can create a PLC domain on its own and become the domain master node of the PLC domain.
  • the PLC device when it detects a MAP frame, it can send an authentication request message to the PLC gateway based on the MAP frame.
  • the MAP frame is used to arrange the transmission time slots of each PLC device in the PLC domain in the next MAC cycle.
  • the MAP frame is also used to notify the newly powered-on PLC device of the network access time window.
  • the PLC device can send an authentication request message to the PLC gateway in the network access time window indicated by the MAP frame. It should be noted that if the PLC device and the PLC gateway cannot be directly connected, the authentication request message can be forwarded through the relay device designated by the PLC gateway.
  • the authentication request message may also include a random function Rand C.
  • the gateway identifier of PLC gateway b is GW_IDb
  • the authentication request message may include the self-verification device identification of the PLC device, the gateway identification of the PLC gateway, and the parameters of the elliptic curve.
  • the first parameter is the first public key.
  • the authentication request message may also include any one or more of the current timestamp and a random function.
  • the gateway identifier of PLC gateway b is GW_IDb
  • the authentication request message includes ⁇ SAIDa,GW_IDb,p,G,x,y,PKa,Sig(Ska,M) ⁇ or ⁇ SAIDa,GW_IDb,p,G,x ,y,PKa,timestamp,Rand C,Sig(Ska,M) ⁇ , where p,G,x,y are the parameters of the elliptic curve, PKa is the first public key, timestamp is the current timestamp, and Rand C is used Generate a random number to prevent replay.
  • M represents all information in the authentication request message except Sig(Ska,M).
  • Sig(Ska,M) represents the first signature of M through the first private key SKa.
  • the authentication request message may also include the ciphertext of the symmetric key.
  • the plain text of the symmetric key is used to encrypt the plain text of the network identification code to obtain the cipher text of the network identification code, or the plain text of the symmetric key is used to decrypt the cipher text of the network identification code to obtain the plain text of the network identification code.
  • the PLC device can use the second public key to encrypt the plaintext of the symmetric key to obtain the ciphertext of the symmetric key.
  • the PLC gateway can use the second private key to decrypt the ciphertext of the symmetric key to obtain the plaintext of the symmetric key, and then use the plaintext of the symmetric key to decrypt the ciphertext of the network identification code to obtain the plaintext of the network identification code.
  • the PLC device can obtain the ciphertext policy attribute base associated with the PLC gateway to obtain the second public key used to encrypt the symmetric key.
  • the ciphertext policy attribute base can be customized in specific scenarios, such as manufacturer, production date, CPU model, memory size, etc.
  • the PLC gateway can obtain the second private key corresponding to the second public key based on the same ciphertext policy attribute base.
  • PLC device a can obtain the ciphertext policy attribute base associated with PLC gateway b to obtain the second public key PKb used to encrypt the symmetric key PDK. Then, PLC gateway b can obtain the second private key SKb corresponding to the second public key PKb based on the ciphertext policy attribute base, decrypt the ciphertext of the PDK based on SKb, obtain the plaintext of the PDK, and decrypt the network identification code based on the plaintext of the PDK. ciphertext to obtain the plaintext of the network identification code.
  • key negotiation can be implemented between the PLC device and the PLC gateway based on the password-based authenticated key exchange (PAKE) protocol, that is, the authentication request message also includes the first key negotiation parameter.
  • PAKE password-based authenticated key exchange
  • the authentication request message may include the first key negotiation parameter X, where X can be obtained through the following algorithm:
  • the PLC gateway verifies the legitimacy of the PLC device based on the authentication request message.
  • the PLC gateway can calculate the first parameter based on a preset hash function to obtain the first hash value. If the first hash value is equal to the self-verification device identification, the first device determines that the second device is authenticated.
  • the first hash value is equal to hash Ni (OTP), where hash() represents the preset hash function.
  • the relay device receives the authentication request message, and the authentication request message includes ⁇ SAIDa,GW_IDb,N-i,OTP ⁇ or ⁇ SAIDa,GW_IDb,N-i,OTP,Rand C ⁇ , the relay device forwards the authentication request message.
  • the above equation would not hold. In other words, as long as the above equation holds, none of SAIDa, N-i, or OTP has been modified, thereby preventing the process of the PLC device from sending the authentication request message from being attacked by a man-in-the-middle.
  • the first parameter is the first public key.
  • the first device can calculate the first public key PKa based on the preset hash function, and the obtained value hash(PKa) is used as the first hash value, where hash() means Default hash function.
  • the authentication request message may also include the first signature Sig(Ska,M), and the first device may verify Sig(Ska,M) based on the first public key PKa. If the verification passes, the first device determines that the second device has passed the authentication.
  • the PLC gateway obtains the ciphertext of the decrypted network identification code based on the authentication request message and obtains the plaintext of the network identification code.
  • the PLC gateway can obtain the ciphertext policy attribute base associated with the PLC gateway to obtain the first private key, and use the first private key to decrypt the ciphertext of the symmetric key to obtain the ciphertext of the symmetric key.
  • plaintext and decrypts the ciphertext of the network identification code based on the plaintext of the symmetric key to obtain the plaintext of the network identification code.
  • Other devices other than the PLC gateway cannot obtain the first private key because they do not have a ciphertext policy attribute base and a corresponding calculation method. That is, they cannot decrypt the ciphertext of the symmetric key to obtain the plaintext of the symmetric key, nor can they obtain the plaintext of the symmetric key.
  • the plaintext of the network identification code is decrypted based on the symmetric key, thereby realizing the confidentiality of the plaintext of the network identification code. It also ensures that with the permission of the PLC device (through the ciphertext of the symmetric key), the PLC gateway can obtain the plaintext of the network identification code.
  • the authentication request message includes the ciphertext of the symmetric key PDKa, and then the PLC gateway uses the corresponding ciphertext policy attribute base to obtain the first private key SKa, and uses SKa to decrypt the ciphertext of PDKa.
  • text obtain the plaintext of PDKa, and then use the plaintext of PDKa to decrypt the label ( ⁇ a) obtained in step 202, and obtain the plaintext ⁇ a of the network identification code corresponding to the PLC device a.
  • the PLC gateway generates a session key based on the first key negotiation parameter and the plain text of the network identification code.
  • key negotiation can be implemented between the PLC device and the PLC gateway based on the password-based authenticated key exchange protocol (PAKE). That is, the authentication response message carries the second key negotiation parameter Y calculated by the PLC gateway.
  • PAKE password-based authenticated key exchange protocol
  • the exemplary PLC gateway b can calculate the second key agreement parameter Y, where Y can be obtained through the following algorithm:
  • key negotiation can be implemented between the PLC device and the PLC gateway based on PAKE.
  • the PLC gateway sends an authentication response message to the PLC device, where the authentication response message includes the second parameter.
  • the authentication response message may include: the self-verification device identification of the PLC device and the gateway identification of the PLC gateway. In some feasible implementations, the authentication response message may also include the self-verification device identification of the PLC device, the gateway identification of the PLC gateway, and any one or more of the following: the second public key, the second hash value (the second The public key, the plain text of the network identification code, the hash value of any one or more of the random functions), and the signature of all the aforementioned information using the second private key. Among them, the second parameter is the second hash value.
  • the authentication response message sent by PLC gateway b to PLC device a may include ⁇ SAIDa, GW_IDb ⁇ or ⁇ SAIDa, GW_IDb, hash(Q) ⁇ , where SAIDa is the SAID of PLC device a and GW IDb is the PLC gateway.
  • the gateway identifier of b, Q can be one or more of ⁇ a, PKa, Rand C, ⁇ a is the plain text of the network identification code, PKb is the second public key, Rand C is used to generate random numbers to prevent replay, hash ( Q) is the second hash value, and HASH() is the preset hash function.
  • the authentication response message sent by PLC gateway b to PLC device a may include ⁇ SAIDa,GW_IDb,hash(Q),Sig(SKb,M') ⁇ , ⁇ SAIDa,GW_IDb,PKa,hash(Q) ⁇ or ⁇ SAIDa,GW_IDb,PKa,hash(Q),Sig(SKb,M') ⁇ , where Q can be one or more of ⁇ a, PKa, Rand C, ⁇ a is the plain text of the network identification code, and PKb is the Two public keys, Rand C is used to generate random numbers to prevent replay, HASH() is the preset hash function, M' represents all other information in the authentication response message except the signature, Sig(SKb,M') represents Signature of M' via private key.
  • the PLC gateway can also assign a device network identifier to the PLC device, and use the session key to encrypt the device network identifier to obtain the plain text of the device network identifier.
  • the authentication response message may carry the ciphertext of the device's network identity.
  • the ciphertext of the device's network identity is obtained by encrypting the plain text of the device's network identity with the session key.
  • the device's network identity is assigned by the first device to the second device. logo.
  • PLC gateway b allocates device in-network identification (Dev in-network ID'a) to PLC device a, encrypts the plain text of Dev in-network ID'a through session key ab, and obtains Dev in-network ID' The ciphertext of a.
  • Dev in-network ID'a device in-network identification
  • the PLC gateway can, after sending the authentication response message, use the session key to encrypt the plain text of the device's network identity, obtain the ciphertext of the device's network identity, and then send the password of the device's network identity to the PLC device.
  • the session key can be used to encrypt the plain text of the device's network identity, obtain the ciphertext of the device's network identity, and then send the password of the device's network identity to the PLC device.
  • the authentication response message carries the second key negotiation parameter Y.
  • the PLC device verifies the legitimacy of the PLC gateway based on the authentication response message.
  • the second device calculates the plaintext of the network identification code based on a preset hash function to obtain a third hash value. If the third hash value is equal to the second hash value, the second device determines that the first device is authenticated.
  • the authentication response message can include the self-verification device identification of the PLC device and the gateway identification of the PLC gateway, there is no need to verify the legitimacy of the PLC gateway. For example, if the authentication response message returned by PLC gateway b to PLC device a includes ⁇ SAIDa, GW_IDb ⁇ , then the PLC device does not need to verify the legitimacy of the PLC gateway.
  • the authentication response message includes the self-verification device identification of the PLC device, the gateway identification of the PLC gateway, and any one or more of the following: the second public key, the second hash value (the second public key any one or more of the key, the plain text of the network identification code, the hash value of the random function) and the signature of all the aforementioned information based on the second private key. Then the PLC device can verify the legitimacy of the PLC gateway.
  • the authentication response message includes ⁇ SAIDa, GW_IDb, hash(Q) ⁇ or ⁇ SAIDa, GW_IDb, PKa, hash(Q) ⁇ , where Q can be one of the preset ⁇ a, PKa, Rand C or Multiple, ⁇ a is the plain text of the network identification code, PKb is the second public key, Rand C is used to generate random numbers to prevent replay, and HASH() is the preset hash function.
  • the authentication response message returned by PLC gateway b to PLC device a may include ⁇ SAIDa,GW_IDb,hash(Q),Sig(SKb,M') ⁇ or ⁇ SAIDa,GW_IDb,PKa,hash(Q),Sig (SKb,M') ⁇ , where Q can be one or more of the preset ⁇ a, PKa, Rand C, ⁇ a is the plain text of the network identification code, PKb is the second public key, and Rand C is used to generate random To prevent replay, HASH() is the preset hash function, M' represents all other information in the authentication response message except the signature, and Sig(SKb,M') represents the signature of M' through the private key.
  • the second device can also verify the second signature Sig(SKb,M') based on the second public key PKb.
  • the PLC device can also verify Sig(SKb,M’) through PKa to verify the integrity of M’.
  • the authentication response message can be considered to be verified, and subsequent steps 209-210 can be further performed, otherwise the authentication response message is considered If the message cannot be verified, subsequent steps 209-210 will not be performed.
  • the PLC device generates a session key based on the second key negotiation parameter and the plain text of the network identification code.
  • the public parameters of the elliptic curve Ep(x, y) are: p, G, x, y, where p is a large prime number, G is the base point of the elliptic curve, and the order of G is n.
  • the PLC device decrypts the ciphertext of the device's network identification based on the session key and obtains the plaintext of the device's network identification.
  • PLC device a After PLC device a receives the ciphertext of Dev in-network ID'a sent by PLC gateway b, it can use key ab to decrypt the ciphertext of Dev in-network ID'a to obtain Dev in-network ID'
  • the plain text of a, and Dev in-network ID'a is used as the identification of the PLC device in the PLC domain, and key ab is used to communicate with the PLC gateway.
  • a communication device 300 used as a first device, may include: an acquisition module 301, configured to acquire a multi-function semantic device tag on a second device.
  • the semantic device tag includes a self-verification device identification;
  • the transceiver module 302 is used to receive the authentication request message sent by the second device, the authentication request message includes the first parameter;
  • the processing module 303 is used to based on the preset hash function The first parameter is calculated to obtain a first hash value; the processing module 303 is also configured to determine that the second device has passed the authentication if the first hash value is equal to the self-verification device identification.
  • the first parameter includes a one-time password OTP and a positive integer Ni
  • the first hash value is equal to hash Ni (OTP), where hash() represents the preset hash function.
  • the authentication request message also includes the first public key Pka; the processing module 303 is also configured to calculate the PKa based on the preset hash function to obtain the value hash(PKa ) as the first hash value, where hash() represents the preset hash function.
  • the authentication request message also includes a first signature Sig(Ska,M); the processing module 303 is also configured to perform a signature on the Sig(Ska,M) based on the first public key PKa. Verify, if the verification passes, perform the step of determining that the second device has passed the certification.
  • the multi-functional semantic device tag also includes the ciphertext of the network identification code
  • the authentication request message also includes the ciphertext of the symmetric key.
  • the processing module is also configured to based on the preset ciphertext.
  • the policy attribute base determines the second private key SKb; uses the second private key to decrypt the ciphertext of the symmetric key to obtain the plaintext of the symmetric key; decrypts the network identification code based on the plaintext of the symmetric key ciphertext to obtain the plaintext of the network identification code.
  • the processing module 303 is also configured to calculate a second parameter based on the preset hash function to obtain a second hash value, where the second parameter includes the network identification code. Plain text; the transceiver module 303 is also configured to send an authentication response message to the second device, where the authentication response message includes the second hash value.
  • the authentication response message also includes a second public key PKb and a second signature Sig(SKb,M'), where M' is the authentication request message in addition to the Sig(SKb, All information except M'), the Sig(SKb,M') represents the signature of the M' based on the second private key SKb, the second private key SKb and the second public key PKb are matched public-private key pair.
  • the authentication request message further includes a first key negotiation parameter
  • the first device generates a session key based on the first key negotiation parameter and the plain text of the network identification code, so The session key is used to communicate with the second device.
  • the authentication response message further includes a second key negotiation parameter
  • the processing module 303 is configured to generate the second key negotiation parameter based on the plain text of the network identification code.
  • the authentication response message also includes the ciphertext of the device's network identity, and the ciphertext of the device's network identity is obtained by encrypting the plaintext of the device's network identity with the session key, so
  • the device network identification is an identification assigned by the first device to the second device.
  • a communication device 400 may include: a processing module 401 for generating an associated self-verification device identification and a first parameter, wherein based on Default The hash function is used to calculate the first parameter to obtain the self-verification device identification; the transceiver module 402 is configured to send an authentication request message to the first device, where the authentication request message includes the first parameter.
  • the first parameter includes a one-time key OTP and a positive integer Ni; the processing module 401 is also used to generate a random number ID_Seed and set N, where N is a positive integer greater than 1; based on the predetermined Assume that the hash function is used to perform N iterative calculations on the ID_Seed, and the obtained value is used as the self-verification device identification; based on the preset hash function, the ID_Seed is used for i iterative calculations, and the obtained value is used as the self-verification device identification.
  • i is a positive integer less than N
  • Ni N-i.
  • the first parameter is the first public key Pka
  • the first hash value is hash(PKa)
  • hash() represents the preset hash function
  • the first hash value is hash(PKa).
  • a public key and a first private key SKa are a paired public and private key pair
  • the second device has the first private key SKa.
  • the authentication request message also includes a first signature Sig(Ska,M), where M is all information in the authentication request message except the Sig(Ska,M); process Module 401 is also used to sign the M based on the first private key SKa to obtain the first signature Sig(Ska,M).
  • the authentication request message also includes the ciphertext of the symmetric key;
  • the communication device 400 also includes an acquisition module 403 for acquiring the plaintext of the network identification code; and a processing module 401 for The plaintext of the key encrypts the plaintext of the network identification code to obtain the ciphertext of the network identification code; determines the second public key PKb based on the preset ciphertext policy attribute base; uses the second public key PKb to encrypt the The plaintext of the symmetric key is obtained to obtain the ciphertext of the symmetric key.
  • the transceiver module 402 is also configured to receive an authentication response message sent by the first device, where the authentication response message includes a second hash value; the processing module 401 is also configured to based on the predetermined Assume that the hash function calculates the plain text of the network identification code to obtain a third hash value; if the third hash value is equal to the second hash value, it is determined that the first device has passed the authentication .
  • the authentication response message also includes the second public key PKb and the second signature Sig(SKb,M'), where M' is the authentication request message in addition to the Sig( All information except SKb,M'), the Sig(SKb,M') represents the signature of the M' based on the second private key SKb; the processing module 401 is also used to based on the second public key PKb Verify the second signature Sig(SKb,M'); if the verification passes, perform the step of determining that the first device has passed the authentication.
  • M' is the authentication request message in addition to the Sig( All information except SKb,M')
  • the Sig(SKb,M') represents the signature of the M' based on the second private key SKb
  • the processing module 401 is also used to based on the second public key PKb Verify the second signature Sig(SKb,M'); if the verification passes, perform the step of determining that the first device has passed the authentication.
  • the authentication response message also includes a second key agreement parameter; the processing module 401 is also configured to generate a session key based on the second key agreement parameter and the plain text of the network identification code. , the session key is used to communicate with the first device.
  • the authentication request message further includes a first key negotiation parameter; the processing module 401 is further configured to generate the first key negotiation parameter based on the plain text of the network identification code.
  • the authentication response message also includes the ciphertext of the device's network identity, and the ciphertext of the device's network identity is obtained by encrypting the plaintext of the device's network identity with the session key, so
  • the device on-network identification is an identification assigned by the first device to the second device; the processing module 401 is also configured to decrypt the ciphertext of the device on-network identification based on the session key to obtain the device on-network identification.
  • the clear text of the network identifier is an identification assigned by the first device to the second device.
  • a communication system 500 provided by an embodiment of the present application includes a first device 510 and a first device 510. Second equipment 520. Among them, the first device 510 is used to obtain the multi-functional semantic device label on the second device 520, and the multi-functional semantic device label includes a self-verification device identification; the second device 520 is used to generate an associated self-verification device identification.
  • the self-verification device identification can be obtained by calculating the first parameter based on a preset hash function; the second device 520 is also used to send a message to the first device 510 Authentication request message, the authentication request message includes a first parameter; the first device 510 is also configured to calculate the first parameter based on a preset hash function to obtain a first hash value; A device 510 is also configured to determine that the second device 520 has passed the authentication if the first hash value is equal to the self-verification device identification.
  • An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a program, and the program executes some or all of the steps described in the above method embodiments.
  • the communication device 600 includes: a receiver 601, a transmitter 602, a processor 603, and a memory 604.
  • the receiver 601, the transmitter 602, the processor 603 and the memory 604 may be connected through a bus or other means, wherein the connection through the bus is taken as an example in FIG. 6 .
  • Memory 604 may include read-only memory and random access memory and provides instructions and data to processor 603 .
  • a portion of memory 604 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 604 stores an operating system and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, where the operating instructions may include various operating instructions for implementing various operations.
  • the operating system may include various system programs that are used to implement various basic services and handle hardware-based tasks.
  • the processor 603 controls the operation of the communication device 600.
  • the processor 603 may also be called a central processing unit (CPU).
  • CPU central processing unit
  • various components of the communication device 600 are coupled together through a bus system, where in addition to a data bus, the bus system may also include a power bus, a control bus, a status signal bus, etc.
  • bus systems in the figure.
  • the methods disclosed in the above embodiments of the present application can be applied to the processor 603 or implemented by the processor 603.
  • the processor 603 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 603 .
  • the above-mentioned processor 603 may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or Other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field-programmable gate array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory 604.
  • the processor 603 reads the information in the memory 604 and completes the steps of the above method in combination with its hardware.
  • the receiver 601 can be used to receive input numeric or character information and generate signal input related to related settings and function control.
  • the transmitter 602 can include a display device such as a display screen.
  • the transmitter 602 can be used to output numeric or character information through an external interface. .
  • the processor 603 is used to execute the aforementioned device authentication method.
  • the communication device 300, the communication device 400 or the communication device 600 when the communication device 300, the communication device 400 or the communication device 600 is a chip, it includes: a processing unit and a communication unit.
  • the processing unit may be a processor, for example, and the communication unit may be, for example. Input/output interface, pin or circuit, etc.
  • the processing unit can execute the computer execution instructions stored in the storage unit, so that the chip in the terminal executes the wireless report information sending method of any one of the above first aspects.
  • the storage unit is a storage unit within the chip, such as a register, cache, etc.
  • the storage unit may also be a storage unit in the terminal located outside the chip, such as a read-only memory (read-only memory). -only memory, ROM) or other types of static storage devices that can store static information and instructions, random access memory (random access memory, RAM), etc.
  • the processor mentioned in any of the above places may be a general central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control program execution of the above method.
  • the device embodiments described above are only illustrative.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physically separate.
  • the physical unit can be located in one place, or it can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the connection relationship between modules indicates that there are communication connections between them, which can be specifically implemented as one or more communication buses or signal lines.
  • the present application can be implemented by software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memories, Special components, etc. to achieve. In general, all functions performed by computer programs can be easily implemented with corresponding hardware. Moreover, the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special-purpose circuits. circuit etc. However, for this application, software program implementation is a better implementation in most cases. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or that contributes to the existing technology.
  • the computer software product is stored in a readable storage medium, such as a computer floppy disk. , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to cause a computer device (which can be a personal computer, server, or network device, etc.) to execute the method described in each embodiment of the application. .
  • a computer device which can be a personal computer, server, or network device, etc.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transferred from a website, computer, server, or data center To another party through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) website, computer, server or data center.
  • wired such as coaxial cable, optical fiber, digital subscriber line (DSL)
  • wireless such as infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that a computer can store, or a data storage device such as a server or data center integrated with one or more available media.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (Solid State Disk, SSD)), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

本申请实施例公开了一种设备认证方法和相关设备,用于为新入网的设备进行认证。本申请第一方面提供了一种设备认证方法。在本申请中,第一设备首先获取第二设备上的多功能语义设备标签,多功能语义设备标签包括自验证设备标识。当第一设备接收到第二设备发送的认证请求消息,认证请求消息包括第一参数,第一设备基于预设的哈希函数对第一参数进行计算,得到第一哈希值。若第一参数被修改,则第一哈希值与自验证设备标识不相等。只有第一参数未被修改,第一哈希值与自验证设备标识才能相等,则第一设备确定第二设备通过认证,从而避免了中继设备容易出现身份伪造或篡改,实现中间人攻击,从而避免了用户的信息泄露等损失。

Description

一种设备认证方法和相关设备
本申请要求于2022年08月31日提交中国专利局、申请号为202211063837.1、发明名称为“一种设备认证方法和相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种设备认证方法和相关设备。
背景技术
电力线通信(power line communication,PLC)是一种利用电力线传输数据和话音信号的通信方式。
基于PLC的网络结构可以包括PLC网关和至少一个PLC域,其中,每个PLC域包括多个PLC设备。若想要实现PLC设备与PLC域中的其他PLC设备通信,需要首先使该PLC设备通过与PLC网关的交互进行认证和注册,从而实现入网。一般的,PLC设备先注册,再认证。通过注册,PLC设备获得了分配的口令(pass word,PW),然后PLC设备和PLC网关基于该PW进行认证,以完成入网。
PLC设备与PLC网关进行认证的过程中,若PLC设备与PLC网关之间没有直连链路时,需要中继设备完成传输,由于消息在传输过程中没有机密性或完整性保护,中继设备容易出现身份伪造或篡改,实现中间人攻击,造成用户的信息泄露等损失。
发明内容
本申请实施例提供了一种设备认证方法和相关设备,用于为新入网的设备进行认证。
本申请第一方面提供了一种设备认证方法。在本申请中,第一设备首先获取第二设备上的多功能语义设备标签,多功能语义设备标签包括自验证设备标识。当第一设备接收到第二设备发送的认证请求消息,认证请求消息包括第一参数,第一设备基于预设的哈希函数对第一参数进行计算,得到第一哈希值。若第一参数被修改,则第一哈希值与自验证设备标识不相等。只有第一参数未被修改,第一哈希值与自验证设备标识才能相等,则第一设备确定第二设备通过认证,从而避免了中继设备容易出现身份伪造或篡改,实现中间人攻击,从而避免了用户的信息泄露等损失。
在一些可能的实现方式中,所述第一参数包括一次性密码OTP和正整数Ni,所述第一哈希值等于hashNi(OTP),其中hash()表示所述预设的哈希函数,若OTP或Ni任一个被修改,则第一哈希值与自验证设备标识不相等。只有OTP或Ni任一个未被修改,第一哈希值与自验证设备标识才能相等,从而避免了中继设备容易出现身份伪造或篡改,实现中间人攻击,从而避免了用户的信息泄露等损失。
在一些可能的实现方式中,所述第一参数为第一公钥PKa所述第一哈希值为hash(PKa),其中hash()表示所述预设的哈希函数,所述第一公钥和第一私钥SKa为配对的公私钥对,所述第二设备具有所述第一私钥SKa,第一哈希值与自验证设备标识才能相 等,从而避免了中继设备容易出现身份伪造或篡改,实现中间人攻击,从而避免了用户的信息泄露等损失。
在一些可能的实现方式中,所述认证请求消息还包括第一签名Sig(Ska,M),所述第一设备基于所述第一公钥PKa对所述Sig(Ska,M)进行验证,若验证通过,则执行所述第一设备确定所述第二设备通过认证的步骤,从而保障了认证请求消息的完整性。
在一些可能的实现方式中,所述多功能语义设备标签还包括网络识别码的密文,所述认证请求消息还包括对称密钥的密文,所述第一设备基于预设的密文策略属性基确定第二私钥SKb;所述第一设备使用所述第二私钥解密所述对称密钥的密文,得到所述对称密钥的明文;所述第一设备基于所述对称密钥的明文解密所述网络识别码的密文,得到所述网络识别码的明文。从而保障了只有在第二设备的许可下才能得到网络识别码的明文,而且保障了中继设备或第三方设备无法获得网络识别码的明文。
在一些可能的实现方式中,所述第一设备基于所述预设的哈希函数对第二参数进行计算,得到第二哈希值,所述第二参数包括所述网络识别码的明文;所述第一设备向所述第二设备发送认证响应消息,所述认证响应消息包括所述第二哈希值。以使得第二设备可以基于第二哈希值验证第一设备的合法性。
在一些可能的实现方式中,所述认证响应消息还包括第二公钥PKb和第二签名Sig(SKb,M’),所述M’为所述认证请求消息中除了所述Sig(SKb,M’)之外所有信息,所述Sig(SKb,M’)表示基于第二私钥SKb对所述M’进行的签名,所述第二私钥SKb和所述第二公钥PKb为匹配的公私钥对,从而保障了认证响应消息的完整性。
在一些可能的实现方式中,所述认证请求消息还包括第一密钥协商参数,所述第一设备基于所述第一密钥协商参数和所述网络识别码的明文生成会话密钥,所述会话密钥用于与所述第二设备通信。从而实现了第一设备和第二设备之间的保密通信。
在一些可能的实现方式中,所述认证响应消息还包括第二密钥协商参数,所述第一设备基于所述网络识别码的明文生成所述第二密钥协商参数,从而可以基于第二密钥协商参数生成会话密钥。
在一些可能的实现方式中,所述认证响应消息还包括设备在网标识的密文,所述设备在网标识的密文由所述会话密钥加密所述设备在网标识的明文得到,所述设备在网标识为所述第一设备为所述第二设备分配的标识。那么,第二设备可以凭着设备在网标识实现入网。
本申请第二方面提供了一种设备认证方法,在本申请中,第二设备生成相关联的自验证设备标识和第一参数,其中,基于预设的哈希函数对所述第一参数进行计算,可得所述自验证设备标识。所述第二设备向所述第一设备发送认证请求消息,所述认证请求消息包括第一参数。若第一参数被修改,则第一哈希值与自验证设备标识不相等。只有第一参数未被修改,第一哈希值与自验证设备标识才能相等,则第一设备确定第二设备通过认证,从而避免了中继设备容易出现身份伪造或篡改,实现中间人攻击,从而避免了用户的信息泄露等损失。
在一些可能的实现方式中,所述第一参数包括一次性密钥OTP和正整数Ni,所述第二设备生成随机数ID_Seed并设置N,N为大于1的正整数;所述第二设备基于所述预设的哈 希函数对所述ID_Seed进行N次迭代计算,得到的值作为所述自验证设备标识;所述第二设备基于所述预设的哈希函数对所述ID_Seed进行i次迭代计算,得到的值作为所述OTP,i为小于N的正整数,Ni=N-i。只有OTP或Ni任一个未被修改,第一哈希值与自验证设备标识才能相等,从而避免了中继设备容易出现身份伪造或篡改,实现中间人攻击,从而避免了用户的信息泄露等损失。
在一些可能的实现方式中,所述第一参数为第一公钥PKa所述第一哈希值为hash(PKa),其中hash()表示所述预设的哈希函数,所述第一公钥和第一私钥SKa为配对的公私钥对,所述第二设备具有所述第一私钥SKa,第一哈希值与自验证设备标识才能相等,从而避免了中继设备容易出现身份伪造或篡改,实现中间人攻击,从而避免了用户的信息泄露等损失。
在一些可能的实现方式中,所述认证请求消息还包括第一签名Sig(Ska,M),所述M为所述认证请求消息中除了所述Sig(Ska,M)之外所有信息;所述第二设备基于所述第一私钥SKa对所述M进行签名,得到所述第一签名Sig(Ska,M)。从而保障了认证请求消息的完整性。
在一些可能的实现方式中,所述认证请求消息还包括对称密钥的密文,所述第二设备获取网络识别码的明文;所述第二设备基于对称密钥的明文加密所述网络识别码的明文,得到所述网络识别码的密文;所述第二设备基于预设的密文策略属性基确定第二公钥PKb;所述第二设备使用所述第二公钥PKb加密所述对称密钥的明文,得到所述对称密钥的密文;从而保障了只有在第二设备的许可下才能得到网络识别码的明文,而且保障了中继设备或第三方设备无法获得网络识别码的明文。
在一些可能的实现方式中,所述第二设备接收所述第一设备发送的认证响应消息,所述认证响应消息包括第二哈希值;所述第二设备基于所述预设的哈希函数对所述网络识别码的明文进行计算,得到第三哈希值;若所述第三哈希值与所述第二哈希值相等,则所述第二设备确定所述第一设备通过认证。以使得第二设备可以基于第二哈希值验证第一设备的合法性。
在一些可能的实现方式中,所述认证响应消息还包括所述第二公钥PKb和第二签名Sig(SKb,M’),所述M’为所述认证请求消息中除了所述Sig(SKb,M’)之外所有信息,所述Sig(SKb,M’)表示基于第二私钥SKb对所述M’进行的签名;所述第二设备基于所述第二公钥PKb对所述第二签名Sig(SKb,M’)进行验证;若验证通过,则执行所述第二设备确定所述第一设备通过认证的步骤。从而保障了认证响应消息的完整性。
在一些可能的实现方式中,所述认证响应消息还包括第二密钥协商参数,所述第二设备基于所述第二密钥协商参数和所述网络识别码的明文生成会话密钥,所述会话密钥用于与所述第一设备通信。从而实现了第一设备和第二设备之间的保密通信。
在一些可能的实现方式中,所述认证请求消息还包括第一密钥协商参数X,所述第二设备基于所述网络识别码的明文生成所述第一密钥协商参数,从而可以基于第一密钥协商参数生成会话密钥。
在一些可能的实现方式中,所述认证响应消息还包括设备在网标识的密文,所述设备在网标识的密文由所述会话密钥加密所述设备在网标识的明文得到,所述设备在网标识为 所述第一设备为所述第二设备分配的标识;所述第二设备基于所述第二密钥协商参数Y和所述网络识别码的明文生成会话密钥之后,所述第二设备基于所述会话密钥解密所述设备在网标识的密文,得到所述设备在网标识的明文。那么,第二设备可以凭着设备在网标识实现入网。
本申请第三方面提供了一种设备认证方法,在本申请中,第一设备首先获取第二设备上的多功能语义设备标签,多功能语义设备标签包括自验证设备标识。当第二设备向第一设备接收发送认证请求消息后,认证请求消息包括第一参数,第一设备可以基于预设的哈希函数对第一参数进行计算,得到第一哈希值。若第一参数被修改,则第一哈希值与自验证设备标识不相等。只有第一参数未被修改,第一哈希值与自验证设备标识才能相等,则第一设备确定第二设备通过认证,从而避免了中继设备容易出现身份伪造或篡改,实现中间人攻击,从而避免了用户的信息泄露等损失。
本申请第四方面提供了一种通信设备,所述通信设备用于执行前述第一方面中任一项中第一设备所执行的方法。
本申请第五方面提供了一种通信设备,所述通信设备用于执行前述第二方面中任一项中第一设备所执行的方法。
本申请第六方面提供了一种通信系统,包括:第一设备和第二设备,其中,所述第一设备用于执行前述第一方面中任一项所述的方法;所述第二设备用于执行前述第二方面中任一项所述的方法。
本申请第七方面提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面或第二方面或第三方面中任一项所述的方法。
本申请第八方面提供一种计算机程序产品,该计算机程序产品包括计算机执行指令,该计算机执行指令存储在计算机可读存储介质中;设备的至少一个处理器可以从计算机可读存储介质读取该计算机执行指令,至少一个处理器执行该计算机执行指令使得设备实施上述第一方面或第二方面或第三方面中任一项所述的方法。
本申请第九方面提供一种通信装置,该通信装置可以包括至少一个处理器、存储器和通信接口。至少一个处理器与存储器和通信接口耦合。存储器用于存储指令,至少一个处理器用于执行该指令,通信接口用于在至少一个处理器的控制下与其他通信装置进行通信。该指令在被至少一个处理器执行时,使至少一个处理器执行前述第一方面或第二方面或第三方面中任一项所述的方法。
本申请第十方面提供了一种芯片系统,该芯片系统包括处理器,用于支持实现上述第一方面或第二方面或第三方面中任一项所述的方法中所涉及的功能。
在一种可能的设计中,芯片系统还可以包括存储器,存储器,用于保存必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件。
其中,第四至第十方面或者其中任一种可能实现方式所带来的技术效果可参见第一方面或第二方面不同可能实现方式所带来的技术效果,此处不再赘述。
附图说明
图1-1为本申请实施例提供的一种基于PLC的网络结构的示意图;
图1-2为本申请实施例提供的第一PLC域的结构示意图;
图2-1为本申请实施例提供的一种设备认证方法的流程示意图;
图2-2为本申请实施例中多功能语义设备标识的示意图;
图2-3为本申请实施例中PLC设备执行HASHi(input)的流程示意图:
图2-4为本申请实施例中多功能语义设备标签的示意图;
图2-5为本申请实施例中PLC设备入网的流程示意图;
图3为本申请实施例提供的一种通信设备的结构示意图;
图4为本申请实施例提供的一种通信设备的另一结构示意图;
图5为本申请实施例提供的一种通信系统的结构示意图;
图6为本申请实施例提供的一种通信装置的结构示意图。
具体实施方式
本申请实施例提供了一种设备认证方法和相关设备,用于为新入网的设备进行认证。
下面结合附图,对本申请的实施例进行描述。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。
本申请实施例可应用于基于PLC的网络结构,该网络结构包括PLC网关和至少一个PLC域。示例性的,如图1-1所示,该网络结构100包括PLC网关110、第一PLC域120和第二PLC域130。在一些可行的实现方式中,该网络结构100可以包括消防系统、低压电力线物联网系统、楼宇控制系统和可视门禁系统等,此处不做限定。
其中,一个PLC域可以包括多个PLC设备。示例性的,如图1-2所示,第一PLC域120包括PLC设备121~126。需要说明的是,PLC设备121~126之间可以为铜线、低压电力线或者双绞线等,以便于传输采用基于PLC技术进行编码的载波信号。
在PLC域内,多个PLC设备可以在3种通信模式下实现通信:点到点模式(point-to-pint mode,PM)、中心化模式(central mode,CM)、统一模式(unified mode,UM)。其中,在PM模式下,PLC设备之间使用点对点的方式进行通信,两个PLC设备之间通过介质建立直接信号流。例如,PLC设备122与PLC设备123之间通过介质直接通信。在CM模式下,PLC设备之间只能通过其中一个PLC设备作为域接入点(domain access point),实现间接通信。例如,PLC设备122与PLC设备124之间通过PLC设备123(域接入点)间接通信。在UM模式下,两个PLC设备之间通过中继设备(relay)实现间接通信。例如,PLC设备122与PLC设备126之间通过PLC设备125(中继设备)间接通信。
若想要实现PLC设备与PLC域中的其他PLC设备通信,需要首先使该PLC设备通过与 PLC网关的交互进行认证和注册,从而实现入网。一般的,PLC设备先注册,再认证。通过注册,PLC设备获得了分配的口令(pass word,PW),然后PLC设备和PLC网关基于该PW进行认证,以完成入网。
PLC设备与PLC网关进行认证的过程中,若PLC设备与PLC网关之间没有直连链路时,需要中继设备完成传输,由于消息在传输过程中没有机密性或完整性保护,中继设备容易出现身份伪造或篡改,实现中间人攻击,造成用户的信息泄露等损失。
例如,PLC设备122与PLC设备126之间通过PLC设备127(中继设备)间接通信,PLC设备122要认证时,PLC设备127为PLC设备转发与PLC网关110之间的消息,由于未有安全信道,PLC设备127可以进行中间人攻击。
为此,本申请提出了一种设备认证方法和相关设备,用于为新入网的设备进行认证。在本申请中,第一设备首先获取第二设备上的多功能语义设备标签,多功能语义设备标签包括自验证设备标识。当第一设备接收到第二设备发送的认证请求消息,认证请求消息包括第一参数,第一设备基于预设的哈希函数对第一参数进行计算,得到第一哈希值。若第一参数被修改,则第一哈希值与自验证设备标识不相等。只有第一参数未被修改,第一哈希值与自验证设备标识才能相等,则第一设备确定第二设备通过认证,从而避免了中继设备容易出现身份伪造或篡改,实现中间人攻击,从而避免了用户的信息泄露等损失。
在本申请实施例中,以PLC设备作为第二设备,PLC网关作为第一设备为例进行说明。在一些可能的实现方式中,本申请实施例的技术方案可以应用于PLC设备和PLC网关中,PLC设备和PLC网关均内置有PLC安全认证模块,PLC设备和PLC网关分别基于内置的PLC安全认证模块实现本申请实施例的方法。
需要说明的是,本申请的技术方案可以应用于前述的基于PLC的网络结构中,也应用于任何适用于其他网络结构(如智能家居、智能电网、Wi-Fi网络等)中,例如哑终端或需要离线操作的设备入网,均能达到低成本和高效的效果。需要说明的是,由于基于PLC的网络结构中存在周期性的MAP帧为未入网的PLC设备分配了入网时间窗口,对于其他网络结构,未入网的设备可以在入网前基于准备入网的网络结构的现有协议的机制下,完成时间同步与入网认证触发。
下面以基于PLC的网络结构为例进行说明。
示例性的,请参考图2-1,本申请实施例中提出的一种设备认证方法,包括:
201、PLC设备烧写多功能语义设备标识。
在本申请实施例中,多功能语义设备标识包括自验证设备标识和网络识别码的明文。示例性的,以PLC设备a为例,如图2-2所示,设备a的多功能语义设备标识为Dev IDa,包括自验证设备标识(SAIDa)和网络识别码的明文(πa)。
其中,自验证设备标识由PLC设备生成,可以基于对称密码的形式生成,也可以基于非对称密码的形式生成。而网络识别码由厂家生成,每个PLC设备都有一个独特的网络识别码。
需要说明的是,PLC设备生成自验证设备标识的方式可以有多种,下面以其中2种生成自验证设备标识的方式为例进行说明。
方式1、基于对称密钥的逻辑生成自验证设备标识。
首先,PLC设备可以产生随机数ID_Seed,并预设标准验证次数N。那么,PLC设备对ID_Seed进行N次哈希(hash)变换,得到的结果作为自验证设备标识。
以PLC设备a为例:
SAIDa=hashN(ID_Seed)
示例性的,如图2-3所示,为PLC设备执行HASHi(input)(i为1~N之间的正整数)的流程示意图:
其中,输入(input)的初始值为ID_seed,首先执行input(1)=HASH(ID_seed),然后执行input(i+1)=HASH(input(i)),最后得到输出(output)的值为output=HASH(input(N)),以output作为自验证设备标识。
方式2、基于非对称密钥的逻辑生成自验证设备标识。
在一些可能的实现方式中,第二设备可以生成第一公钥PKa和第一私钥SKa,第一公钥PKa和第一私钥SKa为匹配的公私钥对。然后,第二设备基于预设的哈希函数对第一公钥PKa进行计算,得到的值作为自验证设备标识。
示例性的,非对称密钥的逻辑可以基于椭圆曲线。首先,PLC设备a选定大素数p、椭圆曲线Ep(x,y)与基点G,其中,G的阶为n。接着,PLC设备a产生任一随机数ID_Seed<n,令第一私钥SKa=ID_Seed,基于椭圆曲线的计算,得到第一公钥PKa=SKa×G,最后计算得到SAIDa=hash(PKa),SAIDa为自验证设备标识。
在本申请实施例中,PLC设备可以设置对称密钥,该对称密钥用于将网络识别码的明文加密,得到网络识别码的密文;对称密钥也用于将网络识别码的密文解密,得到网络识别码的明文。需要说明的是,PLC设备的多功能语义设备标签包括自验证设备标识和网络识别码的密文。需要说明的是,PLC设备的多功能语义设备标签是公开的,PLC网关或任何设备都可以获取PLC设备的多功能语义设备标签。
示例性的,PLC设备a可以使用对称密钥PDKa加密网络识别码的明文(πa),得到网络识别码的密文label(πa),其中,label(πa)=E(PDKa,πa),E()为对称加密的过程。那么,如图2-4所示,PLC设备a上的多功能语义设备标签(Dev IDa label)包括SAIDa和label(πa)。
在一些可行的实现方式中,多功能语义设备标签可以为字符串(多个数字、英文和标点符号或其混合)、序列号、条形码或二维码,或其他形式,此处不做限定。
下面以二维码为例进行说明。自验证设备标识的长度取决于哈希算法的选取,通常SHA-256可以保证其安全性,则自验证设备标识的长度为256比特。网络识别码的密文的长度取决于网络识别码的明文的长度和所使用的密钥的长度。通常的,网络识别码的明文的长度为96比特,采用GCM-AES-128对网络识别码的明文进行加密,生成的网络识别码的密文的长度为128比特。那么,多功能语义设备标签的长度为256+128=384比特。
需要说明的是,如表1所示,二维码一共有40个版本(Version),从L1到L40,每个版本都对应了不同的码元结构(码元数),码元指的就是组成二维码的方形黑白点,黑点表示二进制1,白点表示二进制的0。L1是21×21的矩阵,可用152比特;L2是25×25的矩阵,可用272比特;L3是29×29的矩阵,可用440比特;L4是29×29的矩阵,可用 640比特。那么,除去定位图案、功能性数据等所需的数据量,L3的容量(440比特)或更高版本的容量可以满足上述多功能语义设备标签的384比特的容量要求。
表1
202、PLC网关获取PLC设备上的多功能语义设备标签。
在本申请实施例中,PLC网关可以获取PLC设备中烧录的多功能语义设备标签。需要说明的是,在PLC设备上可以显示多功能语义设备标签,PLC网关或任何设备均可从PLC设备上获取多功能语义设备标签,得到自验证设备标识和网络识别码的密文。
在一些可行的实现方式中,若多功能语义设备标签为二维码或条码,贴示在PLC设备上,PLC网关可以通过扫码的方式获取二维码或条码中的信息,得到多功能语义设备标签。在一些可行的实现方式中,多功能语义设备标签也可以为字符串或者序列号,用户可以在PLC网关上输入该字符串或序列号。在一些可行的实现方式中,PLC设备也可以通过通信的方式向PLC网关发送多功能语义设备标签。此处不做限定。
203、PLC设备向PLC网关发送认证请求消息,该认证请求消息携带第一参数。
在一些可行的实现方式中,如图2-5所示,PLC域中的域主节点(可以配置PLC域中的多个PLC设备中的其中一个PLC设备为域主节点)可以周期性广播MAP帧,PLC设备可以通过介质检测MAP帧。若PLC设备检测到MAP帧,即发现PLC域,PLC设备可以发起与PLC网关的认证,以实现入网,从而使得该PLC设备成为该PLC域的一个PLC设备。若PLC设备未发现PLC域,该PLC设备则可以自行建立一个PLC域,并成为该PLC域的域主节点。
在本申请实施例中,当PLC设备检测到MAP帧,可以基于MAP帧向PLC网关发送认证请求消息。需要说明的是,MAP帧用于安排下一个MAC周期中PLC域内各PLC设备的传输时隙,MAP帧还用于通知新上电的PLC设备的入网时间窗口。在本申请实施例中,PLC设备可以在MAP帧指示的入网时间窗口向PLC网关发送认证请求消息。需要说明的是,若PLC设备与PLC网关之间无法直连,可以借助PLC网关指定的中继设备对认证请求消息进行转发。
在一些可行的实现方式中,对于步骤201中基于对称密钥的逻辑生成的自验证设备标识,认证请求消息可以包括PLC设备的自验证设备标识、PLC网关的网关标识、N-i、一次性密码(one time password,OTP),其中,以OTP和正整数Ni=N-i作为第一参数。在一些可行的实现方式中,认证请求消息还可以包括随机函数Rand C。
示例性的,PLC网关b的网关标识为GW_IDb,PLC设备a发送的认证请求消息包括{SAIDa,GW_IDb,N-i,OTP}或{SAIDa,GW_IDb,N-i,OTP,Rand C},其中,OTP=hashi(ID_Seed),Rand C用于生成随机数以防重放。
在一些可行的实现方式中,对于步骤201中基于非对称密钥的逻辑生成的自验证设备标识,认证请求消息可以包括PLC设备的自验证设备标识、PLC网关的网关标识、椭圆曲线的参数、第一公钥和使用第一私钥进行的第一签名。其中,第一参数为第一公钥。在一些可行的实现方式中,认证请求消息还可以包括当前时间戳和随机函数中的任意一个或多个。
示例性的,PLC网关b的网关标识为GW_IDb,认证请求消息包括{SAIDa,GW_IDb,p,G,x,y,PKa,Sig(Ska,M)}或{SAIDa,GW_IDb,p,G,x,y,PKa,timestamp,Rand C,Sig(Ska,M)},其中,p,G,x,y为椭圆曲线的参数,PKa为第一公钥,timestamp为当前时间戳,Rand C用于生成随机数以防重放,M表示认证请求消息中除了Sig(Ska,M)之外的所有信息,Sig(Ska,M)表示通过第一私钥SKa对M的第一签名。
示例性的,Sig(Ska,M)的签名算法可以为:1、计算M的哈希值z=hash(M);2、在[1,n-1]的范围内任选随机数c,n为G的阶;3、计算(x,y)=c×G;4、计算r=x,且保障r≠0;5、计算s=c-1(z+r×SKa)mod n;6、计算Sig(Ska,M)=(r,s)。
在一些可行的实现方式中,认证请求消息还可以包括对称密钥的密文。其中,对称密钥的明文用于加密网络识别码的明文,得到网络识别码的密文,或者,对称密钥的明文用于解密网络识别码的密文,得到网络识别码的明文。在一些可行的实现方式中,PLC设备可以使用第二公钥对对称密钥的明文加密,得到对称密钥的密文,只有PLC网关才有该第二公钥对应的第二私钥,使得PLC网关可以使用第二私钥对该对称密钥的密文进行解密,得到对称密钥的明文,再使用对称密钥的明文解密网络识别码的密文,得到网络识别码的明文。
需要说明的是,PLC设备可以获取PLC网关相关联的密文策略属性基,以得到用于加密对称密钥的第二公钥。密文策略属性基除了涉及PLC网关外,可以在特定场景内进行订制,例如生产厂家、生产日期、CPU型号、内存大小等。PLC网关可以基于相同的密文策略属性基得到该第二公钥对应的第二私钥。
示例性的,PLC设备a可以获取PLC网关b相关联的密文策略属性基,以得到用于加密对称密钥PDK的第二公钥PKb。然后,PLC网关b可以基于密文策略属性基得到该第二公钥PKb对应的第二私钥SKb,并基于SKb解密PDK的密文,得到PDK的明文,并基于PDK的明文解密网络识别码的密文,得到网络识别码的明文。
在一些可行的实现方式中,PLC设备和PLC网关之间可以基于口令认证密钥交换协议(password-based authenticated key exchange,PAKE)实现密钥协商,即认证请求消息还包括第一密钥协商参数。
以基于椭圆曲线为例,假设椭圆曲线Ep(x,y)的公共参数为p,G,x,y,p,其中,p为大素数、G为椭圆曲线的基点,G的阶为n。示例性的,对于PLC设备a,认证请求消息中可以包括第一密钥协商参数X,其中,X可以通过下述算法得到:
1、计算G=f(πa),其中函数f()可以自定义,例如f(x)=x2
2、生成随机数x_seed<n;
3、计算X=x_seed×G mod n。
204、PLC网关基于认证请求消息验证PLC设备的合法性。
在一些可能的实现方式中,PLC网关可以基于预设的哈希函数对第一参数进行计算,得到第一哈希值。若第一哈希值与自验证设备标识相等,则第一设备确定第二设备通过认证。
方式一、
其中,若第一参数包括OTP和Ni,第一哈希值等于hashNi(OTP),其中hash()表示所述预设的哈希函数。
示例性的,若认证请求消息是PLC设备a发送的,其自验证设备标识为SAIDa,是基于对称密钥的逻辑生成的,PLC网关可以验证hashN-i(OTP)=SAIDa是否成立,若该等式成立,则认证通过,否则认证不通过。
需要说明的是,若中继设备接收到认证请求消息,认证请求消息包括{SAIDa,GW_IDb,N-i,OTP}或{SAIDa,GW_IDb,N-i,OTP,Rand C},在中继设备转发认证请求消息之前,修改SAIDa、N-i或OTP中的任意一个或多个,上述等式都将不成立。也就是说,只要上述等式成立,则SAIDa、N-i或OTP中的任意一个均未被修改,从而防止PLC设备发送认证请求消息的过程受到中间人攻击。
方式二、
其中,第一参数为第一公钥,第一设备可以基于预设的哈希函数对第一公钥PKa进行计算,得到的值hash(PKa)作为第一哈希值,其中hash()表示预设的哈希函数。在一些可能的实现方式中,认证请求消息还可以包括第一签名Sig(Ska,M),则第一设备可以基于第一公钥PKa对Sig(Ska,M)进行验证。若验证通过,则第一设备确定第二设备通过认证。
示例性的,若认证请求消息包括{SAIDa,GW_IDb,p,G,x,y,PKa,Sig(Ska,M)}或{SAIDa,GW_IDb,p,G,x,y,PKa,timestamp,Rand C,Sig(Ska,M)},其中,Sig(Ska,M)=(r,s),M为认证请求消息中除了Sig(Ska,M)之外的所有信息。则PLC网关可以对签名Sig(Ska,M)进行验证,以验证认证请求消息的完整性,防止认证请求消息的所有信息都未被修改。
示例性的,PLC网关可以通过下述方式进行验证:1、计算z=hash(M);2、计算w=s-1mod n;3、计算u1=zw mod n,u2=rw mod n;4、计算X=[x,y]=u1×G+u2×PKa;5、计算v=x mod n。若x=r,则Sig(Ska,M)通过验证,说明认证请求消息未被修改;否则验证不通过,说明认证请求消息被修改过。
在对Sig(Ska,M)进行验证之前或之后,PLC网关可以确定SAIDa=hash(PKa)是否成立,若该等式成立,则说明SAIDa和PKa是配套的,则认证通过,否则认证不通过。其中,hash()是预设的,对于PLC设备和PLC网关均使用相同的hash()。需要说明的是,若中继设备接收到认证请求消息,若中继设备转发认证请求消息之前,修改SAIDa或PKa中的任意一个或多个,上述等式都将不成立。也就是说,只要上述等式成立,则SAIDa或PKa中的任意一个或多个均未被修改,从而防止PLC设备发送认证请求消息的过程受到中间人攻击。
205、PLC网关基于认证请求消息获取解密网络识别码的密文,得到网络识别码的明文。
在一些可行的实现方式中,PLC网关可以获取PLC网关相关联的密文策略属性基,以得到第一私钥,并使用该第一私钥解密对称密钥的密文,得到对称密钥的明文,并基于对称密钥的明文解密网络识别码的密文,得到网络识别码的明文。而PLC网关之外的其他设备,由于未具有密文策略属性基,也没有对应的计算方法,无法获得第一私钥,即无法解密对称密钥的密文得到对称密钥的明文,也无法基于对称密钥的明文解密网络识别码的密文,从而实现了对网络识别码的明文的保密。也保证了在PLC设备的许可下(通过对称密钥的密文),PLC网关才能获得网络识别码的明文。
示例性的,PLC网关b接收到认证请求消息后,认证请求消息中包括对称密钥PDKa的密文,然后PLC网关利用对应密文策略属性基得到第一私钥SKa,使用SKa解密PDKa的密文,得到PDKa的明文,再使用PDKa的明文对步骤202中获取的label(πa)进行解密,得到该PLC设备a对应的网络识别码的明文πa。
206、PLC网关基于第一密钥协商参数和网络识别码的明文生成会话密钥。
在一些可行的实现方式中,PLC设备和PLC网关之间可以基于口令认证密钥交换协议(password-based authenticated key exchange,PAKE)实现密钥协商。即认证响应消息中携带PLC网关计算得到的第二密钥协商参数Y。
首先,第二设备计算G=f(πa),其中,f()为自定义函数,πa为所述网络识别码的明文。然后,所述第二设备生成随机数x_seed<n,n为G的阶。接着,所述第二设备计算所述第一密钥协商参数X=y_seed×G mod n。
示例性的,以椭圆曲线为例,假设椭圆曲线Ep(x,y)的公共参数为:p,G,x,y,p,其中,p为大素数、G为椭圆曲线的基点,G的阶为n。示例性的PLC网关b可以计算第二密钥协商参数Y,其中,Y可以通过下述算法得到:
1、计算G=f(πa),其中函数f()可以自定义,例如f(x)=x3
2、生成随机数y_seed<n;
3、计算Y=y_seed×Ga mod n。
在一些可行的实现方式中,PLC设备和PLC网关之间可以基于PAKE实现密钥协商。PLC网关可以基于认证请求消息中的第一密钥协商参数X,计算得到对称的会话密钥key ab:
key ab=X×y_seed mod n
从而完成在PLC设备侧与PLC网关之间的密钥协商。
207、PLC网关向PLC设备发送认证响应消息,认证响应消息包括第二参数。
在一些可行的实现方式中,认证响应消息可以包括:PLC设备的自验证设备标识、PLC网关的网关标识。在一些可行的实现方式中,认证响应消息还可以包括PLC设备的自验证设备标识、PLC网关的网关标识,以及下述任意一个或多个:第二公钥、第二哈希值(第二公钥、网络识别码的明文、随机函数中任意一个或多个的哈希值)、使用第二私钥对前述所有信息的签名。其中,第二参数第二哈希值。
示例性的,PLC网关b向PLC设备a发送的认证响应消息可以包括{SAIDa,GW_IDb}或{SAIDa,GW_IDb,hash(Q)},其中,SAIDa为PLC设备a的SAID,GW IDb为PLC网关b的网关标识,Q可以为πa、PKa、Rand C中的一个或多个,πa为网络识别码的明文,PKb为第二公钥,Rand C用于生成随机数以防重放,hash(Q)为第二哈希值,HASH()为预设的哈希函数。
示例性的,PLC网关b向PLC设备a发送的认证响应消息可以包括{SAIDa,GW_IDb,hash(Q),Sig(SKb,M’)}、{SAIDa,GW_IDb,PKa,hash(Q)}或{SAIDa,GW_IDb,PKa,hash(Q),Sig(SKb,M’)},其中,Q可以为πa、PKa、Rand C中的一个或多个,πa为网络识别码的明文,PKb为第二公钥,Rand C用于生成随机数以防重放,HASH()为预设的哈希函数,M’表示认证响应消息中除了签名以外的其他所有信息,Sig(SKb,M’)表示通过私钥对M’的签名。
在一些可能的实现方式中,PLC网关还可以为PLC设备分配设备在网标识,并使用会话密钥加密该设备在网标识,得到设备在网标识的明文。在认证响应消息中可以携带设备在网标识的密文,设备在网标识的密文由会话密钥加密所述设备在网标识的明文得到,设备在网标识为第一设备为第二设备分配的标识。
示例性的,PLC网关b为PLC设备a分配设备在网标识(Dev in-network ID’a),通过会话密钥key ab加密Dev in-network ID’a的明文,得到Dev in-network ID’a的密文。
在一些可能的实现方式中,PLC网关可以在发送认证响应消息后,使用会话密钥加密设备在网标识的明文,得到设备在网标识的密文,再向PLC设备发送设备在网标识的密文,此处不做限定。
在一些可能的实现方式中,认证响应消息中携带第二密钥协商参数Y。
208、PLC设备基于认证响应消息验证PLC网关的合法性。
在一些可能的实现方式中,第二设备基于可以预设的哈希函数对网络识别码的明文进行计算,得到第三哈希值。若所述第三哈希值与所述第二哈希值相等,则所述第二设备确定所述第一设备通过认证。
在一些可行的实现方式中,若认证响应消息可以包括PLC设备的自验证设备标识和PLC网关的网关标识,则无需验证PLC网关的合法性。示例性的,PLC网关b向PLC设备a返回的认证响应消息包括{SAIDa,GW_IDb},则PLC设备无需验证PLC网关的合法性。
在一些可行的实现方式中,若认证响应消息包括PLC设备的自验证设备标识、PLC网关的网关标识,以及下述任意一个或多个:第二公钥、第二哈希值(第二公钥、网络识别码的明文、随机函数的哈希值中的任意一个或多个)以及基于第二私钥对前述所有信息的签名。则PLC设备可以验证PLC网关的合法性。
示例性的,认证响应消息包括{SAIDa,GW_IDb,hash(Q)}或{SAIDa,GW_IDb,PKa,hash(Q)},其中,Q可以为预设的πa、PKa、Rand C中的一个或多个,πa为网络识别码的明文,PKb为第二公钥,Rand C用于生成随机数以防重放,HASH()为预设的哈希函数。当PLC设备接收到认证响应消息后,PLC设备可以基于预设的πa、PKa、Rand C中的一个或多个(设为Q’)计算得到第三哈希值hash(Q’),若hash(Q’)=hash(Q),则确认PLC网 关的合法性,否则认为PLC网关不合法。
示例性的,PLC网关b向PLC设备a返回的认证响应消息可以包括{SAIDa,GW_IDb,hash(Q),Sig(SKb,M’)}或{SAIDa,GW_IDb,PKa,hash(Q),Sig(SKb,M’)},其中,Q可以为预设的πa、PKa、Rand C中的一个或多个,πa为网络识别码的明文,PKb为第二公钥,Rand C用于生成随机数以防重放,HASH()为预设的哈希函数,M’表示认证响应消息中除了签名以外的其他所有信息,Sig(SKb,M’)表示通过私钥对M’的签名。
当PLC设备接收到认证响应消息后,PLC设备可以基于预设的πa、PKa、Rand C中的一个或多个(设为Q’)计算得到hash(Q’),若hash(Q’)=hash(Q),则确认PLC网关的合法性,否则认为PLC网关不合法。
在一些可能的实现方式中,第二设备还可以基于第二公钥PKb对第二签名Sig(SKb,M’)进行验证。
示例性的,PLC设备还可以通过PKa对Sig(SKb,M’)进行验证,以验证M’的完整性。在一些可行的实现方式中,当M’的完整性和PLC网关的合法性均得到验证,即可认为该认证响应消息得到验证,则可以进一步执行后续的步骤209-210,否则认为该认证响应消息得不到验证,则不执行后续的步骤209-210。
209、PLC设备基于第二密钥协商参数和网络识别码的明文生成会话密钥。
首先,第二设备计算G=f(πa),其中,f2()为自定义函数,πa为网络识别码的明文。然后,第二设备生成随机数x_seed<n,n为G的阶。接着,第二设备计算会话密钥key ab=Y×x_seed mod n,Y为第二密钥协商参数。
示例性的,以椭圆曲线为例,假设椭圆曲线Ep(x,y)的公共参数为:p,G,x,y,其中,p为大素数、G为椭圆曲线的基点,G的阶为n。
那么,PLC网关可以基于认证请求消息中的第一密钥协商参数Y,计算得到对称的会话密钥key ab:
key ab=Y×x_seed mod n
从而完成在PLC设备侧的密钥协商。
210、PLC设备基于会话密钥解密设备在网标识的密文,得到设备在网标识的明文。
示例性的,PLC设备a接收到PLC网关b发送的Dev in-network ID’a的密文后,可以使用key ab解密该Dev in-network ID’a的密文,得到Dev in-network ID’a的明文,并将Dev in-network ID’a作为PLC设备在PLC域中的标识,并使用key ab用于与PLC网关进行通信。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
为便于更好的实施本申请实施例的上述方案,下面还提供用于实施上述方案的相关装置。
请参阅图3所示,本申请实施例提供的一种通信设备300,用作第一设备,可以包括:获取模块301,用于获取第二设备上的多功能语义设备标签,所述多功能语义设备标签包括自验证设备标识;收发模块302,用于接收所述第二设备发送的认证请求消息,所述认证请求消息包括第一参数;处理模块303,用于基于预设的哈希函数对所述第一参数进行计算,得到第一哈希值;处理模块303,还用于若所述第一哈希值与所述自验证设备标识相等,则确定所述第二设备通过认证。
在一些可能的实现方式中,所述第一参数包括一次性密码OTP和正整数Ni,所述第一哈希值等于hashNi(OTP),其中hash()表示所述预设的哈希函数。
在一些可能的实现方式中,所述认证请求消息还包括第一公钥Pka;处理模块303,还用于基于所述预设的哈希函数对所述PKa进行计算,得到的值hash(PKa)作为所述第一哈希值,其中hash()表示所述预设的哈希函数。
在一些可能的实现方式中,所述认证请求消息还包括第一签名Sig(Ska,M);处理模块303,还用于基于所述第一公钥PKa对所述Sig(Ska,M)进行验证,若验证通过,则执行确定所述第二设备通过认证的步骤。
在一些可能的实现方式中,所述多功能语义设备标签还包括网络识别码的密文,所述认证请求消息还包括对称密钥的密文,处理模块,还用于基于预设的密文策略属性基确定第二私钥SKb;使用所述第二私钥解密所述对称密钥的密文,得到所述对称密钥的明文;基于所述对称密钥的明文解密所述网络识别码的密文,得到所述网络识别码的明文。
在一些可能的实现方式中,处理模块303,还用于基于所述预设的哈希函数对第二参数进行计算,得到第二哈希值,所述第二参数包括所述网络识别码的明文;收发模块303,还用于向所述第二设备发送认证响应消息,所述认证响应消息包括所述第二哈希值。
在一些可能的实现方式中,所述认证响应消息还包括第二公钥PKb和第二签名Sig(SKb,M’),所述M’为所述认证请求消息中除了所述Sig(SKb,M’)之外所有信息,所述Sig(SKb,M’)表示基于第二私钥SKb对所述M’进行的签名,所述第二私钥SKb和所述第二公钥PKb为匹配的公私钥对。
在一些可能的实现方式中,所述认证请求消息还包括第一密钥协商参数,所述第一设备基于所述第一密钥协商参数和所述网络识别码的明文生成会话密钥,所述会话密钥用于与所述第二设备通信。
在一些可能的实现方式中,所述认证响应消息还包括第二密钥协商参数,处理模块303,用于基于所述网络识别码的明文生成所述第二密钥协商参数。
在一些可能的实现方式中,所述认证响应消息还包括设备在网标识的密文,所述设备在网标识的密文由所述会话密钥加密所述设备在网标识的明文得到,所述设备在网标识为所述第一设备为所述第二设备分配的标识。
请参阅图4所示,本申请实施例提供的一种通信设备400,用作第二设备,可以包括:处理模块401,用于生成相关联的自验证设备标识和第一参数,其中,基于预设的哈 希函数对所述第一参数进行计算,可得所述自验证设备标识;收发模块402,用于向所述第一设备发送认证请求消息,所述认证请求消息包括第一参数。
在一些可能的实现方式中,所述第一参数包括一次性密钥OTP和正整数Ni;处理模块401,还用于生成随机数ID_Seed并设置N,N为大于1的正整数;基于所述预设的哈希函数对所述ID_Seed进行N次迭代计算,得到的值作为所述自验证设备标识;基于所述预设的哈希函数对所述ID_Seed进行i次迭代计算,得到的值作为所述OTP,i为小于N的正整数,Ni=N-i。
在一些可能的实现方式中,所述第一参数为第一公钥Pka,所述第一哈希值为hash(PKa),其中hash()表示所述预设的哈希函数,所述第一公钥和第一私钥SKa为配对的公私钥对,所述第二设备具有所述第一私钥SKa。
在一些可能的实现方式中,所述认证请求消息还包括第一签名Sig(Ska,M),所述M为所述认证请求消息中除了所述Sig(Ska,M)之外所有信息;处理模块401,还用于基于所述第一私钥SKa对所述M进行签名,得到所述第一签名Sig(Ska,M)。
在一些可能的实现方式中,所述认证请求消息还包括对称密钥的密文;该通信设备400还包括获取模块403,用于获取网络识别码的明文;处理模块401,还用于基于对称密钥的明文加密所述网络识别码的明文,得到所述网络识别码的密文;基于预设的密文策略属性基确定第二公钥PKb;使用所述第二公钥PKb加密所述对称密钥的明文,得到所述对称密钥的密文。
在一些可能的实现方式中,收发模块402,还用于接收所述第一设备发送的认证响应消息,所述认证响应消息包括第二哈希值;处理模块401,还用于基于所述预设的哈希函数对所述网络识别码的明文进行计算,得到第三哈希值;若所述第三哈希值与所述第二哈希值相等,则确定所述第一设备通过认证。
在一些可能的实现方式中,所述认证响应消息还包括所述第二公钥PKb和第二签名Sig(SKb,M’),所述M’为所述认证请求消息中除了所述Sig(SKb,M’)之外所有信息,所述Sig(SKb,M’)表示基于第二私钥SKb对所述M’进行的签名;处理模块401,还用于基于所述第二公钥PKb对所述第二签名Sig(SKb,M’)进行验证;若验证通过,则执行确定所述第一设备通过认证的步骤。
在一些可能的实现方式中,所述认证响应消息还包括第二密钥协商参数;处理模块401,还用于基于所述第二密钥协商参数和所述网络识别码的明文生成会话密钥,所述会话密钥用于与所述第一设备通信。
在一些可能的实现方式中,所述认证请求消息还包括第一密钥协商参数;处理模块401,还用于基于所述网络识别码的明文生成所述第一密钥协商参数。
在一些可能的实现方式中,所述认证响应消息还包括设备在网标识的密文,所述设备在网标识的密文由所述会话密钥加密所述设备在网标识的明文得到,所述设备在网标识为所述第一设备为所述第二设备分配的标识;处理模块401,还用于基于所述会话密钥解密所述设备在网标识的密文,得到所述设备在网标识的明文。
请参阅图5所示,本申请实施例提供的一种通信系统500,包括第一设备510和第 二设备520。其中,第一设备510,用于获取第二设备520上的多功能语义设备标签,所述多功能语义设备标签包括自验证设备标识;第二设备520,用于生成相关联的自验证设备标识和第一参数,其中,基于预设的哈希函数对所述第一参数进行计算,可得所述自验证设备标识;所述第二设备520,还用于向所述第一设备510发送认证请求消息,所述认证请求消息包括第一参数;所述第一设备510,还用于基于预设的哈希函数对所述第一参数进行计算,得到第一哈希值;所述第一设备510,还用于若所述第一哈希值与所述自验证设备标识相等,则确定所述第二设备520通过认证。
需要说明的是,上述装置各模块/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其带来的技术效果与本申请方法实施例相同,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储有程序,该程序执行包括上述方法实施例中记载的部分或全部步骤。
接下来介绍本申请实施例提供的另一种通信装置,请参阅图6所示,通信装置600包括:接收器601、发射器602、处理器603和存储器604。在本申请的一些实施例中,接收器601、发射器602、处理器603和存储器604可通过总线或其它方式连接,其中,图6中以通过总线连接为例。
存储器604可以包括只读存储器和随机存取存储器,并向处理器603提供指令和数据。存储器604的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。存储器604存储有操作系统和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。操作系统可包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。
处理器603控制通信装置600的操作,处理器603还可以称为中央处理单元(central processing unit,CPU)。具体的应用中,通信装置600的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线系统。
上述本申请实施例揭示的方法可以应用于处理器603中,或者由处理器603实现。处理器603可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器603中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器603可以是通用处理器、数字信号处理器(digital signal processing,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器604,处理器603读取存储器604中的信息,结合其硬件完成上述方法的步骤。
接收器601可用于接收输入的数字或字符信息,以及产生与相关设置以及功能控制有关的信号输入,发射器602可包括显示屏等显示设备,发射器602可用于通过外接接口输出数字或字符信息。
本申请实施例中,处理器603,用于执行前述的设备认证方法。
在另一种可能的设计中,当通信设备300、通信设备400或通信装置600为芯片时,包括:处理单元和通信单元,所述处理单元例如可以是处理器,所述通信单元例如可以是输入/输出接口、管脚或电路等。该处理单元可执行存储单元存储的计算机执行指令,以使该终端内的芯片执行上述第一方面任意一项的无线报告信息的发送方法。可选地,所述存储单元为所述芯片内的存储单元,如寄存器、缓存等,所述存储单元还可以是所述终端内的位于所述芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。
其中,上述任一处提到的处理器,可以是一个通用中央处理器,微处理器,ASIC,或一个或多个用于控制上述方法的程序执行的集成电路。
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一 个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。

Claims (28)

  1. 一种设备认证方法,其特征在于,包括:
    第一设备获取第二设备上的多功能语义设备标签,所述多功能语义设备标签包括自验证设备标识;
    所述第一设备接收所述第二设备发送的认证请求消息,所述认证请求消息包括第一参数;
    所述第一设备基于预设的哈希函数对所述第一参数进行计算,得到第一哈希值;
    若所述第一哈希值与所述自验证设备标识相等,则所述第一设备确定所述第二设备通过认证。
  2. 根据权利要求1所述方法,其特征在于,所述第一参数包括一次性密码OTP和正整数Ni,所述第一哈希值等于hashNi(OTP),其中hash()表示所述预设的哈希函数。
  3. 根据权利要求1所述方法,其特征在于,所述第一参数为第一公钥PKa,所述第一哈希值为hash(PKa),其中hash()表示所述预设的哈希函数。
  4. 根据权利要求3所述方法,其特征在于,所述认证请求消息还包括第一签名,所述第一设备确定所述第二设备通过认证之前,所述方法还包括:
    所述第一设备基于所述第一公钥PKa对所述第一签名进行验证;
    若验证通过,则执行所述第一设备确定所述第二设备通过认证的步骤。
  5. 根据权利要求1-4中任一项所述方法,其特征在于,所述多功能语义设备标签还包括网络识别码的密文,所述认证请求消息还包括对称密钥的密文,所述方法还包括:
    所述第一设备基于预设的密文策略属性基确定第二私钥SKb;
    所述第一设备使用所述第二私钥SKb解密所述对称密钥的密文,得到所述对称密钥的明文;
    所述第一设备基于所述对称密钥的明文解密所述网络识别码的密文,得到所述网络识别码的明文。
  6. 根据权利要求5所述方法,其特征在于,所述方法还包括:
    所述第一设备基于所述预设的哈希函数对第二参数进行计算,得到第二哈希值,所述第二参数包括所述网络识别码的明文;
    所述第一设备向所述第二设备发送认证响应消息,所述认证响应消息包括所述第二哈希值。
  7. 根据权利要求6所述方法,其特征在于,所述认证响应消息还包括第二公钥PKb和第二签名Sig(SKb,M’),所述M’为所述认证请求消息中除了所述Sig(SKb,M’)之外所有信息,所述Sig(SKb,M’)表示基于第二私钥SKb对所述M’进行的签名,所述第二私钥SKb和所述第二公钥PKb为匹配的公私钥对。
  8. 根据权利要求5-7中任一项所述方法,其特征在于,所述认证请求消息还包括第一密钥协商参数,所述方法还包括:
    所述第一设备基于所述第一密钥协商参数和所述网络识别码的明文生成会话密钥,所述会话密钥用于与所述第二设备通信。
  9. 根据权利要求8所述方法,其特征在于,所述认证响应消息还包括第二密钥协商参 数,所述方法还包括:
    所述第一设备基于所述网络识别码的明文生成所述第二密钥协商参数。
  10. 根据权利要求8或9所述方法,其特征在于,所述认证响应消息还包括设备在网标识的密文,所述设备在网标识的密文由所述会话密钥加密所述设备在网标识的明文得到,所述设备在网标识为所述第一设备为所述第二设备分配的标识。
  11. 一种设备认证方法,其特征在于,包括:
    第二设备生成相关联的自验证设备标识和第一参数,其中,基于预设的哈希函数对所述第一参数进行计算可得所述自验证设备标识;
    所述第二设备向所述第一设备发送认证请求消息,所述认证请求消息包括第一参数。
  12. 根据权利要求11所述方法,其特征在于,所述第一参数包括一次性密钥OTP和正整数Ni,所述第二设备生成相关联的自验证设备标识和第一参数包括:
    所述第二设备生成随机数ID_Seed并设置N,N为大于1的正整数;
    所述第二设备基于所述预设的哈希函数对所述ID_Seed进行N次迭代计算,得到的值作为所述自验证设备标识;
    所述第二设备基于所述预设的哈希函数对所述ID_Seed进行i次迭代计算,得到的值作为所述OTP,i为小于N的正整数,Ni=N-i。
  13. 根据权利要求11所述方法,其特征在于,所述方法还包括:
    所述第二设备生成第一公钥PKa和第一私钥SKa,以所述第一公钥PKa作为所述第一参数,所述第一公钥PKa和所述第一私钥SKa为匹配的公私钥对;
    所述第二设备基于所述预设的哈希函数对所述第一公钥PKa进行计算,得到的值作为所述自验证设备标识。
  14. 根据权利要求13所述方法,其特征在于,所述认证请求消息还包括第一签名Sig(Ska,M),所述第一签名Sig(Ska,M)为对使用所述第一私钥Ska对M进行前面得到,所述M为所述认证请求消息中除了所述Sig(Ska,M)之外所有信息。
  15. 根据权利要求11-14中任一项所述方法,其特征在于,所述认证请求消息还包括对称密钥的密文,所述方法还包括:
    所述第二设备获取网络识别码的明文;
    所述第二设备基于所述对称密钥的明文加密所述网络识别码的明文,得到所述网络识别码的密文;
    所述第二设备基于预设的密文策略属性基确定第二公钥PKb;
    所述第二设备使用所述第二公钥PKb加密所述对称密钥的明文,得到所述对称密钥的密文。
  16. 根据权利要求15所述方法,其特征在于,所述方法还包括:
    所述第二设备接收所述第一设备发送的认证响应消息,所述认证响应消息包括第二哈希值;
    所述第二设备基于所述预设的哈希函数对所述网络识别码的明文进行计算,得到第三哈希值;
    若所述第三哈希值与所述第二哈希值相等,则所述第二设备确定所述第一设备通过认 证。
  17. 根据权利要求16所述方法,其特征在于,所述认证响应消息还包括所述第二公钥PKb和第二签名Sig(SKb,M’),所述M’为所述认证请求消息中除了所述Sig(SKb,M’)之外所有信息,所述Sig(SKb,M’)表示基于第二私钥SKb对所述M’进行的签名,所述私钥SKb和所述第二公钥PKb为配对的公私钥对;
    所述第二设备确定所述第一设备通过认证之前,还包括:
    所述第二设备基于所述第二公钥PKb对所述第二签名Sig(SKb,M’)进行验证;
    若验证通过,则执行所述第二设备确定所述第一设备通过认证的步骤。
  18. 根据权利要求15-17中任一项所述方法,其特征在于,所述认证响应消息还包括第二密钥协商参数,所述方法还包括:
    所述第二设备基于所述第二密钥协商参数和所述网络识别码的明文生成会话密钥,所述会话密钥用于与所述第一设备通信。
  19. 根据权利要求17或18所述方法,其特征在于,所述认证请求消息还包括第一密钥协商参数,所述方法还包括:
    所述第二设备基于所述网络识别码的明文生成所述第一密钥协商参数。
  20. 根据权利要求18或19所述方法,其特征在于,所述认证响应消息还包括设备在网标识的密文,所述设备在网标识的密文由所述会话密钥加密所述设备在网标识的明文得到,所述设备在网标识为所述第一设备为所述第二设备分配的标识;
    所述第二设备基于所述第二密钥协商参数和所述网络识别码的明文生成会话密钥之后,还包括:
    所述第二设备基于所述会话密钥解密所述设备在网标识的密文,得到所述设备在网标识的明文。
  21. 一种设备认证方法,其特征在于,包括:
    第一设备获取第二设备上的多功能语义设备标签,所述多功能语义设备标签包括自验证设备标识;
    第二设备生成相关联的自验证设备标识和第一参数,其中,基于预设的哈希函数对所述第一参数进行计算,可得所述自验证设备标识;
    所述第二设备向所述第一设备发送认证请求消息,所述认证请求消息包括第一参数;
    所述第一设备基于所述预设的哈希函数对所述第一参数进行计算,得到第一哈希值;
    若所述第一哈希值与所述自验证设备标识相等,则所述第一设备确定所述第二设备通过认证。
  22. 一种通信设备,其特征在于,所述通信设备用于执行前述权利要求1-10中任一项中所述第一设备所执行的方法。
  23. 一种通信设备,其特征在于,所述通信设备用于执行前述权利要求11-20中任一项中所述第一设备所执行的方法。
  24. 一种通信系统,其特征在于,包括:第一设备和第二设备,其中,
    所述第一设备用于执行前述权利要求1-10中任一项所述的方法;
    所述第二设备用于执行前述权利要求11-20中任一项所述的方法。
  25. 一种计算机可读存储介质,其特征在于,该计算机可读存储介质存储有程序,所述程序使得计算机设备执行如权利要求1-20中任一项所述的方法。
  26. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机执行指令,所述计算机执行指令存储在计算机可读存储介质中;设备的至少一个处理器从所述计算机可读存储介质中读取所述计算机执行指令,所述至少一个处理器执行所述计算机执行指令使得所述设备执行如权利要求1-20中任一项所述的方法。
  27. 一种通信装置,其特征在于,所述通信装置包括至少一个处理器、存储器和通信接口;
    所述至少一个处理器与所述存储器和所述通信接口耦合;
    所述存储器用于存储指令,所述处理器用于执行所述指令,所述通信接口用于在所述至少一个处理器的控制下与其他通信装置进行通信;
    所述指令在被所述至少一个处理器执行时,使所述至少一个处理器执行如权利要求1-20中任一项所述的方法。
  28. 一种芯片系统,其特征在于,所述芯片系统包括处理器和存储器,所述存储器和所述处理器通过线路互联,所述存储器中存储有指令,所述处理器用于执行如权利要求1-20中任一项所述的方法。
PCT/CN2023/092507 2022-08-31 2023-05-06 一种设备认证方法和相关设备 WO2024045680A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211063837.1 2022-08-31
CN202211063837.1A CN117675254A (zh) 2022-08-31 2022-08-31 一种设备认证方法和相关设备

Publications (1)

Publication Number Publication Date
WO2024045680A1 true WO2024045680A1 (zh) 2024-03-07

Family

ID=90066897

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/092507 WO2024045680A1 (zh) 2022-08-31 2023-05-06 一种设备认证方法和相关设备

Country Status (2)

Country Link
CN (1) CN117675254A (zh)
WO (1) WO2024045680A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130269007A1 (en) * 2010-12-16 2013-10-10 Nec Software Kyushu, Ltd. Authentication system, authentication server, service providing server, authentication method, and computer-readable recording medium
CN104243158A (zh) * 2013-06-13 2014-12-24 松下电器产业株式会社 认证方法、通信系统、设备以及服务器
KR20160122556A (ko) * 2015-04-14 2016-10-24 임용훈 Otp 인증을 위한 장치 및 방법
JP2020017247A (ja) * 2018-07-27 2020-01-30 ファン アンド ニュー カンパニー リミテッド ディスプレイ基盤の動的2次元コード認証方法、動的2次元コード認証システム、そのユーザ端末及び認証サーバー
CN111901346A (zh) * 2020-07-29 2020-11-06 北京奇艺世纪科技有限公司 一种身份认证系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130269007A1 (en) * 2010-12-16 2013-10-10 Nec Software Kyushu, Ltd. Authentication system, authentication server, service providing server, authentication method, and computer-readable recording medium
CN104243158A (zh) * 2013-06-13 2014-12-24 松下电器产业株式会社 认证方法、通信系统、设备以及服务器
KR20160122556A (ko) * 2015-04-14 2016-10-24 임용훈 Otp 인증을 위한 장치 및 방법
JP2020017247A (ja) * 2018-07-27 2020-01-30 ファン アンド ニュー カンパニー リミテッド ディスプレイ基盤の動的2次元コード認証方法、動的2次元コード認証システム、そのユーザ端末及び認証サーバー
CN111901346A (zh) * 2020-07-29 2020-11-06 北京奇艺世纪科技有限公司 一种身份认证系统

Also Published As

Publication number Publication date
CN117675254A (zh) 2024-03-08

Similar Documents

Publication Publication Date Title
US11026084B2 (en) Mobile network authentication method, terminal device, server, and network authentication entity
US10979412B2 (en) Methods and apparatus for secure device authentication
US10694374B2 (en) Electronic network device
WO2019174187A1 (zh) 基于区块链的多端间消息通信的方法、终端及存储介质
WO2021196915A1 (zh) 基于加密、解密操作的数据传输方法、系统和计算机设备
US20160269176A1 (en) Key Configuration Method, System, and Apparatus
US10680835B2 (en) Secure authentication of remote equipment
WO2014180296A1 (zh) 一种设备之间建立连接的方法、配置设备和无线设备
US12003629B2 (en) Secure server digital signature generation for post-quantum cryptography key encapsulations
CN110545252B (zh) 一种认证和信息保护的方法、终端、控制功能实体及应用服务器
BR112021003460A2 (pt) dispositivo sem identidade de assinante, dispositivo de identidade do assinante, método para uso em um dispositivo sem identidade de assinante, método para uso em um dispositivo com identidade de assinante e produto de programa de computador
BR112021003448A2 (pt) dispositivo sem identidade de assinante, dispositivo de identidade do assinante, método para uso em um dispositivo sem identidade de assinante, método para uso em um dispositivo com identidade de assinante e produto de programa de computador transferível por download
US11552994B2 (en) Methods and nodes for handling LLDP messages in a communication network
WO2009074092A1 (fr) Procédé et système allégés d&#39;authentification d&#39;accès
WO2020216047A1 (zh) 一种认证信息处理方法、终端和网络设备
WO2024045680A1 (zh) 一种设备认证方法和相关设备
WO2018172776A1 (en) Secure transfer of data between internet of things devices
WO2018076299A1 (zh) 数据传输方法及装置
EP4228306A1 (en) Early indication for changing cryptographic strength during configuration
CN107370598A (zh) 以智能手机作为个人电脑电子密钥的方法
US20230308424A1 (en) Secure Session Resumption using Post-Quantum Cryptography
US20240039732A1 (en) Signature graph method for enabling human authentication of high-entropy data
GB2560895A (en) Secure transfer of data between internet of things devices
KR20170013141A (ko) 클라이언트 인증 방법, 클라이언트의 동작 방법, 서버, 및 통신 소프트웨어
CN117527339A (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: 23858720

Country of ref document: EP

Kind code of ref document: A1