WO2018177385A1 - 一种传输数据的方法、装置和设备 - Google Patents

一种传输数据的方法、装置和设备 Download PDF

Info

Publication number
WO2018177385A1
WO2018177385A1 PCT/CN2018/081185 CN2018081185W WO2018177385A1 WO 2018177385 A1 WO2018177385 A1 WO 2018177385A1 CN 2018081185 W CN2018081185 W CN 2018081185W WO 2018177385 A1 WO2018177385 A1 WO 2018177385A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
identifier
data
message
transmission path
Prior art date
Application number
PCT/CN2018/081185
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 WO2018177385A1 publication Critical patent/WO2018177385A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • 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

Definitions

  • the present disclosure relates to the field of communications technologies, and in particular, to a method, an apparatus, and a device for transmitting data.
  • Multi-hop transmission of data transmitted by two devices across multiple nodes in a communication network is a common transmission method.
  • each device sends data to its neighboring device, and the neighboring device forwards the data to its neighboring device according to a certain manner (for example, an IP routing algorithm, or other means), and then the device The device forwards it until it is forwarded to the recipient.
  • the Internet of Things communication network may include a service server, a platform server, a gateway, and a camera installed in the home, and the transmission path of the camera to the service server is a camera, a gateway, a platform server, and a service server.
  • the data to be sent may be encrypted and transmitted.
  • One common processing procedure may be: the sending device registers the key in the authentication server and obtains the key identifier, and uses the data to be sent by the key. Encryption is performed, and then a communication message is sent to the receiving device, and the communication message carries the encrypted data and the key identifier. After receiving the communication message, the receiving device may obtain a corresponding key from the authentication server according to the key identifier, and decrypt the encrypted data to obtain the original data.
  • a user at home obtains monitoring data by accessing a local gateway, and an outgoing user can obtain monitoring data by accessing the service server, and both the gateway and the service server need to obtain monitoring data.
  • a person's health data (such as blood sugar, blood pressure, weight, etc.) needs to be sent to a remote diagnostic center or gym center for daily attention guidance or fitness instruction.
  • the monitoring data sent to the gateway and the service server, or the health data sent to the remote diagnostic center or gym center can be encrypted and transmitted in the above manner.
  • intermediate devices that can have a key, it may bring a security risk.
  • the intruder can pass The key is decrypted to obtain the original text of the data, the original text is falsified, and then the key is used for encryption, and the encrypted data is sent to the receiving device, and the receiving device cannot know that the data has been tampered with, resulting in data transmission. Reduced reliability.
  • a method of transmitting data comprising:
  • the communication message carries a key identifier, an encrypted data, and a first message verification code
  • the encrypted data is a target data to be sent by using a key corresponding to the key identifier
  • the first message verification code is a verification code generated according to the key, the target data, and preset auxiliary verification information
  • the receiving party receives the communication message sent by the first device, where the communication message carries the key identifier, the encrypted data, and the first message verification code, and the receiver can obtain the key and the auxiliary corresponding to the key identifier.
  • the verification information is used to verify the encrypted data according to the key, the first message verification code and the auxiliary verification information, thereby determining whether the encrypted data is falsified, and improving the reliability of the transmitted data.
  • the acquiring the key corresponding to the key identifier and the auxiliary verification information includes:
  • the verifying the encrypted data according to the key, the first message verification code, and the auxiliary verification information including:
  • the method further includes:
  • the authentication server may be notified that the data is abnormal, so that the authentication server processes according to the preset security policy, thereby improving data security.
  • the method before receiving the communication message sent by the first device, the method further includes:
  • the second device can actively acquire data of the first device.
  • the receiving, by the first device, the communication message includes:
  • the third device Receiving a communication message of the first device forwarded by the third device, the third device being another recipient in a transmission path that receives the target data.
  • a method of transmitting data comprising:
  • the receiving party receives the communication message sent by the first device, where the communication message carries the key identifier, the encrypted data, and the first message verification code, and the receiver can obtain the key and the auxiliary corresponding to the key identifier.
  • the verification information is used to verify the encrypted data according to the key, the first message verification code and the auxiliary verification information, thereby determining whether the encrypted data is falsified, and improving the reliability of the transmitted data.
  • the method further includes:
  • the obtaining, according to the identifier of the first device and the identifier of the receiver of the target data, the transmission path corresponding to each receiver includes:
  • the method further includes:
  • the device in which the abnormality has occurred can be determined, and the first device can be notified that the first device can stop sending the communication message to the abnormal device to prevent the data from being tampered with.
  • a method of transmitting data comprising:
  • the receiving party receives the communication message sent by the first device, where the communication message carries the key identifier, the encrypted data, and the first message verification code, and the receiver can obtain the key and the auxiliary corresponding to the key identifier.
  • the verification information is used to verify the encrypted data according to the key, the first message verification code and the auxiliary verification information, thereby determining whether the encrypted data is falsified, and improving the reliability of the transmitted data.
  • the method further includes:
  • the method before the acquiring the target data to be sent, the method further includes:
  • the second device can actively acquire data of the first device.
  • the sending, by the second device, a communication message includes:
  • Transmitting the communication message to a third device so that the third device forwards the communication message to the second device, where the third device is another receiver in a transmission path corresponding to the second device .
  • a second device in a fourth aspect, includes: a first processor, a first network interface, a first memory, a first transmitter, and a first receiver, the first memory and the first network interface Respectively connected to the first processor; the first processor is configured to execute instructions stored in the first memory; the first processor implements any one of the first aspect or the first aspect of the implementation by executing the instructions The method of transmitting data provided.
  • an embodiment of the present invention provides an apparatus for transmitting data, where the apparatus for transmitting data includes at least one unit, where the at least one unit is used to implement any one of the foregoing first aspect or the first aspect.
  • the method of transmitting data provided.
  • an authentication server includes: a second processor, a second network interface, a second memory, a second receiver, and a second transmitter, where the second memory and the second network interface respectively a second processor coupled; the second processor configured to execute instructions stored in the second memory; the second processor implementing the instructions provided by any one of the second aspect or the second aspect of the second aspect The method of transferring data.
  • an embodiment of the present invention provides an apparatus for transmitting data, where the apparatus for transmitting data includes at least one unit, where the at least one unit is configured to implement any one of the foregoing second aspect or the second aspect.
  • the method of transmitting data provided.
  • a first device comprising: a third processor, a third network interface, a third memory, a third receiver, and a third transmitter, and the third memory and the third network interface Separately connected to the third processor; the third processor is configured to execute the instructions stored in the third memory; and the third processor implements any one of the third or third aspects of the foregoing implementation by executing the instructions The method of transmitting data provided.
  • an embodiment of the present invention provides an apparatus for transmitting data, where the apparatus for transmitting data includes at least one unit, where the at least one unit is configured to implement any one of the foregoing third aspect or the third aspect.
  • the method of transmitting data provided.
  • an embodiment of the present invention provides a computer program product comprising instructions, when executed on a computer, causing a computer to perform the transmission of data provided by any one of the foregoing first to third possible implementation manners. method.
  • the receiving party receives the communication message sent by the first device, where the communication message carries the key identifier, the encrypted data, and the first message verification code, and the receiver can obtain the key and the auxiliary corresponding to the key identifier.
  • the verification information is used to verify the encrypted data according to the key, the first message verification code and the auxiliary verification information, thereby determining whether the encrypted data is falsified, and improving the reliability of the transmitted data.
  • FIG. 1 is a system frame diagram provided by an embodiment of the present disclosure
  • FIG. 2 is a schematic structural diagram of a second device according to an embodiment of the present disclosure.
  • FIG. 3 is a schematic structural diagram of an authentication server according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of a first device according to an embodiment of the present disclosure.
  • FIG. 5 is a flowchart of a method for transmitting data according to an embodiment of the present disclosure
  • FIG. 6 is a flowchart of a method for transmitting data according to an embodiment of the present disclosure
  • FIG. 7 is a flowchart of a method for transmitting data according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of an apparatus for transmitting data according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of an apparatus for transmitting data according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of an apparatus for transmitting data according to an embodiment of the present disclosure.
  • M2M Machine-to-Machine Communications
  • a multi-layer device is usually included.
  • the service server, the gateway, and a camera installed in the home can be included.
  • devices adjacent to each other may be referred to as adjacent devices.
  • each device sends data to its neighboring device, and the neighboring device forwards the data according to a certain manner (such as an IP routing algorithm, or other means) until it is forwarded to the receiver.
  • a certain manner such as an IP routing algorithm, or other means
  • the M2M system may include an application service node (ASN), an intermediate node (MN), an infrastructure node (IN), and an M2M authentication function (MAF).
  • Equipment and business servers can be a terminal device, such as a smart camera or a smart air conditioner.
  • the ASN can include a Common Service Entity (CSE) and at least one Application Entity (AE);
  • the MN can be a gateway in the M2M system.
  • a device such as a home gateway, may include a CSE and any number of AEs; IN may include one CSE and any number of AEs; MAF may be a device for the M2M system to register and issue keys for each device during operation.
  • the service server can be a background server of a certain service in the M2M system, and can include an AE, such as a background server of a smart camera.
  • the system framework diagram provided for this implementation includes MAF001, AE002 (ie, service server), IN003, MN004, and ASN005.
  • MAF001 can establish data connection with IN003 and AE002, and can also establish data connection with at least one MN 004 and ASN005.
  • the data connection may be a Transport Layer Security (TLS) protocol connection or a Datagram Transport Layer Security (DTLS) protocol connection.
  • TLS Transport Layer Security
  • DTLS Datagram Transport Layer Security
  • the foregoing device may be a single device or a server, or may be a function module of a device or a server.
  • the terminal device may send data to the upper device (ie, the gateway device or the service server), or the upper device may send data to the terminal device.
  • the sender may be referred to as a first device
  • the receiver may be referred to as a second device.
  • at least one intermediate device may exist, and the intermediate device may exist.
  • At least one other recipient of the data to be transmitted ie, the target data below).
  • the second device 10 includes a first transceiver 1011 and a first memory 1012, and the second device may further include The first processor 1013 and the first network interface 1014.
  • the first memory 1012 and the first network interface 1014 are respectively connected to the first processor 1013; the first memory 1012 is configured to store program code, the program code includes computer operation instructions, and the first processor 1013 and the first transceiver 1011 are used.
  • the program code stored in the first memory 1012 is executed to implement related processing of the transmitted data, and can interact with the first device and the authentication server through the first network interface 1014.
  • the first memory 1012 and the first network interface 1014 are respectively connected to the first processor 1013 and the first transceiver 1011, and the first transceiver 1011 may include a first transmitter and a first receiver.
  • the first memory 1012 can be used to store software programs and units. Specifically, the first memory 1012 can store the first operating system 10121, the first application unit 10122 required for at least one function.
  • the first operating system 10121 may be an operating system such as Real Time eXecutive (RTX), LINUX, UNIX, WINDOWS, or OS X.
  • the first processor 1013 includes one or more processing cores.
  • the first processor 1013 executes the following instructions for operating the data by running the software program and the unit:
  • the communication message carries a key identifier, an encrypted data, and a first message verification code
  • the encrypted data is a target data to be sent by using a key corresponding to the key identifier
  • the first message verification code is a verification code generated according to the key, the target data, and preset auxiliary verification information
  • the acquiring the key corresponding to the key identifier and the auxiliary verification information includes:
  • the verifying the encrypted data according to the key, the first message verification code, and the auxiliary verification information includes:
  • the method further includes:
  • the method before receiving the communication message sent by the first device, the method further includes:
  • the receiving, by the first device, the communication message includes:
  • the third device Receiving a communication message of the first device forwarded by the third device, the third device being another recipient in a transmission path that receives the target data.
  • the authentication server 20 includes a second transceiver 2011 and a second memory 2012.
  • the authentication server may further include a second processor 2013 and a Two network interfaces 2014.
  • the second memory 2012 and the second network interface 2014 are respectively connected to the second processor 2013; the second memory 2012 is used for storing program codes, the program code includes computer operation instructions, and the second processor 2013 and the second transceiver 2011 are used.
  • the program code stored in the second memory 2012 is executed to implement related processing of the transmission data, and can interact with the network device through the second network interface 2014.
  • the second memory 2012 and the second network interface 2014 are respectively connected to the second processor 2013 and the second transceiver 2011, and the second transceiver 2011 may include a second transmitter and a second receiver.
  • the second memory 2012 can be used to store software programs as well as units. Specifically, the second memory 2012 can store the second application unit 20122 required by the second operating system 20121 and at least one function.
  • the second operating system 20121 may be an operating system such as Real Time eXecutive (RTX), LINUX, UNIX, WINDOWS or OS X.
  • the second processor 2013 includes one or more processing cores.
  • the second processor 2013 executes the following instructions for operating the data by running the software program and the unit:
  • the method further includes:
  • the obtaining, according to the identifier of the first device and the identifier of the receiver of the target data, the transmission path corresponding to each receiver including:
  • the method further includes:
  • the first device 30 includes a third transceiver 3011 and a third memory 3012.
  • the first device further includes A third processor 3013 and a third network interface 3014 can be included.
  • the third memory 3012 and the third network interface 3014 are respectively connected to the third processor 3013; the third memory 3012 is configured to store program code, the program code includes computer operation instructions, and the third processor 3013 and the third transceiver 3011 are used.
  • the program code stored in the third memory 3012 is executed to implement related processing of the transmitted data, and can interact with the first device and the authentication service through the third network interface 3014.
  • the third memory 3012 and the third network interface 3014 are respectively connected to the third processor 3013 and the third transceiver 3011, and the third transceiver 3011 may include a third transmitter and a third receiver.
  • the third memory 3012 can be used to store software programs and units. Specifically, the third memory 3012 can store the third operating system 30121, and the third application unit 30122 required for at least one function.
  • the third operating system 30121 can be an operating system such as Real Time eXecutive (RTX), LINUX, UNIX, WINDOWS, or OS X.
  • the third processor 3013 includes one or more processing cores.
  • the third processor 3013 executes the following instructions for operating the data by running the software program and the unit:
  • the method further includes:
  • the method before the acquiring the target data to be sent, the method further includes:
  • the sending, by the second device, a communication message includes:
  • Transmitting the communication message to a third device so that the third device forwards the communication message to the second device, where the third device is another receiver in a transmission path corresponding to the second device .
  • the embodiment provides a method for transmitting data, which may be performed by the second device in FIG. 2, the authentication server in FIG. 3, and the foregoing FIG. A device is implemented together.
  • the first device Before transmitting data, the first device needs to perform key registration in the authentication server, and the authentication server performs an operation of creating a key and returns a key identifier to the first device, so as to be in the process of subsequently transmitting data.
  • Each device (such as a data receiver) issues the sender's key.
  • the process of key registration may include the following steps:
  • Step 501 The first device sends a key registration request to the authentication server.
  • the first device when the first device needs to register the key, the first device may obtain the pre-stored identifier of the receiver and the local identifier, and then send a key registration request to the authentication server, where the key registration request may carry the target data.
  • the receiver of the target data may be pre-configured by the technician, or may be determined by the first device according to the needs of the service.
  • the identity of the recipient may be carried in the key registration request in the form of a recipient list.
  • the recipients corresponding to different target data may be the same or different.
  • the key registration request when the first device can reach the preset period, the key registration request is sent to the authentication server; after receiving the key registration command, the key registration request may be sent to the authentication server.
  • the key used in the process of transmitting data may also be generated by the first device.
  • the key registration request may further carry a key generated by the first device, and the key may be a symmetric key.
  • the key registration request may also carry an identifier of the key usage mode.
  • the key registration request can be as follows:
  • http://m2m.maf.com/tef0001 represents the Uniform Resoure Locator (URL) of the MAF (ie, the authentication server), that is, the parent node whose key is to be registered, where tef001 is the identity of the MAF.
  • URL Uniform Resoure Locator
  • the identification number (Identity, ID); http://m2m.things.com/cse001/ae001 indicates the URL of the ASN-AE (ie, the sender), where /cse001 is the ID of the ASN-CSE, and /cse001/ae001 is the ASN- AE ID; "ResourceType”: "symmKeyReg”, indicating that a symmKeyReg resource is to be created under tef001, "symmKeyReg.targetIDs”: "/cse002, /cse000/ae002" is the receiver list, and the receiver list contains the transmission.
  • the identification of the device of the party's data These devices can obtain the key of the sender.
  • the key can be obtained by the device identified as /cse002 and /cse000/ae002, where /cse002 is MN-CSE (ie gateway) ID of the device, /cse000/ae002 is the ID of the IN-AE (that is, the ID of the service server); "symmKeyReg.SUID”: "34" indicates the key usage mode. When the value is 34, it indicates that the key can be used. Data encryption for multi-hop transmission; "symmKeyReg.keyValue”: "CDExedSGEdXGj142 He expressed the need for registration of the key value "CDExedSGEdXGj142".
  • the key used in the process of data encryption transmission may also be generated by the authentication server.
  • the key registration request does not need to carry the key.
  • the first device may notify the authentication server to generate a key, and the authentication server may generate a key using a TLS Key Export (IETF RFC 5705) algorithm, and may send the key to the first device, so that the first device is based on the secret.
  • the key is used to encrypt the target data.
  • Step 502 The authentication server receives a key registration request sent by the first device, where the key registration request carries the identifier of the recipient of the target data and the identifier of the first device.
  • Step 503 The authentication server acquires a transmission path corresponding to each receiver according to the identifier of the first device and the identifier of the receiver.
  • the authentication server may create a symmKeyReg resource corresponding to the key registration request, and allocate a resource ID, such as skr001, to the symmKeyReg resource; the authentication server may also assign a key identifier to the key. , that is, KcID, the key and the recipient list in the key registration request are stored corresponding to the key identifier, and the correspondence between the key identifier and the key is established, and the correspondence between the key identifier and the receiver list is established. relationship.
  • the authentication server can determine that the key is a multi-hop data transmission for the multi-data receiver according to the recipient list and the key usage mode.
  • the authentication server may also obtain the transmission path corresponding to each receiver according to the identifier of the first device and the identifier of the receiver, and the obtaining manner may be diversified.
  • Manner 1 The authentication server queries the transmission path corresponding to each receiver in the preset transmission path according to the identifier of the first device and the identifier of the receiver of the target data.
  • a technician may pre-configure a transmission path between devices, and each transmission path may include an identifier of a sender in the transmission path, an identifier of an intermediate device that needs to pass, and an identifier of the receiver.
  • the network system may include a service server 003, a gateway device 002, and a camera 001 installed in the home.
  • the transmission path of the data sent by the camera to the service server is 001, 002, 003; and the transmission path of the data sent by the camera to the gateway device is 001, 002.
  • the authentication server may separately query the transmission path corresponding to each receiver in the preset transmission path according to the identifier of the first device and the identifier of each receiver.
  • the foregoing transmission path may be stored in the authentication server and queried by the authentication server.
  • the transmission path may be stored in the infrastructure node, queryed to the infrastructure node, and then the queried result is sent to the authentication server.
  • the specific processing procedure may include the following steps:
  • Step 1 The authentication server sends a transmission path query request to the infrastructure node.
  • the transmission path query request may carry the identifier of the first device and the receiver list, and also carries the transmission path request indication.
  • the transport path query request can be as follows:
  • targetIDs "/cse002, /cse000/ae002"
  • http://m2m.in.com/cse000/dataTransPath represents the virtual resource URL of the transmission path query request
  • cse000 is the ID of the IN-CSE (ie, the ID of the infrastructure node)
  • the access to the virtual resource is triggered.
  • the infrastructure node performs data transmission path retrieval; "symmKeyReg.resourceID”: “skr001” indicates that the transmission path query request is for registration of Kc in the skr001 resource; "sourceIDs”: “/cse001/ae001” indicates that the sender of the transmission path is ASN-AE, “targetIDs”: “/cse002, /cse000/ae002” indicates that the receiver of the data transmission path is MN-CSE and IN-AE, and "dataTransPathIndicator”: "1" is the transmission path request indication.
  • Step 2 The infrastructure node queries the transmission path corresponding to each receiver in the preset transmission path according to the identifier of the first device and the identifier of the receiver of the target data.
  • the transmission path between the devices may be pre-stored in the infrastructure node, and after receiving the transmission path query request, the infrastructure node may parse the transmission path query request, obtain the identifier of the first device, and receive each The identifier of the party is then queried according to the identifier of the first device (which may be referred to as the first identifier) and the identifier of each receiver (which may be referred to as the second identifier), and the identifier of the sender is queried in the preset transmission path.
  • An identifier, and the identifier of the receiver is the transmission path of the second identifier, thereby obtaining a transmission path corresponding to each receiver.
  • Step 3 The infrastructure node sends the transmission path corresponding to each receiver to the authentication server.
  • the transmission path corresponding to each receiver may be separately sent to the authentication server, or the transmission path corresponding to each receiver may be carried in a response message.
  • the transmission path corresponding to each receiver may be carried in a response message.
  • the successful response it is sent to the authentication server.
  • the successful response can be as follows:
  • “symmKeyReg.resourceID” indicates that the data transmission path is mainly for the registration Kc corresponding to the skr001 resource
  • the transmission path, "dataTransPath”: "/cse001/ae001, /cse001, /cse002, /cse000, /cse000/ae002” indicates the transmission path of ASN-AE to IN-AE.
  • Step 4 The authentication server receives a transmission path corresponding to each receiver sent by the infrastructure node.
  • Manner 2 The authentication server generates a transmission path corresponding to each receiver according to the identifier of the first device and the identifier of the receiver of the target data.
  • the authentication server may generate a transmission path corresponding to each receiver according to a preset transmission path generation algorithm, an identifier of the first device, and an identifier of each receiver of the target data.
  • the transmission path generation algorithm may be stored in the authentication server, and the transmission path is generated by the authentication server; or the transmission path generation algorithm may be stored in the infrastructure node, the transmission path is generated by the infrastructure node, and then the generated transmission path is sent. Give the authentication server.
  • Step 504 If there is another receiver of the target data in the transmission path corresponding to the second device in the receiver, the authentication server generates the auxiliary verification information corresponding to the second device.
  • the authentication server determines, according to the obtained transmission path, whether the identifier of the intermediate device included in the transmission path includes the identifier in the receiver list, and if yes, determines the receiver.
  • the auxiliary verification information corresponding to the receiver ie, the second device
  • the transmission path corresponding to the receiver is determined.
  • other recipients of the target data do not exist, and no auxiliary verification information is generated.
  • the number of the second devices may be one or multiple. If there are multiple second devices, the authentication server may separately generate auxiliary verification information corresponding to each second device, and then store the identifier of the device and the corresponding auxiliary verification information, and establish a correspondence between the identifier of the device and the auxiliary verification information. relationship.
  • Step 505 The authentication server sends a second response message to the first device.
  • the second response message may be sent to the first device, where the second response message may carry the auxiliary verification information corresponding to each second device, and may also carry There is information such as key identification and resource ID and recipient list.
  • the second response message can be as follows:
  • Step 506 The first device receives the second response message sent by the authentication server.
  • the first device may receive the second response message sent by the authentication server, and then parse the second response message to obtain the auxiliary verification information corresponding to the second device, and then the identifier of the second device and the auxiliary verification information may be Corresponding storage is performed to establish a correspondence between the identifier of the device and the auxiliary authentication information, so that when the communication message is sent to the second device, the message verification code corresponding to the second device is generated based on the auxiliary verification information (ie, the first message verification code) ).
  • the first device After the first device successfully registers the key in the authentication server, the first device can send the communication message to the receiver through the third device, and the third device is illegal.
  • the intrusion is taken as an example, and the foregoing method for transmitting data is described.
  • the second device and the third device are both receivers of the target data, and the keys of the first device are obtained, and the third device is configured to transmit corresponding to the second device. Any intermediate device in the path. As shown in Figure 6, the process flow can be as follows:
  • Step 601 The first device acquires target data to be sent.
  • the target data may be data detected by the first device, may be data sent by other devices to the first device, or may be data pre-stored in the first device.
  • the first device obtains the target data in a manner that the first device acquires the detected target data, or the first device receives the target data sent by the other device, or the first device acquires the pre-stored target data.
  • the first device may be a smart camera, and the smart camera may perform image detection in real time, and use the detected image data as target data to be transmitted.
  • Step 602 The first device encrypts the target data by using the registered key, obtains the encrypted data, and generates the first according to the auxiliary verification information, the key, and the target data that are allocated by the authentication server corresponding to the second device that receives the target data. Message verification code.
  • the other recipients of the target data may exist in the transmission path corresponding to the second device.
  • the target data (which may be referred to as Data) may be encrypted using a registered key and an encryption algorithm to obtain encrypted data (which may be referred to as Data-Encry).
  • the first device may also determine whether the identifier of the receiver exists in the correspondence between the identifier of the locally stored device and the auxiliary authentication information. If yes, the auxiliary verification information corresponding to the identifier of the receiver (ie, the second device) may be obtained, and then the auxiliary verification information (which may be referred to as Data') may be added after the target data, and then according to Data' and the key. And generating a first message verification code with a preset encryption algorithm.
  • the encryption algorithm may be any encryption algorithm, for example, may be encrypted based on Message Integrity Code (MIC), which is based on a key, a hash function, and Data' to calculate a message verification code.
  • the first device may generate a communication message corresponding to the second device according to the encrypted data and the first message verification code, where the communication message may further carry a key identifier of the key of the first device, an identifier of the encryption algorithm, and a second device.
  • logo The encryption algorithm for generating the encrypted data may be different from the encryption algorithm for generating the message verification code.
  • the first device may generate a communication message corresponding to the receiver according to the encrypted data, and the communication message may further carry a key identifier of the key of the first device and an identifier of the encryption algorithm.
  • the first device may separately generate a communication message corresponding to each receiver, and then separately send to each receiver, and the communication messages in the following refer to the communication message sent by the first device to the second device.
  • the form of the foregoing communication message may be various.
  • the communication message may be a communication message used only for transmitting the foregoing data; or the data may also carry other communication messages (such as Create/Update/Notify or The response message, etc., is directly assigned as an attribute of a resource in the message, or is included in a parameter of one of the oneM2M.
  • Step 603 The first device sends a communication message to the third device.
  • the communication message may carry the key identifier, the encrypted data, and the first message verification code of the key, and the destination address of the communication message is an address of the second device.
  • the intermediate device ie, the third device that forwards the communication message may be determined based on the preset transmission policy, and then the communication message is sent to the third device. So that the third device forwards the communication message to the second device.
  • Step 604 The third device receives the communication message of the first device.
  • the communication message may carry the key identifier, the encrypted data, and the first message verification code, where the encrypted data is data obtained by encrypting the target data to be sent by the key corresponding to the key identifier, and the first message verification code. Is a verification code generated based on the key, target data, and preset secondary verification information.
  • Step 605 The third device sends a key acquisition request to the authentication server.
  • the third device may parse the communication message sent by the first device to itself, and obtain the key identifier corresponding to the first device, or may parse the communication message to obtain the key corresponding to the first device.
  • logo The third device may obtain a locally pre-stored key according to the key identifier, or the third device may also send a key acquisition request to the authentication server to obtain the key.
  • the key acquisition request may carry the key identifier and the identifier of the third device.
  • the key acquisition request can be as follows:
  • http://m2m.maf.com/tef001/kc001/keyValue indicates that the key identifier to be requested is kc001.
  • Http://m2m.things.com/cse002 indicates that the sender of the key acquisition request is the identifier of the MN (ie, the third device) is cse002.
  • Step 606 The authentication server receives a key acquisition request sent by the third device.
  • Step 607 The authentication server acquires a key corresponding to the pre-stored key identifier.
  • the authentication server may parse the key acquisition request, obtain the key identifier carried in the third device, and then obtain the identifier according to the pre-stored key. Corresponding relationship between the identifier and the receiver list, and the received key identifier, determining a corresponding receiver list, and then determining whether the identifier of the third device is included in the receiver list, and if included, indicating that the third device can obtain the The key, the authentication server may determine the key corresponding to the received key identifier according to the correspondence between the key identifier and the key stored in advance; if not, the processing may not be processed, and the request may be fed back to the third device. Failed response message.
  • the MAF finds its corresponding recipient list “/cse002, /cse000/ae002” according to the identifier kc001 of the key, and can determine that the identifier/cse002 of the third device MN-CSE is in the receiver list, ie, MN-CSE. Have access to Kc.
  • Step 608 The authentication server sends a third response message to the third device.
  • the third response message may carry the key corresponding to the key identifier, and the third response message may be as follows:
  • CDExedSGEdXGj142 is the value of the key
  • kc001 is the key identifier
  • Step 609 The third device sends the communication message to the second device.
  • the third device does not parse the communication message in a normal state, but after receiving the communication message, forwards the communication message directly to the second according to the destination address in the communication message. device.
  • the criminal can use the third device to parse the encrypted data in the communication message based on the received key and the preset encryption algorithm, obtain the original data of the target data, and then the original data.
  • Data tampering (the falsified data may be referred to as Data), encrypting the data by the encryption algorithm and the key, carrying the encrypted data in the communication message, and forwarding the communication message to the second device .
  • Step 610 The second device receives the communication message forwarded by the third device.
  • the communication message may carry the key identifier, the encrypted data, and the first message verification code, and may also carry the identifier of the encryption algorithm and the identifier of the second device, and the destination address of the communication message is the address of the second device. .
  • Step 611 The second device sends a key acquisition request to the authentication server.
  • the key acquisition request carries the key identifier that is parsed by the second device, and the identifier of the second device.
  • the key acquisition request may refer to the example in the foregoing 605, and details are not described herein.
  • Step 612 The authentication server receives a key acquisition request sent by the second device.
  • Step 613 The authentication server acquires a key corresponding to the key identifier stored in advance, and auxiliary verification information corresponding to the identifier of the second device.
  • the authentication server may parse the key acquisition request, obtain the key identifier carried in the second device, and then obtain the identifier according to the pre-stored key. Corresponding relationship between the identifier and the receiver list, and the received key identifier, determining a corresponding receiver list, and then determining whether the identifier of the second device is included in the receiver list, and if included, indicating that the second device can obtain the The key, the authentication server may determine the key corresponding to the received key identifier according to the correspondence between the key identifier and the key stored in advance; if not, the processing may not be processed, and the request may be fed back to the second device. Failed response message.
  • the authentication server may further obtain the auxiliary verification information corresponding to the second device according to the correspondence between the identifier of the pre-stored device and the auxiliary verification information, and the identifier of the second device.
  • the MAF finds that its stored targetIDs are "/cse002, /cse000/ae002" according to kc001 corresponding to symmKeyReg, and can determine that the second device IN-AE (/cse000/ae002) has the right to obtain Kc, and the IN-AE is Auxiliary authentication information ExtAuthenData is assigned.
  • Step 614 The authentication server sends a first response message to the second device.
  • the first response message may carry a key and auxiliary verification information, and the first response message may be as follows:
  • CDExedSGEdXGj142 is the value of the key
  • kc001 is the key identifier
  • CHMEGKSjMX23J is the auxiliary verification information corresponding to the second device.
  • Step 615 The second device receives the first response message sent by the authentication server.
  • the second device may parse the first response message, and obtain the key and the auxiliary verification information in the first response message.
  • Step 616 The second device verifies the encrypted data according to the key, the first message verification code, and the auxiliary verification information.
  • the second device may decrypt the encrypted data according to the key, obtain the decrypted data, and then generate the message verification code by using the decrypted data, the auxiliary verification information, the key, and a preset encryption algorithm. That is, the second message verification code), and then it can be determined whether the second message verification code matches the first message verification code (such as whether it is the same), and if the second message verification code matches the first message, it can be determined that the verification is passed, the encryption
  • the data is not tampered with; if the second message verification code does not match the first message, it may be determined that the verification failed, the encrypted data is abnormal, may be tampered with, and then step 616 may be performed.
  • Step 617 The second device sends a data abnormality notification to the authentication server.
  • the second device may send a data abnormality notification to the authentication server, where the data abnormality notification may carry the key identifier and the identifier of the second device, so that the authentication server can correspond to the key identifier.
  • the data exception notification can be as follows:
  • Step 618 The authentication server receives the data abnormality notification sent by the second device.
  • the authentication server determines an abnormal device in the transmission path according to the transmission path corresponding to the second device and other receiving parties in the transmission path, and sends an alarm message corresponding to the abnormal device to the first device.
  • the authentication server may parse the data abnormality notification, obtain the key identifier and the identifier of the second device, and the authentication server may determine the transmission of the second device according to the transmission path corresponding to the second device acquired in advance.
  • the authentication server can log out the key and delete the symmKeyReg resource corresponding to the key.
  • the authentication server may also obtain the identifier of the intermediate device (ie, the abnormal device), and then send an alarm message corresponding to the abnormal device to the first device, where the alarm message may carry the identifier, key identifier, and key logout indication of the abnormal device.
  • the alarm message can be as follows:
  • the embodiment further provides a method for transmitting data, in which the second device can actively acquire target data of the first device.
  • the second device may directly request the target data from the first device, and after receiving the data acquisition request, the first device generates a communication message corresponding to the second device, and sends the communication message to the second device.
  • the first device may also generate a communication message corresponding to each receiver in advance, and then store the communication message in another device (which may be referred to as a fourth device), and the second device acquires the communication message from the fourth device.
  • the second device directly requests the target data from the first device as an example.
  • the specific processing procedure may be as follows:
  • Step 701 The second device sends a data acquisition request to the first device.
  • Step 702 The first device receives a data acquisition request sent by the second device.
  • Step 703 The first device acquires target data to be sent.
  • step 601 For the specific processing of this step, refer to the related description in step 601 above.
  • Step 704 The first device encrypts the target data based on the preset key, obtains the encrypted data, and generates the first message verification according to the pre-stored auxiliary verification information, the key, and the target data corresponding to the second device that receives the target data. code.
  • Step 705 The first device sends a communication message to the third device.
  • Step 706 The third device receives the communication message of the first device.
  • Step 707 The third device sends a key acquisition request to the authentication server.
  • Step 708 The authentication server receives a key acquisition request sent by the third device.
  • step 606 For the specific processing of this step, reference may be made to the related description in step 606 above.
  • Step 709 The authentication server acquires a key corresponding to the pre-stored key identifier.
  • Step 710 The authentication server sends a third response message to the third device.
  • Step 711 The third device sends a communication message to the second device.
  • Step 712 The second device receives the communication message of the first device.
  • Step 713 The second device sends a key acquisition request to the authentication server.
  • Step 714 The authentication server receives a key acquisition request sent by the second device.
  • Step 715 The authentication server acquires a key corresponding to the key identifier stored in advance, and auxiliary verification information corresponding to the identifier of the second device.
  • Step 716 The authentication server sends a first response message to the second device.
  • Step 717 The second device receives the first response message sent by the authentication server.
  • step 615 For the specific processing of this step, reference may be made to the related description in step 615 above.
  • Step 718 The second device verifies the encrypted data according to the key, the first message verification code, and the auxiliary verification information.
  • Step 719 The second device sends a data abnormality notification to the authentication server.
  • Step 720 The authentication server receives the data abnormality notification sent by the second device.
  • Step 721 The authentication server determines an abnormal device in the transmission path according to the transmission path corresponding to the second device and other receiving parties in the transmission path, and sends an alarm message corresponding to the abnormal device to the first device.
  • the receiving party receives the communication message sent by the first device, where the communication message carries the key identifier, the encrypted data, and the first message verification code, and the receiver can obtain the key and the auxiliary corresponding to the key identifier.
  • the verification information is used to verify the encrypted data according to the key, the first message verification code and the auxiliary verification information, thereby determining whether the encrypted data is falsified, and improving the reliability of the transmitted data.
  • FIG. 8 is a structural block diagram of an apparatus for transmitting data according to an embodiment of the present invention.
  • the apparatus may be implemented as part or all of a second device by software, hardware, or a combination of both.
  • the device includes a transceiver unit 810, an acquisition unit 820, and a processing unit 830.
  • the transceiver unit 810 is configured to perform step 610, step 617, step 701, step 721, and step 719 in the foregoing embodiments, and an alternative thereto.
  • the obtaining unit 820 is configured to perform step 611, step 617, step 713, and step 717 and other alternatives in the foregoing embodiments.
  • the processing unit 830 is configured to perform steps 616 and 718 and its alternatives in the above embodiments.
  • the receiving party receives the communication message sent by the first device, where the communication message carries the key identifier, the encrypted data, and the first message verification code, and the receiver can obtain the key and the auxiliary corresponding to the key identifier.
  • the verification information is used to verify the encrypted data according to the key, the first message verification code and the auxiliary verification information, thereby determining whether the encrypted data is falsified, and improving the reliability of the transmitted data.
  • FIG. 9 is a structural block diagram of an apparatus for transmitting data according to an embodiment of the present invention.
  • the apparatus may be implemented as part or all of an authentication server by software, hardware, or a combination of both.
  • the device includes a transceiver unit 910 and an acquisition unit 920.
  • the transceiver unit 910 is configured to perform step 502, step 505, step 606, step 608, step 612, step 614, step 618, step 619, step 708, step 710, step 714, step 716, step 720, and Step 721 and its alternatives.
  • the obtaining unit 920 is configured to perform step 607 and its alternatives in the foregoing embodiments.
  • the apparatus may also include a processing unit for performing step 504 and its alternatives in the above-described embodiments.
  • the receiving party receives the communication message sent by the first device, where the communication message carries the key identifier, the encrypted data, and the first message verification code, and the receiver can obtain the key and the auxiliary corresponding to the key identifier.
  • the verification information is used to verify the encrypted data according to the key, the first message verification code and the auxiliary verification information, thereby determining whether the encrypted data is falsified, and improving the reliability of the transmitted data.
  • FIG. 10 is a structural block diagram of an apparatus for transmitting data according to an embodiment of the present invention.
  • the apparatus may be implemented as part or all of the first device by software, hardware, or a combination of both.
  • the apparatus includes an acquisition unit 1010, a processing unit 1020, and a transceiver unit 1030.
  • the obtaining unit 1010 is configured to perform step 601 and step 703 and its alternatives in the above embodiments.
  • the processing unit 1020 is configured to perform step 602 and step 704 and its alternatives in the foregoing embodiments.
  • the transceiver unit 1030 is configured to perform step 501, step 506, step 603, step 702, and step 705 and other alternatives in the foregoing embodiments.
  • the receiving party receives the communication message sent by the first device, where the communication message carries the key identifier, the encrypted data, and the first message verification code, and the receiver can obtain the key and the auxiliary corresponding to the key identifier.
  • the verification information is used to verify the encrypted data according to the key, the first message verification code and the auxiliary verification information, thereby determining whether the encrypted data is falsified, and improving the reliability of the transmitted data.
  • a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
  • the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

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

Abstract

本公开提供了一种传输数据的方法、装置和设备,属于通信技术领域。所述方法包括:接收第一设备的通信消息,所述通信消息中携带有密钥标识、加密数据和第一消息验证码,其中,所述加密数据是通过所述密钥标识对应的密钥对待发送的目标数据加密得到的数据,所述第一消息验证码是根据所述密钥、所述目标数据和预设的辅助验证信息生成的验证码;获取所述密钥标识对应的密钥和所述辅助验证信息;根据所述密钥、所述第一消息验证码和所述辅助验证信息对所述加密数据进行验证。本公开可以提高传输数据的可靠性。

Description

一种传输数据的方法、装置和设备
本申请要求于2017年3月31日提交中国专利局、申请号为201710210007.X、发明名称为“一种传输数据的方法、装置和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及通信技术领域,特别涉及一种传输数据的方法、装置和设备。
背景技术
目前,通信网络的应用越来越广泛,人们可以通过通信网络实现信息化和远程管理控制。通信网络中两个设备跨越多个节点传输数据的多跳传输是常见的传输方式。在多跳传输的过程中,各设备将数据发送给与其相邻的设备,相邻设备根据某种方式(例如IP路由算法,或其他方式)将数据转发给自身相邻的设备,再由该设备进行转发,直到转发至接收方为止。例如,物联网通信网络可以包括业务服务器、平台服务器、网关和家庭中安装的摄像头,摄像头向业务服务器发送数据的传输路径为摄像头、网关、平台服务器、业务服务器。
为了提高传输数据的安全性,可以对待发送的数据进行加密传输,其中一种常见的处理过程可以为:发送设备在认证服务器中注册密钥并获得密钥标识,用该密钥对待发送的数据进行加密,然后向接收设备发送通信消息,该通信消息中携带加密后的数据和密钥标识等。接收设备接收到该通信消息后,可以根据密钥标识从认证服务器中获取相应的密钥,对加密后的数据进行解密,从而获取到数据原文。
在实际中,经常会出现数据被多个设备所需要的情况。例如,在家的用户通过访问本地的网关获取监控数据,外出的用户可以通过访问业务服务器获取监控数据,此时网关和业务服务器均需要获得监控数据。或者,一个人的健康数据(例如血糖,血压,体重等等)需要发送给远程诊断中心或者健身房中心,以获取日常注意指导或健身指导。为了确保安全,发送给网关和业务服务器的监控数据,或者发送给远程诊断中心或健身房中心的健康数据,均可采用上述方式进行加密传输。但这种情况下,若某一接收设备的传输路径中包含其他可以拥有密钥的接收设备(称中间设备),则会带来安全隐患,例如,若中间设备被入侵,则入侵者可以通过该密钥解密得到数据原文,对数据原文进行篡改,然后再用该密钥进行加密,将加密后的数据发送给该接收设备,而该接收设备无法获知该数据已被篡改,导致传输数据的可靠性降低。
发明内容
为了解决现有技术的问题,本公开实施例提供了一种传输数据的方法、装置和设备。所述技术方案如下:
第一方面,提供了一种传输数据的方法,所述方法包括:
接收第一设备的通信消息,所述通信消息中携带有密钥标识、加密数据和第一消息验证码,其中,所述加密数据是通过所述密钥标识对应的密钥对待发送的目标数据加密得到的数据,所述第一消息验证码是根据所述密钥、所述目标数据和预设的辅助验证信息生成的验证码;
获取所述密钥标识对应的密钥和所述辅助验证信息;
根据所述密钥、所述第一消息验证码和所述辅助验证信息对所述加密数据进行验证。
本公开实施例中,接收方接收第一设备发送的通信消息,该通信消息中携带有密钥标识、加密数据和第一消息验证码,接收方可以获取该密钥标识对应的密钥和辅助验证信息,根据该密钥、第一消息验证码和辅助验证信息对加密数据进行验证,从而判断加密数据是否篡改,提高了传输数据的可靠性。
在一种可能的实现方式中,所述获取所述密钥标识对应的密钥和所述辅助验证信息,包括:
向认证服务器发送密钥获取请求,所述密钥获取请求中携带有所述密钥标识和本地的标识;
接收所述认证服务器发送的第一响应消息,所述第一响应消息中携带有所述密钥标识对应的密钥和所述辅助验证信息。
这样,提供了一种获取密钥和辅助验证信息的实现方式。
在另一种可能的实现方式中,所述根据所述密钥、所述第一消息验证码和所述辅助验证信息对所述加密数据进行验证,包括:
基于所述密钥对所述加密数据进行解密;
根据所述密钥、所述辅助验证信息和解密得到的数据生成第二消息验证码,如果所述第一消息验证码与所述第二消息验证码不匹配,则所述加密数据验证未通过。
这样,提供了一种对加密数据进行验证的实现方式。
在另一种可能的实现方式中,所述方法还包括:
如果验证未通过,则向所述认证服务器发送数据异常通知。
这样,可以通知认证服务器数据出现异常,以便认证服务器按照预设的安全策略进行处理,提高数据的安全性。
在另一种可能的实现方式中,所述接收第一设备发送的通信消息之前,还包括:
向所述第一设备发送数据获取请求,以使所述第一设备发送所述通信消息。
这样,第二设备可以主动获取第一设备的数据。
在另一种可能的实现方式中,所述接收第一设备的通信消息,包括:
接收第三设备转发的第一设备的通信消息,所述第三设备是接收所述目标数据的传输路中的其他接收方。
第二方面,提供了一种传输数据的方法,所述方法包括:
接收第二设备发送的密钥获取请求,所述密钥获取请求中携带有密钥标识和所述第二设备的标识;
获取预先存储的所述密钥标识对应的密钥,以及所述第二设备的标识对应的辅助验证信息;
向所述第二设备发送第一响应消息,所述第一响应消息中携带有所述密钥和所述辅助验证信息,以使所述第二设备对接收到的加密数据进行验证。
本公开实施例中,接收方接收第一设备发送的通信消息,该通信消息中携带有密钥标识、加密数据和第一消息验证码,接收方可以获取该密钥标识对应的密钥和辅助验证信息,根据该密钥、第一消息验证码和辅助验证信息对加密数据进行验证,从而判断加密数据是否篡改,提高了传输数据的可靠性。
在一种可能的实现方式中,所述方法还包括:
接收第一设备发送的密钥注册请求,所述密钥注册请求中携带有所述目标数据的接收方的标识和所述第一设备的标识;
根据所述第一设备的标识和所述接收方的标识,获取各接收方对应的传输路径;
如果所述接收方中的所述第二设备对应的传输路径中,存在所述目标数据的其他接收方,则生成所述第二设备对应的辅助验证信息;
向所述第一设备发送第二响应消息,所述第二响应消息中携带有所述第二设备对应的辅助验证信息。
这样,提供了注册密钥以及生成辅助验证信息的实现方式。
在另一种可能的实现方式中,所述根据所述第一设备的标识和所述目标数据的接收方的标识,获取各接收方对应的传输路径,包括:
根据所述第一设备的标识和所述目标数据的接收方的标识,在预设的传输路径中查询各接收方对应的传输路径;或者,
根据所述第一设备的标识和所述目标数据的接收方的标识,生成各接收方对应的传输路径。
这样,提供了获取传输路径的实现方式。
在另一种可能的实现方式中,所述方法还包括:
接收所述第二设备发送的数据异常通知;
根据所述第二设备对应的传输路径,以及所述传输路径中的其他接收方,确定所述传输路径中的异常设备,向所述第一设备发送对应所述异常设备的告警消息。
这样,可以确定发生异常的设备,并可以通知第一设备,第一设备可以停止向异常设备发送通信消息,以防止数据被篡改。
第三方面,提供了一种传输数据的方法,所述方法包括:
获取待发送的目标数据;
基于预设的密钥对所述目标数据进行加密,得到加密数据,并根据接收所述目标数据的第二设备对应的预先存储的辅助验证信息、所述密钥和所述目标数据生成第一消息验证码,其中,所述第二设备对应的传输路径中存在所述目标数据的其他接收方;
向所述第二设备发送通信消息,所述通信消息中携带有所述密钥的密钥标识、所述加密数据和所述第一消息验证码。
本公开实施例中,接收方接收第一设备发送的通信消息,该通信消息中携带有密钥标识、加密数据和第一消息验证码,接收方可以获取该密钥标识对应的密钥和辅助验证信息,根据该密钥、第一消息验证码和辅助验证信息对加密数据进行验证,从而判断加密数据是 否篡改,提高了传输数据的可靠性。
在一种可能的实现方式中,所述方法还包括:
向认证服务器发送密钥注册请求,所述密钥注册请求中携带有所述目标数据的接收方的标识和本地的标识;
接收所述认证服务器发送的第二响应消息,所述第二响应消息中携带有所述第二设备对应的辅助验证信息。
这样,提供了注册密钥以及生成辅助验证信息的实现方式。
在另一种可能的实现方式中,所述获取待发送的目标数据之前,还包括:
当接收到所述第二设备发送的数据获取请求时,执行获取待发送的目标数据的步骤。
这样,第二设备可以主动获取第一设备的数据。
在另一种可能的实现方式中,所述向所述第二设备发送通信消息,包括:
向第三设备发送所述通信消息,以使所述第三设备将所述通信消息转发给所述第二设备,所述第三设备是所述第二设备对应的传输路径中的其他接收方。
第四方面,提供了一种第二设备,该第二设备包括:第一处理器、第一网络接口、第一存储器、第一发射器和第一接收器,第一存储器与第一网络接口分别与第一处理器相连;第一处理器被配置为执行第一存储器中存储的指令;第一处理器通过执行指令来实现上述第一方面或第一方面中任意一种可能的实现方式所提供的传输数据的方法。
第五方面,本发明实施例提供了一种传输数据的装置,该传输数据的装置包括至少一个单元,该至少一个单元用于实现上述第一方面或第一方面中任意一种可能的实现方式所提供的传输数据的方法。
第六方面,提供了一种认证服务器,该认证服务器包括:第二处理器、第二网络接口、第二存储器、第二接收器和第二发射器,第二存储器与第二网络接口分别与第二处理器相连;第二处理器被配置为执行第二存储器中存储的指令;第二处理器通过执行指令来实现上述第二方面或第二方面中任意一种可能的实现方式所提供的传输数据的方法。
第七方面,本发明实施例提供了一种传输数据的装置,该传输数据的装置包括至少一个单元,该至少一个单元用于实现上述第二方面或第二方面中任意一种可能的实现方式所提供的传输数据的方法。
第八方面,提供了一种第一设备,该第一设备包括:第三处理器、第三网络接口、第三存储器、第三接收器和第三发射器,第三存储器与第三网络接口分别与第三处理器相连;第三处理器被配置为执行第三存储器中存储的指令;第三处理器通过执行指令来实现上述第三方面或第三方面中任意一种可能的实现方式所提供的传输数据的方法。
第九方面,本发明实施例提供了一种传输数据的装置,该传输数据的装置包括至少一个单元,该至少一个单元用于实现上述第三方面或第三方面中任意一种可能的实现方式所提供的传输数据的方法。
第十方面,本发明实施例提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面至第三方面任意一种可能的实现方式所提供的传输数据的方法。
本公开实施例提供的技术方案带来的有益效果是:
本公开实施例中,接收方接收第一设备发送的通信消息,该通信消息中携带有密钥标识、加密数据和第一消息验证码,接收方可以获取该密钥标识对应的密钥和辅助验证信息,根据该密钥、第一消息验证码和辅助验证信息对加密数据进行验证,从而判断加密数据是否篡改,提高了传输数据的可靠性。
附图说明
图1是本公开实施例提供的系统框架图;
图2是本公开实施例提供的第二设备的结构示意图;
图3是本公开实施例提供的认证服务器的结构示意图;
图4是本公开实施例提供的第一设备的结构示意图;
图5是本公开实施例提供的传输数据的方法流程图;
图6是本公开实施例提供的传输数据的方法流程图;
图7是本公开实施例提供的传输数据的方法流程图;
图8是本公开实施例提供的传输数据的装置结构示意图;
图9是本公开实施例提供的传输数据的装置结构示意图;
图10是本公开实施例提供的传输数据的装置结构示意图。
具体实施方式
为使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开实施方式作进一步地详细描述。
上述所有可选技术方案,可以采用任意结合形成本公开的可选实施例,在此不再一一赘述。
随着通信网络的发展,设备之间的通讯方式越来越多样化。在机器通信(Machine-to-Machine Communications,M2M)系统中,通常会包含多层设备,例如,在智能监控的场景中,可以包括业务服务器、网关和家庭中安装的摄像头这三层设备。其中,层次相邻的设备,可称为相邻的设备。在多跳传输的过程中,各设备将数据发送给与其相邻的设备,相邻设备根据某种方式(例如IP路由算法,或其他方式)将数据转发给,直到转发至接收方为止。本发明实施例中,M2M系统可以包含应用服务节点(Application Service Node,ASN)、中间节点(Middle Node,MN)、基础设施节点(Infrastructure Node,IN)、M2M认证功能(M2M Authentication Function,MAF)设备和业务服务器。其中,ASN可以为终端设备,比如智能摄像头或智能空调等,ASN可以包含一个公共服务实体(Common Service Entity,CSE)和至少一个应用实体(Application Entity,AE);MN可以为M2M系统中的网关设备,比如家庭网关,MN可以包含一个CSE,以及任意数目个AE;IN可以包含一个CSE,以及任意数目个AE;MAF可以是M2M系统在运行过程中为各设备注册和发放密钥的设备,可称为认证服务器;业务服务器可以是M2M系统中某业务的后台服务器,可以包含一个AE,比如某智能摄像头的后台服务器。如图1所示,为本实施提供的系统框架图,其中包括MAF001、AE002(即业务服务器)、IN003、MN004和ASN005。其中,MAF001 可以与IN003、AE002建立数据连接,还可以与至少一个MN 004和ASN005建立数据连接。该数据连接可以是传输层安全(Transport Layer Security,TLS)协议连接,或数据包传输层安全性(Datagram Transport Layer Security,DTLS)协议连接。
需要说明的是,上述设备可以是一个单独的设备或服务器,也可以是某设备或某服务器中的一个功能模块。在传输数据时,可以是终端设备向上级设备(即网关设备或业务服务器)发送数据,也可以是上级设备向终端设备发送数据。为了便于描述,本实施例中发送方可称为第一设备,接收方可称为第二设备,第一设备与第二设备的传输路径中,可以存在至少一个中间设备,中间设备中可以存在至少一个待传输数据(即下文中的目标数据)的其他接收方。
参见图2,其示出了本发明示例性实施例提供的用于接收通信消息的第二设备,该第二设备10包括第一收发器1011和第一存储器1012,该第二设备还可以包括第一处理器1013和第一网络接口1014。其中,第一存储器1012和第一网络接口1014分别与第一处理器1013连接;第一存储器1012用于存储程序代码,程序代码包括计算机操作指令,第一处理器1013和第一收发器1011用于执行第一存储器1012中存储的程序代码,用于实现传输数据的相关处理,并可以通过第一网络接口1014与第一设备和认证服务器进行交互。
其中,第一存储器1012与第一网络接口1014分别与第一处理器1013和第一收发器1011相连,第一收发器1011可以包括第一发射器和第一接收器。
第一存储器1012可用于存储软件程序以及单元。具体的,第一存储器1012可存储第一操作系统10121、至少一个功能所需的第一应用程序单元10122。第一操作系统10121可以是实时操作系统(Real Time eXecutive,RTX)、LINUX、UNIX、WINDOWS或OS X之类的操作系统。
第一处理器1013包括一个或者一个以上处理核心。第一处理器1013通过运行软件程序以及单元,从而执行以下传输数据的操作的指令:
接收第一设备的通信消息,所述通信消息中携带有密钥标识、加密数据和第一消息验证码,其中,所述加密数据是通过所述密钥标识对应的密钥对待发送的目标数据加密得到的数据,所述第一消息验证码是根据所述密钥、所述目标数据和预设的辅助验证信息生成的验证码;
获取所述密钥标识对应的密钥和所述辅助验证信息;
根据所述密钥、所述第一消息验证码和所述辅助验证信息对所述加密数据进行验证。
在一种可能的实现方式中,所述获取所述密钥标识对应的密钥和所述辅助验证信息,包括:
向认证服务器发送密钥获取请求,所述密钥获取请求中携带有所述密钥标识和本地的标识;
接收所述认证服务器发送的第一响应消息,所述第一响应消息中携带有所述密钥标识对应的密钥和所述辅助验证信息。
在一种可能的实现方式中,所述根据所述密钥、所述第一消息验证码和所述辅助验证信息对所述加密数据进行验证,包括:
基于所述密钥对所述加密数据进行解密;
根据所述密钥、所述辅助验证信息和解密得到的数据生成第二消息验证码,如果所述第一消息验证码与所述第二消息验证码不匹配,则所述加密数据验证未通过。
在一种可能的实现方式中,所述方法还包括:
如果验证未通过,则向所述认证服务器发送数据异常通知。
在一种可能的实现方式中,所述接收第一设备发送的通信消息之前,还包括:
向所述第一设备发送数据获取请求,以使所述第一设备发送所述通信消息。
在一种可能的实现方式中,所述接收第一设备的通信消息,包括:
接收第三设备转发的第一设备的通信消息,所述第三设备是接收所述目标数据的传输路中的其他接收方。
参见图3,其示出了本发明示例性实施例提供的一种认证服务器,该认证服务器20包括第二收发器2011和第二存储器2012,该认证服务器还可以包括第二处理器2013和第二网络接口2014。其中,第二存储器2012和第二网络接口2014分别与第二处理器2013连接;第二存储器2012用于存储程序代码,程序代码包括计算机操作指令,第二处理器2013和第二收发器2011用于执行第二存储器2012中存储的程序代码,用于实现传输数据的相关处理,并可以通过第二网络接口2014与网络设备进行交互。
其中,第二存储器2012与第二网络接口2014分别与第二处理器2013和第二收发器2011相连,第二收发器2011可以包括第二发射器和第二接收器。
第二存储器2012可用于存储软件程序以及单元。具体的,第二存储器2012可存储第二操作系统20121、至少一个功能所需的第二应用程序单元20122。第二操作系统20121可以是实时操作系统(Real Time eXecutive,RTX)、LINUX、UNIX、WINDOWS或OS X之类的操作系统。
第二处理器2013包括一个或者一个以上处理核心。第二处理器2013通过运行软件程序以及单元,从而执行以下传输数据的操作的指令:
接收第二设备发送的密钥获取请求,所述密钥获取请求中携带有密钥标识和所述第二设备的标识;
获取预先存储的所述密钥标识对应的密钥,以及所述第二设备的标识对应的辅助验证信息;
向所述第二设备发送第一响应消息,所述第一响应消息中携带有所述密钥和所述辅助验证信息,以使所述第二设备对接收到的加密数据进行验证。
在一种可能的实现方式中,所述方法还包括:
接收第一设备发送的密钥注册请求,所述密钥注册请求中携带有所述目标数据的接收方的标识和所述第一设备的标识;
根据所述第一设备的标识和所述接收方的标识,获取各接收方对应的传输路径;
如果所述各接收方中的所述第二设备对应的传输路径中,存在所述目标数据的其他接收方,则生成所述第二设备对应的辅助验证信息;
向所述第一设备发送第二响应消息,所述第二响应消息中携带有所述第二设备对应的辅助验证信息。
在一种可能的实现方式中,所述根据所述第一设备的标识和所述目标数据的接收方的标识,获取各接收方对应的传输路径,包括:
根据所述第一设备的标识和所述目标数据的接收方的标识,在预设的传输路径中查询各接收方对应的传输路径;或者,
根据所述第一设备的标识和所述目标数据的接收方的标识,生成各接收方对应的传输路径。
在一种可能的实现方式中,所述方法还包括:
接收所述第二设备发送的数据异常通知;
根据所述第二设备对应的传输路径,以及所述传输路径中的其他接收方,确定所述传输路径中的异常设备,向所述第一设备发送对应所述异常设备的告警消息。
参见图4,其示出了本发明示例性实施例提供的一种用于发送通信消息的第一设备,该第一设备30包括第三收发器3011和第三存储器3012,该第一设备还可以包括第三处理器3013和第三网络接口3014。其中,第三存储器3012和第三网络接口3014分别与第三处理器3013连接;第三存储器3012用于存储程序代码,程序代码包括计算机操作指令,第三处理器3013和第三收发器3011用于执行第三存储器3012中存储的程序代码,用于实现传输数据的相关处理,并可以通过第三网络接口3014与第一设备和认证服务进行交互。
其中,第三存储器3012与第三网络接口3014分别与第三处理器3013和第三收发器3011相连,第三收发器3011可以包括第三发射器和第三接收器。
第三存储器3012可用于存储软件程序以及单元。具体的,第三存储器3012可存储第三操作系统30121、至少一个功能所需的第三应用程序单元30122。第三操作系统30121可以是实时操作系统(Real Time eXecutive,RTX)、LINUX、UNIX、WINDOWS或OS X之类的操作系统。
第三处理器3013包括一个或者一个以上处理核心。第三处理器3013通过运行软件程序以及单元,从而执行以下传输数据的操作的指令:
获取待发送的目标数据;
基于预设的密钥对所述目标数据进行加密,得到加密数据,并根据接收所述目标数据的第二设备对应的预先存储的辅助验证信息、所述密钥和所述目标数据生成第一消息验证码,其中,所述第二设备对应的传输路径中存在所述目标数据的其他接收方;
向所述第二设备发送通信消息,所述通信消息中携带有所述密钥的密钥标识、所述加密数据和所述第一消息验证码。
在一种可能的实现方式中,所述方法还包括:
向认证服务器发送密钥注册请求,所述密钥注册请求中携带有所述目标数据的接收方的标识和本地的标识;
接收所述认证服务器发送的第二响应消息,所述第二响应消息中携带有所述第二设备对应的辅助验证信息。
在一种可能的实现方式中,所述获取待发送的目标数据之前,还包括:
当接收到所述第二设备发送的数据获取请求时,执行获取待发送的目标数据的步骤。
在一种可能的实现方式中,所述向所述第二设备发送通信消息,包括:
向第三设备发送所述通信消息,以使所述第三设备将所述通信消息转发给所述第二设备,所述第三设备是所述第二设备对应的传输路径中的其他接收方。
为了提高传输数据的安全性和可靠性,本实施例提供了一种传输数据的方法,该方法可以由上述图2中的第二设备、上述图3中的认证服务器和上述图4中的第一设备共同实现。
首先,在传输数据之前,第一设备需要先在认证服务器中进行密钥注册,认证服务器则会进行执行密钥创建操作并向第一设备返回密钥标识,以便在后续传输数据的过程中为各设备(比如数据接收方)发放该发送方的密钥。如图5所示,密钥注册的处理流程可以包括以下几个步骤:
步骤501,第一设备向认证服务器发送密钥注册请求。
实施中,当第一设备需要注册密钥时,第一设备可以获取预先存储的接收方的标识和本地的标识,进而向认证服务器发送密钥注册请求,密钥注册请求中可以携带有目标数据的接收方的标识和本地的标识。目标数据的接收方可以由技术人员预先配置,也可以是第一设备根据业务需要确定。对于接收方为多个的情况,接收方的标识可以以接收方列表的形式携带在密钥注册请求中。不同的目标数据对应的接收方可以是相同的,也可以是不同的。另外,第一设备可以达到预设周期时,向认证服务器发送密钥注册请求;也可以在接收到密钥注册指令后,向认证服务器发送密钥注册请求。
传输数据的过程中所使用的密钥还可以由第一设备生成,相应的,密钥注册请求中还可以携带第一设备生成的密钥,该密钥可以是对称密钥。另外,密钥注册请求中还可以携带有密钥使用方式的标识。例如,该密钥注册请求可以如下:
POST http://m2m.maf.com/tef0001HTTP/1.1
X-M2M-Origin:http://m2m.things.com/cse001/ae001
Content-type:application/onem2m-resource+json
{“ResourceType”:“symmKeyReg”,
“symmKeyReg.targetIDs”:“/cse002,/cse000/ae002”,
“symmKeyReg.SUID”:“34”,
“symmKeyReg.keyValue”:“CDExedSGEdXGj142”}
其中,http://m2m.maf.com/tef0001表示MAF(即认证服务器)的统一资源定位器(Uniform Resoure Locator,URL),也就是密钥想要注册的父节点,其中tef001为MAF的身份标识号码(Identity,ID);http://m2m.things.com/cse001/ae001表示ASN-AE(即发送方)的URL,其中/cse001为ASN-CSE的ID,/cse001/ae001为ASN-AE的ID;“ResourceType”:“symmKeyReg”,表示要在tef001下创建一个symmKeyReg资源,“symmKeyReg.targetIDs”:“/cse002,/cse000/ae002”为接收方列表,接收方列表中包含接收该发送方的数据的设备的标识,这些设备可以获取该发送方的密钥,本示例中,密钥可以被标识为/cse002和/cse000/ae002的设备获取,其中/cse002为MN-CSE(即网关设备)的ID,/cse000/ae002为IN-AE的ID(即业务服务器的标识);“symmKeyReg.SUID”:“34”表示密钥使用方式,当值为34时,表示该密钥可以用于多跳传输的数据加 密;“symmKeyReg.keyValue”:“CDExedSGEdXGj142”表示需要注册的密钥的值为“CDExedSGEdXGj142”。
或者,数据加密传输的过程中所使用的密钥也可以由认证服务器来生成,相应的,密钥注册请求则不需要携带密钥。例如,第一设备可以通知认证服务器生成密钥,认证服务器则可以使用TLS Key Export(IETF RFC 5705)算法生成密钥,并可以将该密钥发送给第一设备,以便第一设备基于该密钥,对目标数据进行加密处理。
步骤502,认证服务器接收第一设备发送的密钥注册请求,密钥注册请求中携带有目标数据的接收方的标识和第一设备的标识。
步骤503,认证服务器根据第一设备的标识和接收方的标识,获取各接收方对应的传输路径。
在实施中,认证服务器接收到密钥注册请求后,可以创建该密钥注册请求对应的symmKeyReg资源,并为该symmKeyReg资源分配资源ID,比如skr001;认证服务器还可以为该密钥分配密钥标识,即KcID,将该密钥注册请求中的密钥和接收方列表,与该密钥标识进行对应的存储,建立密钥标识与密钥的对应关系,以及密钥标识与接收方列表的对应关系。认证服务器可以根据接收方列表和密钥使用方式,判定该密钥是用于多数据接收方的多跳数据传输。认证服务器还可以根据第一设备的标识和接收方的标识,获取各接收方对应的传输路径,获取方式可以多样化,本实施例提供了两种可行的处理方式:
方式一、认证服务器根据第一设备的标识和目标数据的接收方的标识,在预设的传输路径中查询各接收方对应的传输路径。
在实施中,技术人员可以预先配置各设备之间的传输路径,每个传输路径可以包括该传输路中的发送方的标识、需要经过的中间设备的标识和接收方的标识。例如,网络系统中可以包括业务服务器003、网关设备002和家庭中安装的摄像头001,摄像头向业务服务器发送数据的传输路径为001,002,003;摄像头向网关设备发送数据的传输路径为001,002。认证服务器可以根据第一设备的标识,以及各接收方的标识,在预设的传输路径中分别查询各接收方对应的传输路径。上述传输路径可以存储在认证服务器中,由认证服务器进行查询;或者,上述传输路径可以存储在基础设施节点中,向基础设施节点进行查询,然后将查询到的结果发送给认证服务器。对于从基础设施节点查询各接收方对应的传输路径的情况,具体的处理过程可以包括以下几个步骤:
步骤1,认证服务器向基础设施节点发送传输路径查询请求。
在实施中,传输路径查询请求中可以携带有第一设备的标识和接收方列表,还需携带有传输路径请求指示。例如,传输路径查询请求可以如下:
GET http://m2m.things.com/cse000/dataTransPath HTTP/1.1
X-M2M-Origin:http://m2m.maf.com/tef001
Content-type:application/onem2m-resource+json
{“symmKeyReg.resourceID”:“skr001”;
“sourceID”:“/cse001/ae001”,
“targetIDs”:“/cse002,/cse000/ae002”,
“dataTransPathIndicator”:“1”}
其中,http://m2m.in.com/cse000/dataTransPath表示传输路径查询请求的虚资源URL,cse000为IN-CSE的ID(即基础设施节点的ID),对于该虚资源的访问,会触发基础设施节点执行数据传输路径检索;“symmKeyReg.resourceID”:“skr001”表示该传输路径查询请求是针对skr001资源中注册Kc;“sourceIDs”:“/cse001/ae001”表示该传输路径的发送方为ASN-AE,“targetIDs”:“/cse002,/cse000/ae002”表示数据传输路径的接收方为MN-CSE和IN-AE,“dataTransPathIndicator”:“1”为传输路径请求指示。
步骤2,基础设施节点根据第一设备的标识和目标数据的接收方的标识,在预设的传输路径中查询各接收方对应的传输路径。
在实施中,基础设施节点中可以预先存储各设备之间的传输路径,基础设施节点接收到传输路径查询请求后,可以对该传输路径查询请求进行解析,获取第一设备的标识,以及各接收方的标识,然后根据第一设备的标识(可称为第一标识),以及各接收方的标识(可称为第二标识),在预设的传输路径中查询以发送方的标识为第一标识,且接收方的标识为第二标识的传输路,从而得到各接收方对应的传输路径。
步骤3,基础设施节点将各接收方对应的传输路径发送给认证服务器。
在实施中,基础设施节点查询到各接收方对应的传输路径后,可以将各接收方对应的传输路径分别发送给认证服务器,也可以将各接收方对应的传输路径携带在一个响应消息(可称为成功响应)中,发送给认证服务器。例如,该成功响应可以如下:
HTTP/1.1 200OK
Content-type:application/onem2m-resource+json
{“symmKeyReg.resourceID”:“skr001”;
“dataTransPathList”:{
“dataTransPath”:“/cse001/ae001,/cse001,/cse002”
“dataTransPath”:“/cse001/ae001,/cse001,/cse002,/cse000,/cse000/ae002”}}
其中,“symmKeyReg.resourceID”:“skr001”;表示数据传输路径主要是针对skr001资源对应的注册Kc,“dataTransPath”:“/cse001/ae001,/cse001,/cse002”表示ASN-AE到MN-CSE的传输路径,“dataTransPath”:“/cse001/ae001,/cse001,/cse002,/cse000,/cse000/ae002”表示ASN-AE到IN-AE的传输路径。
步骤4,认证服务器接收基础设施节点发送的各接收方对应的传输路径。
方式二、认证服务器根据第一设备的标识和目标数据的接收方的标识,生成各接收方对应的传输路径。
在实施中,认证服务器也可以在接收到密钥注册请求后,根据预设的传输路径生成算法、第一设备的标识和目标数据的各接收方的标识,分别生成各接收方对应的传输路径。该传输路径生成算法可以存储在认证服务器中,由认证服务器生成传输路径;或者,该传输路径生成算法也可以存储在基础设施节点中,由基础设施节点生成传输路径,然后将生成的传输路径发送给认证服务器。
步骤504,如果接收方中的第二设备对应的传输路径中,存在目标数据的其他接收方,则认证服务器生成第二设备对应的辅助验证信息。
在实施中,对于任一接收方,认证服务器根据获取到的传输路径,判断该传输路径所 包含的中间设备的标识中,是否包含上述接收方列表中的标识,如果包含,则判定该接收方对应的传输路径中,存在目标数据的其他接收方,然后可以生成该接收方(即第二设备)对应的辅助验证信息(即ExtAuthenData);如果不包含,则判定该接收方对应的传输路径中,不存在目标数据的其他接收方,不生成辅助验证信息。例如,IN-AE的数据传输路径中“/cse001/ae001,/cse001,/cse002,/cse000,/cse000/ae002”包含拥有密钥的接收方MN-CSE(/cse002),则认证服务器可以为IN-AE分配附加认证数据ExtAuthenData:CHMEGKSjMX23J。
其中,第二设备的数目可以是一个,也可以是多个。如果存在多个第二设备的情况,认证服务器可以分别生成每个第二设备对应的辅助验证信息,然后将设备的标识与对应的辅助验证信息进行存储,建立设备的标识和辅助验证信息的对应关系。
步骤505,认证服务器向第一设备发送第二响应消息。
在实施中,认证服务器生成第二设备对应的辅助验证信息后,可以向第一设备发送第二响应消息,第二响应消息中可以携带有每个第二设备对应的辅助验证信息,还可以携带有密钥标识和资源ID和接收方列表等信息。例如,第二响应消息可以如下:
HTTP/1.1 200OK
Content-type:application/onem2m-resource+json
{“symmKeyReg.kcIdentity”:“kc001”;
“symmKeyReg.targetIDs”:“/cse002,/cse000/ae002”,
“symmKeyReg.extAuthenDataList”:“/cse000/ae002,CHMEGKSjMX23J”}
其中,“symmKeyReg.kcIdentity”:“kc001”表示KcID为kc001,“symmKeyReg.extAuthenDataList”:“/cse000/ae002,CHMEGKSjMX23J”是表示分配给IN-AE的辅助验证信息为CHMEGKSjMX23J的映射对,对于第二设备为多个的情况,那么“symmKeyReg.extAuthenDataList”可以赋值为多个映射对。
步骤506,第一设备接收认证服务器发送的第二响应消息。
在实施中,第一设备可以接收认证服务器发送的第二响应消息,然后对第二响应消息进行解析,获取第二设备对应的辅助验证信息,然后可以将第二设备的标识与该辅助验证信息进行对应的存储,建立设备的标识和辅助验证信息的对应关系,以便在向第二设备发送通信消息时,基于该辅助验证信息,生成第二设备对应的消息验证码(即第一消息验证码)。
第一设备在认证服务器中成功注册密钥后,可以向接收方发送需要传输的目标数据,本实施例以第一设备通过第三设备将通信消息转发给第二设备,且第三设备被非法入侵为例,对上述传输数据方法进行说明,其中,第二设备和第三设备均是目标数据的接收方,均可以获得第一设备的密钥,第三设备设是第二设备对应的传输路径中的任一中间设备。如图6所示,该处理流程可以如下:
步骤601,第一设备获取待发送的目标数据。
在实施中,目标数据可以是第一设备检测到的数据,可以是其他设备向第一设备发送的数据,还可以是第一设备中预先存储的数据。相应的,第一设备获取目标数据的方式可 以为,第一设备获取检测到的目标数据,或者,第一设备接收其他设备发送的目标数据,或者,第一设备获取预先存储的目标数据。例如,第一设备可以为智能摄像头,智能摄像头可以实时进行图像检测,将检测到的图像数据作为待发送的目标数据。
步骤602,第一设备使用已注册的密钥对目标数据进行加密,得到加密数据,并根据接收目标数据的第二设备对应的由认证服务器分配的辅助验证信息、密钥和目标数据生成第一消息验证码。
其中,第二设备对应的传输路径中可以存在目标数据的其他接收方。
在实施中,第一设备在向接收方发送目标数据时,可以使用已注册的密钥和加密算法对目标数据(可称为Data)进行加密,得到加密数据(可称为Data-Encry),第一设备还可以判断本地存储的设备的标识和辅助验证信息的对应关系中,是否存在该接收方的标识。如果存在,则可以获取该接收方(即第二设备)的标识对应的辅助验证信息,然后可以在目标数据的后面添加该辅助验证信息(可称为Data’),然后根据Data’、密钥和预设的加密算法生成第一消息验证码。该加密算法可以是任意加密算法,例如,可以基于消息完整性编码(Message Integrity Code,MIC)进行加密,该加密算法是基于密钥、Hash函数和Data’来计算消息验证码的。第一设备可以根据加密数据和第一消息验证码,生成第二设备对应的通信消息,该通信消息中还可以携带有第一设备的密钥的密钥标识、加密算法的标识以及第二设备的标识。其中,生成加密数据的加密算法,与生成消息验证码的加密算法可以是不同的。
如果第一设备判定设备的标识和辅助验证信息的对应关系中,不存在该接收方的标识,则可以不执行生成消息验证码的处理。第一设备可以根据加密数据生成该接收方对应的通信消息,该通信消息中还可以携带有第一设备的密钥的密钥标识和加密算法的标识。对于不同的接收方,第一设备可以分别生成每个接收方对应的通信消息,然后分别发送给每个接收方,下文中的通信消息均指代第一设备发送给第二设备的通信消息。
其中,上述通信消息的形式可以是多种多样的,例如,该通信消息可以是只用于发送上述数据的通信消息;或者,上述数据也可以携带其他通信消息中(比如Create/Update/Notify或响应消息等),直接作为该消息中的某个资源的属性赋值,或者包含在某个oneM2M的参数中进行发送。
步骤603,第一设备向第三设备发送通信消息。
其中,该通信消息中可以携带有该密钥的密钥标识、加密数据和第一消息验证码,且该通信消息的目的地址为第二设备的地址。
在实施中,第一设备生成第二设备对应的通信消息后,可以基于预设的传输策略,确定转发该通信消息的中间设备(即第三设备),然后向第三设备发送该通信消息,以使第三设备将该通信消息转发给第二设备。
步骤604,第三设备接收第一设备的通信消息。
其中,该通信消息中可以携带有密钥标识、加密数据和第一消息验证码,该加密数据是通过密钥标识对应的密钥对待发送的目标数据加密得到的数据,该第一消息验证码是根据密钥、目标数据和预设的辅助验证信息生成的验证码。
步骤605,第三设备向认证服务器发送密钥获取请求。
在实施中,第三设备可以对第一设备发送给自身的通信消息进行解析,获取第一设备对应的密钥标识,或者,也可以对该通信消息进行解析,获取第一设备对应的密钥标识。第三设备可以根据该密钥标识,获取本地预先存储的密钥,或者,第三设备也可以向认证服务器发送密钥获取请求,以获取该密钥。密钥获取请求中可以携带有密钥标识和第三设备的标识。该密钥获取请求可以如下所示:
GET http://m2m.maf.com/tef001/kc001/keyValue HTTP/1.1
X-M2M-Origin:http://m2m.things.com/cse002
Content-type:application/onem2m-resource+json
其中,http://m2m.maf.com/tef001/kc001/keyValue表示要请求的密钥标识为kc001。http://m2m.things.com/cse002表示该密钥获取请求的发送方为MN(即第三设备)的标识为cse002。
步骤606,认证服务器接收第三设备发送的密钥获取请求。
步骤607,认证服务器获取预先存储的密钥标识对应的密钥。
在实施中,认证服务器接收第三设备发送的密钥获取请求后,可以对该密钥获取请求进行解析,获取其中携带的密钥标识和第三设备的标识,然后可以根据预先存储的密钥标识与接收方列表的对应关系,以及接收到的密钥标识,确定对应的接收方列表,然后判断该接收方列表中是否包含第三设备的标识,如果包含,则说明第三设备可以获取该密钥,认证服务器可以根据预先存储的密钥标识与密钥的对应关系,确定接收到的密钥标识对应的密钥;如果不包含,则可以不进行处理,并可以向第三设备反馈请求失败的响应消息。例如,MAF根据密钥的标识kc001查找到其对应的接收方列表“/cse002,/cse000/ae002”,可以判断第三设备MN-CSE的标识/cse002在该接收方列表中,即MN-CSE具有获得Kc的权限。
步骤608,认证服务器向第三设备发送第三响应消息。
在实施中,第三响应消息中可以携带有该密钥标识对应的密钥,该第三响应消息可以如下所示:
HTTP/1.1 200OK
Content-type:application/onem2m-resource+json
{“symmKeyReg.kcIdentity”:“kc001”;
“symmKeyReg.keyValue”:“CDExedSGEdXGj142”}
其中,“CDExedSGEdXGj142”为密钥的值,“kc001”为密钥标识。
步骤609,第三设备将通信消息发送给第二设备。
在实施中,第三设备在正常的状态下,不会对该通信消息进行解析,而是在接收到该通信消息后,根据该通信消息中的目的地址,将该通信消息直接转发给第二设备。第三设备被入侵后,不法分子可以通过第三设备,基于接收到的密钥和预设的加密算法,对通信消息中的加密数据进行解析,得到目标数据的数据原文,然后对该数据原文(Data)进行篡改(篡改后的数据可称为Data”),通过该加密算法和密钥对Data”进行加密,将该加密数据携带在该通信消息中,将该通信消息转发给第二设备。
步骤610,第二设备接收第三设备转发的通信消息。
其中,该通信消息中可以携带有密钥标识、加密数据和第一消息验证码,还可以携带有加密算法的标识以及第二设备的标识,且该通信消息的目的地址为第二设备的地址。
步骤611,第二设备向认证服务器发送密钥获取请求。
在实施中,该密钥获取请求中携带有第二设备解析得到的密钥标识,以及第二设备的标识,该密钥获取请求可以参照上述605中的示例,不再赘述。
步骤612,认证服务器接收第二设备发送的密钥获取请求。
步骤613,认证服务器获取预先存储的密钥标识对应的密钥,以及第二设备的标识对应的辅助验证信息。
在实施中,认证服务器接收第二设备发送的密钥获取请求后,可以对该密钥获取请求进行解析,获取其中携带的密钥标识和第二设备的标识,然后可以根据预先存储的密钥标识与接收方列表的对应关系,以及接收到的密钥标识,确定对应的接收方列表,然后判断该接收方列表中是否包含第二设备的标识,如果包含,则说明第二设备可以获取该密钥,认证服务器可以根据预先存储的密钥标识与密钥的对应关系,确定接收到的密钥标识对应的密钥;如果不包含,则可以不进行处理,并可以向第二设备反馈请求失败的响应消息。另外,认证服务器还可以根据预先存储的设备的标识和辅助验证信息的对应关系,以及第二设备的标识,获取第二设备对应的辅助验证信息。例如,MAF根据kc001对应symmKeyReg查找到其存储的targetIDs为“/cse002,/cse000/ae002”,可以判定第二设备IN-AE(/cse000/ae002)具有获得Kc的权限,并且该IN-AE被分配了辅助验证信息ExtAuthenData。
步骤614,认证服务器向第二设备发送第一响应消息。
在实施中,第一响应消息中可以携带有密钥和辅助验证信息,该第一响应消息可以如下所示:
HTTP/1.1 200OK
Content-type:application/onem2m-resource+json
{“symmKeyReg.kcIdentity”:“kc001”,
“symmKeyReg.keyValue”:“CDExedSGEdXGj142”,
“symmKeyReg.extAuthenDataList”:“/cse000/ae002,CHMEGKSjMX23J”}
其中,“CDExedSGEdXGj142”为密钥的值,“kc001”为密钥标识。“CHMEGKSjMX23J”为第二设备对应的辅助验证信息。
步骤615,第二设备接收认证服务器发送的第一响应消息。
在实施中,第二设备接收到第一响应消息后,可以对第一响应消息进行解析,获取第一响应消息中的密钥和辅助验证信息。
步骤616,第二设备根据密钥、第一消息验证码和辅助验证信息对加密数据进行验证。
在实施中,第二设备可以根据该密钥对加密数据进行解密,得到解密后的数据,然后可以解密后的数据、辅助验证信息、该密钥和预设的加密算法,生成消息验证码(即第二消息验证码),然后可以判定第二消息验证码是否与第一消息验证码匹配(比如是否相同),如果第二消息验证码与第一消息匹配,则可以判定验证通过,该加密数据未被篡改;如果第二消息验证码与第一消息不匹配,则可以判定验证未通过,该加密数据异常,可能被篡 改,然后可以执行步骤616。
步骤617,第二设备向认证服务器发送数据异常通知。
在实施中,如果验证未通过,则第二设备可以向认证服务器发送数据异常通知,该数据异常通知中可以携带有密钥标识和第二设备的标识,以便认证服务器可以根据该密钥标识对应的接收方列表,确定可能被篡改的接收方。该数据异常通知可以如下所示:
POST http://m2m.maf.com/tef001/HTTP/1.1
X-M2M-Origin:http://m2m.things.com/cse000/ae002
Content-type:application/onem2m-resource+json
{“symmKeyReg.kcIdentity”:“kc001”,
“kcAbnormalIndicator”:“1”}
其中“symmKeyReg.kcIdentity”:“kc001”表示该数据异常通知是针对密钥标识为kc001的密钥,“kcAbnormalIndicator”:“1”表示该密钥出现异常现象。
步骤618,认证服务器接收第二设备发送的数据异常通知。
步骤619,认证服务器根据第二设备对应的传输路径,以及传输路径中的其他接收方,确定传输路径中的异常设备,向第一设备发送对应异常设备的告警消息。
在实施中,认证服务器可以对该数据异常通知进行解析,获取其中的密钥标识和第二设备的标识,认证服务器可以根据预先获取到的第二设备对应的传输路径,判断第二设备的传输路径中存在其他能够获得该密钥标识对应的密钥的中间设备,说明可能是由于该中间设备受到攻击,导致数据发生异常,该密钥就可能被不法分子获得。认证服务器可以注销该密钥,并删除该密钥对应的symmKeyReg资源。认证服务器还可以获取该中间设备(即异常设备)的标识,然后向第一设备发送对应异常设备的告警消息,该告警消息中可以携带有该异常设备的标识、密钥标识和密钥注销指示,该告警消息可以如下所示:
POST http://m2m.things.com/cse001/ae001/HTTP/1.1
X-M2M-Origin:http://m2m.maf.com/tef001
Content-type:application/onem2m-resource+json
{“symmKeyReg.kcIdentity”:“kc001”,
“symmKeyReg.targetAbnormalId”:“/cse002”,
“kcDeRegistIndicator”:“1”}
其中“symmKeyReg.kcIdentity”:“kc001”表示该告警消息针对密钥标识为kc001的密钥,“symmKeyReg.targetAbnormalId”:“/cse002”表示第三设备MN-CSE存在异常的可能,“kcDeRegistIndicator”:“1”表示该密钥已被注销。
如图7所示,本实施例还提供了一种传输数据的方法,该方法中,第二设备可以主动获取第一设备的目标数据。第二设备可以直接向第一设备请求目标数据,第一设备在接收到数据获取请求后,生成第二设备对应的通信消息,将该通信消息发送给第二设备。或者,第一设备也可以预先生成各接收方对应的通信消息,然后将该通信消息存储在其他设备(可称为第四设备)中,第二设备从第四设备中获取通信消息。本实施例以第二设备直接向第一设备请求目标数据为例进行说明,具体的处理流程可以如下:
步骤701,第二设备向第一设备发送数据获取请求。
步骤702,第一设备接收第二设备发送的数据获取请求。
步骤703,第一设备获取待发送的目标数据。
本步骤的具体处理过程可以参照上述步骤601中的相关说明。
步骤704,第一设备基于预设的密钥对目标数据进行加密,得到加密数据,并根据接收目标数据的第二设备对应的预先存储的辅助验证信息、密钥和目标数据生成第一消息验证码。
本步骤的具体处理过程可以参照上述步骤602中的相关说明。
步骤705,第一设备向第三设备发送通信消息。
本步骤的具体处理过程可以参照上述步骤603中的相关说明。
步骤706,第三设备接收第一设备的通信消息。
本步骤的具体处理过程可以参照上述步骤604中的相关说明。
步骤707,第三设备向认证服务器发送密钥获取请求。
本步骤的具体处理过程可以参照上述步骤605中的相关说明。
步骤708,认证服务器接收第三设备发送的密钥获取请求。
本步骤的具体处理过程可以参照上述步骤606中的相关说明。
步骤709,认证服务器获取预先存储的密钥标识对应的密钥。
本步骤的具体处理过程可以参照上述步骤607中的相关说明。
步骤710,认证服务器向第三设备发送第三响应消息。
本步骤的具体处理过程可以参照上述步骤608中的相关说明。
步骤711,第三设备对将通信消息发送给第二设备。
本步骤的具体处理过程可以参照上述步骤609中的相关说明。
步骤712,第二设备接收第一设备的通信消息。
本步骤的具体处理过程可以参照上述步骤610中的相关说明。
步骤713,第二设备向认证服务器发送密钥获取请求。
本步骤的具体处理过程可以参照上述步骤611中的相关说明。
步骤714,认证服务器接收第二设备发送的密钥获取请求。
本步骤的具体处理过程可以参照上述步骤612中的相关说明。
步骤715,认证服务器获取预先存储的密钥标识对应的密钥,以及第二设备的标识对应的辅助验证信息。
本步骤的具体处理过程可以参照上述步骤613中的相关说明。
步骤716,认证服务器向第二设备发送第一响应消息。
本步骤的具体处理过程可以参照上述步骤614中的相关说明。
步骤717,第二设备接收认证服务器发送的第一响应消息。
本步骤的具体处理过程可以参照上述步骤615中的相关说明。
步骤718,第二设备根据密钥、第一消息验证码和辅助验证信息对加密数据进行验证。
本步骤的具体处理过程可以参照上述步骤616中的相关说明。
步骤719,第二设备向认证服务器发送数据异常通知。
本步骤的具体处理过程可以参照上述步骤617中的相关说明。
步骤720,认证服务器接收第二设备发送的数据异常通知。
本步骤的具体处理过程可以参照上述步骤618中的相关说明。
步骤721,认证服务器根据第二设备对应的传输路径,以及传输路径中的其他接收方,确定传输路径中的异常设备,向第一设备发送对应异常设备的告警消息。
本步骤的具体处理过程可以参照上述步骤619中的相关说明。
本公开实施例中,接收方接收第一设备发送的通信消息,该通信消息中携带有密钥标识、加密数据和第一消息验证码,接收方可以获取该密钥标识对应的密钥和辅助验证信息,根据该密钥、第一消息验证码和辅助验证信息对加密数据进行验证,从而判断加密数据是否篡改,提高了传输数据的可靠性。
图8是本发明实施例提供的一种传输数据的装置的结构方框图,该装置可以通过软件、硬件或者两者的结合实现成为第二设备的部分或者全部。
该装置包括:收发单元810、获取单元820和处理单元830。
收发单元810用于执行上述实施例中的步骤610、步骤617、步骤701、步骤721和步骤719及其可选方案。
获取单元820用于执行上述实施例中的步骤611、步骤617、步骤713和、步骤717及其可选方案。
处理单元830用于执行上述实施例中的步骤616和步骤718及其可选方案。
本公开实施例中,接收方接收第一设备发送的通信消息,该通信消息中携带有密钥标识、加密数据和第一消息验证码,接收方可以获取该密钥标识对应的密钥和辅助验证信息,根据该密钥、第一消息验证码和辅助验证信息对加密数据进行验证,从而判断加密数据是否篡改,提高了传输数据的可靠性。
图9是本发明实施例提供的一种传输数据的装置的结构方框图,该装置可以通过软件、硬件或者两者的结合实现成为认证服务器的部分或者全部。
该装置包括:收发单元910和获取单元920。
收发单元910用于执行上述实施例中的步骤502、步骤505、步骤606、步骤608、步骤612、步骤614、步骤618、步骤619、步骤708、步骤710、步骤714、步骤716、步骤720和步骤721及其可选方案。
获取单元920用于执行上述实施例中的步骤607及其可选方案。
该装置还可以包括处理单元,处理单元用于执行上述实施例中的步骤504及其可选方案。
本公开实施例中,接收方接收第一设备发送的通信消息,该通信消息中携带有密钥标识、加密数据和第一消息验证码,接收方可以获取该密钥标识对应的密钥和辅助验证信息,根据该密钥、第一消息验证码和辅助验证信息对加密数据进行验证,从而判断加密数据是否篡改,提高了传输数据的可靠性。
图10是本发明实施例提供的一种传输数据的装置的结构方框图,该装置可以通过软件、硬件或者两者的结合实现成为第一设备的部分或者全部。
该装置包括:获取单元1010、处理单元1020和收发单元1030。
获取单元1010用于执行上述实施例中的步骤601和步骤703及其可选方案。
处理单元1020用于执行上述实施例中的步骤602和步骤704及其可选方案。
收发单元1030用于执行上述实施例中的步骤501、步骤506、步骤603、步骤702和步骤705及其可选方案。
本公开实施例中,接收方接收第一设备发送的通信消息,该通信消息中携带有密钥标识、加密数据和第一消息验证码,接收方可以获取该密钥标识对应的密钥和辅助验证信息,根据该密钥、第一消息验证码和辅助验证信息对加密数据进行验证,从而判断加密数据是否篡改,提高了传输数据的可靠性。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本公开的可选实施例,并不用以限制本公开,凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (29)

  1. 一种传输数据的方法,其特征在于,所述方法包括:
    接收第一设备的通信消息,所述通信消息中携带有密钥标识、加密数据和第一消息验证码,其中,所述加密数据是通过所述密钥标识对应的密钥对待发送的目标数据加密得到的数据,所述第一消息验证码是根据所述密钥、所述目标数据和预设的辅助验证信息生成的验证码;
    获取所述密钥标识对应的密钥和所述辅助验证信息;
    根据所述密钥、所述第一消息验证码和所述辅助验证信息对所述加密数据进行验证。
  2. 根据权利要求1所述的方法,其特征在于,所述获取所述密钥标识对应的密钥和所述辅助验证信息,包括:
    向认证服务器发送密钥获取请求,所述密钥获取请求中携带有所述密钥标识和本地的标识;
    接收所述认证服务器发送的第一响应消息,所述第一响应消息中携带有所述密钥标识对应的密钥和所述辅助验证信息。
  3. 根据权利要求1或2所述的方法,其特征在于,所述根据所述密钥、所述第一消息验证码和所述辅助验证信息对所述加密数据进行验证,包括:
    基于所述密钥对所述加密数据进行解密;
    根据所述密钥、所述辅助验证信息和解密得到的数据生成第二消息验证码,如果所述第一消息验证码与所述第二消息验证码不匹配,则所述加密数据验证未通过。
  4. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    如果验证未通过,则向所述认证服务器发送数据异常通知。
  5. 根据权利要求1或2所述的方法,其特征在于,所述接收第一设备发送的通信消息之前,还包括:
    向所述第一设备发送数据获取请求,以使所述第一设备发送所述通信消息。
  6. 根据权利要求1所述的方法,其特征在于,所述接收第一设备的通信消息,包括:
    接收第三设备转发的第一设备的通信消息,所述第三设备是接收所述目标数据的传输路中的其他接收方。
  7. 一种传输数据的方法,其特征在于,所述方法包括:
    接收第二设备发送的密钥获取请求,所述密钥获取请求中携带有密钥标识和所述第二设备的标识;
    获取预先存储的所述密钥标识对应的密钥,以及所述第二设备的标识对应的辅助验证信息;
    向所述第二设备发送第一响应消息,所述第一响应消息中携带有所述密钥和所述辅助验证信息,以使所述第二设备对接收到的加密数据进行验证。
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    接收第一设备发送的密钥注册请求,所述密钥注册请求中携带有所述目标数据的接收 方的标识和所述第一设备的标识;
    根据所述第一设备的标识和所述接收方的标识,获取各接收方对应的传输路径;
    如果所述各接收方中的所述第二设备对应的传输路径中,存在所述目标数据的其他接收方,则生成所述第二设备对应的辅助验证信息;
    向所述第一设备发送第二响应消息,所述第二响应消息中携带有所述第二设备对应的辅助验证信息。
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述第一设备的标识和所述目标数据的接收方的标识,获取各接收方对应的传输路径,包括:
    根据所述第一设备的标识和所述目标数据的接收方的标识,在预设的传输路径中查询各接收方对应的传输路径;或者,
    根据所述第一设备的标识和所述目标数据的接收方的标识,生成各接收方对应的传输路径。
  10. 根据权利要求7-9任一所述的方法,其特征在于,所述方法还包括:
    接收所述第二设备发送的数据异常通知;
    根据所述第二设备对应的传输路径,以及所述传输路径中的其他接收方,确定所述传输路径中的异常设备,向所述第一设备发送对应所述异常设备的告警消息。
  11. 一种传输数据的方法,其特征在于,所述方法包括:
    获取待发送的目标数据;
    基于预设的密钥对所述目标数据进行加密,得到加密数据,并根据接收所述目标数据的第二设备对应的预先存储的辅助验证信息、所述密钥和所述目标数据生成第一消息验证码,其中,所述第二设备对应的传输路径中存在所述目标数据的其他接收方;
    向所述第二设备发送通信消息,所述通信消息中携带有所述密钥的密钥标识、所述加密数据和所述第一消息验证码。
  12. 根据权利要求11所述的方法,其特征在于,所述方法还包括:
    向认证服务器发送密钥注册请求,所述密钥注册请求中携带有所述目标数据的接收方的标识和本地的标识;
    接收所述认证服务器发送的第二响应消息,所述第二响应消息中携带有所述第二设备对应的辅助验证信息。
  13. 根据权利要求11或12所述的方法,其特征在于,所述获取待发送的目标数据之前,还包括:
    当接收到所述第二设备发送的数据获取请求时,执行获取待发送的目标数据的步骤。
  14. 根据权利要求11所述的方法,其特征在于,所述向所述第二设备发送通信消息,包括:
    向第三设备发送所述通信消息,以使所述第三设备将所述通信消息转发给所述第二设备,所述第三设备是所述第二设备对应的传输路径中的其他接收方。
  15. 一种传输数据的装置,其特征在于,所述装置包括:
    收发单元,用于接收第一设备的通信消息,所述通信消息中携带有密钥标识、加密数据和第一消息验证码,其中,所述加密数据是通过所述密钥标识对应的密钥对待发送的目标数据加密得到的数据,所述第一消息验证码是根据所述密钥、所述目标数据和预设的辅助验证信息生成的验证码;
    获取单元,用于获取所述密钥标识对应的密钥和所述辅助验证信息;
    处理单元,用于根据所述密钥、所述第一消息验证码和所述辅助验证信息对所述加密数据进行验证。
  16. 根据权利要求15所述的装置,其特征在于,所述获取单元,还用于:
    向认证服务器发送密钥获取请求,所述密钥获取请求中携带有所述密钥标识和本地的标识;
    接收所述认证服务器发送的第一响应消息,所述第一响应消息中携带有所述密钥标识对应的密钥和所述辅助验证信息。
  17. 根据权利要求15或16所述的装置,其特征在于,所述处理单元,还用于:
    基于所述密钥对所述加密数据进行解密;
    根据所述密钥、所述辅助验证信息和解密得到的数据生成第二消息验证码,如果所述第一消息验证码与所述第二消息验证码不匹配,则所述加密数据验证未通过。
  18. 根据权利要求15或16所述的装置,其特征在于,所述处理单元,还用于:
    如果验证未通过,则控制所述收发单元向所述认证服务器发送数据异常通知。
  19. 根据权利要求15或16所述的装置,其特征在于,所述收发单元,还用于:
    向所述第一设备发送数据获取请求,以使所述第一设备发送所述通信消息。
  20. 根据权利要求15所述的装置,其特征在于,所述收发单元,还用于:
    接收第三设备转发的第一设备的通信消息,所述第三设备是接收所述目标数据的传输路中的其他接收方。
  21. 一种传输数据的装置,其特征在于,所述装置包括:
    收发单元,用于接收第二设备发送的密钥获取请求,所述密钥获取请求中携带有密钥标识和所述第二设备的标识;
    获取单元,用于获取预先存储的所述密钥标识对应的密钥,以及所述第二设备的标识对应的辅助验证信息;
    所述收发单元,还用于向所述第二设备发送第一响应消息,所述第一响应消息中携带有所述密钥和所述辅助验证信息,以使所述第二设备对接收到的加密数据进行验证。
  22. 根据权利要求21所述的装置,其特征在于,所述装置还包括:
    所述收发单元,还用于接收第一设备发送的密钥注册请求,所述密钥注册请求中携带有所述目标数据的接收方的标识和所述第一设备的标识;
    所述获取单元,还用于根据所述第一设备的标识和所述接收方的标识,获取各接收方对应的传输路径;
    处理单元,用于如果所述各接收方中的所述第二设备对应的传输路径中,存在所述目标数据的其他接收方,则生成所述第二设备对应的辅助验证信息;
    所述收发单元,还用于向所述第一设备发送第二响应消息,所述第二响应消息中携带有所述第二设备对应的辅助验证信息。
  23. 根据权利要求22所述的装置,其特征在于,所述获取单元,还用于:
    根据所述第一设备的标识和所述目标数据的接收方的标识,在预设的传输路径中查询各接收方对应的传输路径;或者,
    根据所述第一设备的标识和所述目标数据的接收方的标识,生成各接收方对应的传输路径。
  24. 根据权利要求21-23任一所述的装置,其特征在于,所述收发单元,还用于:
    接收所述第二设备发送的数据异常通知;
    根据所述第二设备对应的传输路径,以及所述传输路径中的其他接收方,确定所述传输路径中的异常设备,向所述第一设备发送对应所述异常设备的告警消息。
  25. 一种传输数据的装置,其特征在于,所述装置包括:
    获取单元,用于获取待发送的目标数据;
    处理单元,用于基于预设的密钥对所述目标数据进行加密,得到加密数据,并根据接收所述目标数据的第二设备对应的预先存储的辅助验证信息、所述密钥和所述目标数据生成第一消息验证码,其中,所述第二设备对应的传输路径中存在所述目标数据的其他接收方;
    收发单元,用于向所述第二设备发送通信消息,所述通信消息中携带有所述密钥的密钥标识、所述加密数据和所述第一消息验证码。
  26. 根据权利要求25所述的装置,其特征在于,所述收发单元,还用于:
    向认证服务器发送密钥注册请求,所述密钥注册请求中携带有所述目标数据的接收方的标识和本地的标识;
    接收所述认证服务器发送的第二响应消息,所述第二响应消息中携带有所述第二设备对应的辅助验证信息。
  27. 根据权利要求25或2所述的装置,其特征在于,所述收发单元,还用于:
    当接收到所述第二设备发送的数据获取请求时,控制所述获取单元执行获取待发送的目标数据的步骤。
  28. 根据权利要求25所述的装置,其特征在于,所述收发单元,还用于:
    向第三设备发送所述通信消息,以使所述第三设备将所述通信消息转发给所述第二设备,所述第三设备是所述第二设备对应的传输路径中的其他接收方。
  29. 一种计算机可读存储介质,所述计算机存储介质中存储有可执行指令,所述可执行指令用于执行权利要求1-14任一项所述的方法。
PCT/CN2018/081185 2017-03-31 2018-03-29 一种传输数据的方法、装置和设备 WO2018177385A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710210007.XA CN108667601B (zh) 2017-03-31 2017-03-31 一种传输数据的方法、装置和设备
CN201710210007.X 2017-03-31

Publications (1)

Publication Number Publication Date
WO2018177385A1 true WO2018177385A1 (zh) 2018-10-04

Family

ID=63674392

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/081185 WO2018177385A1 (zh) 2017-03-31 2018-03-29 一种传输数据的方法、装置和设备

Country Status (2)

Country Link
CN (1) CN108667601B (zh)
WO (1) WO2018177385A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111404671A (zh) * 2019-01-02 2020-07-10 中国移动通信有限公司研究院 移动化量子保密通信方法、网关、移动终端及服务器
CN111526122A (zh) * 2020-03-25 2020-08-11 平安证券股份有限公司 数据监控的方法、装置、设备及介质
CN112532629A (zh) * 2020-11-30 2021-03-19 航天信息股份有限公司 一种数据传输方法、装置、设备和介质
CN113923655A (zh) * 2020-12-23 2022-01-11 技象科技(浙江)有限公司 基于相邻节点的数据解密接收方法及装置

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109698863A (zh) * 2018-12-20 2019-04-30 杭州迪普科技股份有限公司 一种确定http报文安全性的方法、装置、设备及存储介质
CN110766845A (zh) * 2019-09-11 2020-02-07 中国南方电网有限责任公司 电力施工用户信息的识别方法、装置和计算机设备
CN111629008B (zh) * 2020-06-11 2022-02-25 深圳市智慧城市通信有限公司 一种通信数据处理方法及装置
CN114257385A (zh) * 2020-09-10 2022-03-29 西交利物浦大学 一种安全通信方法、装置、电子设备和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030046565A1 (en) * 2001-08-31 2003-03-06 Toshiba Tec Kabushiki Kaisha Method for encrypting and decrypting contents data distributed through network, and system and user terminal using that method
CN101098229A (zh) * 2006-06-26 2008-01-02 华为技术有限公司 验证待传消息完整性的方法、装置和系统
CN101345761A (zh) * 2008-08-20 2009-01-14 深圳市同洲电子股份有限公司 一种私密数据的传输方法及系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101989984A (zh) * 2010-08-24 2011-03-23 北京易恒信认证科技有限公司 电子文件安全共享系统及方法
CN101931536B (zh) * 2010-08-31 2012-05-30 武汉理工大学 一种无需认证中心的高效数据加密及认证方法
CN102594563A (zh) * 2012-02-20 2012-07-18 南京中通电气有限公司 一种用于安全组播的源认证方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030046565A1 (en) * 2001-08-31 2003-03-06 Toshiba Tec Kabushiki Kaisha Method for encrypting and decrypting contents data distributed through network, and system and user terminal using that method
CN101098229A (zh) * 2006-06-26 2008-01-02 华为技术有限公司 验证待传消息完整性的方法、装置和系统
CN101345761A (zh) * 2008-08-20 2009-01-14 深圳市同洲电子股份有限公司 一种私密数据的传输方法及系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI WEI: "Research on security technology of wireless sensor networks", CHINESE MASTER'S THESES FULL-TEXT DATABASE, 15 August 2010 (2010-08-15) *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111404671A (zh) * 2019-01-02 2020-07-10 中国移动通信有限公司研究院 移动化量子保密通信方法、网关、移动终端及服务器
CN111526122A (zh) * 2020-03-25 2020-08-11 平安证券股份有限公司 数据监控的方法、装置、设备及介质
CN111526122B (zh) * 2020-03-25 2023-09-05 平安证券股份有限公司 数据监控的方法、装置、设备及介质
CN112532629A (zh) * 2020-11-30 2021-03-19 航天信息股份有限公司 一种数据传输方法、装置、设备和介质
CN113923655A (zh) * 2020-12-23 2022-01-11 技象科技(浙江)有限公司 基于相邻节点的数据解密接收方法及装置
CN113923655B (zh) * 2020-12-23 2023-08-25 技象科技(南京)有限公司 基于相邻节点的数据解密接收方法及装置

Also Published As

Publication number Publication date
CN108667601B (zh) 2020-12-01
CN108667601A (zh) 2018-10-16

Similar Documents

Publication Publication Date Title
WO2018177385A1 (zh) 一种传输数据的方法、装置和设备
US10601594B2 (en) End-to-end service layer authentication
JP6923611B2 (ja) サービス層におけるコンテンツセキュリティ
CN112260995B (zh) 接入认证方法、装置及服务器
KR102001753B1 (ko) 공개 키잉 메커니즘들을 사용한 서비스 계층에서의 종단간 인증
EP4014425B1 (en) Secure publish-subscribe communication methods and apparatus
CN102970299B (zh) 文件安全保护系统及其方法
CN100568800C (zh) 用于安全远程访问的系统和方法
US20140298037A1 (en) Method, apparatus, and system for securely transmitting data
CN111030996B (zh) 一种访问资源的方法及装置
US9876773B1 (en) Packet authentication and encryption in virtual networks
US11652633B2 (en) System and method for securely transmitting non-PKI encrypted messages
EP4231680A1 (en) Identity authentication system, method and apparatus, device, and computer readable storage medium
KR20150135032A (ko) Puf를 이용한 비밀키 업데이트 시스템 및 방법
Coruh et al. Hybrid secure authentication and key exchange scheme for M2M home networks
WO2022067667A1 (en) A method for preventing encrypted user identity from replay attacks
KR102413497B1 (ko) 보안 전자 데이터 전송을 위한 시스템 및 방법
Jansi et al. Efficient privacy-preserving fault tolerance aggregation for people-centric sensing system
CN109150661A (zh) 一种设备发现方法及装置
WO2018172776A1 (en) Secure transfer of data between internet of things devices
WO2022067627A1 (en) A method for preventing leakage of authentication sequence number of a mobile terminal
CN113992734A (zh) 会话连接方法及装置、设备
US11683167B2 (en) Network traffic management using server name indication
GB2560895A (en) Secure transfer of data between internet of things devices
WO2022067628A1 (en) A method for preventing encrypted user identity from replay attacks

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: 18775599

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18775599

Country of ref document: EP

Kind code of ref document: A1