WO2013087039A1 - 一种安全传输数据方法,装置和*** - Google Patents

一种安全传输数据方法,装置和*** Download PDF

Info

Publication number
WO2013087039A1
WO2013087039A1 PCT/CN2012/086753 CN2012086753W WO2013087039A1 WO 2013087039 A1 WO2013087039 A1 WO 2013087039A1 CN 2012086753 W CN2012086753 W CN 2012086753W WO 2013087039 A1 WO2013087039 A1 WO 2013087039A1
Authority
WO
WIPO (PCT)
Prior art keywords
digest
server
integrity
resource access
message
Prior art date
Application number
PCT/CN2012/086753
Other languages
English (en)
French (fr)
Inventor
肖芳英
卞永刚
张永靖
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP12857397.9A priority Critical patent/EP2779524A4/en
Publication of WO2013087039A1 publication Critical patent/WO2013087039A1/zh
Priority to US14/305,679 priority patent/US20140298037A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • 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/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0869Network architectures or network communication protocols for network security for authentication of entities for achieving mutual authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • 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
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/168Implementing security features at a particular protocol layer above the transport layer
    • 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
    • H04L9/3226Cryptographic 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 using a predetermined code, e.g. password, passphrase or PIN
    • 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
    • H04L9/3236Cryptographic 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 using cryptographic hash functions
    • 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
    • H04L9/3271Cryptographic 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 using challenge-response
    • H04L9/3273Cryptographic 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 using challenge-response for mutual authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/70Services for machine-to-machine communication [M2M] or machine type communication [MTC]
    • 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
    • H04L63/0435Network 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 wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption

Definitions

  • the present invention relates to the field of communications, and in particular, to a method, device and system for securely transmitting data. Background technique
  • the CoAP (Constrained Application Protocol) protocol is mainly used in machine-to-machine (M2M) scenarios such as home controllers, building automation, smart energy, and sensor networks.
  • M2M machine-to-machine
  • the functions of these machines are relatively simple.
  • the processing end has only 8 bits, the storage space is small, the complex transmission protocol is not supported, and the data transmission rate is also low.
  • CoAP provides a request/response interaction model that supports embedded resource discovery, including key web page concepts such as Universal Resource Identifier (URI) and content type.
  • URI Universal Resource Identifier
  • CoAP can be easily translated into the Hyper Text Transfer Protocol (HTTP) for integration into the network.
  • HTTP Hyper Text Transfer Protocol
  • End-to-end secure data transmission includes two-way authentication of user terminals and servers, anti-replay attacks, and encryption and integrity verification of communication data.
  • the technical problem to be solved by the embodiments of the present invention is to provide a method for securely transmitting data, a user terminal, a server, and a system, so that message transmission of the M2M can be performed securely and reliably.
  • an embodiment of the present invention provides a method for securely transmitting data, including: The user terminal sends a resource access request carrying the first authentication header field to the server, where the first authentication header field includes a user identifier and a server identifier;
  • the request response includes a second authentication header field and a message body, the second authentication header field carrying a third integrity digest; and the third integrity digest is received by the server
  • the message body carries the message content encrypted by the shared key; wherein the user password is the user identifier carried according to the resource access request. Obtained in the storage area of the server;
  • a method for securely transmitting data including:
  • the user terminal sends a resource access request carrying a first authentication header field and a message body, where the first authentication header field includes a user identifier, a server identifier, and a first integrity summary, where the first integrity summary is a user
  • the terminal calculates, according to the user password and the message content, the first message digest algorithm; wherein the message body carries the message content encrypted by the shared key;
  • Receiving a request response returned by the server the request response is returned by the server after receiving the resource access request, and verifying that the resource access request is valid, and the validating the verification resource access request specifically includes: decrypting the resource access by using a shared key
  • the requested message body obtains the content of the message, and obtains a corresponding user password from the storage area according to the user identifier in the first authentication header field, and uses the second message digest algorithm to calculate the content according to the message content and the obtained user password.
  • a second integrity summary where the verification resource access request is valid when the first integrity summary and the first integrity summary in the resource access request are consistent.
  • a user terminal including:
  • a first sending module configured to send a resource access request including a first authentication header field to the server, where the first authentication header field carries a user identifier and a server identifier;
  • a first receiving module configured to receive a request response returned by the server, and send the response to the first verification module, where the request response includes a second authentication header field and a message body; and the second authentication header field carries a third integrity
  • the third integrity digest is further calculated according to the user password and the message content by using a third message digest algorithm, where the message body carries the shared secret.
  • the content of the message after the key is encrypted; wherein the user password is obtained from the storage area of the server according to the user identifier carried in the resource access request;
  • a first verification module configured to generate a resource access request, and transmit the request to the first sending module, and configured to obtain a request response from the first receiving module, and use the shared key to decrypt the message body of the request response to obtain the message content, according to
  • the message content and the user password use a fourth message digest algorithm to calculate a fourth integrity digest; when the fourth integrity digest is consistent with the third integrity digest in the request response, the PBN request response is valid. .
  • the present invention provides a server, including:
  • a second receiving module configured to receive a resource access request sent from the user terminal, and send the request to the second authentication module, where the resource access request carries the user identifier and the server identifier;
  • a second verification module configured to acquire a user password from a storage area of the server according to the user identifier in the resource access request; calculate a third integrity summary by using a third message digest algorithm according to the user password and the message content, and carry the second The request header of the authentication header field and the message body is sent to the second sending module; wherein the second authentication header field includes the third integrity digest, and the message body includes the message content encrypted by the shared key;
  • a second sending module configured to send the request response from the second verification module to the user terminal.
  • the present invention provides a user terminal, including:
  • a third sending module configured to send a resource access request from the third authentication module, where the resource access request carries a first authentication header field and a message body, where the first authentication header field carries a user identifier and a server identifier And a first integrity summary;
  • a third verification module configured to calculate, by using a first message digest algorithm, a first integrity digest according to the user password and the message content, and carry the first integrity header, and use the shared key to encrypt the message content and carry the message content in the message body. Transmitting, to the third sending module, a resource access request carrying the first authentication header field and the message body;
  • the third receiving module is configured to receive a request response returned by the server, and transmit the request response to the third verification module.
  • the present invention provides a server, including:
  • a fourth receiving module configured to receive a resource access request sent from the user terminal, and send the request to the fourth authentication module, where the resource access request includes a first authentication header field, where the first authentication header field carries a user identifier , server identity, message body, and first integrity summary;
  • a fourth verification module configured to: after obtaining the resource access request from the fourth receiving module, obtain the message content encrypted by the user terminal carried in the resource access request, and decrypt the message body acquiring message of the resource access request by using the shared key Content: decrypting the message body of the resource access request by using a shared key to obtain a message content, and acquiring a user password from the storage area according to the user identifier in the first authentication header field, according to the message content and the Acquiring the user password to calculate a second integrity digest using a second message digest algorithm; verifying that the resource access request is valid when the second integrity digest is consistent with the first integrity digest in the resource access request,
  • the fourth sending module transmits a request response, and the fourth sending module is configured to
  • the present invention provides a system for securely transmitting data, including:
  • a user terminal configured to send a resource access request carrying a first authentication header field to the server, where the first authentication header field includes a user identifier and a server identifier, and is further configured to receive the request response and decrypt the
  • the message body requesting the response obtains the message content, and calculates a fourth integrity summary according to the message content and the user password, and when the fourth integrity summary is consistent with the third integrity summary in the request response, the verification request response is valid. of;
  • a server configured to receive the resource access request, calculate a third integrity summary by using a third message digest algorithm according to the user password and the message content, and carry the third integrity header in the second authentication header field; use the shared key to encrypt the message content and Carrying in the message body; wherein the user password is obtained from the storage area of the server by using the user identifier carried in the resource access request; wherein the message content is obtained after the operation of the service completion resource access request; and the second terminal is carried by the user terminal The authentication header field and the request response of the message body.
  • the present invention provides a system for securely transmitting data, including:
  • a user terminal configured to send a resource access request carrying a first authentication header field and a message body, where the first authentication header field includes a user identifier, a server identifier, and a first integrity summary, where the first integrity is The abstract is calculated by the user terminal using the first message digest algorithm according to the user password and the message content; wherein the message body carries the message content encrypted by the shared key; and is further configured to receive the request response returned by the server;
  • a server configured to receive a resource access request sent from the user terminal, decrypt the message body of the resource access request by using a shared key, obtain a message content, and obtain a user password from the storage area according to the user identifier in the first authentication header domain. Determining the second message according to the content of the message and the obtained user password The digest algorithm calculates a second integrity digest; when the second integrity digest is consistent with the first integrity digest in the resource access request, the verification resource access request is valid, and the request response is returned to the user terminal.
  • Embodiments of the inventive solution divide the message structure into an authentication header field and a message body, use a key to encrypt the message body to ensure message security, and use integrity summary calculation and verification to ensure secure transmission of the overall message.
  • Figure la is a flow chart of a method for securely transmitting data according to the present invention.
  • Figure lb is a flow chart of a method for securely transmitting data according to the present invention.
  • Figure 5 is a schematic diagram of a user terminal of the present invention.
  • Figure 6 is a schematic diagram of a server of the present invention.
  • Figure 7 is a schematic diagram of a user terminal of the present invention.
  • Figure 8 is a schematic diagram of a server of the present invention.
  • FIG. 9 is a schematic diagram of a system for securely transmitting data according to the present invention.
  • FIG. 10 is a schematic diagram of a system for securely transmitting data provided by the present invention.
  • the user terminal sends a resource access request that carries the first authentication header field to the server.
  • the first authentication header field may further include a first digest calculation parameter, where the first digest calculation parameter includes The user identifier and the server identifier further include one or a combination of a random identifier, a resource access path, and a negotiation key parameter; and the resource access request sent by the user terminal may further include: according to the user password and One or several combinations of the first summary calculation parameters use a first message digest algorithm to calculate a first integrity digest;
  • the random identifier is temporarily generated by the user terminal each time the resource access request message is sent, and the temporarily generated random identifier parameter is invalid after completing a round of resource access request and request response, thereby preventing the user terminal from being subjected to a third party.
  • Replay attack can be
  • the random identifier cnonce can be
  • the random number may also be a UTC format time parameter, and may be another parameter that provides no repetitive change.
  • the first digest calculation parameter further includes a first resource version, and the user terminal may further add the first digest calculation parameter.
  • the first resource version calculates a first integrity summary, and sends a resource access request that carries the first resource version;
  • the server After receiving the resource access request, the server calculates a second integrity digest in the second integrity digest algorithm according to the user password and the first digest calculation parameter of the storage area of the server, where the first integrity digest and the second When the integrity summary is the same, the resource access request is valid, and the first message digest algorithm and the second message digest algorithm are the same.
  • the initial value of the first resource version is returned to the user terminal after the resource is successfully created, and the resource version is monotonous in the update resource request operation of the same resource content on the server, which may be monotonically increasing;
  • the version is added to the integrity summary calculation process to ensure the validity of the resource version, that is, any tampering will be found in the integrity verification process, and each time the server accesses the same resource access request, such as updating the resource request, the modified resource.
  • the version of the second resource of the server is updated after being modified, so that the third party can prevent the third party from using the intercepted resource access request to replay the attack server; if the server receives a valid resource access request, if the version Etag cannot be Corresponding to the Etag of the corresponding resource of the server, the server will return the correct Etag to the user terminal;
  • Resource access requests include, but are not limited to, obtaining resource requests, updating resource requests, and creating resource requests;
  • S1002 Receive a request response returned by the server, where the request response includes a second authentication header field and a message body, where the second authentication header field carries a third integrity summary;
  • the third integrity digest is further calculated according to the user password and the message content by using a third message digest algorithm, where the message body carries the message content encrypted by the shared key;
  • the user password is obtained from the storage area of the server according to the user identifier carried in the resource access request; the content of the message is obtained after the server performs the operation according to the resource access request.
  • the second authentication header field in the request response further includes a second digest calculation parameter, where the second digest calculation parameter specifically includes one or more of a user identifier, a random identifier, a resource access path, a server identifier, and a negotiation key parameter. Combination of the second summary calculation parameters can participate in the third integrity Summary.
  • S1003 Decrypt the message body of the request response by using a shared key to obtain a message content, and calculate a fourth integrity summary by using a fourth message digest algorithm according to the message content and the user password, where the fourth integrity summary and the The verification request response is valid when the third integrity summary in the request response is consistent;
  • the shared key is negotiated by the server and the user terminal, and may be a general DH key pair.
  • the key may be calculated according to the message digest algorithm of the key according to the user account and the user password, and the specific calculation parameter may further include a resource access path.
  • the message digest algorithm of the key includes, but is not limited to, DM5, DM8, or SHA-1, etc., the server identifier, the random identifier, the first resource version, and the like;
  • the valid means that the parameter participating in the first integrity digest calculation in the resource access request or the parameter participating in the third integrity digest calculation in the request response is not tampered with by a third party; otherwise the resource received by the server The request response or the request response received by the user terminal is changed during transmission, and the specific situation may be tampering by a third party or due to channel noise and the like.
  • the first message digest algorithm, the second message digest algorithm, the third message digest algorithm, and the fourth message digest algorithm are preferably, but not limited to, a hash function, and may be MD4, MD5, SHA or based on a hash function.
  • An algorithm such as SHA-1; the user password is known to both sides of the user terminal and the server, and participates in the integrity summary calculation on both sides to verify the authority of the user terminal and the validity of the information on both sides, including but not limited to: Whether the parameters used to calculate the integrity summary have been tampered with by a third party.
  • An embodiment of the present invention provides another method for securely transmitting data, including:
  • the user terminal sends a resource access request that carries the first authentication header field and the message body.
  • the first authentication header field includes a user identifier, a server identifier, and a first integrity summary, where the first integrity summary is a user.
  • the terminal calculates, according to the user password and the message content, the first message digest algorithm; wherein the message body carries the message content encrypted by the shared key;
  • the first integrity digest is used by the server to decrypt the message body of the resource access request to obtain the message content after receiving the resource access request, and to store the content according to the user identifier in the first authentication header field. Obtaining a corresponding user password in the area, and calculating, by using the second message digest algorithm, a second integrity digest according to the content of the message and the acquired user password, where the second integrity digest and the resource access request are first When the integrity summary is consistent, verify that the resource access request is valid;
  • the first authentication header field may further include a first digest calculation parameter, and the first digest calculation parameter And including the user identifier and the server identifier, and further comprising one or a combination of a random identifier, a resource access path, and a negotiation key parameter;
  • the user terminal calculates the first integrity digest using the first message digest algorithm according to the user password, the message content, and the first digest calculation parameter; the server message content, the user password, and the first digest calculation parameter use the second message digest algorithm to calculate the second An integrity summary; and verifying that the resource access request is valid when the first integrity digest is consistent with the first integrity digest in the resource access request.
  • S2002 Receive a request response returned by the server; the request response is returned by the server after receiving the resource access request, and verifying that the resource access request is valid;
  • the server uses the shared key to decrypt the message body of the resource access request to obtain the message content, and obtains the corresponding user password from the storage area according to the user identifier in the first authentication header field, according to the message content and the acquired content.
  • the user password uses a second message digest algorithm to calculate a second integrity digest, and when the second integrity digest is consistent with the first integrity digest in the resource access request, verifying that the resource access request is valid;
  • the request response may further include a second authentication header field, where the second authentication header field further includes a second digest calculation parameter, where the second digest calculation parameter specifically includes a user identifier, a random identifier, a resource access path, and a server. And combining the one of the identification and the negotiation key parameters; the server calculates and obtains the third integrity summary by using the third message digest algorithm according to the user password and the second digest calculation parameter;
  • the user terminal After receiving the request response, the user terminal calculates and obtains a fourth integrity digest in the third integrity digest and the fourth according to the user password and the second digest calculation parameter, using a fourth message digest algorithm. When the integrity summary is the same, then the request response is valid.
  • An embodiment of the present invention provides a method for obtaining a resource.
  • the resource access request may be a request for obtaining a resource.
  • the user terminal initiates the GET request for obtaining a resource
  • the user terminal generates a random identifier cnonce in UTC format, which is carried in the GET request.
  • An authentication header field is used to identify a replay attack on the server side.
  • the server and the user terminal perform the two-way identity authentication by using the user name and the user password to participate in the integrity digest calculation.
  • the calculation method is based on the hash hash function.
  • the specific message digest calculation method includes but is not limited to: Message Digest Algorithm 5 , MD5), Secure Hash Algorithm (SHA) or SHA-1.
  • the DH negotiation key parameter is carried in the first authentication header field of the GET request, and the shared key may be the generated DH key, and the flowchart thereof is Shown as follows:
  • the user terminal sends a CoAP protocol GET request to the proxy, where the request carries the first authentication header field of the Authorization identifier, and the first digest calculation parameter includes: the user identifier Digest username. the server identifier realm, the resource access path uri, and the random identifier cnonce
  • the first summary calculation parameter may further include a proxy identifier Uri-Host, where the first authentication header field includes the first digest calculation parameter, and further includes a first integrity digest response, used to complete the GET request.
  • the GET request message is as follows:
  • g and p are the parameters required for the DH key calculation
  • kc is calculated by the user terminal according to the DH key formula gx Mod p Obtained, where X is a private parameter pair generated by the user terminal and the server negotiated, stored in the user terminal, and y with the server side constituting the DH key.
  • these three values can also be added to the calculation of the integrity summary as a summary calculation parameter. If the user terminal and the server have a fixed set of g and p values, then the parameters g and do not need to be carried.
  • the random identifier cnonce is generated by the user terminal according to the UTC format, and is temporarily stored in the user terminal, and also used as the transmission time parameter; the response is the first integrity summary generated by the user terminal, and the user terminal uses the parameter g required for the DH key exchange. , p, kc, and the random identifier cnonce, as well as the combination of user name and password, and use a hash operation, such as MD5 to calculate the integrity summary, the calculation integrity summary method can also be but not limited to SHA or SHA-1. Response The specific calculation is as follows:
  • the proxy receives a GET request from the user terminal, obtains a protocol supported by the user terminal and the server according to the user identity identifier 1 ⁇ 1 and the server identifier [email protected] in the resource access request; completes protocol conversion of the resource access request, so that The original CoAP GET request is converted to an HTTP GET request that supports the server's HTTP protocol; the details are as follows:
  • the proxy sends the converted HTTP GET request to the server
  • the server After receiving the HTTP GET request from the proxy conversion, the server first determines, according to the sending time variable in the random identifier cnonce in the first authentication header field, whether the received GET request is a validity period request, and the expiration is recorded in the expiration date. In the temporary expiration table, and when the next expired GET request is still received, the verification of the temporary expiration table is confirmed to be the second time, then sending the message to the user terminal may be intercepted by the third party and the corresponding measures are taken; When it is determined that the request is within the validity period, the user identity identifier and the first summary calculation parameter stored in the server are queried according to the user identity identifier sensor-1, and the second integrity summary verification user terminal is recalculated, the second integrity summary.
  • the A3 in the second summary calculation parameter is unq(username-value) ":" unq(realm-value) ":” passwd, A4 is uri, and data is the content of the message to be sent by the server. And return an HTTP 200 OK response to the proxy;
  • the proxy converts the HTTP 200 OK response to include the following Authorization option.
  • CoAP 2.05 responds and sends to the user terminal
  • the user terminal After receiving the request response from the proxy, the user terminal first verifies that the request response is carried.
  • the message body obtains the message content data, and then performs a fourth integrity summary calculation according to a third message digest algorithm of the third integrity summary calculated by the server, and the formula is as follows:
  • the third party does not know the value of the private parameters X and y of the key pair formed by both the user terminal and the server, the final DH key cannot be known, and the message content is not obtained; The content of the message is cracked, because the user password is not known to the third party as a necessary parameter for the integrity summary calculation.
  • the third party obtains the modification of any parameter of the message in the transmission, it will cause the integrity summary calculated by the receiver and the The integrity summary carried by the message in the transmission is different and is known by the user terminal or the server; the addition of the data character makes the acquisition resource request and the request response uniquely corresponding, and the repeated transmission request response is not handled by the user terminal because the CNNC check is inconsistent, so The security and integrity of messages between the user terminal and the server are guaranteed.
  • the shared key can be known to each other by using the user terminal and the server, and the user password that the third party cannot know is calculated by the message digest algorithm, in order to enhance the complexity of the key and Security, the user identity and the access resource path can be further increased as parameters for calculating the shared key.
  • the message digest algorithm of the key can be, but is not limited to, MD5, and the formula is as follows:
  • B2 is uri
  • the server encrypts the data message content with the shared key key as the message body of the request response.
  • the Authorization identifier of the resource access request is first.
  • the authentication header field is modified as follows:
  • A5 in the first summary calculation parameter is unq(username) ":” unq(realm) ":” passwd
  • A6 is Method ":” uric where username is the user ID, realm is the server ID, asswd is the user password, Method For the resource access request method, uri is the address of the request resource.
  • the method of this embodiment reduces the delivery of the negotiation key parameters, so that the message header field takes up less space, and the shared key can be obtained by the hash algorithm by using a combination of the user password and the header field parameter. This increases the confidentiality of the information.
  • the present invention provides an embodiment for updating a resource.
  • the resource access request is specifically an update resource request
  • the user terminal generates a different random identifier cnonce to carry the PUT request each time the user terminal initiates the update resource request PUT.
  • the first authentication header field is used to identify the replay attack on the server side, that is, the conce is dynamically changed, and different CNONs are used for the sent update resource request, and the cnonce value carried in the request response sent by the server is received from Obtained in the resource access request.
  • the server and the user terminal participate in the integrity summary calculation using the user name and the user password to perform two-way identity authentication, and the calculation methods include, but are not limited to, MD5, SHA, or SHA-1.
  • the user terminal generates an encryption key and encrypts the data by using information such as a username and a password, and the flowchart thereof is as follows:
  • the user terminal initiates a CoAP PUT request, where the request carries the first authentication header field of the Authorization identifier, and is used to complete the PUT request and the authorization negotiation of the server, where the first digest calculation parameter includes: the user identifier Digest username, the server identifier realm And the resource access path uri, the random identifier cnonce, and the resource version Etag.
  • the first summary calculation parameter may further include a proxy identifier Uri-Host, where the first authentication header field includes the first digest calculation parameter, Including the first integrity summary response, the specific CoAP PUT request message header field is as follows:
  • the first message digest algorithm of the first integrity summary response is: KD ( H(A1), H(A2)": “H(data)), where Al is unq(username) ":” unq(realm)”: “unq(Etag) ": “passwd, A2 is Method ": " uri , data is the data before encryption, that is, the message content of the update resource request.
  • the message digest algorithm of the user terminal according to the user identity usemame and the user password passwd key is:
  • A3 is unq(username) ":” unq(realm)": "Etag”: "passwd”, the user terminal encrypts the message content with key as the message body of the PUT request;
  • the proxy receives the PUT request from the user terminal, obtains a protocol supported by the user terminal and the server according to the user identity identifier 1 ⁇ 1 and the server identifier [email protected] in the resource access request; completes protocol conversion of the resource access request, so that The original CoAP PUT request is converted to an HTTP PUT request of the HTTP protocol supported by the server; the proxy sends the converted HTTP PUT request to the server;
  • the server After receiving the HTTP PUT request forwarded by the proxy, the server verifies the consistency of the first resource version Etag for updating and the original second resource version Etag of the server that are carried in the first authentication header field of the PUT request.
  • the consistency may be that after the server updates the resource, the corresponding resource version is incremented by one to generate the third resource version Etag, and when the update resource is subsequently received, the resource version Etag for updating and the original resource version Etag of the server are verified.
  • the same indicates that the Etag carried in the resource update request is valid, thereby limiting the replay attack of the third party; further verifying that the first resource version Etag satisfies the consistency:
  • usemame queries the user password stored in the server, and uses HTTP PUT to request the realm and uri in the first authentication header field to pass the message digest algorithm of the same key as the user terminal:
  • A1 is unq(username) ":” unq(realm)”: “unq(Etag) ":” passwd
  • A2 is Method ":” uri
  • data is the data before encryption, using the calculation
  • the second integrity digest is compared with the first integrity digest response carried in the first authentication header field of the Authorization to verify the integrity of the PUT request message. If the comparison result is the same, the resource of the server is updated by using the message content, specifically, the resource of the storage and the server is replaced by the content of the message decrypted in the resource update request, and the version of the replaced resource is added to generate a third resource version. And entering S309; if the comparison result is not the same, returning the authentication failure unauthorization message;
  • the server returns an HTTP 401 response, where the response carries a second resource version Etag, a third integrity digest, and a second digest calculation parameter.
  • the second resource version Etag is used to indicate that the user terminal sends the correct version of the resource.
  • the third summary calculation parameter includes: a user identifier, a user password, a server identifier, and a random identifier in addition to the second resource version, and calculates a third integrity summary by using a third message digest algorithm;
  • the proxy converts the HTTP 401 response into a CoAP 4.01 response and sends the response to the user terminal.
  • the second resource header of the resource access request is reset according to the second resource version Etag value in the request response, and a CoAP is initiated again.
  • the PUT request the process of initiating the PUT request is the same as step S301;
  • the proxy receives the CoAP PUT request from the user terminal, and sends an HTTP PUT request to the server after the conversion protocol.
  • the server receives a PUT request carrying a new Etag value, and the specific execution operation is the same as that in step S303.
  • the server returns an HTTP 200 OK response, and the response carries the updated third resource version Etag, and the second authentication header field of the Authentication-info carries the server authentication information, where the second digest calculation parameter is included: the user identifier Digest username, the server Identify the realm, the resource access path uri, and the random identifier cnonce.
  • the content of the message before encryption is also used as the third integrity summary calculation parameter, that is, the third message digest algorithm of the third integrity summary is:
  • A1 is unq(username) ": “unq(realm) ":"Etag”:"passwd,
  • A2 is uri, and the message content data is encrypted by the shared key key to generate a message body for sending;
  • the proxy converts the 200 OK request response of the HTTP protocol into a CoAP 2.04 request response of the CoAP protocol, and forwards the response to the user terminal.
  • the user terminal first verifies whether the random identifier cnonce carried in the request response and the random identifier cnonce value temporarily stored by the user terminal are the same, the same is to delete the temporarily stored cnonce, and the user password is used to calculate the shared secret through the key message digest algorithm.
  • the key further decrypts the message body using the shared key to obtain the message content, and calculates the fourth integrity digest in the same formula as the server calculates the third integrity digest. Comparing the calculated fourth integrity summary and the third integrity summary carried in the request response, when the two are the same, the resource update process is completed; when the two are different, it can be inferred that the request response has been tampered with by a third party, according to the setting S301 restarts the update process or the end process.
  • the shared key is generated by the message digest algorithm by using the user identifier and the user password, so that the message delivery data is less, and the security density of the key is higher.
  • the calculation formulas for calculating the key and the integrity summary are all preferred solutions.
  • the user password can be introduced as a necessary parameter, and other data to be protected and data complexity of the algorithm can be introduced.
  • the data combination of the parameters is also variable. Due to the introduction of the resource version, the server side also has the ability to prevent heavy attacks.
  • the resource access request is specifically a request for creating a resource.
  • the user terminal initiates the creation of a resource request POST
  • the user terminal randomly generates a data character cnonce and carries the first request in the POST.
  • the authentication header field it is used to identify the replay attack on the server side, that is, the conce is dynamically changed, and the temporarily generated one is used when sending the update resource request.
  • Cnoncerob The server no longer uses the Etag used in the previous embodiment to complete the anti-gravity attack, but uses a random identifier nonce that generates a server similar to conce to implement the replay attack.
  • the server and user terminal utilize the username and user password. Participate in the integrity summary calculation for identity authentication, including but not limited to: MD5, SHA or SHA-1.
  • the user terminal generates the encryption key and encrypts the data by using information such as the username and password.
  • the flowchart is as shown in Figure 5:
  • the user terminal initiates a CoAP POST request, and carries a user identity, a server identifier, and a proxy identifier.
  • the random identifier cnonce is a random identifier generated by the user terminal, and is temporarily stored in the user terminal.
  • the proxy receives the CoAP POST request from the user terminal, and completes a protocol conversion of the resource access request according to the user identity identifier sensor-1 and the server identifier example.com in the resource access request, so that the original CoAP POST request is converted into server support.
  • HTTP protocol
  • the proxy converts the HTTP 401 response into a CoAP 4.01 response and forwards the response to the user terminal.
  • the server-side y constitutes a private parameter pair of the DH key, and encrypts the data data with the shared key key;
  • the user terminal re-initiates the CoAP POST request, and uses the encrypted data as the message body of the POST request.
  • the POST request carries the Authorization option with the following parameters:
  • Kc is obtained by the user terminal according to the DH key formula gxMod p, and the first message digest algorithm of the first integrity summary response is as follows:
  • A1 is unq(username) ":” unq(realm) ": "passwd
  • A2 is
  • the proxy converts the CoAP POST request into an HTTP POST request and forwards the request to the server.
  • the server When the POST request is verified, the server creates a resource according to the content of the message and the uri; if the first resource version is carried in the POST request, it is preferred to verify the consistency between the first resource version and the second resource version stored by the server. And generating a third resource version after completing the creation of the resource;
  • the server returns an HTTP 200 OK response, where the resource access address uri of the created resource is included.
  • the Etag further participates in the third integrity summary calculation as one of the second summary calculation parameters, and Carry in the request response HTTP 200 OK; 409.
  • the proxy converts the HTTP 200 OK response into a CoAP 2.01 response and forwards it to the user terminal.
  • it is verified whether the cnonce carried in the request response and the cnonce value temporarily stored by the user terminal are the same, and the cnonce temporarily deleted is deleted, and the shared key decryption message body is further generated by using the key negotiation parameter kc, and the fourth message is used.
  • the digest algorithm calculates a fourth integrity digest according to the received second computation digest parameter and the user password, and completes the creation process when the fourth integrity digest and the third integrity digest are verified to be the same.
  • the non-secure attack is implemented on the server by using a nonce.
  • the nonce can also be one of the user terminal's IP, the UTC format time parameter, and the server private key.
  • Steps S401-S404 are added in the signaling transmission process, but there is no particular limitation on the storage mode of the resource version, and the application range is improved in the case of loss of execution efficiency.
  • a user terminal provided by the present invention includes:
  • the first sending module 501 is configured to send a resource access request including a first authentication header field to the server, where the first authentication header field carries a user identifier and a server identifier;
  • the first receiving module 502 is configured to receive a request response returned by the server, and send the response to the first verification module, where the request response includes a second authentication header field and a message body; and the second authentication header field carries a third complete Sexual abstract
  • the first verification module 503 is configured to generate a resource access request, and transmit the request to the first sending module.
  • the method further includes: acquiring a request response from the first receiving module, and decrypting the message body of the request response to obtain the message content by using the shared key, Calculating a fourth integrity digest according to the message content and the user password using a fourth message digest algorithm; and when the fourth integrity digest is consistent with the third integrity digest in the request response, the 3 full certificate request response is valid of.
  • the first authentication header field carried by the resource access request further includes a first digest calculation parameter, where the first digest calculation parameter includes the user identifier and the server identifier, and further includes a random identifier, a resource access path, and a negotiation key parameter.
  • first digest calculation parameter includes the user identifier and the server identifier
  • random identifier includes the user identifier and the server identifier
  • negotiation key parameter includes the negotiation key parameter.
  • the first verification module calculates a first integrity digest using the first message digest algorithm according to the user password and the first digest calculation parameter, and carries the first integrity digest in the resource access request to enable the server Calculating a second integrity digest using a second message digest algorithm according to the user password and the first digest calculation parameter, wherein the first message digest algorithm and the second message digest algorithm The same, and when the first integrity digest and the second integrity digest are the same, verify that the resource access request is valid.
  • the second authentication header field further includes a second digest calculation parameter, where the second digest calculation parameter specifically includes a combination of one or more of a user identifier, a random identifier, a resource access path, a server identifier, and a negotiation key parameter.
  • the first verification module is further configured to calculate a fourth integrity digest using the fourth message digest algorithm according to the user password, the message content, and the second digest calculation parameter.
  • the first verification module is further configured to: send the resource access request carrying the random identifier to the first sending module, and store the random identifier; further receive the request from the first receiving module. In response, it is verified whether the stored random identifier and the random identifier in the second digest calculation parameter carried in the request response are the same, and if the request response is non-repetitively transmitted.
  • the foregoing first sending module, the first receiving module, and the first verifying module in the user terminal are also used to execute the corresponding functions in the foregoing method embodiments, and details are not described herein again.
  • a server provided by the present invention includes:
  • the second receiving module 601 is configured to receive a resource access request sent from the user terminal, and send the request to the second authentication module, where the resource access request carries the user identifier and the server identifier;
  • the second verification module 602 is configured to obtain a user password from a storage area of the server according to the user identifier in the resource access request, and calculate a third integrity summary by using the third message digest algorithm according to the user password and the message content, and transmit the The request header of the second authentication header field and the message body is sent to the second sending module; wherein the second authentication header field includes the third integrity digest, and the message body includes the message content encrypted by the shared key;
  • the second sending module 603 is configured to send the request response from the second verification module to the user terminal.
  • the first authentication header field carried by the resource access request further includes a first digest calculation parameter, where the first digest calculation parameter includes the user identifier and the server identifier, and further includes a random identifier, a resource access path, and a negotiation key parameter.
  • first digest calculation parameter includes the user identifier and the server identifier
  • random identifier includes the user identifier and the server identifier
  • negotiation key parameter includes the negotiation key parameter.
  • the second verification module calculates the second integrity digest using the second message digest algorithm according to the user password and the first digest calculation parameter, and verifies when the first integrity digest and the second integrity digest in the resource access request are the same
  • the resource access request is valid.
  • the second authentication header field in the request response further includes a second digest calculation parameter, where the second digest calculation parameter specifically includes one or more of a user identifier, a random identifier, a resource access path, a server identifier, and a negotiation key parameter. Combination of species.
  • the second verification module is further configured to calculate a third integrity digest using the third message digest algorithm according to the user password, the message content, and the second digest calculation parameter.
  • the second verification module is further configured to compare whether the first resource version and the second resource version stored locally by the server are the same, and the same resource access request After the resource access request is valid, the request is sent to the second sending module, and the request response further carries the first resource version.
  • the foregoing second sending module, the second receiving module, and the second verifying module in the server are also used to execute the corresponding functions in the foregoing method embodiments, and details are not described herein again.
  • a user terminal provided by the present invention includes:
  • the third sending module 701 is configured to send a resource access request from the third verification module, where the resource access request carries a first authentication header field and a message body, where the first authentication header field carries a user identifier and a server. Identification and first integrity summary;
  • the third verification module 702 is configured to calculate, according to the user password and the message content, the first integrity digest by using the first message digest algorithm and carry the first integrity digest in the first authentication header field, and use the shared key to encrypt the message content and carry the message content in the message body. Transmitting, by the third sending module, a resource access request carrying the first authentication header field and the message body; the third integrity digest is further used by the server according to the user password and the message content after receiving the resource access request by the server.
  • the third message digest algorithm calculates that the message body carries the message content encrypted by the shared key; wherein the user password is obtained from the storage area of the server according to the user identifier carried in the resource access request;
  • the third receiving module 703 is configured to receive a request response returned by the server, and send the response to the third verification module.
  • the request response includes a second authentication header field, the second authentication header field further includes a second digest calculation parameter, where the second digest calculation parameter specifically includes a user identifier, a random identifier, a resource access path, a server identifier, and a negotiation key.
  • the second digest calculation parameter specifically includes a user identifier, a random identifier, a resource access path, a server identifier, and a negotiation key.
  • the third verification module calculates, according to the fourth message digest algorithm, a fourth integrity digest, a third integrity digest in the request response, and the fourth integrity digest. To be the same, verify that the request response is valid.
  • the first authentication header field further includes a first digest calculation parameter, where the first digest calculation parameter includes the user identifier and the server identifier, and further includes one of a random identifier, a resource access path, and a negotiation key parameter.
  • the first digest calculation parameter includes the user identifier and the server identifier, and further includes one of a random identifier, a resource access path, and a negotiation key parameter.
  • the third verification module is further configured to calculate, by using the first message digest algorithm, the first integrity digest according to the user password, the message content, and the first digest calculation parameter, and carry the first integrity digest in the resource access request; After the resource access request of the first integrity summary, further calculating a second integrity digest using the second message digest algorithm using the user password, the message content, and the first digest calculation parameter, and in the first integrity digest and the When the second integrity digest is the same, verifying that the resource access request is valid, wherein the first message digest algorithm and the second message digest algorithm are the same.
  • the third verification module is further configured to generate a random identifier and store the packet, and further receive a request response from the server that is forwarded by the third receiving module, where the random identifier in the second digest calculation parameter is the server from the first digest calculation parameter. Obtaining; the third verification module verifies whether the stored random identifier and the random identifier in the second digest calculation parameter carried in the request response are the same, and if the request response is non-repetitively transmitted.
  • the third verification module further calculates a first integrity digest by using the first resource version of the first digest calculation parameter, where the initial value of the first resource version is After the resource is successfully created, it is returned to the user terminal by the server; when the user terminal verifies that the request response is valid, the third resource version carried in the request response returned by the server is saved.
  • a server provided by the present invention includes:
  • the fourth receiving module 801 is configured to receive a resource access request sent from the user terminal, and send the request to the fourth authentication module, where the resource access request includes a first authentication header field, where the first authentication header field carries a user Identification, server identity, message body, and first integrity summary;
  • the fourth verification module 802 is configured to obtain, after obtaining the resource access request from the fourth receiving module, the message content encrypted by the user terminal carried in the resource access request, and decrypt the message body of the resource access request by using the shared key Message content: decrypting the message body of the resource access request by using a shared key to obtain a message content, and acquiring a user password from the storage area according to the user identifier in the first authentication header field, according to the message content and the location Deriving the user password to calculate a second integrity digest using a second message digest algorithm; first completing the second integrity digest and the resource access request When the integrity summary is consistent, the resource access request is valid, and the request response is transmitted to the fourth sending module.
  • the fourth sending module 803 is configured to send a request response from the fourth verification module to the user terminal.
  • the first authentication header field carried by the resource access request further includes a first digest calculation parameter, where the first digest calculation parameter includes the user identifier and the server identifier, and further includes a random identifier, a resource access path, and a negotiation key parameter.
  • the fourth verification module is further configured to calculate a second integrity digest using the second message digest algorithm according to the message content, the user password, and the first digest calculation parameter, and compare the first integrity digest and the second integrity digest At the same time, verifying that the resource access request is valid; the first message digest algorithm and the second message digest algorithm are the same.
  • the request response carries a second authentication header field
  • the second authentication header field further includes a second digest calculation parameter
  • the second digest calculation parameter specifically includes a user identifier, a random identifier, a resource access path, and a server.
  • the fourth verification module is further configured to calculate a third integrity digest by using a third message digest algorithm according to the user password and the second digest calculation parameter, and carry the third integrity digest in the request response; Calculating a fourth integrity digest using a fourth message digest algorithm according to the user password and the second digest calculation parameter, and verifying that the request response is valid when the fourth integrity digest and the third integrity digest are the same .
  • the fourth verification module is further configured to compare whether the first resource version and the second resource version stored locally by the server are the same, and if the resource access request is non-repeating After the verification that the resource access request is valid, the resource access request operation is completed, the second resource version is updated to the third resource version, and the third resource version is further calculated by using the third resource version.
  • a system for securely transmitting data provided by the present invention includes:
  • the user terminal 901 is configured to send a resource access request carrying the first authentication header field to the server, where the first authentication header field includes a user identifier and a server identifier, and is further configured to receive the request response and decrypt the location by using the shared key.
  • the message body of the request response obtains the message content, calculates a fourth integrity summary according to the message content and the user password, and verifies the request response when the fourth integrity summary is consistent with the third integrity summary in the request response. Effective;
  • the server 902 is configured to receive the resource access request, and use the user password and the message content.
  • the second message digest algorithm calculates a third integrity digest and carries it in the second authentication header field; encrypts the message content and carries it in the message body using the shared key; wherein the user password is a user identifier carried by the resource access request Obtaining from the storage area of the server; wherein the message content is obtained after the operation of the service completion resource access request; and sending the request response carrying the second authentication header field and the message body to the user terminal.
  • a system for securely transmitting data provided by the present invention includes:
  • the user terminal 1001 is configured to send a resource access request that carries a first authentication header field and a message body, where the first authentication header field includes a user identifier, a server identifier, and a first integrity summary, where the first complete
  • the sexual summary is calculated by the user terminal according to the user password and the message content by using a first message digest algorithm; wherein the message body carries the message content encrypted by the shared key; and is further configured to receive the request response returned by the server;
  • the server 1002 is configured to receive a resource access request sent from the user terminal, decrypt the message body of the resource access request by using a shared key, obtain the message content, and obtain the user from the storage area according to the user identifier in the first authentication header field. a password, using a second message digest algorithm to calculate a second integrity digest according to the message content and the obtained user password; when the first integrity digest is consistent with the first integrity digest in the resource access request, Verify that the resource access request is valid and return a request response to the user terminal.
  • the user terminal and server in various embodiments of the present invention include at least one processor (e.g., a CPU), at least one network interface or other communication interface, a memory, and at least one communication bus for enabling connection communication between the devices.
  • the processor is for executing executable modules stored in the memory, such as a computer program.
  • the memory may include a high speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory such as at least one disk memory and an optical disk.
  • the communication connection between the system gateway and at least one other network element may be implemented through at least one network interface (which may be wired or wireless), and may use an Internet, a wide area network, a local network, a metropolitan area network, or the like.
  • the memory stores a program that can be executed by a processor for performing the steps of the various method embodiments above.

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)
  • Power Engineering (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephonic Communication Services (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Storage Device Security (AREA)

Abstract

本发明提供一种安全传输数据方法,装置和***。提供一种安全传输数据的方法,其特征在于,包括:用户终端发送一个携带第一鉴权头域的资源访问请求到服务器,所述第一鉴权头域包括用户标识和服务器标识;接收服务器返回的请求响应,所述请求响应包括第二鉴权头域和消息体,所述第二鉴权头域携带第三完整性摘要;所述第三完整性摘要由服务器收到所述资源访问请求后,进一步根据用户密码和消息内容使用第三消息摘要算法计算得出,所述消息体携带由共享密钥加密后的消息内容;其中用户密码是根据资源访问请求携带的用户标识从服务器的存储区中获取;以使得基于CoAP协议的M2M传输能够安全可靠的进行。

Description

一种安全传输数据方法, 装置和***
本申请要求于 2011 年 12 月 15 日提交中国专利局、 申请号为 201110421295.6、 发明名称为 "一种安全传输数据方法, 装置和***" 的中国 专利申请的优先权, 其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信领域, 尤其涉及一种安全传输数据方法, 装置和***。 背景技术
CoAP ( Constrained Application Protocol ) 协议主要是用于机器对机器 ( Machine-to-Machine, M2M ) 的场景中, 比如: 家庭控制器、 楼宇自动化、 智能能源、 传感端网络等。 在这样的环境中, 这些机器的功能比较简单, 一般 处理端只有 8位,存储空间小 ,不支持复杂的传输协议,数据传输速率也较低。 CoAP提供一种请求 /响应的交互模式, 支持内嵌的资源发现, 包括关键的网页 概念, 比如统一资源标识( Universal Resource Identifier , URI )和内容类型。 CoAP 可以艮容易地翻译到超文本链接协议 ( Hyper Text Transfer Protocol, HTTP ), 用于集成到网络中。
CoAP中, 安全问题很重要, 尤其是一些传感数据属于保密数据, 例如人 的生理特征参数,还有很多的对控制器的操作也需要进行授权检查,而且 CoAP 的设备通信可能会跨越不信任的中间节点,因此需要端到端的 CoAP安全数据 传输。端到端安全数据传输包括用户终端和服务器的双向身份认证、 防重放攻 击以及通信数据的加密和完整性验证。
现有技术中没有保证 CoAP协议和 HTTP协议转换信息和传递消息体分开 保护的有效方法,以至于 CoAP消息的加密和 CoAP与 HTTP协议间的转换无 法同时实现, 以致增加代理装置 Proxy后, 现有 CaAP协议无法在保证加密安 全的情况下正常传输。
发明内容
本发明实施例要解决的技术问题是提供一种安全传输数据方法、用户终端、 服务器和***, 以使得 M2M的消息传输能够安全可靠的进行。
为解决上述技术问题, 本发明实施例一方面,提供了一种安全传输数据的 方法包括: 用户终端发送一个携带第一鉴权头域的资源访问请求到服务器,所述第一 鉴权头域包括用户标识和服务器标识;
接收服务器返回的请求响应, 所述请求响应包括第二鉴权头域和消息体, 所述第二鉴权头域携带第三完整性摘要;所述第三完整性摘要由服务器收到所 述资源访问请求后,进一步根据用户密码和消息内容使用第三消息摘要算法计 算得出, 所述消息体携带由共享密钥加密后的消息内容; 其中用户密码是根据 资源访问请求携带的用户标识从服务器的存储区中获取;
使用共享密钥解密所述请求响应的消息体获取消息内容,依据所述消息内 容和用户密码使用第四消息摘要算法计算第四完整性摘要,在所述第四完整性 摘要和与所述请求响应中第三完整性摘要一致时, 验证请求响应是有效的。
另一方面, 提供了一种安全传输数据的方法包括:
用户终端发送一个携带有第一鉴权头域和消息体的资源访问请求 ,所述第 一鉴权头域包括用户标识、服务器标识和第一完整性摘要, 所述第一完整性摘 要是用户终端根据用户密码和消息内容使用第一消息摘要算法计算得出;其中 消息体携带有经过共享密钥加密后的消息内容;
接收服务器返回的请求响应;所述请求响应是服务器接收所述资源访问请 求,验证所述资源访问请求有效后返回的, 所述验证资源访问请求有效具体包 括: 使用共享密钥解密所述资源访问请求的消息体获取消息内容, 并根据第一 鉴权头域中的用户标识从存储区中获取对应的用户密码,依据所述消息内容和 所述获取的用户密码使用第二消息摘要算法计算第二完整性摘要,在所述第二 完整性摘要和所述资源访问请求中第一完整性摘要一致时,验证资源访问请求 是有效的。
另一方面, 提供了一种用户终端, 包括:
第一发送模块 ,用于发送一个包括第一鉴权头域的资源访问请求到服务器 , 所述第一鉴权头域携带用户标识和服务器标识;
第一接收模块,用于接收服务器返回的请求响应,并传递给第一验证模块, 所述请求响应包括第二鉴权头域和消息体;所述第二鉴权头域携带第三完整性 摘要; 所述第三完整性摘要由服务器收到所述资源访问请求后, 进一步根据用 户密码和消息内容使用第三消息摘要算法计算得出,所述消息体携带由共享密 钥加密后的消息内容;其中用户密码是根据资源访问请求携带的用户标识从服 务器的存储区中获取;
第一验证模块, 用于生成资源访问请求, 并向第一发送模块传递; 还用于 获取来自第一接收模块的请求响应,使用共享密钥解密所述请求响应的消息体 获取消息内容,依据所述消息内容和用户密码使用第四消息摘要算法计算第四 完整性摘要;在所述第四完整性摘要和所述请求响应中第三完整性摘要一致时, 马全证请求响应是有效的。
另一方面, 本发明提供了一种服务器, 包括:
第二接收模块, 用于接收发自用户终端的资源访问请求, 并传递给第二验 证模块, 所述资源访问请求携带有用户标识和服务器标识;
第二验证模块,用于根据资源访问请求中的用户标识从服务器的存储区获 取用户密码;根据所述用户密码和消息内容使用第三消息摘要算法计算第三完 整性摘要,传递携带有第二鉴权头域和消息体的请求响应给第二发送模块; 其 中第二鉴权头域包括所述第三完整性摘要,消息体包括由共享密钥加密后的消 息内容;
第二发送模块, 用于发送来自第二验证模块的所述请求响应给用户终端。 另一方面, 本发明提供了一种用户终端, 包括:
第三发送模块, 用于发送来自第三验证模块的资源访问请求, 所述资源访 问请求携带有第一鉴权头域和消息体, 所述第一鉴权头域携带有用户标识、服 务器标识和第一完整性摘要;
第三验证模块,用于根据用户密码和消息内容使用第一消息摘要算法计算 得出第一完整性摘要并携带在第一鉴权头域,使用共享密钥加密消息内容并携 带在消息体中 ,向第三发送模块传递携带有第一鉴权头域和消息体的资源访问 请求;
第三接收模块,用于接收服务器返回的请求响应,并传递给第三验证模块。 另一方面, 本发明提供了一种服务器, 包括:
第四接收模块, 用于接收发自用户终端的资源访问请求, 并传递给第四验 证模块, 所述资源访问请求包括第一鉴权头域, 所述第一鉴权头域携带有用户 标识、 服务器标识、 消息体和第一完整性摘要; 第四验证模块, 用于在获得来自第四接收模块的资源访问请求后, 获取资 源访问请求中携带的经过用户终端加密的消息内容,使用共享密钥解密所述资 源访问请求的消息体获取消息内容,使用共享密钥解密所述资源访问请求的消 息体获取消息内容,并根据所述第一鉴权头域中的用户标识从存储区中获取用 户密码,依据所述的消息内容和所述获取的用户密码使用第二消息摘要算法计 算第二完整性摘要;在所述第二完整性摘要和所述资源访问请求中第一完整性 摘要一致时, 验证所述资源访问请求有效, 向第四发送模块传递请求响应; 第四发送模块, 用于发送来自第四验证模块的请求响应给用户终端。
另一方面, 本发明提供了一种安全传输数据的***, 包括:
用户终端, 用于发送一个携带第一鉴权头域的资源访问请求到服务器, 所 述第一鉴权头域包括用户标识和服务器标识;还用于接收请求响应并使用共享 密钥解密所述请求响应的消息体获取消息内容,依据所述消息内容和用户密码 计算第四完整性摘要,在所述第四完整性摘要与所述请求响应中第三完整性摘 要一致时, 验证请求响应有效的;
服务器, 用于接收所述资源访问请求,根据用户密码和消息内容使用第三 消息摘要算法计算得出第三完整性摘要并携带在第二鉴权头域中;使用共享密 钥加密消息内容并携带在消息体中;其中用户密码是利用资源访问请求携带的 用户标识从服务器的存储区中获取;其中消息内容是服务完成资源访问请求的 操作后获得;向用户终端发送携带有所述第二鉴权头域和所述消息体的请求响 应。
另一方面, 本发明提供了一种安全传输数据的***, 包括:
用户终端, 用于发送一个携带有第一鉴权头域和消息体的资源访问请求, 所述第一鉴权头域包括用户标识、服务器标识和第一完整性摘要, 所述第一完 整性摘要是用户终端根据用户密码和消息内容使用第一消息摘要算法计算得 出; 其中消息体携带有经过共享密钥加密后的消息内容; 还用于接收服务器返 回的请求响应;
服务器, 用于接收发自用户终端的资源访问请求,使用共享密钥解密所述 资源访问请求的消息体获取消息内容,并根据第一鉴权头域中的用户标识从存 储区中获取用户密码,依据所述消息内容和所述获取的用户密码使用第二消息 摘要算法计算第二完整性摘要;在所述第二完整性摘要和所述资源访问请求中 第一完整性摘要一致时,验证资源访问请求是有效的, 向用户终端返回请求响 应。
本发明方案的各实施例通过将消息结构分成鉴权头域和消息体,使用密钥 加密消息体来保证消息的安全性,并使用完整性摘要计算及验证来保证整体消 息的安全传输。
附图说明
图 la本发明的一种安全传输数据的方法流程图;
图 lb本发明的一种安全传输数据的方法流程图;
图 2本发明的一种获取资源实施例的信令流程图;
图 3本发明的一种更新资源实施例的信令流程图;
图 4本发明的一种创建资源实施例的信令流程图;
图 5本发明的一种用户终端示意图;
图 6本发明的一种服务器示意图;
图 7本发明的一种用户终端示意图;
图 8本发明的一种服务器示意图;
图 9本发明提供的一种安全传输数据的***示意图;
图 10本发明提供的一种安全传输数据的***示意图。
具体实施方式
本发明提供的一种获取资源的方法实施例, 其实现过程具体为:
S 1001、 用户终端向服务器发送一个携带第一鉴权头域的资源访问请求; 进一步的, 所述第一鉴权头域还可以包括第一摘要计算参数, 所述第一摘 要计算参数包含所述用户标识和所述服务器标识,还包括随机标识、 资源访问 路径和协商密钥参数中的一种或者几种的组合;用户终端发送的所述资源访问 请求进一步可以包括根据所述用户密码和第一摘要计算参数中一种或者几种 组合使用第一消息摘要算法计算第一完整性摘要;
所述随机标识由用户终端在每次发送资源访问请求消息时临时生成,所述 临时生成的随机标识参数在完成一轮资源访问请求和请求响应后便无效,因此 可以避免用户终端受到来自第三方的重放攻击; 所述随机标识 cnonce可以是 随机数,也可以是 UTC格式时间参数,还可以是其他提供无重复变化的参数; 具体地, 第一摘要计算参数还包括第一资源版本, 用户终端进一步可以增 加所述第一摘要计算参数中的第一资源版本计算第一完整性摘要,并发送携带 所述第一资源版本的资源访问请求;
服务器接收到资源访问请求后,根据所述服务器的存储区的用户密码和第 一摘要计算参数使用第二消息摘要算法计算第二完整性摘要,在所述第一完整 性摘要和所述第二完整性摘要相同时, 则资源访问请求是有效的, 所述第一消 息摘要算法和第二消息摘要算法相同。
所述第一资源版本初始值是在创建资源成功后,由服务器返回给用户终端, 服务器上同种资源内容的更新资源请求操作中, 资源版本具有单调性, 可以是 单调递增的; 通过将资源版本加入到完整性摘要计算过程,保证了资源版本的 有效性, 即任意的篡改都会在完整性验证过程中发现, 而每一次服务器针对同 种资源访问请求, 如更新资源请求, 被修改的资源唯一的对应一个版本, 服务 器端第二资源的版本在被修改后更新,因此可以防止第三方使用截获的资源访 问请求重放攻击服务器; 服务器对于接收到有效的资源访问请求中,如果版本 Etag无法对应上服务器对应资源的 Etag, 则服务器会返回正确的 Etag给用户 终端;
资源访问请求包括但不局限于获取资源请求、更新资源请求和创建资源请 求;
S1002、 接收服务器返回的请求响应, 所述请求响应包括第二鉴权头域和 消息体, 所述第二鉴权头域携带第三完整性摘要;
所述第三完整性摘要由服务器收到所述资源访问请求后,进一步根据用户 密码和消息内容使用第三消息摘要算法计算得出,所述消息体携带由共享密钥 加密后的消息内容;其中用户密码是根据资源访问请求携带的用户标识从服务 器的存储区中获取;所述消息内容是服务器根据资源访问请求进行操作后获得 的。
请求响应中的第二鉴权头域进一步包括第二摘要计算参数,所述第二摘要 计算参数具体包括用户标识、 随机标识、 资源访问路径、 服务器标识和协商密 钥参数中的一种或者几种的组合,所述第二摘要计算参数可以参与第三完整性 摘要。
S1003、 使用共享密钥解密所述请求响应的消息体获取消息内容, 依据所 述消息内容和用户密码使用第四消息摘要算法计算第四完整性摘要,在所述第 四完整性摘要和与所述请求响应中第三完整性摘要一致时,验证请求响应是有 效的;
所述共享密钥由服务器和用户终端协商, 可以是通用的 DH密钥对; 也可 是依据用户账号和用户密码根据密钥的消息摘要算法计算出密钥,具体计算参 数还可以包括资源访问路径、 服务器标识、 随机标识、 第一资源版本等, 所述 密钥的消息摘要算法包括但不局限于 DM5、 DM8或 SHA-1等;
所述有效的是指所述资源访问请求中参与所述第一完整性摘要计算的参 数或请求响应中参与第三完整性摘要计算的参数没有被第三方篡改;否则服务 器接收到的所述资源访问请求或用户终端接收到的所述请求响应在传输过程 中发生更改, 其具体情况可能是被第三方篡改或者因为信道噪声等原因。
所述第一消息摘要算法、 第二消息摘要算法、第三消息摘要算法和第四消 息摘要算法, 优选的但不局限于釆用 hash函数, 具体可以是基于 hash函数的 MD4、MD5、 SHA或 SHA-1等算法;用户密码为用户终端和服务器两侧知道, 参与两侧的完整性摘要计算以验证用户终端的权限以及两侧信息的有效性,所 述验证有效性包括但不局限于:用于计算完整性摘要的参数是否被第三方篡改。
本发明的实施例提供另一种安全传输数据方法, 包括:
S2001、用户终端发送一个携带有第一鉴权头域和消息体的资源访问请求; 第一鉴权头域包括用户标识、服务器标识和第一完整性摘要, 所述第一完 整性摘要是用户终端根据用户密码和消息内容使用第一消息摘要算法计算得 出; 其中消息体携带有经过共享密钥加密后的消息内容;
所述第一完整性摘要用于服务器接收到所述资源访问请求后,使用共享密 钥解密所述资源访问请求的消息体获取消息内容,并根据第一鉴权头域中的用 户标识从存储区中获取对应的用户密码,依据所述消息内容和所述获取的用户 密码使用第二消息摘要算法计算第二完整性摘要,在所述第二完整性摘要和所 述资源访问请求中第一完整性摘要一致时, 验证资源访问请求是有效的;
所述第一鉴权头域还可以包括第一摘要计算参数,所述第一摘要计算参数 包含所述用户标识和所述服务器标识,还包括随机标识、 资源访问路径和协商 密钥参数中的一种或者几种的组合;
进一步用户终端根据用户密码、消息内容和第一摘要计算参数使用第一消 息摘要算法计算得到第一完整性摘要; 服务器消息内容、用户密码和第一摘要 计算参数使用第二消息摘要算法计算第二完整性摘要;并在所述第二完整性摘 要和所述资源访问请求中第一完整性摘要一致时 ,验证资源访问请求是有效的。
S2002、 接收服务器返回的请求响应; 所述请求响应是服务器接收所述 资源访问请求, 验证所述资源访问请求有效后返回的;
服务器使用共享密钥解密所述资源访问请求的消息体获取消息内容,并根 据第一鉴权头域中的用户标识从存储区中获取对应的用户密码,依据所述消息 内容和所述获取的用户密码使用第二消息摘要算法计算第二完整性摘要,在所 述第二完整性摘要和所述资源访问请求中第一完整性摘要一致时 ,验证资源访 问请求是有效的 ;
所述请求响应还可以包括第二鉴权头域,所述第二鉴权头域进一步包括第 二摘要计算参数, 所述第二摘要计算参数具体包括用户标识、 随机标识、 资源 访问路径、服务器标识和协商密钥参数中的一种或者几种的组合; 服务器根据 用户密码和所述第二摘要计算参数使用第三消息摘要算法计算并获得第三完 整性摘要;
进一步用户终端接收到所述请求响应后,根据用户密码和所述第二摘要计 算参数使用第四消息摘要算法计算并获得第四完整性摘要,在所述第三完整性 摘要和所述第四完整性摘要相同时, 则所述请求响应是有效的。
本发明提供的一种获取资源的实施例,本实施例中资源访问请求可以是获 取资源请求, 用户终端在发起获取资源请求 GET时, 生成一个 UTC格式的随 机标识 cnonce, 携带在 GET请求的第一鉴权头域中, 用于识别服务器侧的重 放攻击。服务器与用户终端利用用户名和用户密码参与完整性摘要计算进行双 向身份认证, 所述计算方法基于哈希 hash函数, 具体消息摘要计算方法包括 但不限于: 消息摘要算法第五版 ( Message Digest Algorithm 5 , MD5 )、 安全 散列算法 (Secure Hash Algorithm, SHA)或 SHA-1。 在 GET请求的第一鉴权头 域中携带 DH协商密钥参数, 共享密钥可以是生成的 DH密钥, 其流程图如 2 所示:
S201、 用户终端向代理发送一个 CoAP 协议 GET 请求, 请求中携带 Authorization标识的第一鉴权头域, 第一摘要计算参数包括: 用户标识 Digest username. 服务器标识 realm、 资源访问路径 uri和随机标识 cnonce, 进一步所 述第一摘要计算参数还可以包括代理标识 Uri-Host, 所述第一鉴权头域包含所 述第一摘要计算参数外, 还包括第一完整性摘要 response, 用于完成 GET请 求和服务器的授权协商, 其中携带有第一摘要计算参数, 具体地, GET请求 消息如下:
GET (T=C0N, Code=l, MID=0x7d32)
Uri-Host: exampleproxy.com,
Authorization: Digest username="sensor_l ",
realm: "example.com",
uri="example . com/ applications/ firstApp/lastmodifiedTime",
cnonce=" 20111128T152000Z",
response="2a69fd5ae49cb3ad3a7094de50f7ca4f ,
g=5,
p=97,
kc=50,
其中 T=C0N表示需要确认的消息, Code=l表示 GET请求, MID=0x7d32 是消息标识; g和 p为 DH密钥计算所需的参数, kc是用户终端根据 DH密钥 公式 gx Mod p计算获得, 其中 X是用户终端和服务器协商产生, 保存于用户 终端, 并与服务器端的 y构成 DH密钥的私有参数对。 为了防止除用户终端和 服务器外的第三方的攻击,这三个值也可作为摘要计算参数加入完整性摘要的 计算。 如果用户终端和服务器有一套固定的 g和 p的值, 就不需要携带参数 g 和 。 随机标识 cnonce是用户终端根据 UTC格式生成, 并被临时存储在用户 终端,同时还作为发送时间参数; response是用户终端生成的第一完整性摘要, 用户终端利用 DH密钥交换所需的参数 g、 p、 kc, 以及随机标识 cnonce, 还 有用户名和密码等信息进行组合, 并利用一种哈希运算, 如 MD5计算出完整 性摘要, 计算完整性摘要方法还可以是但不局限于 SHA或 SHA-1。 Response 具体计算如下:
Response=KD ( H(A1), unq(cnonce)": "g": "p": "kc": 'Ή(Α2) )
其中 Α1为 unq(username) ":" unq(realm) ":" passwd, A2为 Method ":" uri; 上述公式 中 , 函数 KD 表达式为 KD ( secret, data ) = H(concat(secret, ":", data)) , 其中 concat(secret, data)函数完成 secret和 data 的组合, 可以是合并或者是***方式, 而 unq ( X )表示获取标识 X对应的内 容, ^口 X为 username而具体 username="sensor_l " ,则 unq(username)= sensor— 1; H(X)表示对 X进行一种哈希运算, 优选的釆用 MD5方法, Method表示请求 方法具体为 GET, passwd为用户密码, 各变量的搭配和排序组合可以不局限 于本实施例里展示的;
S202、 代理接收来自用户终端 GET请求, 根据所述资源访问请求中的用 户身份标识 sensor— 1和服务器标识 [email protected]获取用户终端和服 务器支持的协议; 完成资源访问请求的协议转换,使原来的 CoAP GET请求转 换为支持服务器的 HTTP协议的 HTTP GET请求; 具体如下:
GET example . com/ applications/ first App/lastmodifiedTime HTTP/1.1
Authorization: Digest username="sensor_l ",
realm: "example.com",
uri="example . com/ applications/ firstApp/lastmodifiedTime",
cnonce="20111128T152000Z",
response="2a69fd5ae49cb3ad3a7094de50f7ca4f ,
g=5,
p=97,
kc=50,
代理将转换后的 HTTP GET请求发送给服务器;
S203、 服务器接收到来自代理转换后的 HTTP GET请求后, 首先根据第 一鉴权头域中的随机标识 cnonce里的发送时间变量判断接收到的 GET请求是 否为有效期内的请求, 过期则记录在临时过期表中, 并在下一仍接收到所述过 期 GET请求时, 核对临时过期表证实是第二次, 则向用户终端发送消息可能 被第三方截获警告并釆取相应措施; 在判断为有效期内的请求时,根据所述用户身份标识 sensor— 1查询存储于 服务器的用户密码和第一摘要计算参数,重新计算第二完整性摘要验证用户终 端 ,所述第二完整性摘要的第二消息摘要算法与用户终端的第一消息摘要算法 相同。 验证所述第一完整性摘要和所述第二完整性摘要相同, 则进一步计算 ks=gy Mod , 加密用的密钥 key=(kc)y Mod , 其中 y是用户终端和服务器协 商产生, 保存于服务器, 并与用户终端的 y组成 DH密钥的私有参数对, 用 key加密服务器要发送的消息内容, 并作为响应的消息体; 消息头如下:
HTTP/1.1 200 OK
Authorization-info: Digest username="sensor_l ",
realm="example.com",
uri="example . com/ applications/ firstApp/lastmodifiedTime",
cnonce="20111128T152000Z",
response="ad3c5fe472afd88cee5fa6c0a00dac2a",
ks=44,
消息头中第三完整性摘要 response的第三消息摘要算法如下:
KD ( H(A3), unq(cnonce) ":"ks":"H(A4) ": "H(data) )
其中第二摘要计算参数中的 A3为 unq(username-value) ":" unq(realm-value) ":" passwd, A4为 uri, data为服务器要发送的消息内容。并向代理返回 HTTP 200 OK响应;
S204、 代理将 HTTP 200 OK响应转换为包含如下 Authorization选项的
CoAP 2.05响应并发送给用户终端;
2.05 Content (T=ACK, Code=69, MID=0x7d32)
Authorization-info: Digest username="sensor_l ",
realm="example.com",
uri= "example . com/ applications/ firstApp/lastmodifiedTime " ,
cnonce="20111128T152000Z",
response="ad3c5fe472afd88cee5fa6c0a00dac2a",
ks=44,
S205、用户终端收到来自代理的请求响应后,首先验证所述请求响应中携 带的随机标识 cnonce和用户终端临时存诸的随机标识 cnonce值是否相同 , 相 同则删除临时存储的 cnonce, 并进一步计算出密钥 key=(ks)xMod p,使用计算 出的共享密钥 key解密消息体, 获取消息内容 data, 然后按照服务器端的计算 第三完整性摘要的第三消息摘要算法进行第四完整性摘要计算,所述公式如下:
Response— out = KD ( H(A3), unq(cnonce) ": "ks": 'Ή(Α4) ": "H(data) ) 比较 Response— out值和接收到请求响应中的 response值,判断响应是否完 整和安全的。在所述 Response— out值和接收到请求响应中的 response值不相同 时, 表明请求响应被第三方篡改过, 结束 GET请求或重复步骤 S201-S205重 新获取资源; 相同进一步完成获取资源操作。
在上述过程中 ,本实施例中因为第三方不知道用户终端和服务器双方构成 密钥对的私密参数 X和 y的值, 因此没法知道最终 DH密钥, 也就获取不到消 息内容; 即使消息内容被破解, 因为用户密码作为完整性摘要计算的必要参数 不被第三方知晓, 因此第三方即使获取了传输中消息的任何参数进行的修改, 都会造成接收端计算的完整性摘要和所述传输中消息携带的完整性摘要不相 同而被用户终端或服务器知晓;数据字符的加入使得获取资源请求和请求响应 唯一对应, 重复的发送请求响应都会因为 cnonce核对不一致而不被用户终端 处理, 因此保证了用户终端和服务器间消息的安全性和完整性。
在上述本发明的另一种获取资源的实施例中,共享密钥可以利用用户终端 和服务器相互知道,而第三方无法知道的用户密码通过消息摘要算法计算得到, 为了增强密钥的复杂度和安全性,可以进一步增加用户身份标识以及访问资源 路径作为计算所述共享密钥的参数。密钥的消息摘要算法可以但不局限于釆用 MD5 , 公式如下:
key= KD (H(B1), unq(cnonce)":"H(B2)),
其中 Bl为 unq(username) ":" unq(realm) ": "passwd, B2为 uri„服务器用共 享密钥 key加密数据消息内容作为请求响应的消息体。 所述资源访问请求的 Authorization标识第一鉴权头域, 对应修改为如下:
Authorization: Digest username="sensor_l ",
realm:" example.com ",
uri=" example . com/ applications/ first App/lastmodifiedTime ", cnonce= xxx ,
response="xxx",
其中完整性摘要 response值计算公式如下:
其中终端计算完整性摘要的公式在釆用了由密码计算共享密钥后,由于减 少了协商密钥参数的传递, 对应的第一消息摘要算法修改为如下:
KD(H(A5), unq(cnonce)":"H(A6))
第一摘要计算参数中的 A5为 unq(username) ":" unq(realm) ":" passwd, A6 为 Method ":" uric其中 username为用户身份标识, realm为服务器标识, asswd 为用户密码, Method为资源访问请求方法, uri为请求资源的地址。
本实施例的方法减少了协商密钥参数的传递,使得消息头域占用空间更少 , 并且可以利用用户密码和头域参数的组合, 通过 hash算法获得共享密钥。 由 此增加了信息的保密程度。
本发明提供一种更新资源的实施例, 本实施例中, 资源访问请求具体为更 新资源请求, 用户终端在每次发起更新资源请求 PUT时, 用户终端生成一个 不同的随机标识 cnonce携带在 PUT请求第一鉴权头域中, 用于识别服务器侧 的重放攻击, 即 cnonce 是动态变化的, 对发送的更新资源请求使用不同的 cnonce, 服务器发送的请求响应中携带的 cnonce值是从接收到的资源访问请 求中获取的。服务器与用户终端利用用户名和用户密码参与完整性摘要计算进 行双向身份认证, 计算方法包括但不限于: MD5、 SHA或 SHA-1。 用户终端 利用用户名和密码等信息生成加密密钥并对数据加密, 其流程图如 3所示:
S301、 用户终端发起一个 CoAP PUT请求, 请求中携带 Authorization标 识的第一鉴权头域, 用于完成 PUT请求和服务器的授权协商, 其中第一摘要 计算参数包括: 用户标识 Digest username、 服务器标识 realm、 资源访问路径 uri、 随机标识 cnonce和资源版本 Etag, 进一步所述第一摘要计算参数还可以 包括代理标识 Uri-Host, 所述第一鉴权头域包含所述第一摘要计算参数外, 还 包括第一完整性摘要 response, 具体 CoAP PUT请求消息头域如下:
PUT (T=CON, Code=3, MID=0x8a54)
Uri-Host: exampleproxy.com
Authorization: Digest username="sensor_l ", realm=" example.com ",
Etag= "xxx" ,
uri="example . com/ applications/ firstApp/lastmodifiedTime",
cnonce="cad081 e0f082dfd2f a751cl 0cblb0c42a",
response="xxx",
第一完整性摘要 response 的第一消息摘要算法为: KD ( H(A1), H(A2)":"H(data)),其中 Al为 unq(username) ":" unq(realm)": "unq(Etag) ": "passwd, A2为 Method ": " uri , data为加密前的数据, 即更新资源请求的消息内容。 同 时用户终端依据用户身份标识 usemame和用户密码 passwd密钥的消息摘要算 法为:
key= KD( H(A3), unq(cnonce)":"H(A4))
其中 A3为 unq(username) ":" unq(realm)": "Etag": "passwd , 用户终端用 key 加密消息内容作为 PUT请求的消息体;
5302、 代理接收来自用户终端 PUT请求, 根据所述资源访问请求中的用 户身份标识 sensor— 1和服务器标识 [email protected]获取用户终端和服 务器支持的协议; 完成资源访问请求的协议转换,使原来的 CoAP PUT请求转 换为服务器支持的 HTTP协议的 HTTP PUT请求;代理将转换后的 HTTP PUT 请求发送给服务器;
5303、 服务器接收到由代理转发的 HTTP PUT请求后, 验证接收到 PUT 请求第一鉴权头域中携带的用于更新的第一资源版本 Etag和服务器原有第二 资源版本 Etag的一致性; 所述一致性可以是服务器每次更新资源后, 对应资 源版本自加 1生成第三资源版本 Etag,则在后续接收到更新资源时,验证用于 更新的资源版本 Etag和服务器原有资源版本 Etag相同则表明所述资源更新请 求中携带的 Etag是有效的, 以此来限制第三方的重放攻击; 在验证第一资源 版本 Etag满足一致性的条件下进一步:
根据用户身份标识 usemame查询存储于服务器的用户密码,并使用 HTTP PUT请求第一鉴权头域中的 realm和 uri 通过与用户终端相同的密钥的消息摘 要算法:
key= KD( H(A3), unq(cnonce)":"H(A4)) 计算出共享密钥 key,并用 key解密 HTTP PUT请求消息体获取消息内容; 根据所述消息内容利用第二消息摘要算法计算第二完整性摘要:
KD ( H(A1), H(A2)":"H(data)),
第二摘要计算参数中 A1 为 unq(username) ":" unq(realm)": "unq(Etag) ":" passwd, A2为 Method ":" uri, data为加密前的数据, 用计算所得第二完整 性摘要和 Authorization第一鉴权头域中携带的第一完整性摘要 response比较来 验证 PUT请求消息的完整性。 如果比对结果相同则使用消息内容更新服务器 的资源,具体为用资源更新请求中解密出来的消息内容替换存储与服务器的资 源, 并且将替换后的资源的版本加 1 即生成第三资源版本, 并进入 S309; 如 果比对结果不相同则返回鉴权失败 unauthorization消息;
如果在验证 Etag得出结果为不一致, 进一步执行完上述解密, 并验证完 整性通过时, 则直接进入 S304;
5304、 服务器返回 HTTP 401响应, 响应中携带第二资源版本 Etag、 第三 完整性摘要和第二摘要计算参数; 所述第二资源版本 Etag用于指示用户终端 发送正确的版本的资源;所述第三摘要计算参数除包含所述第二资源版本外还 包括: 用户标识、 用户密码、 服务器标识和随机标识, 并通过第三消息摘要算 法计算得到第三完整性摘要;
5305、 代理将 HTTP 401响应转换为 CoAP 4.01 响应并发送给用户终端;
5306、 用户终端完成 CoAP 4.01 响应有效性验证后, 根据请求响应中的 第二资源版本 Etag值重置资源访问请求第二鉴权头域,并再次发起一个 CoAP
PUT请求, 发起 PUT请求的过程与步骤 S301相同;
5307、代理接收来自用户终端 CoAP PUT请求,转换协议后向服务器发送 HTTP PUT请求;
5308、 服务器接收到携带有新 Etag值 PUT请求, 具体的执行操作和步骤 S303中相同;
5309、 服务器返回 HTTP 200 OK响应, 响应携带更新后的第三资源版本 Etag, 同时通过 Authentication-info第二鉴权头域携带服务器认证信息, 其中 包含第二摘要计算参数: 用户标识 Digest username、 服务器标识 realm、 资源 访问路径 uri和随机标识 cnonce , Authentication-info携带信息如下: Authentication-info: Digest username="sensor_l ",
realm="example.com",
Etag= "xxx" ,
uri=" example . com/ applications/ first App/lastmodifiedTime ",
Cnonce="61cd8ad85d002c07fd2f0bbe02flbl0cl",
response="xxx"
加密前的消息内容也作为第三完整性摘要计算参数,即第三完整性摘要的 第三消息摘要算法为:
KD ( H(A3), unq(cnonce)": 'Ή(Α4)": "H(data)) ,
第三摘要计算参数中 A1为 unq(username) ": "unq(realm) ":"Etag":"passwd,
A2为 uri, 消息内容 data经由共享密钥 key加密生成用于发送的消息体;
S310、 代理将 HTTP协议的 200 OK请求响应转换为 CoAP协议的 CoAP 2.04请求响应并转发给用户终端;
用户终端首先验证所述请求响应中携带的随机标识 cnonce和用户终端临 时存储的随机标识 cnonce值是否相同, 相同则删除临时存储的 cnonce, 还要 通过用户密码通过密钥的消息摘要算法计算共享密钥,进一步使用共享密钥解 密消息体以获取消息内容,并以服务器计算第三完整性摘要相同的公式计算所 述第四完整性摘要。比较计算所得第四完整性摘要和请求响应中携带的第三完 整性摘要, 两者相同时完成更新资源过程; 当两者不相同时可以推断出请求响 应已被第三方篡改, 根据设定从 S301重新开始本次更新过程或者结束过程。
本实施例中利用用户标识和用户密码通过消息摘要算法生成共享密钥,使 得消息传递数据更少, 密钥的保密度更高。 本实施例中, 用于计算密钥和完整 性摘要的计算公式都是优选方案,实际操作中保证用户密码作为必要参数前提 下, 可以引进其他需要保护的数据和增加算法复杂度的数据,各参数的数据组 合也是可变的。 由于引入了资源版本, 使得服务器端也拥有了防重攻击能力。
本发明的一种创建资源的实施例, 本实施例中资源访问请求具体为创建资 源请求, 用户终端在每次发起创建资源请求 POST时, 用户终端随机生成一个 数据字符 cnonce携带在 POST请求第一鉴权头域中, 用于识别服务器侧的重 放攻击, 即 cnonce 是动态变化的, 在发送更新资源请求时使用临时生成的 cnonce„ 服务器此时不再使用之前实施例所使用的 Etag来完成防重攻击, 而 是利用生成一个类似于 cnonce的服务器的随机标识 nonce来实现重放攻击。 服务器与用户终端利用用户名和用户密码参与完整性摘要计算进行身份认证, 计算方法包括但不限于: MD5、 SHA或 SHA-1。 用户终端利用用户名和密码 等信息生成加密密钥并对数据加密, 其流程图如 5所示:
5401、 用户终端发起一个 CoAP POST请求, 携带了用户身份标识、 服务 器标识和代理标识, 随机标识 cnonce是用户终端生成的随机标识, 并被临时 存储在用户终端;
5402、 代理接收来自用户终端 CoAP POST请求, 根据所述资源访问请求 中的用户身份标识 sensor— 1和服务器标识 example.com, 完成资源访问请求的 协议转换, 使原来的 CoAP POST请求转换为服务器支持的 HTTP协议;
5403、服务器通过接收到转发自代理的 POST消息, 因为用户终端事先不 知道 nonce值, 所述 POST消息携带的 nonce参数将无法通过服务器的验证, 从而返回 HTTP 401响应, 携带 Authentication第二鉴权头域, 参数如下: Authentication-info: Digest username="sensor 1",
realm:" example.com ",
uri=" example . com/ applications/ first App/lastmodifiedTime ",
cnonce="xxx",
nonce="02df8a71 ed2fbd0c026dcb 1 f0851 Oc 15b",
g=xxx,
p=xxx,
ks=xxx,
g和 p为 DH密钥计算所需的参数, ks=gyMod p, y是用户终端和服务器 协商产生, 保存于服务器, 并与客户端的 X构成 DH密钥的私有参数对, 为了 防止除用户终端和服务器外的第三方的攻击修改 p、 g和 ks, 这三个值也可作 为参数加入完整性摘要的计算中;
5404、 代理将 HTTP 401响应转换为 CoAP 4.01响应并转发给用户终端。 用户终端收到服务器的响应后, 在完成了完整性摘要的验证后, 进一步计算共 享密钥 key=(ks)xMod p, x是用户终端和服务器协商产生, 保存于用户终端, 并与服务器端的 y构成 DH密钥的私有参数对, 并用共享密钥 key加密数据 data;
405、 用户终端重新发起 CoAP POST请求, 将加密后的数据作为 POST 请求的消息体。 POST请求携带 Authorization选项, 参数如下:
Authorization: Digest username=" sensor 1",
realm:" example.com ",
uri=" example . com/ applications/ first App/lastmodifiedTime ",
nonce=" 02df8a71 ed2fbd0c026dcb 1 f0851 Oc 15b ",
cnonce="xxx",
response="xxx",
kc=xxx
kc是用户终端根据 DH 密钥公式 gxMod p计算获得, 第一完整性摘要 response的第一消息摘要算法如下:
KD ( H(A1), unq(nonce)": "unq(cnonce)": "kc": 'Ή(Α2) ": "H(data) )
第一摘要计算参数中 A1为 unq(username) ":" unq(realm) ": "passwd, A2为
Method ":" uri, data为力口密前的消息内容;
406、 代理将 CoAP POST请求转换为 HTTP POST请求并转发给服务器;
407、 服务器收到用户终端重发的 POST请求后, 在 POST请求中携带有 第一资源版本计算共享密钥 key=(kc)yMod p,并用共享密钥 key解密 POST请 求消息体获取消息内容。然后再依据第一摘要计算参数:消息内容、 username、 realm, passwd和 uri按照与第二消息摘要算法计算第二完整性摘要,并验证所 述第一完整性摘要和所述第二完整性摘要相同, 则 POST请求验证通过, 即没 有被第三方修改过,其中所述第二消息摘要算法和所述第一消息摘要算法相同。 验证 POST请求通过时,则服务器根据消息内容和 uri创建资源;在所述 POST 请求中如果携带有第一资源版本时,则优选验证第一资源版本和服务器存储的 第二资源版本的一致性, 并在完成创建资源后生成第三资源版本;
408、服务器返回 HTTP 200 OK应答, 其中包含所创建资源的资源访问地 址 uri; 当拥有第三资源版本 Etag时,进一步所述 Etag作为第二摘要计算参数 之一参与第三完整性摘要计算, 并携带在请求响应 HTTP 200 OK中; 409、代理将 HTTP 200 OK应答转换为 CoAP 2.01应答并转发给用户终端。 首先验证所述请求响应中携带的 cnonce和用户终端临时存储的 cnonce值是否 相同, 相同则删除临时存储的 cnonce, 并进一步利用密钥协商参数 kc生成共 享密钥解密消息体,并使用第四消息摘要算法根据接收到的第二计算摘要参数 和用户密码计算第四完整性摘要,在验证所述第四完整性摘要和第三完整性摘 要相同时, 完成创建过程。
本实施例通过 nonce来实现服务器端的防重攻击, 所述 nonce具体还可以 是通过用户终端的 IP, UTC格式时间参数, 服务器私有密钥其中一种或者几 种组合,相对 Etag防重攻击方式在信令传输过程中多了步骤 S401-S404,但对 于资源版本的存储方式没有特殊限定,在损失执行效率的情况下改善了应用范 围。
本发明提供的一种用户终端, 包括:
第一发送模块 501 , 用于发送一个包括第一鉴权头域的资源访问请求到服 务器 , 所述第一鉴权头域携带用户标识和服务器标识;
第一接收模块 502, 用于接收服务器返回的请求响应, 并传递给第一验证 模块, 所述请求响应包括第二鉴权头域和消息体; 所述第二鉴权头域携带第三 完整性摘要;
第一验证模块 503 , 用于生成资源访问请求, 并向第一发送模块传递; 还 用于获取来自第一接收模块的请求响应 ,使用共享密钥解密所述请求响应的消 息体获取消息内容,依据所述消息内容和用户密码使用第四消息摘要算法计算 第四完整性摘要;在所述第四完整性摘要和所述请求响应中第三完整性摘要一 致时, 3全证请求响应是有效的。
资源访问请求携带的第一鉴权头域还包括第一摘要计算参数,所述第一摘 要计算参数包含所述用户标识和所述服务器标识,还包括随机标识、 资源访问 路径和协商密钥参数中的一种或者几种的组合。
进一步的,第一验证模块根据所述用户密码和第一摘要计算参数使用第一 消息摘要算法计算第一完整性摘要,并将所述第一完整性摘要携带在所述资源 访问请求中使得服务器能根据用户密码和第一摘要计算参数使用第二消息摘 要算法计算第二完整性摘要,其中所述第一消息摘要算法和第二消息摘要算法 相同, 并在所述第一完整性摘要和所述第二完整性摘要相同时,验证所述资源 访问请求是有效的。
第二鉴权头域进一步包括第二摘要计算参数,所述第二摘要计算参数具体 包括用户标识、 随机标识、 资源访问路径、 服务器标识和协商密钥参数中的一 种或者几种的组合。
第一验证模块还用于根据所述用户密码、所述消息内容和所述第二摘要计 算参数使用第四消息摘要算法计算第四完整性摘要。
资源访问请求进一步携带有随机标识时,第一验证模块还用于向第一发送 模块传递携带有随机标识的资源访问请求, 并存储所述随机标识; 进一步在收 到来自第一接收模块的请求响应时,验证存储的随机标识和请求响应携带的第 二摘要计算参数中的随机标识是否相同,相同则所述请求响应是非重复发送的。
用户终端中的以上第一发送模块,第一接收模块和第一验证模块还用于执 行以上各方法实施例中的对应功能的流程, 在此不再赘述。
本发明提供的一种服务器, 包括:
第二接收模块 601 , 用于接收发自用户终端的资源访问请求, 并传递给第 二验证模块, 所述资源访问请求携带有用户标识和服务器标识;
第二验证模块 602, 用于根据资源访问请求中的用户标识从服务器的存储 区获取用户密码;根据所述用户密码和消息内容使用第三消息摘要算法计算第 三完整性摘要,传递携带有第二鉴权头域和消息体的请求响应给第二发送模块; 其中第二鉴权头域包括所述第三完整性摘要,消息体包括由共享密钥加密后的 消息内容;
第二发送模块 603 , 用于发送来自第二验证模块的所述请求响应给用户终 端。
资源访问请求携带的第一鉴权头域还包括第一摘要计算参数,所述第一摘 要计算参数包含所述用户标识和所述服务器标识,还包括随机标识、 资源访问 路径和协商密钥参数中的一种或者几种的组合。
第二验证模块根据用户密码和第一摘要计算参数使用第二消息摘要算法 计算第二完整性摘要,并在资源访问请求中的第一完整性摘要和所述第二完整 性摘要相同时, 验证所述资源访问请求是有效的。 请求响应中的第二鉴权头域进一步包括第二摘要计算参数,所述第二摘要 计算参数具体包括用户标识、 随机标识、 资源访问路径、 服务器标识和协商密 钥参数中的一种或者几种的组合。
第二验证模块还用于根据所述用户密码、所述消息内容和第二摘要计算参 数使用第三消息摘要算法计算第三完整性摘要。
所述第一摘要计算参数还携带有第一资源版本时 , 第二验证模块还用 于比对所述第一资源版本和服务器本地存储的第二资源版本是否相同,相同则 所述资源访问请求是非重复发送的; 验证出所述资源访问请求有效后, 则向第 二发送模块传递请求响应, 所述请求响应进一步携带所述第一资源版本。
服务器中的以上第二发送模块,第二接收模块和第二验证模块还用于执行 以上各方法实施例中的对应功能的流程, 在此不再赘述。
本发明提供的一种用户终端, 包括:
第三发送模块 701 , 用于发送来自第三验证模块的资源访问请求, 所述资 源访问请求携带有第一鉴权头域和消息体,所述第一鉴权头域携带有用户标识、 服务器标识和第一完整性摘要;
第三验证模块 702 , 用于根据用户密码和消息内容使用第一消息摘要算法 计算得出第一完整性摘要并携带在第一鉴权头域,使用共享密钥加密消息内容 并携带在消息体中,向第三发送模块传递携带有第一鉴权头域和消息体的资源 访问请求; 所述第三完整性摘要由服务器收到所述资源访问请求后, 进一步根 据用户密码和消息内容使用第三消息摘要算法计算得出,所述消息体携带由共 享密钥加密后的消息内容;其中用户密码是根据资源访问请求携带的用户标识 从服务器的存储区中获取;
第三接收模块 703 , 用于接收服务器返回的请求响应, 并传递给第三验证 模块。
请求响应包括第二鉴权头域,所述第二鉴权头域进一步包括第二摘要计算 参数, 所述第二摘要计算参数具体包括用户标识、 随机标识、 资源访问路径、 服务器标识和协商密钥参数中的一种或者几种的组合。
进一步的, 第三验证模块收到所述请求响应后,按照第四消息摘要算法计 算获得第四完整性摘要,在请求响应中的第三完整性摘要和所述第四完整性摘 要相同时, 验证所述请求响应是有效的。
所述第一鉴权头域还包括第一摘要计算参数,所述第一摘要计算参数包含 所述用户标识和所述服务器标识,还包括随机标识、 资源访问路径和协商密钥 参数中的一种或者几种的组合,
第三验证模块还用于根据用户密码、消息内容和第一摘要计算参数使用第 一消息摘要算法计算得出第一完整性摘要, 并携带在资源访问请求中; 使得服 务器在接收到携带有所述第一完整性摘要的资源访问请求后,进一步使用用户 密码、消息内容和第一摘要计算参数使用第二消息摘要算法计算第二完整性摘 要, 并在所述第一完整性摘要和所述第二完整性摘要相同时,验证所述资源访 问请求是有效的, 其中所述第一消息摘要算法和所述第二消息摘要算法相同。
第三验证模块还用于生成随机标识并存储;进一步接收第三接收模块转发 的来自服务器的请求响应,请求响应中第二摘要计算参数中的随机标识是服务 器从所述第一摘要计算参数中获得的;第三验证模块验证存储的随机标识和请 求响应携带的第二摘要计算参数中的随机标识是否相同,相同则请求响应是非 重复发送的。
所述第一摘要计算参数还包括第一资源版本时 ,第三验证模块进一步使用 所述第一摘要计算参数的第一资源版本计算第一完整性摘要,所述第一资源版 本初始值是在创建资源成功后, 由服务器返回给用户终端; 用户终端在验证所 述请求响应有效时, 保存携带在服务器返回的请求响应中的第三资源版本。
本发明提供的一种服务器, 包括:
第四接收模块 801 , 用于接收发自用户终端的资源访问请求, 并传递给第 四验证模块, 所述资源访问请求包括第一鉴权头域, 所述第一鉴权头域携带有 用户标识、 服务器标识、 消息体和第一完整性摘要;
第四验证模块 802, 用于在获得来自第四接收模块的资源访问请求后, 获 取资源访问请求中携带的经过用户终端加密的消息内容,使用共享密钥解密所 述资源访问请求的消息体获取消息内容,使用共享密钥解密所述资源访问请求 的消息体获取消息内容,并根据所述第一鉴权头域中的用户标识从存储区中获 取用户密码,依据所述的消息内容和所述获取的用户密码使用第二消息摘要算 法计算第二完整性摘要;在所述第二完整性摘要和所述资源访问请求中第一完 整性摘要一致时 ,验证所述资源访问请求有效,向第四发送模块传递请求响应; 第四发送模块 803: 用于发送来自第四验证模块的请求响应给用户终端。 资源访问请求携带的第一鉴权头域还包括第一摘要计算参数,所述第一摘 要计算参数包含所述用户标识和所述服务器标识,还包括随机标识、 资源访问 路径和协商密钥参数中的一种或者几种的组合。
第四验证模块还用于根据消息内容、用户密码和第一摘要计算参数使用第 二消息摘要算法计算第二完整性摘要,并在所述第一完整性摘要和所述第二完 整性摘要相同时,验证所述资源访问请求是有效的; 所述第一消息摘要算法和 所述第二消息摘要算法相同。
进一步的,请求响应携带有第二鉴权头域, 所述第二鉴权头域进一步包括 第二摘要计算参数, 所述第二摘要计算参数具体包括用户标识、 随机标识、 资 源访问路径、 服务器标识和协商密钥参数中的一种或者几种的组合,
第四验证模块还用于根据所述用户密码和第二摘要计算参数使用第三消 息摘要算法计算第三完整性摘要,并将所述第三完整性摘要携带在请求响应中; 使得用户终端可以根据用户密码和第二摘要计算参数使用第四消息摘要算法 计算第四完整性摘要,并在所述第四完整性摘要和所述第三完整性摘要相同时, 验证所述请求响应是有效的。
第一摘要计算参数还携带有第一资源版本时,第四验证模块还用于比对所 述第一资源版本和服务器本地存储的第二资源版本是否相同,相同则所述资源 访问请求是非重复发送的; 验证得出所述资源访问请求有效后, 完成资源访问 请求操作, 更新第二资源版本为第三资源版本, 进一步使用所述第三资源版本 计算第三完整性摘要。
本发明提供的一种安全传输数据的***, 包括:
用户终端 901 , 用于发送一个携带第一鉴权头域的资源访问请求到服务器, 所述第一鉴权头域包括用户标识和服务器标识;还用于接收请求响应并使用共 享密钥解密所述请求响应的消息体获取消息内容,依据所述消息内容和用户密 码计算第四完整性摘要,在所述第四完整性摘要与所述请求响应中第三完整性 摘要一致时, 验证请求响应有效的;
服务器 902, 用于接收所述资源访问请求, 根据用户密码和消息内容使用 第二消息摘要算法计算得出第三完整性摘要并携带在第二鉴权头域中;使用共 享密钥加密消息内容并携带在消息体中;其中用户密码是利用资源访问请求携 带的用户标识从服务器的存储区中获取;其中消息内容是服务完成资源访问请 求的操作后获得;向用户终端发送携带有所述第二鉴权头域和所述消息体的请 求响应。
本发明提供的一种安全传输数据的***, 包括:
用户终端 1001 , 用于发送一个携带有第一鉴权头域和消息体的资源访问 请求, 所述第一鉴权头域包括用户标识、 服务器标识和第一完整性摘要, 所述 第一完整性摘要是用户终端根据用户密码和消息内容使用第一消息摘要算法 计算得出; 其中消息体携带有经过共享密钥加密后的消息内容; 还用于接收服 务器返回的请求响应;
服务器 1002, 用于接收发自用户终端的资源访问请求, 使用共享密钥解 密所述资源访问请求的消息体获取消息内容,并根据第一鉴权头域中的用户标 识从存储区中获取用户密码,依据所述消息内容和所述获取的用户密码使用第 二消息摘要算法计算第二完整性摘要;在所述第二完整性摘要和所述资源访问 请求中第一完整性摘要一致时,验证资源访问请求是有效的, 向用户终端返回 请求响应。
本发明各实施例中用户终端和服务器,包括至少一个处理器(例如 CPU ), 至少一个网络接口或者其他通信接口,存储器和至少一个通信总线, 用于实现 这些装置之间的连接通信。处理器用于执行存储器中存储的可执行模块, 例如 计算机程序。 存储器可能包含高速随机存取存储器 (RAM: Random Access Memory ), 也可能还包括非不稳定的存者器( non-volatile memory ), 例如至少 一个磁盘存储器和光盘。 通过至少一个网络接口 (可以是有线或者无线)实现 该***网关与至少一个其他网元之间的通信连接, 可以使用互联网, 广域网, 本地网, 城域网等。 在一些实施方式中, 存储器存储了程序, 程序可以被处理 器执行, 这个程序用于执行以上各方法实施例的各步骤。
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。 凡在本发明的精神和原则之内所作的任何修改、 等同替换、 改进等, 均包含在 本发明的保护范围内。

Claims

权 利 要 求
1、 一种安全传输数据的方法, 其特征在于, 包括:
用户终端向服务器发送一个携带第一鉴权头域的资源访问请求,所述第一 鉴权头域包括用户标识和服务器标识;
接收服务器返回的请求响应, 所述请求响应包括第二鉴权头域和消息体, 所述第二鉴权头域携带第三完整性摘要;所述第三完整性摘要由服务器收到所 述资源访问请求后,进一步根据用户密码和消息内容使用第三消息摘要算法计 算得出, 所述消息体携带由共享密钥加密后的消息内容; 其中用户密码是根据 资源访问请求携带的用户标识从服务器的存储区中获取;
使用共享密钥解密所述请求响应的消息体获取消息内容,依据所述消息内 容和用户密码使用第四消息摘要算法计算第四完整性摘要,在所述第四完整性 摘要和与所述请求响应中第三完整性摘要一致时, 验证请求响应是有效的。
2、 如权利要求 1所述的方法, 其特征在于, 所述第一鉴权头域包括第一 摘要计算参数, 所述第一摘要计算参数包含所述用户标识和所述服务器标识, 还包括随机标识、 资源访问路径和协商密钥参数中的一种或者几种的组合, 所 述方法进一步包括:
用户终端发送的所述资源访问请求进一步包括根据所述用户密码和第一 摘要计算参数中的一种或者几种参数组合使用第一消息摘要算法计算第一完 整性摘要;
服务器接收到所述资源访问请求后,根据所述服务器的存储区的用户密码 和第一摘要计算参数使用第二消息摘要算法计算第二完整性摘要,其中所述第 一消息摘要算法和第二消息摘要算法相同,在所述第一完整性摘要和所述第二 完整性摘要相同时, 则资源访问请求是有效的。
3、 如权利要求 1或 2所述的方法, 其特征在于, 所述请求响应中的第二 鉴权头域进一步包括第二摘要计算参数,所述第二摘要计算参数具体包括用户 标识、 随机标识、 资源访问路径、 服务器标识和协商密钥参数中的一种或者几 种的组合;
所述第三完整性摘要根据用户密码和消息内容使用第三消息摘要算法计 算得出具体包括: 所述第三完整性摘要根据用户密码、 消息内容和第二摘要计 算参数使用第三消息摘要算法计算得出;
所述依据所述消息内容和用户密码使用第四消息摘要算法计算第四完整 性摘要具体包括: 第四完整性摘要根据用户密码、 消息内容和第二摘要计算参 数使用第四消息摘要算法计算得出,其中所述第四消息摘要算法和所述第三消 息摘要算法相同。
4、 如权利要求 3所述方法, 其特征在于, 所述资源访问请求中进一步包 含随机标识,
所述用户终端发送资源访问请求具体包括:发送携带有随机标识的资源访 问请求,所述随机标识由用户终端生成并存储,且携带在第一摘要计算参数中; 所述接受服务器返回的请求响应进一步包括:所述请求响应的第二摘要计 算参数中包含随机标识;
所述方法进一步包括用户终端验证所述存储的随机标识和请求响应携带 的第三摘要计算参数中的随机标识相同, 则请求响应是非重复发送的。
5、 如权利要求 2或 3所述方法, 其特征在于, 所述第一摘要计算参数还 包括第一资源版本,
所述根据所述用户密码和第一摘要计算参数中的一种或者几种参数组合 使用第一消息摘要算法计算第一完整性摘要还包括:进一步使用所述第一摘要 计算参数中的第一资源版本计算第一完整性摘要 ,并发送携带所述第一资源版 本的资源访问请求;
所述方法进一步包括: 服务器接收到所述资源访问请求后, 比对所述第一 资源版本和服务器本地存储的第二资源版本是否相同,相同则所述资源访问请 求是非重复发送的;
所述根据所述服务器的存储区的用户密码和第一摘要计算参数使用第二 消息摘要算法计算第二完整性摘要还包括:进一步使用所述第一资源版本计算 第二完整性摘要, 验证所述资源访问请求是有效的。
6、 如权利要求 5所述方法, 其特征在于, 所述方法还包括:
若所述资源访问请求携带的第一资源版本和服务器本地存储的第二资源 版本结果不相同,且所述第一完整性摘要和第二完整性摘要的验证结果是相同 时,服务器进一步使用所述第二资源版本计算得出第三完整性摘要,在请求响 应中进一步携带第二资源版本, 并发送给用户终端。
7、 如权利要求 1-6中任一权利要求所述的方法, 其特征在于,
所述用户终端使用的共享密钥是用户终端根据用户标识和用户密码经过 密钥的消息摘要算法生成的;
服务器根据资源访问请求中携带的用户标识查询存储的用户密码,并根据 所述用户标识和所述用户密码进一步经过所述密钥的消息摘要算法计算生成 服务器使用的共享密钥。
8、 如权利要求 1-6中任一权利要求所述的方法, 其特征在于,
所述服务器使用的共享密钥根据协商密钥参数计算获得;用户终端使用的 共享密钥则是根据请求响应中携带的协商密钥参数计算获得。
9、 如权利要求 1-8 中任一权利要求所述的方法, 其特征在于, 所述用户 终端发送一个携带第一鉴权头域的资源访问请求到服务器进一步包括:
代理接收资源访问请求,根据所述资源访问请求中的用户标识和服务器标 识获取用户终端和服务器支持的协议,完成资源访问请求的协议转换生成支持 服务器支持的协议的资源访问请求, 向服务器发送转换后的资源访问请求。
10、 如权利要求 1-9中任一权利要求所述的方法, 其特征在于, 所述接收 服务器返回的请求响应进一步包括:
代理接收到所述请求响应,根据所述请求响应中的用户标识和服务器标识, 完成请求响应的协议转换生成支持用户终端支持的协议的请求响应,向用户终 端发送转换后的请求响应。
11、 一种安全传输数据的方法, 其特征在于, 包括:
用户终端发送一个携带有第一鉴权头域和消息体的资源访问请求 ,所述第 一鉴权头域包括用户标识、服务器标识和第一完整性摘要, 所述第一完整性摘 要是用户终端根据用户密码、 消息内容使用第一消息摘要算法计算得出; 其中 消息体携带有经过共享密钥加密后的消息内容;
接收服务器返回的请求响应;所述请求响应是服务器接收所述资源访问请 求,验证所述资源访问请求有效后返回的, 所述验证资源访问请求有效具体包 括: 使用共享密钥解密所述资源访问请求的消息体获取消息内容, 并根据第一 鉴权头域中的用户标识从存储区中获取对应的用户密码, 依据所述消息内容、 所述获取的用户密码使用第二消息摘要算法计算第二完整性摘要,在所述第二 完整性摘要和所述资源访问请求中第一完整性摘要一致时,验证资源访问请求 是有效的。
12、 如权利要求 11所述的方法, 其特征在于, 所述请求响应包括第二鉴 权头域, 所述第二鉴权头域进一步包括第二摘要计算参数, 所述第二摘要计算 参数具体包括用户标识、 随机标识、 资源访问路径、 服务器标识和协商密钥参 数中的一种或者几种的组合, 所述方法进一步包括:
用户终端接收携带有第三完整性摘要的请求响应,所述第三完整性摘要是 根据所述用户密码和所述第二摘要计算参数并使用第三消息摘要算法计算获 得;
用户终端接收到所述请求响应后,根据用户密码和所述第二摘要计算参数 使用第四消息摘要算法计算并获得第四完整性摘要,其中所述第四消息摘要算 法和所述第三消息摘要算法相同,在所述第三完整性摘要和所述第四完整性摘 要相同时, 则所述请求响应是有效的。
13、 如权利要求 11或 12所述的方法, 其特征在于, 所述所述第一鉴权头 域包括第一摘要计算参数,所述第一摘要计算参数包含所述用户标识和所述服 务器标识,还包括随机标识、 资源访问路径和协商密钥参数中的一种或者几种 的组合;
所述第一完整性摘要是用户终端根据用户密码和消息内容使用第一消息 摘要算法计算得出具体包括: 第一完整性摘要是用户终端根据用户密码、 消息 内容和第一摘要计算参数使用第一消息摘要算法计算得出;
所述依据所述获取消息内容和用户密码使用第二消息摘要算法计算第二 完整性摘要具体包括: 依据所述获取消息内容、用户密码和第一摘要计算参数 使用第二消息摘要算法计算第二完整性摘要,其中所述第一消息摘要算法和所 述第二消息摘要算法相同。
14、 如权利要求 13所述方法, 其特征在于, 所述资源访问请求中进一步 包含随机标识, 所述用户终端发送资源访问请求具体包括: 发送携带有随机 标识的资源访问请求, 所述随机标识由用户终端生成并存储,携带在第一摘要 计算参数中; 所述接收服务器返回的请求响应进一步包括:所述请求响应的第二摘要计 算参数中包含随机标识;
所述方法进一步包括用户终端验证所述存储的随机标识和请求响应携带 的第二摘要计算参数中的随机标识相同, 则请求响应是非重复发送的。
15、 如权利要求 13或 14所述方法, 其特征在于, 所述第一摘要计算参数 包括第一资源版本,
所述第一完整性摘要是用户终端根据用户密码、消息内容使用第一消息摘 要算法计算得出包括:用户终端进一步使用所述第一摘要计算参数中的第一资 源版本计算第一完整性摘要, 并发送携带所述第一资源版本的资源访问请求; 所述方法进一步包括: 服务器接收到所述资源访问请求后, 比对所述第一 资源版本和服务器本地存储的第二资源版本是否相同,相同则所述资源访问请 求是非重复发送的;
所述服务器计算第三完整性摘要具体包括: 完成资源访问请求操作, 更新 第二资源版本为第三资源版本,进一步使用所述第三资源版本计算第三完整性 摘要,发送携带有所述第三资源版本和第三完整性摘要的请求响应给用户终端; 所述根据用户密码和所述第二摘要计算参数使用第四消息摘要算法计算 并获得第四完整性摘要包括:用户终端进一步使用接收的请求响应中携带的第 三资源版本计算第四完整性摘要,在验证所述第四完整性摘要和请求响应中携 带的第三完整性摘要相同时, 保存第三资源版本。
16、 如权利要求 15所述方法, 其特征在于, 所述方法还包括:
若所述资源访问请求携带的第一资源版本和服务器本地存储的第二资源 版本结果不相同,且所述第一完整性摘要和第二完整性摘要的验证结果是相同 时,服务器进一步使用所述第二资源版本计算得出第三完整性摘要, 并在请求 响应中进一步携带第二资源版本, 并发送给用户终端。
17、 如权利要求 11-16中任一权利要求所述的方法, 其特征在于, 用户终端使用的共享密钥是用户终端根据用户标识和用户密码经过密钥 的消息摘要算法生成的;
服务器根据资源访问请求中携带的用户标识查询存储的用户密码,并根据 所述用户标识和所述用户密码进一步经过所述密钥的消息摘要算法计算生成 服务器使用的共享密钥。
18、 如权利要求 11-16中任一权利要求所述的方法, 其特征在于, 服务器使用的共享密钥根据在协商密钥参数计算获得;用户终端使用的共 享密钥则是根据请求响应中携带的协商密钥参数计算获得。
19、 如权利要求 11-18中任一权利要求所述的方法, 其特征在于, 所述用 户终端发送一个携带第一鉴权头域的资源访问请求到服务器具体包括:
代理接收资源访问请求,根据所述资源访问请求中的用户标识和服务器标 识获取用户终端和服务器支持的协议,完成资源访问请求的协议转换生成支持 服务器支持的协议的资源访问请求, 向服务器发送转换后的资源访问请求。
20、 如权利要求 11-19中任一权利要求所述的方法, 其特征在于, 所述接 收服务器返回的请求响应具体包括:
代理接收到所述请求响应,根据所述请求响应中的用户标识和服务器标识, 完成请求响应的协议转换生成支持用户终端支持的协议的请求响应,向用户终 端发送转换后的请求响应。
21、 一种用户终端, 其特征在于, 包括:
第一发送模块 ,用于发送一个包括第一鉴权头域的资源访问请求到服务器 , 所述第一鉴权头域携带用户标识和服务器标识;
第一接收模块,用于接收服务器返回的请求响应,并传递给第一验证模块, 所述请求响应包括第二鉴权头域和消息体;所述第二鉴权头域携带第三完整性 摘要; 所述第三完整性摘要由服务器收到所述资源访问请求后, 进一步根据用 户密码和消息内容使用第三消息摘要算法计算得出 ,所述消息体携带由共享密 钥加密后的消息内容;其中用户密码是根据资源访问请求携带的用户标识从服 务器的存储区中获取;
第一验证模块, 用于生成资源访问请求, 并向第一发送模块传递; 还用于 获取来自第一接收模块的请求响应,使用共享密钥解密所述请求响应的消息体 获取消息内容,依据所述消息内容和用户密码使用第四消息摘要算法计算第四 完整性摘要;在所述第四完整性摘要和所述请求响应中第三完整性摘要一致时, 马全证请求响应是有效的。
22、 如权利要求 21所述的终端, 其特征在于, 所述资源访问请求携带的 第一鉴权头域还包括第一摘要计算参数,所述第一摘要计算参数包含所述用户 标识和所述服务器标识,还包括随机标识、 资源访问路径和协商密钥参数中的 一种或者几种的组合;
所述第一验证模块进一步用于根据所述用户密码和第一摘要计算参数使 用第一消息摘要算法计算第一完整性摘要,并将所述第一完整性摘要携带在所 述资源访问请求中使得服务器能根据用户密码和第一摘要计算参数使用第二 消息摘要算法计算第二完整性摘要,其中所述第一消息摘要算法和第二消息摘 要算法相同, 并在所述第一完整性摘要和所述第二完整性摘要相同时,验证所 述资源访问请求是有效的。
23、 如权利要求 21或 22所述的终端, 其特征在于, 所述第二鉴权头域进 一步包括第二摘要计算参数, 所述第二摘要计算参数具体包括用户标识、 随机 标识、资源访问路径、服务器标识和协商密钥参数中的一种或者几种的组合 ; 所述第一验证模块还用于根据所述用户密码、所述消息内容和所述第二摘 要计算参数使用第四消息摘要算法计算第四完整性摘要。
24、 如权利要求 23所述的终端, 其特征在于, 所述资源访问请求进一步 携带有随机标识,
所述第一验证模块还用于向第一发送模块传递携带有随机标识的资源访 问请求,并存储所述随机标识;进一步在收到来自第一接收模块的请求响应时, 验证存储的随机标识和请求响应携带的第二摘要计算参数中的随机标识是否 相同, 相同则所述请求响应是非重复发送的。
25、 一种服务器, 其特征在于, 包括:
第二接收模块, 用于接收发自用户终端的资源访问请求, 并传递给第二验 证模块, 所述资源访问请求携带有用户标识和服务器标识;
第二验证模块,用于根据资源访问请求中的用户标识从服务器的存储区获 取用户密码;根据所述用户密码和消息内容使用第三消息摘要算法计算第三完 整性摘要,传递携带有第二鉴权头域和消息体的请求响应给第二发送模块; 其 中第二鉴权头域包括所述第三完整性摘要,消息体包括由共享密钥加密后的消 息内容;
第二发送模块, 用于发送来自第二验证模块的所述请求响应给用户终端。
26、 如权利要求 25所述的服务器, 其特征在于, 所述资源访问请求携带 的第一鉴权头域还包括第一摘要计算参数,所述第一摘要计算参数包含所述用 户标识和所述服务器标识,还包括随机标识、 资源访问路径和协商密钥参数中 的一种或者几种的组合,
所述第二验证模块还用于根据用户密码和第一摘要计算参数使用第二消 息摘要算法计算第二完整性摘要,并在资源访问请求中的第一完整性摘要和所 述第二完整性摘要相同时, 验证所述资源访问请求是有效的。
27、 如权利要求 26所述的服务器, 其特征在于, 所述请求响应中的第二 鉴权头域进一步包括第二摘要计算参数,所述第二摘要计算参数具体包括用户 标识、 随机标识、 资源访问路径、 服务器标识和协商密钥参数中的一种或者几 种的组合,
所述第二验证模块还用于根据所述用户密码、所述消息内容和所述第二摘 要计算参数使用第三消息摘要算法计算第三完整性摘要。
28、 如权利要求 26或 27所述的服务器, 其特征在于, 所述第一摘要计算 参数还携带有第一资源版本时,
所述第二验证模块还用于比对所述第一资源版本和服务器本地存储的第 二资源版本是否相同,相同则所述资源访问请求是非重复发送的; 验证出所述 资源访问请求有效后, 则向第二发送模块传递请求响应, 所述请求响应进一步 携带所述第一资源版本。
29、 一种用户终端, 其特征在于, 包括:
第三发送模块, 用于发送来自第三验证模块的资源访问请求, 所述资源访 问请求携带有第一鉴权头域和消息体, 所述第一鉴权头域携带有用户标识、服 务器标识和第一完整性摘要;
第三验证模块,用于根据用户密码和消息内容使用第一消息摘要算法计算 得出第一完整性摘要并携带在第一鉴权头域,使用共享密钥加密消息内容并携 带在消息体中 ,向第三发送模块传递携带有第一鉴权头域和消息体的资源访问 请求;
第三接收模块,用于接收服务器返回的请求响应,并传递给第三验证模块。
30、 如权利要求 29所述终端, 其特征在于, 所述请求响应包括第二鉴权 头域, 所述第二鉴权头域进一步包括第二摘要计算参数, 所述第二摘要计算参 数具体包括用户标识、 随机标识、 资源访问路径、 服务器标识和协商密钥参数 中的一种或者几种的组合,
所述第三验证模块还用于, 收到所述请求响应后,按照第四消息摘要算法 计算获得第四完整性摘要,在请求响应中的第三完整性摘要和所述第四完整性 摘要相同时, 验证所述请求响应是有效的。
31、 如权利要求 29或 30所述终端, 其特征在于, 所述第一鉴权头域还包 括第一摘要计算参数,所述第一摘要计算参数包含所述用户标识和所述服务器 标识,还包括随机标识、 资源访问路径和协商密钥参数中的一种或者几种的组 合,
所述第三验证模块还用于根据用户密码、消息内容和第一摘要计算参数使 用第一消息摘要算法计算得出第一完整性摘要, 并携带在资源访问请求中; 使 得服务器在接收到携带有所述第一完整性摘要的资源访问请求后,进一步使用 用户密码、消息内容和第一摘要计算参数并使用第二消息摘要算法计算第二完 整性摘要, 其中所述第一消息摘要算法和所述第二消息摘要算法相同, 并在所 述第一完整性摘要和所述第二完整性摘要相同时 ,验证所述资源访问请求是有 效的。
32、 如权利要求 31所述的终端, 其特征在于,
所述第三验证模块还用于生成随机标识并存储;进一步接收第三接收模块 转发的来自服务器的请求响应,所述请求响应中第二摘要计算参数中的随机标 识是从所述第一摘要计算参数中获得的;
所述第三验证模块验证存储的随机标识和请求响应携带的第二摘要计算 参数中的随机标识相同, 则请求响应是非重复发送的。
33、 如权利要求 31或 32所述的终端, 其特征在于, 所述第一摘要计算参 数还包括第一资源版本,
所述第三验证模块进一步使用所述第一摘要计算参数的第一资源版本计 算第一完整性摘要, 所述第一资源版本初始值是在创建资源成功后, 由服务器 返回给用户终端;
所述第三验证模块在验证所述请求响应有效时 ,保存携带在服务器返回的 请求响应中的第三资源版本。
34、 一种服务器, 其特征在于, 包括:
第四接收模块, 用于接收发自用户终端的资源访问请求, 并传递给第四验 证模块, 所述资源访问请求包括第一鉴权头域, 所述第一鉴权头域携带有用户 标识、 服务器标识、 消息体和第一完整性摘要;
第四验证模块, 用于在获得来自第四接收模块的资源访问请求后, 获取资 源访问请求中携带的经过用户终端加密的消息内容,使用共享密钥解密所述资 源访问请求的消息体获取所述消息内容,并根据所述第一鉴权头域中的用户标 识从存储区中获取用户密码,依据所述的消息内容和所述获取的用户密码使用 第二消息摘要算法计算第二完整性摘要;在所述第二完整性摘要和所述资源访 问请求中第一完整性摘要一致时,验证所述资源访问请求有效, 向第四发送模 块传递请求响应;
第四发送模块, 用于发送来自第四验证模块的请求响应给用户终端。
35、 如权利要求 34所述的服务器, 其特征在于, 所述资源访问请求携带 的第一鉴权头域还包括第一摘要计算参数,所述第一摘要计算参数包含所述用 户标识和所述服务器标识,还包括随机标识、 资源访问路径和协商密钥参数中 的一种或者几种的组合,
所述第四验证模块还用于根据消息内容、用户密码和第一摘要计算参数使 用第二消息摘要算法计算第二完整性摘要,并在所述第一完整性摘要和所述第 二完整性摘要相同时,验证所述资源访问请求是有效的; 所述第一消息摘要算 法和所述第二消息摘要算法相同。
36、 如权利要求 34或 35所述的服务器, 其特征在于, 所述请求响应携带 有第二鉴权头域, 所述第二鉴权头域进一步包括第二摘要计算参数, 所述第二 摘要计算参数具体包括用户标识、 随机标识、 资源访问路径、 服务器标识和协 商密钥参数中的一种或者几种的组合,
所述第四验证模块还用于根据所述用户密码和第二摘要计算参数使用第 三消息摘要算法计算第三完整性摘要,并将所述第三完整性摘要携带在请求响 应中;使得用户终端可以根据用户密码和第二摘要计算参数使用第四消息摘要 算法计算第四完整性摘要,并在所述第四完整性摘要和所述第三完整性摘要相 同时, 验证所述请求响应是有效的。
37、 如权利要求 36所述的服务器, 其特征在于, 所述第一摘要计算参数 还携带有第一资源版本时,
所述第四验证模块还用于比对所述第一资源版本和服务器本地存储的第 二资源版本是否相同,相同则所述资源访问请求是非重复发送的; 验证得出所 述资源访问请求有效后, 完成资源访问请求操作, 更新第二资源版本为第三资 源版本, 进一步使用所述第三资源版本计算第三完整性摘要。
38、 一种安全传输数据的***, 其特征在于, 包括:
用户终端, 用于发送一个携带第一鉴权头域的资源访问请求到服务器, 所 述第一鉴权头域包括用户标识和服务器标识;还用于接收请求响应并使用共享 密钥解密所述请求响应的消息体获取消息内容,依据所述消息内容和用户密码 计算第四完整性摘要,在所述第四完整性摘要与所述请求响应中第三完整性摘 要一致时, 验证请求响应有效的;
服务器, 用于接收所述资源访问请求,根据用户密码和消息内容使用第三 消息摘要算法计算得出第三完整性摘要并携带在第二鉴权头域中;使用共享密 钥加密消息内容并携带在消息体中;其中用户密码是利用资源访问请求携带的 用户标识从服务器的存储区中获取;其中消息内容是服务完成资源访问请求的 操作后获得;向用户终端发送携带有所述第二鉴权头域和所述消息体的请求响 应。
39、 如权利要求 38所述***, 其特征在于, 还包括代理装置,
所述代理装置用于接收来自用户终端的资源访问请求 ,根据所述资源访问 请求中的用户标识和服务器标识获取用户终端和服务器支持的协议,完成资源 访问请求的协议转换生成支持服务器支持的协议的资源访问请求,向服务器发 送转换后的资源访问请求;
代理装置还用于接收来自服务器的请求响应 ,根据所述请求响应中的用户 标识和服务器标识,完成请求响应的协议转换生成支持用户终端支持的协议的 请求响应, 向用户终端发送转换后的请求响应。
40、 一种安全传输数据的***, 其特征在于, 包括:
用户终端, 用于发送一个携带有第一鉴权头域和消息体的资源访问请求, 所述第一鉴权头域包括用户标识、服务器标识和第一完整性摘要, 所述第一完 整性摘要是用户终端根据用户密码和消息内容使用第一消息摘要算法计算得 出; 其中消息体携带有经过共享密钥加密后的消息内容; 还用于接收服务器返 回的请求响应;
服务器, 用于接收发自用户终端的资源访问请求,使用共享密钥解密所述 资源访问请求的消息体获取消息内容,并根据第一鉴权头域中的用户标识从存 储区中获取用户密码,依据所述消息内容和所述获取的用户密码使用第二消息 摘要算法计算第二完整性摘要;在所述第二完整性摘要和所述资源访问请求中 第一完整性摘要一致时,验证资源访问请求是有效的, 向用户终端返回请求响 应。
41、 如权利要求 40所述***, 其特征在于, 还包括代理装置,
代理装置用于接收来自用户终端的资源访问请求,根据所述资源访问请求 中的用户标识和服务器标识获取用户终端和服务器支持的协议,完成资源访问 请求的协议转换生成支持服务器支持的协议的资源访问请求,向服务器发送转 换后的资源访问请求;
代理装置接收来自服务器的请求响应,根据所述请求响应中的用户标识和 服务器标识,完成请求响应的协议转换生成支持用户终端支持的协议的请求响 应, 向用户终端发送转换后的请求响应。
PCT/CN2012/086753 2011-12-15 2012-12-17 一种安全传输数据方法,装置和*** WO2013087039A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP12857397.9A EP2779524A4 (en) 2011-12-15 2012-12-17 METHOD, DEVICE AND SYSTEM FOR SECURE DATA TRANSMISSION
US14/305,679 US20140298037A1 (en) 2011-12-15 2014-06-16 Method, apparatus, and system for securely transmitting data

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110421295.6 2011-12-15
CN2011104212956A CN103166931A (zh) 2011-12-15 2011-12-15 一种安全传输数据方法,装置和***

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/305,679 Continuation US20140298037A1 (en) 2011-12-15 2014-06-16 Method, apparatus, and system for securely transmitting data

Publications (1)

Publication Number Publication Date
WO2013087039A1 true WO2013087039A1 (zh) 2013-06-20

Family

ID=48589677

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/086753 WO2013087039A1 (zh) 2011-12-15 2012-12-17 一种安全传输数据方法,装置和***

Country Status (4)

Country Link
US (1) US20140298037A1 (zh)
EP (1) EP2779524A4 (zh)
CN (1) CN103166931A (zh)
WO (1) WO2013087039A1 (zh)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105530238A (zh) * 2014-10-20 2016-04-27 塔塔咨询服务有限公司 用于安全对话建立和数据的加密交换的计算机实现***和方法
US9419979B2 (en) 2014-03-31 2016-08-16 EXILANT Technologies Private Limited Increased communication security
US9419949B2 (en) 2014-03-31 2016-08-16 EXILANT Technologies Private Limited Increased communication security
US9426136B2 (en) 2014-03-31 2016-08-23 EXILANT Technologies Private Limited Increased communication security
US9426148B2 (en) 2014-03-31 2016-08-23 EXILANT Technologies Private Limited Increased communication security
US9426135B2 (en) 2014-03-31 2016-08-23 EXILANT Technologies Private Limited Increased communication security
US9602486B2 (en) 2014-03-31 2017-03-21 EXILANT Technologies Private Limited Increased communication security
US10389714B2 (en) 2014-03-31 2019-08-20 Idaax Technologies Private Limited Increased communication security
CN114499969A (zh) * 2021-12-27 2022-05-13 天翼云科技有限公司 一种通信报文的处理方法、装置、电子设备及存储介质
CN115442026A (zh) * 2022-11-07 2022-12-06 苏州浪潮智能科技有限公司 一种hmac算法处理***、方法、设备及介质

Families Citing this family (46)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140304381A1 (en) * 2013-04-05 2014-10-09 Nokia Corporation Method and apparatus for communicating with smart objects
CN105659565B (zh) * 2013-09-20 2020-01-10 康维达无线有限责任公司 基于兴趣的增强型m2m内容管理
CN104092647B (zh) * 2013-11-25 2016-04-13 腾讯科技(深圳)有限公司 网络访问方法、***及客户端
US9298942B1 (en) 2013-12-31 2016-03-29 Google Inc. Encrypted augmentation storage
KR102144509B1 (ko) * 2014-03-06 2020-08-14 삼성전자주식회사 근접 통신 방법 및 장치
CN104836782B (zh) * 2014-04-03 2018-07-20 腾讯科技(北京)有限公司 服务器、客户端以及数据访问方法和***
CN104284332A (zh) * 2014-09-26 2015-01-14 中兴通讯股份有限公司 一种鉴权方法及无线路由器
CN111030996B (zh) 2014-10-24 2021-10-15 华为技术有限公司 一种访问资源的方法及装置
KR20160092275A (ko) * 2015-01-27 2016-08-04 한국전자통신연구원 CoAP 통신 방법 및 이를 수행하는 시스템
CN106549924B (zh) * 2015-09-22 2019-06-28 ***通信集团公司 一种通信安全防护方法、装置和***
CN106937240B (zh) * 2015-12-31 2020-10-09 华为技术有限公司 一种获取资源的方法和装置
CN114826673A (zh) 2016-07-06 2022-07-29 华为技术有限公司 一种传输数据的保护***、方法及装置
CN106656955A (zh) * 2016-09-26 2017-05-10 山东浪潮商用***有限公司 一种通信方法及***、客户端
CN108337210B (zh) * 2017-01-19 2021-05-18 钉钉控股(开曼)有限公司 设备配置方法及装置、***
US9736268B1 (en) 2017-02-23 2017-08-15 Thumbtack, Inc. System for generating responses to requests
CN108933757B (zh) * 2017-05-22 2021-09-17 北京君泊网络科技有限责任公司 一种硬件设备的安全可靠联网接入方法
CN107231238A (zh) * 2017-06-02 2017-10-03 上海斐讯数据通信技术有限公司 一种基于安全授信凭证的授信方法及***
CN107547307B (zh) * 2017-07-28 2021-04-30 新华三技术有限公司 一种时间参数确定方法及装置
CN107689964B (zh) * 2017-09-28 2020-10-23 深圳市友华通信技术有限公司 嵌入式web服务器防重放攻击的方法
US11706310B2 (en) * 2018-03-01 2023-07-18 Thales Dis Cpl Usa, Inc. System and method for adapting a response provided by a first device
CN108616350B (zh) * 2018-03-20 2021-08-10 如般量子科技有限公司 一种基于对称密钥池的HTTP-Digest类AKA身份认证***和方法
CN109088913B (zh) * 2018-06-29 2021-05-11 华为技术有限公司 请求数据的方法和负载均衡服务器
CN109257630B (zh) * 2018-11-14 2020-12-11 苏州科达科技股份有限公司 视频点播中的数据传输***、方法、装置及存储介质
US20230344818A1 (en) * 2018-11-27 2023-10-26 Meta Platforms Technologies, Llc Systems and methods for securely establishing trusted device bonding
CN109639436A (zh) * 2019-01-04 2019-04-16 平安科技(深圳)有限公司 基于盐值的数据持有性验证方法及终端设备
CN113709095A (zh) 2019-02-28 2021-11-26 Oppo广东移动通信有限公司 资源请求方法、设备及存储介质
EP3716177A1 (en) * 2019-03-25 2020-09-30 IPCO 2012 Limited A method, apparatus and computer program for verifying the integrity of electronic messages
CN110120898B (zh) * 2019-04-23 2021-03-23 杭州安恒信息技术股份有限公司 远程网页资源变更监测及有害性检测识别方法
CN111181940A (zh) * 2019-12-20 2020-05-19 国久大数据有限公司 数据校验方法及数据校验***
US11652616B2 (en) 2020-02-26 2023-05-16 International Business Machines Corporation Initializing a local key manager for providing secure data transfer in a computing environment
US11184160B2 (en) 2020-02-26 2021-11-23 International Business Machines Corporation Channel key loading in a computing environment
US11546137B2 (en) * 2020-02-26 2023-01-03 International Business Machines Corporation Generation of a request to initiate a secure data transfer in a computing environment
US11489821B2 (en) * 2020-02-26 2022-11-01 International Business Machines Corporation Processing a request to initiate a secure data transfer in a computing environment
US11502834B2 (en) 2020-02-26 2022-11-15 International Business Machines Corporation Refreshing keys in a computing environment that provides secure data transfer
CN111431717A (zh) * 2020-03-31 2020-07-17 兴唐通信科技有限公司 一种卫星移动通信***的加密方法
CN111770048B (zh) * 2020-05-08 2023-04-07 厦门亿联网络技术股份有限公司 一种防止sip设备被攻击的方法、主叫设备及被叫设备
TWI766327B (zh) * 2020-07-31 2022-06-01 建國工程股份有限公司 即時取得資訊方法及系統
US11546277B2 (en) * 2020-09-09 2023-01-03 Snap Inc. Third-party resource coordination
CN112906063B (zh) * 2021-02-26 2024-04-26 杭州萤石软件有限公司 一种数字摘要算法处理设备方法、装置、***及设备
CN113938327B (zh) * 2021-12-17 2022-05-24 亿次网联(杭州)科技有限公司 Vpn服务的访问方法和访问***、电子设备、存储介质
CN114884913A (zh) * 2022-01-10 2022-08-09 ***通信有限公司研究院 消息交互方法、装置、电子设备、消息服务器及存储介质
CN114928466B (zh) * 2022-03-31 2023-11-07 成都鲁易科技有限公司 加密数据自动识别方法、装置、存储介质及计算机设备
WO2023224544A1 (en) * 2022-05-19 2023-11-23 Dbs Bank Limited Systems, devices, and methods for validating information and information sets
TWI802447B (zh) * 2022-06-21 2023-05-11 桓達科技股份有限公司 感測器無線傳訊的封包加解密方法
CN115314292B (zh) * 2022-08-08 2023-03-07 钛信(上海)信息科技有限公司 一种报文安全传输方法及装置
CN117728958A (zh) * 2024-02-05 2024-03-19 浙江大华技术股份有限公司 一种通信方法、装置和***

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1820481A (zh) * 2003-07-11 2006-08-16 国际商业机器公司 在客户机-服务器环境中认证客户机的***和方法
CN101350820A (zh) * 2008-08-29 2009-01-21 中兴通讯股份有限公司 一种推送业务代理网关对推送业务发起者的安全认证方法
US20100077463A1 (en) * 2008-09-24 2010-03-25 Disney Enterprises, Inc. System and method for providing a secure content with revocable access
CN102014129A (zh) * 2010-11-22 2011-04-13 华为技术有限公司 一种在CoAP网络中注册的方法及装置
CN102195957A (zh) * 2010-03-19 2011-09-21 华为技术有限公司 一种资源共享方法、装置及***

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4487490B2 (ja) * 2003-03-10 2010-06-23 ソニー株式会社 情報処理装置、およびアクセス制御処理方法、情報処理方法、並びにコンピュータ・プログラム
JP4264650B2 (ja) * 2004-04-07 2009-05-20 ソニー株式会社 コンテンツ伝送システム及びコンテンツ伝送方法、コンテンツ送信装置及びコンテンツ送信方法、コンテンツ受信装置及びコンテンツ受信方法、並びにコンピュータ・プログラム
JP4748774B2 (ja) * 2004-06-02 2011-08-17 キヤノン株式会社 暗号化通信方式及びシステム
US20070174630A1 (en) * 2005-02-21 2007-07-26 Marvin Shannon System and Method of Mobile Anti-Pharming and Improving Two Factor Usage
US8832466B1 (en) * 2006-01-27 2014-09-09 Trustwave Holdings, Inc. Methods for augmentation and interpretation of data objects
US8327142B2 (en) * 2006-09-27 2012-12-04 Secureauth Corporation System and method for facilitating secure online transactions
US8509431B2 (en) * 2010-09-20 2013-08-13 Interdigital Patent Holdings, Inc. Identity management on a wireless device
CN102148863A (zh) * 2011-01-27 2011-08-10 华为技术有限公司 一种m2m业务消息传递的方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1820481A (zh) * 2003-07-11 2006-08-16 国际商业机器公司 在客户机-服务器环境中认证客户机的***和方法
CN101350820A (zh) * 2008-08-29 2009-01-21 中兴通讯股份有限公司 一种推送业务代理网关对推送业务发起者的安全认证方法
US20100077463A1 (en) * 2008-09-24 2010-03-25 Disney Enterprises, Inc. System and method for providing a secure content with revocable access
CN102195957A (zh) * 2010-03-19 2011-09-21 华为技术有限公司 一种资源共享方法、装置及***
CN102014129A (zh) * 2010-11-22 2011-04-13 华为技术有限公司 一种在CoAP网络中注册的方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2779524A4 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9876643B2 (en) 2014-03-31 2018-01-23 EXILANT Technologies Private Limited Increased communication security
US9426148B2 (en) 2014-03-31 2016-08-23 EXILANT Technologies Private Limited Increased communication security
US10560446B2 (en) 2014-03-31 2020-02-11 Idaax Technologies Private Limited Increased communication security
US9426136B2 (en) 2014-03-31 2016-08-23 EXILANT Technologies Private Limited Increased communication security
US10171244B2 (en) 2014-03-31 2019-01-01 Idaax Technologies Private Limited Increased communication security
US9426135B2 (en) 2014-03-31 2016-08-23 EXILANT Technologies Private Limited Increased communication security
US9602486B2 (en) 2014-03-31 2017-03-21 EXILANT Technologies Private Limited Increased communication security
US10237260B2 (en) 2014-03-31 2019-03-19 Idaax Technologies Private Limited Increased communication security
US9419949B2 (en) 2014-03-31 2016-08-16 EXILANT Technologies Private Limited Increased communication security
US9419979B2 (en) 2014-03-31 2016-08-16 EXILANT Technologies Private Limited Increased communication security
US9794246B2 (en) 2014-03-31 2017-10-17 EXILANT Technologies Private Limited Increased communication security
US10389714B2 (en) 2014-03-31 2019-08-20 Idaax Technologies Private Limited Increased communication security
US10560271B2 (en) 2014-03-31 2020-02-11 Idaax Technologies Private Limited Increased communication security
CN105530238A (zh) * 2014-10-20 2016-04-27 塔塔咨询服务有限公司 用于安全对话建立和数据的加密交换的计算机实现***和方法
CN105530238B (zh) * 2014-10-20 2020-10-02 塔塔咨询服务有限公司 用于安全对话建立和数据的加密交换的计算机实现***和方法
CN114499969A (zh) * 2021-12-27 2022-05-13 天翼云科技有限公司 一种通信报文的处理方法、装置、电子设备及存储介质
CN115442026A (zh) * 2022-11-07 2022-12-06 苏州浪潮智能科技有限公司 一种hmac算法处理***、方法、设备及介质

Also Published As

Publication number Publication date
US20140298037A1 (en) 2014-10-02
EP2779524A4 (en) 2015-01-14
CN103166931A (zh) 2013-06-19
EP2779524A1 (en) 2014-09-17

Similar Documents

Publication Publication Date Title
WO2013087039A1 (zh) 一种安全传输数据方法,装置和***
US9621545B2 (en) System and method for connecting client devices to a network
WO2018076365A1 (zh) 密钥协商方法及装置
KR102068367B1 (ko) 사물인터넷을 위한 데이터그램 전송에서 경량 인증을 위한 컴퓨터 구현 시스템 및 방법
JP5414898B2 (ja) 有線lanのセキュリティアクセス制御方法及びそのシステム
JP6896940B2 (ja) 第1のアプリケーションと第2のアプリケーションとの間の対称型相互認証方法
WO2022021992A1 (zh) 一种基于NB-IoT通信的数据传输方法、***及介质
CN107612889B (zh) 防止用户信息泄露的方法
WO2010078755A1 (zh) 电子邮件的传送方法、***及wapi终端
WO2006131061A1 (fr) Procede d'authentification et procede de transmission d'informations correspondant
KR100842267B1 (ko) 다중 인증 수단을 가지는 시스템의 통합 사용자 인증 서버,클라이언트 및 방법
WO2011076008A1 (zh) 一种wapi终端与应用服务器传输文件的***及方法
CN109714360B (zh) 一种智能网关及网关通信处理方法
WO2009082717A2 (en) A method for authenticating a communication channel between a client and a server
JP2016526844A (ja) 制約リソースデバイスのための鍵確立
JP2008125075A5 (zh)
WO2016011588A1 (zh) 移动管理实体、归属服务器、终端、身份认证***和方法
JP2016514913A (ja) セッション鍵を確立する方法および装置
CN111654481B (zh) 一种身份认证方法、装置和存储介质
KR101704540B1 (ko) M2m 환경의 다중 디바이스 데이터 공유를 위한 그룹키 관리 방법
WO2012048552A1 (zh) 网络访问控制方法及***
WO2017206185A1 (zh) 验证应用程序合法性的方法、装置及***
KR20210126319A (ko) 키 관리 장치 및 방법
WO2012000313A1 (zh) 一种家庭网关认证方法和***
KR101256114B1 (ko) 다수의 mac검증서버에 의한 메시지인증코드 검증 방법 및 시스템

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

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2012857397

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2012857397

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE