WO2023236925A1 - 一种认证方法和通信装置 - Google Patents
一种认证方法和通信装置 Download PDFInfo
- Publication number
- WO2023236925A1 WO2023236925A1 PCT/CN2023/098486 CN2023098486W WO2023236925A1 WO 2023236925 A1 WO2023236925 A1 WO 2023236925A1 CN 2023098486 W CN2023098486 W CN 2023098486W WO 2023236925 A1 WO2023236925 A1 WO 2023236925A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- client
- key
- authentication
- server
- token
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 108
- 238000004891 communication Methods 0.000 title claims abstract description 84
- 230000015654 memory Effects 0.000 claims description 20
- 238000012552 review Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 15
- 230000006870 function Effects 0.000 description 44
- 238000012545 processing Methods 0.000 description 29
- 238000012795 verification Methods 0.000 description 19
- 230000008878 coupling Effects 0.000 description 5
- 238000010168 coupling process Methods 0.000 description 5
- 238000005859 coupling reaction Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000013478 data encryption standard Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000001010 compromised effect Effects 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 241001417527 Pempheridae Species 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000012550 audit Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000005336 cracking Methods 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000001356 surgical procedure Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
Definitions
- the embodiments of the present application relate to the field of communications, and in particular, to an authentication method and a communications device.
- the Internet of things is an Internet that connects things. It can realize the interconnection between objects and objects, and between people and objects, and realize intelligent perception, identification and management of objects and processes.
- the client In order to protect the security of the Internet of Things, when the client accesses the Internet of Things, the client needs to be authenticated by the server. When the identity authentication of the device passes, the client is allowed to access the Internet of Things. The client and server will store a common pre-shared key and perform authentication based on the pre-shared key to determine the legitimacy of the other party. But once the pre-shared key is leaked, the security of the Internet of Things is threatened.
- Embodiments of the present application provide an authentication method and communication device, which can update the shared key between the client and the server and improve the security of the authentication process.
- an authentication method including: the server receives authentication information from the client, the authentication information is used by the server to perform first authentication on the client, and the authentication information includes a token A token generated by parameters, the token parameters include a first key and a unique identifier, the unique identifier uniquely corresponds to the client; the server determines the client based on the unique identifier The number of successful authentications, the number of successful authentications is the number of successful authentications of the client before performing the first authentication; the server determines whether the client passes the first authentication based on the number of successful authentications.
- the first key is updated after authentication.
- the server after receiving the client's authentication information, the server obtains the client's corresponding unique identifier DUID based on the token in the authentication information, so that the number of successful authentications of the client before this authentication can be determined based on the DUID. , and determine whether to update the first key after the first authentication is successful based on the number of successful authentications.
- the token includes a plaintext part and a ciphertext part
- the plaintext part includes the unique identifier
- the ciphertext part is generated by a ciphertext parameter.
- the ciphertext parameters include the unique identifier and the first key.
- the plaintext part includes the unique identifier, so that the server can query the number of successful authentications corresponding to the client based on the unique identifier in the plaintext part, and the ciphertext part is used by the server to authenticate the client.
- the ciphertext part includes
- the unique identifier may not be set in the plain text part of the token, but may be carried in the authentication information and sent to the server together with the token, or may not be sent with the authentication information, but through other information.
- the server can authenticate the client based on the obtained unique identifier, and only include the unique identifier and the first key in the ciphertext parameters, which can reduce the length of the token and improve the security of the authentication.
- the method further includes: the server determines, based on the DUID, whether the DUID can be queried on the server;
- the server determines that the client's first authentication fails.
- the server will query whether the DUID exists in its file system or database based on the DUID. If the DUID does not exist, it proves that the client is a counterfeit, and therefore it is determined that the client's first authentication failed, which improves Authentication system security.
- the server determines whether to update the first key after the client passes the first authentication based on the number of successful authentications, including : When the number of successful authentications is 0, the server determines to update the first key after the client passes the first authentication.
- the server determines that the number of successful authentications of the client before this authentication is 0, that is, this authentication is the first authentication. After the client passes the first authentication, the server will immediately update the shared first key (pre-shared key) with the client. Therefore, the pre-shared key stored in the client can only protect the client once and is used again. Update immediately after one time, improving client security.
- the server determines whether to update the first key after the client passes the first authentication based on the number of successful authentications, including : When the number of successful authentications is not 0, after the client passes the first authentication, the server determines the life cycle of the first key; when the life cycle of the first key When the life cycle is greater than the preset life cycle, the server determines to update the first key.
- the server determines that for the client, the number of successful authentications before this authentication is not 0, that is, this authentication is not the first authentication. After the client's first authentication passes, the server needs to determine the life cycle of the first key used for this authentication. When the life cycle of the first key exceeds the preset life cycle, the server determines to update the first key. This facilitates subsequent authentication of the client.
- the life cycle of the first key includes the number of uses of the first key or the use time of the first key.
- the life cycle of the first key is the number of uses of the first key.
- the server will set a parameter indicating the number of uses of the first key in its database or file system.
- the number of uses is preset to 0, and every time the client successfully authenticates, the number of uses increases by 1. For example, the life cycle of a key is 10 times. If the number of uses is 10 after passing the first authentication, that is, the life cycle of the first key reaches the preset life cycle, and the server will perform the process of updating the first key. .
- the life cycle of the first key is the usage time of the first key
- the server will preset the time to generate the first key in its system, for example, it may specify the time for generating the first key.
- the acquisition time of the first key parameter is the start time of use of the first key.
- the server After each successful authentication, the server will determine the difference between the current time and the start time of use of the first key. When the predetermined time is reached, After the life cycle, for example, 3 days, the first key is updated.
- the method further includes: the server determines the status of the first key according to the unique identifier, and the status of the first key The status is used to indicate whether the first key is safe; wherein the server determines whether to update the first key after the client passes the first authentication based on the number of successful authentications, including: The server determines whether to update the first key after the client passes the first authentication based on the number of successful authentications and the status of the first key.
- the server will also determine the status of the first key based on the unique identifier, so that the client can determine whether to update the third key after the first authentication based on the status of the first key and the number of successful authentications.
- a key the status of the first key based on the unique identifier
- the server determines whether the client passes the first authentication based on the number of successful authentications and the status of the first key. Updating the first key includes: when the status of the first key indicates that the first key is unsafe, the server authenticates the client after the client passes the first authentication. The client performs an identity review; the server determines to update the first key after the client passes the identity review.
- the security of the first key may be monitored by the server.
- the server When the security of the first key is threatened, after the server successfully authenticates the client using the first key, the server will conduct an identity review on the client. When the identity review passes, the server will update the first key. , when the identity verification fails, the client will be denied access to the Internet of Things.
- updating the first key by the server includes: the server obtains a second key parameter, and the second key parameter is used to generate the second key, so The second key is used for the next authentication of the client; the server sends the second key parameter to the client.
- the server generates a second key parameter and sends the second key parameter to the client, so that the server and the client can generate a new second key according to the agreed algorithm to update the first key parameter.
- the second key parameter may be a random number, and the server and the client use the same algorithm to generate the second key using the random number and the first key.
- the method further includes: the server receiving a reset request from the client; the server verifying that the client's identity is authentic; The server sets the number of successful authentications to 0 according to the reset request.
- a user with a real identity can use the client to send a reset request to the server.
- the shared key is restored to the pre-shared key (the key stored when the client leaves the factory).
- the server After the server receives the request and verifies the client's identity, it can reset the key used by the server to the pre-shared key, and The number of successful authentications is reset to 0, so that the subsequent server and client can be authenticated according to the technical solution of this application.
- the token parameter further includes a timestamp or a sequence number.
- a timestamp or sequence number is set in the token to prevent attackers from performing replay attacks and improve the security of the authentication process.
- the token parameter further includes a random number
- the method further includes: the server sending the random number to the client.
- a random number is set in the token, and the random number can be generated by the server.
- the server sends the generated random number to the client, so that the client can generate a username based on the random number.
- the token used for authentication improves the security of the authentication process.
- the random number is generated by the server, which improves the security of the random number.
- the token parameter further includes a server identifier.
- the server identifier is added to the token, thereby preventing attackers from performing reflection attacks and improving the security of the authentication system.
- the token includes a plaintext part and a ciphertext part
- the ciphertext part is generated by a symmetric encryption function or a one-way function.
- the unique identifier is generated by at least one of the following: Including: client identification, user identification, media access control MAC address, Bluetooth MAC, serial SN number, International Mobile Subscriber Identity code IMEI, International Mobile Subscriber Identity code IMSI and random serial number.
- the unique identifier is generated by at least one of the above parameters, thereby uniquely identifying a client, and combining the unique identifier into the token to improve the security of the authentication process.
- the parameters used may have certain rules, and a unique identifier without rules may be generated based on the parameters through a one-way algorithm or other functions.
- an authentication method including: the client sends authentication information to the server, the authentication information is used by the server to perform first authentication on the client, and the authentication information includes a token,
- the token is generated according to token parameters, the token parameters include a first key and a unique identifier, the unique identifier uniquely corresponds to the client, and the unique identifier is used for the service
- the client determines the number of successful authentications of the client before performing the first authentication.
- the client sends authentication information to the server, so that the server can determine the number of successful authentications of the client based on the unique identifier in the token of the authentication information, and perform subsequent operations based on the number of successful authentications.
- the token parameter further includes a timestamp or a sequence number.
- the token parameter further includes a random number
- the method further includes: the client receiving the random number sent by the server.
- the method further includes: the client generating the authentication information according to the random number.
- the token parameter further includes a server identifier.
- the token includes a plaintext part and a ciphertext part
- the ciphertext part is generated by a symmetric encryption function or a one-way function.
- the unique identifier is generated by at least one of the following: client identification, user identification, media access control MAC address, Bluetooth MAC, serial SN number, international Mobile subscriber identity code IMEI, international mobile subscriber identity code IMSI and random serial number.
- a communication device (such as a server) is provided.
- the communication device includes: a transceiver unit configured to receive authentication information from a client.
- the authentication information is used for the first authentication of the client.
- the authentication The information includes a token generated by a token parameter, the token parameter including a first key and a unique identifier, the unique identifier uniquely corresponds to the client; a processing unit configured to use the unique identifier according to the , determine the number of successful authentications of the client, where the number of successful authentications is the number of successful authentications of the client before performing the first authentication; the processing unit is also configured to determine whether based on the number of successful authentications, The first key is updated after the client passes the first authentication.
- the communication device receives the authentication information of the client through the transceiver unit, and the processing unit can determine the number of successful authentications of the client based on the unique identifier in the token of the authentication information, and thereby determine whether to update the authentication based on the number of successful authentications.
- the first key in the message is the first key in the message.
- the token includes a plaintext part and a ciphertext part
- the plaintext part includes the unique identifier
- the ciphertext part is generated by ciphertext parameters.
- the ciphertext parameters include the unique identifier and the first key.
- the processing unit is specifically configured to, when the recognition When the number of successful authentications is 0, it is determined that the first key is updated after the client passes the first authentication.
- the processing unit is specifically configured to: determine the first password when the number of successful authentications is not 0. The life cycle of the key; when the life cycle of the first key is greater than the preset life cycle, the processing unit is also used to determine to update the first key.
- the life cycle of the first key includes the number of uses of the first key or the use time of the first key.
- the processing unit is further configured to determine the status of the first key according to the unique identifier, and the status of the first key is expressed in To indicate whether the first key is safe; the processing unit is specifically configured to: determine whether the client passes the first authentication based on the number of successful authentications and the status of the first key. Update the first key.
- the processing unit is specifically configured to: when the status of the first key indicates that the first key is unsafe, the client passes the After the first authentication, an identity review is performed on the client; after the client passes the identity review, it is determined to update the first key.
- the transceiver unit is also used to receive a reset request from the client; the processing unit is also used to verify that the identity of the client is authentic. ; The processing unit is further configured to set the number of successful authentications to 0 according to the reset request.
- the token parameter further includes a timestamp or a sequence number.
- the token parameter further includes a random number
- the transceiver unit is further configured to send the random number to the client.
- the token parameter further includes a server identifier.
- the token includes a plaintext part and a ciphertext part, and the ciphertext part is generated by a symmetric encryption function or a one-way function.
- the unique identifier is generated by at least one of the following: client identification, user identification, media access control MAC address, Bluetooth MAC, serial SN number, international Mobile subscriber identity code IMEI, international mobile subscriber identity code IMSI and random serial number.
- a communication device for example, a client
- a transceiver unit configured to send authentication information to a server, where the authentication information is used by the server to perform first authentication on the client.
- the authentication information includes a token generated by token parameters
- the token parameters include a first key and a unique identifier
- the unique identifier uniquely corresponds to the client
- the unique identifier is used to
- the server determines the number of successful authentications of the client, and the number of successful authentications is the number of successful authentications of the client before performing the first authentication.
- the token parameter further includes a timestamp or a sequence number.
- the token parameter further includes a random number
- the transceiver unit is further configured to receive the random number sent by the server.
- the communication device further includes a processing unit configured to generate the authentication information according to the random number.
- the token parameter further includes a server identifier.
- the token includes a plaintext part and a ciphertext part, and the ciphertext part is generated by a symmetric encryption function or a one-way function.
- the unique identifier is generated by at least one of the following: client identification, user identification, media access control MAC address, Bluetooth MAC, serial SN number, international shift Mobile Subscriber Identity Code IMEI, International Mobile Subscriber Identity Code IMSI and random serial number.
- a communication device for example, a server
- the communication device includes: one or more processors; one or more memories; the one or more memories store one or more computer programs , the one or more computer programs include instructions that, when executed by the one or more processors, cause the communication device to perform the following steps: receive authentication information from the client, the authentication information is used to The server performs first authentication on the client.
- the authentication information includes a token generated by token parameters.
- the token parameters include a first key and a unique identifier.
- the unique identifier is the same as the token.
- the client uniquely corresponds to the client; according to the unique identifier, the number of successful authentications of the client is determined, and the number of successful authentications is the number of successful authentications of the client before performing the first authentication; according to the successful authentication times to determine whether to update the first key after the client passes the first authentication.
- the communication device when the instructions are executed by the one or more processors, the communication device is caused to perform the following steps: when the number of authentication successes is 0 , determining to update the first key after the client passes the first authentication.
- the communication device when the instructions are executed by the one or more processors, the communication device is caused to perform the following steps: when the number of authentication successes is not 0 When the client passes the first authentication, determine the life cycle of the first key; when the life cycle of the first key is greater than the preset life cycle, determine to update the first key key.
- the life cycle of the first key includes the number of uses of the first key or the use time of the first key.
- the communication device when the instructions are executed by the one or more processors, the communication device is caused to perform the following steps: determining the unique identifier according to the unique identifier. The status of the first key is used to indicate whether the first key is safe; the number of successful authentications and the status of the first key are used to determine whether the first key is secure on the client. The first key is updated after passing the first authentication.
- the communication device when the instructions are executed by the one or more processors, the communication device is caused to perform the following steps: when the status of the first key When it is indicated that the first key is unsafe, an identity review is performed on the client after the client passes the first authentication; and it is determined to update the first key after the client passes the identity review.
- the communication device when the instructions are executed by the one or more processors, the communication device is caused to perform the following steps: receiving a reset request from the client; Verify that the client identity is authentic; set the number of successful authentications to 0 according to the reset request.
- the token parameter further includes a timestamp or a sequence number.
- the token parameter further includes a random number, which causes the communication device to perform the following steps when the instructions are executed by the one or more processors. : Send the random number to the client.
- the token parameter further includes a server identifier.
- the token includes a plaintext part and a ciphertext part, and the ciphertext part is generated by a symmetric encryption function or a one-way function.
- the unique identifier is generated by at least one of the following: client identification, user identification, media access control MAC address, Bluetooth MAC, serial SN number, international Mobile subscriber identity code IMEI, international mobile subscriber identity code IMSI and random serial number.
- a communication device (eg, client)
- the communication device including: one or more processors; one or more memories; the one or more memories store one or more computer programs , the one or more computer programs include instructions that, when executed by the one or more processors, cause the communication device to perform the following steps: sending authentication information to the server, the authentication information being used to The server performs first authentication on the client.
- the authentication information includes a token generated by token parameters.
- the token parameters include a first key and a unique identifier.
- the unique identifier is the same as the token.
- the unique identifier corresponds to the client, and the unique identifier is used by the server to determine the number of successful authentications of the client before performing the first authentication.
- the token parameter further includes a timestamp or a sequence number.
- the token parameter further includes a random number, which causes the communication device to perform the following steps when the instruction is executed by the one or more processors. : Receive the random number sent by the server.
- the token parameter further includes a server identifier.
- the token includes a plaintext part and a ciphertext part, and the ciphertext part is generated by a symmetric encryption function or a one-way function.
- the unique identifier is generated by at least one of the following: client identification, user identification, media access control MAC address, Bluetooth MAC, serial SN number, international Mobile subscriber identity code IMEI, international mobile subscriber identity code IMSI and random serial number.
- a computer-readable storage medium including a computer program.
- the computer program When the computer program is run on a computer, it causes the computer to execute the first aspect or any implementation of the first aspect and the second aspect. Or any method of implementing the second aspect.
- a communication device including at least one processor, the processor being coupled to a memory, the memory being used to store instructions, and when the instructions are run by the processor, they cause the processor to execute The first aspect or any implementation of the first aspect and the second aspect or any implementation of the second aspect.
- a computer program product includes computer program code or instructions.
- the computer program code or instructions When the computer program code or instructions are executed on a computer, the computer program code or instructions cause the computer to execute the first aspect or any aspect of the first aspect.
- Figure 1 shows an architectural diagram of a communication system applicable to the embodiment of the present application.
- Figure 2 shows a schematic flow chart of an authentication method provided by an embodiment of the present application.
- Figure 3 shows a schematic flow chart of another authentication method provided by an embodiment of the present application.
- Figure 4 shows a schematic flow chart of another authentication method provided by an embodiment of the present application.
- Figure 5 shows a schematic flow chart of another authentication method provided by an embodiment of the present application.
- Figure 6 shows a schematic flow chart of another authentication method provided by an embodiment of the present application.
- Figure 7 shows a schematic block diagram of another communication device provided by an embodiment of the present application.
- Figure 8 shows a schematic block diagram of another communication device provided by an embodiment of the present application.
- Figure 9 shows a schematic block diagram of another communication device provided by an embodiment of the present application.
- Replay attacks Also known as replay attacks and replay attacks, the attacker sends a packet that has been received by the destination host to achieve the purpose of deceiving the system. It is mainly used in the identity authentication process to destroy the correctness of the authentication. Replay attacks can be carried out by an adversary that intercepts and retransmits the data. The attacker uses network monitoring or other methods to steal the authentication information generated by the authentication key, and then resends the authentication information to the server. Replay attacks can occur during various network communications and are one of the common attack methods used by hackers in the computer world.
- IoT networks may include the Internet of Vehicles.
- vehicle to X vehicle to vehicle
- V2X vehicle to vehicle
- X vehicle to network
- V2N vehicle and network
- the client of this application may also be called user equipment, Internet of Things client, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment , user agent or user device, etc., are collectively referred to as clients below.
- the client can be an MTC terminal, a computer with wireless transceiver function, an Internet of Things terminal, a virtual reality client, an augmented reality client, a wearable device, a vehicle, a terminal in D2D communication, a terminal in V2X communication, or a terminal in smart office.
- Terminals terminals in industrial control, terminals in driverless driving, terminals in remote surgery, terminals in smart grids, terminals in transportation security, terminals in smart cities, or terminals in smart homes, etc.
- the embodiments of this application do not limit the specific technology and specific device form used by the client.
- Figure 1 shows a schematic architectural diagram of a communication system applicable to the embodiment of this application.
- the communication system includes a server 110, a client 120 and a client 130.
- the two clients and the server 110 are connected through a network.
- the client 120 can be a mobile terminal such as a mobile phone
- the client 130 can be a smart client such as a sweeper
- the server 110 can be a cloud server, a local server, or a terminal device.
- the server 110 will perform identity authentication on the client in order to control the behavior of accessing the Internet of Things and improve the security of the Internet of Things.
- the identity authentication scheme used by the server for the client generally includes authentication initiated by client A or authentication initiated by server B.
- client A when client A wants to access the Internet of Things, client A can send an authentication message to server B, and then server B verifies the authentication message, thereby authenticating client A.
- both client A and server B store the same pre-shared key (PSK), and the authentication message sent by client A to server B includes a token generated by the pre-shared key, for example
- the token Token AB sent by client A to server B [ TA
- T A is the timestamp
- N A is the sequence number
- N A ] indicates choosing one of them.
- the specific choice depends on the technical capabilities and environment of the client and server.
- fK AB (X) represents the cryptographic verification value calculated for data X using the cryptographic verification function f and the pre-shared key K AB .
- Text1 and Text2 are text fields, Text1 is known to B, or is contained in Text2.
- B in the formula represents the identity identifier of server B. Whether to include identity identifier B in the token is optional. When identity identifier B is included, it can prevent the attacker from impersonating server B and reusing the token for client A.
- Token AB but identifier B can be omitted in an environment where such attacks do not exist.
- server B can check the timestamp or sequence number and calculate fK AB ([ TA
- server B can send a random number to client A, and server B can also send a text field Text1 to client A, so that the client can generate a token based on the random number and text field Text1.
- Client A sends the generated token to Server B for identity authentication, and Server B authenticates Client A based on the token.
- server B sends a random number and text field Text1 to client A because it receives a message requesting login authentication from client A, thereby sending some parameters for authentication to the client. Initiate identity authentication for client A.
- the confidentiality of the pre-shared key K AB plays an important role in the security of the entire authentication process.
- the pre-shared key is generally determined at the factory, and all clients of the same type will use the same pre-shared key. Shared key. If the pre-shared key is violently cracked or leaked by an attacker, the ciphertext part encrypted by the password verification function or symmetric encryption function will be easier to crack, and the security of IoT access cannot be guaranteed, and all this type of Client security is compromised.
- embodiments of the present application provide an authentication method that can increase the security of the authentication process.
- Figure 2 shows an authentication method provided by an embodiment of the present application.
- the method includes:
- the server receives authentication information from the client.
- the authentication information is used by the server to perform first authentication on the client.
- the authentication information includes a token, and the token is generated according to token parameters.
- the token parameter includes a first key and a unique identifier of the client, and the unique identifier uniquely corresponds to the client.
- the client sends the authentication information to the server.
- the unique identifier (device unique ID, DUID) uniquely corresponds to the client.
- the unique identifier of each client or the parameter information for generating the unique identifier is preset in the server database (or file system).
- Each client's unique identifier is unique and long enough that its unique identifier cannot be easily cracked through enumeration, etc.
- the unique identifiers of different clients are not consecutive numbers and have no other obvious patterns, making it difficult to guess the unique identifier of one device from the unique identifier of another device.
- the unique identifier can be generated by at least one of the following: client identification (deviceID), user identification, media access control (media access control, MAC) address, Bluetooth MAC, serial number (serial number, SN), International Mobile Equipment Identity (IMEI), International Mobile Subscriber Identification (IMSI) and random serial number. DUID can also be further set in combination with factory date, IP address, etc., thereby improving its security.
- the unique identifier when authentication is through an application on the client applying for authentication to the server, can also be regarded as uniquely corresponding to the application on the client that needs to be authenticated to the server.
- the security factor of the transmission channel used by the client for authentication is relatively high, and a unique identifier can be formed by concatenating or splicing several items of the above information.
- the DUID can be generated by using a function.
- the DUID can be generated by hash-based message authentication code (HMAC), key derivation function algorithm 2 (password-based keyderivation function 2, PBKDF2), advanced encryption standard algorithm (advance encryption standard, AES), DES (data encryption standard, data encryption standard) and other methods are generated.
- HMAC hash-based message authentication code
- PBKDF2 key derivation function algorithm 2
- AES advanced encryption standard algorithm
- DES data encryption standard, data encryption standard
- DUID HMAC(Key, deviceID
- the DUID can be preset in the client system, and the server can preset the same DUID or the key and the parameters for generating the DUID.
- the parameters for generating DUID can be preset in the client system, and the server and client can share the key and generate DUID for use through the same algorithm.
- the key used to generate the DUID here is generally different from the key used to generate the authentication information.
- the authentication information can be sent in the form of a token or the authentication information includes the token, which is the information used by the client to prove its identity to the server.
- the first key and the unique identifier may be included in the token parameters used to generate the token.
- the authentication information includes the above-mentioned DUID that is not easy to guess, even if the PSK is leaked, the attacker cannot directly impersonate the client for authentication because the DUID is confidential. Including the unique identifier in the token prevents attackers from reverse engineering and brute force cracking of the client, threatening the client's security.
- the token includes a plaintext part and a ciphertext part.
- the plaintext part may include DUID, and the plaintext part may also include some parameters to prevent replay attacks, such as timestamp, sequence number, random number, etc.
- the plain text part is "timestamp
- the ciphertext part can be generated through ciphertext parameters, which can include DUID.
- the ciphertext parameters can also include some parameters used to prevent replay attacks, such as timestamps, sequence numbers, random numbers, etc.
- the ciphertext part is "HMAC (Key1, timestamp
- the plaintext and ciphertext parts can be concatenated to form the entire token.
- the first key is Key1 in the Token, and the client uses the first key to generate the ciphertext part of the token.
- the ciphertext part of the token can be generated using one-way function algorithms such as HMAC and PBKDF2 through the first key and the timestamp
- the server can authenticate the client based on the authentication information.
- the server can first query the DUID in plain text. Only after querying the server's file system or database for the existence of the DUID can the client or client application pass the server's authentication.
- the server continues to verify the parameters to prevent replay attacks.
- token Token timestamp
- DUID) is timestamp.
- the server can be set to authenticate only the authentication information whose difference between the timestamp and the current timestamp is within a certain range. For example, the server can determine whether the difference between the timestamp and the current time is within 1 minute. If the difference between the timestamp and the current time exceeds After 1 minute, it is determined that the client's first authentication result is failed, and the client is denied access to the Internet of Things.
- the server can process the cipher text part of the authentication information.
- the DUID can be used to search in the server's database or file system to obtain the currently valid key.
- Key1' using this key and the timestamp obtained from the plain text part, the DUID and the stored server identification,
- the Token is the same, which means that the server and the client use the same algorithm and the same key to generate the token. Since the key is generally known only to the client and the server, the server can judge the client. Passed certification.
- the plaintext in the token and the parameters used to prevent replay attacks in the ciphertext can be replaced by a sequence number, that is, the token parameters used to generate the token can include a timestamp or a sequence number.
- the sequence number and timestamp have similar functions.
- the server can query the server's file system or database to see if the serial number is the one that should be used currently. If not, the authentication will fail. For example, sequence numbers 1-5 have been used in previous authentications, then the first authentication should use sequence number 6 to generate authentication information for this authentication. If the serial number used by the client in the first authentication is not 6, it can be determined that the The client's authentication failed.
- the timestamp and sequence number may not be set in the plaintext of the token but only in the ciphertext part of the token.
- the timestamp and sequence number may be transmitted simultaneously with the token in the authentication information, or the timestamp and sequence number may be The number may not be transmitted in the authentication information, but transmitted to the server through other information, so that the server can use the same algorithm to generate the ciphertext part for verification based on the timestamp or sequence number.
- Token DUID
- sequence number] represents one of the timestamp or sequence number
- Key2 is the key used to generate the ciphertext part of the token.
- the timestamp can also be replaced with a random number, which in some embodiments can be generated by the client.
- the server in order to obtain a more secure random number, can generate a random number and send the random number to the client, so that the client can send authentication information based on the random number.
- the token parameter further includes a random number
- the method further includes: the server sending the random number to the client.
- the client receives the random number sent from the server. The sending of the random number may be triggered based on the authentication request information from the client to the server.
- the random number does not need to be set in the plain text of the token.
- the server When the server generates the random number, it will send the random number to the client. Therefore, there is no need to send an additional random number to the client.
- the token parameters used to generate the token can include one of timestamp, sequence number, and random number.
- the DUID may not be set in the clear text of the token, but may be sent separately in the authentication information, or it may not be sent together with the information including the token, but may be sent to the server in separate information, in which case , the authentication information includes the information of the DUID and the information of the token.
- the token or the ciphertext part of the token is generated by a one-way function.
- the token can also be generated by other functions or algorithms.
- the token can also be generated using a symmetric encryption algorithm.
- the ciphertext part of the symmetric encryption algorithm can restore the plaintext through the key used for encryption. Therefore, after the client uses the key to encrypt the text field to form ciphertext, the server needs to know the key that can decrypt the ciphertext, decrypt the ciphertext part based on the key, and then verify the decrypted text field. Whether the various parameters meet the requirements. Since the ciphertext part can be decrypted through the key Therefore, the parameters used to prevent replay attacks when generating a token do not need to be set in the plain text part, but can be decrypted and then verified by the server.
- Token DUID
- DUID is encrypted.
- AES symmetric encryption algorithm used
- Token DUID
- the plaintext part is DUID
- the ciphertext part is the result obtained by encrypting the text field ([timestamp
- the timestamp or sequence number can be replaced with a random number, and in scenarios that do not include reflection attacks, the server identification in the ciphertext part can be omitted.
- the server uses the key shared with the client to decrypt the ciphertext part of the token.
- the decryption process can be understood as using the key to obtain the ciphertext part by the inverse operation of the encryption algorithm. The corresponding plain text. And verify the timestamp or serial number and DUID.
- the decryption is successful and the timestamp or serial number and DUID meet the requirements, it is judged that the client has been authenticated. Specifically, the timestamp needs to be within the preset time range, the serial number needs to be the target serial number that should be used for this authentication, and the DUID needs to be queryable in the server's file system or database.
- the DUID may not be set in the clear text part of the token, but may be sent to the server device at the same time or not at the same time as the token for server authentication and obtaining the currently valid key. For example, it may be sent with the token. At the same time, it is sent to the server device in the authentication information.
- the above-mentioned token form is only for illustrating the technical solution of the present application, and the token is not limited to being consistent with the above-mentioned illustrative form.
- " may be somewhat different from what was shown above.
- the parameters used to generate the ciphertext may also include other parameters, such as other text fields shared by the server and the client.
- the ciphertext part of the authentication information in the above example uses HMAC and AES algorithms as examples.
- the ciphertext part can also use other encryption methods, such as symmetric encryption algorithms such as SM4, DES, and RC5, or one-way functions such as PBKDF2 and Scrypt.
- symmetric encryption algorithms such as SM4, DES, and RC5
- RC5 symmetric encryption algorithms
- PBKDF2 and Scrypt.
- S220 The server determines the number of successful authentications of the client before performing the first authentication based on the unique identifier.
- the number of successful authentications is the number of successful authentications of the client before performing the first authentication.
- S230 The server determines whether to update the first key after the client passes the first authentication based on the number of successful authentications.
- the authentication method provided by the embodiment of this application will query the number of successful authentications of the corresponding client based on the DUID, and determine whether to update the first key based on the number of successful authentications for subsequent authentication of the client.
- the server determines whether to update the first key after the client passes the first authentication based on the number of successful authentications, including: when the number of successful authentications is 0, the service The terminal determines to update the first key after the client passes the first authentication.
- the first key is a pre-shared key.
- the pre-shared key is an initial key shared by the client and the server.
- the pre-shared key is preset in the client's system when the client leaves the factory. For different clients, their pre-shared keys are the same. After that, the effective key of each client will be updated according to the technical solution of this application, and the updated keys will be different, thereby improving the efficiency of each client. End security.
- the server determines that the client's authentication is the first authentication based on the client's successful authentication times, it can query the pre-shared key corresponding to the DUID from the server's file system or database to authenticate the client.
- the server When the client passes the first authentication, the server will update the key used for authentication, so that the pre-shared key only protects the client once and becomes invalid immediately after the first authentication. Specifically, the server will obtain the second key parameter.
- the server can generate the second key parameter or obtain the second key parameter through other devices connected to the server.
- the second key parameter can be used to generate the second key parameter.
- the second key parameter can be a random number
- the second key Key2 HMAC (Key1, N1), that is, the second key is obtained by using different algorithms to calculate the random number and the first key, or the second key The key is generated based on the first key.
- the server may store the second key parameters used to generate the second key in its file system or database, or may directly store the obtained second key in the file system of the server. Afterwards, the server can send the second key parameter to the client, so that the client can generate the second key according to the same algorithm as the server for the next authentication of the client.
- the second key may not be generated based on the first key. No matter how the second key is generated, the server and the client can update the key in the same way through pre-negotiation or regulations.
- the server determines whether to update the first key after the client passes the first authentication based on the number of successful authentications, including: when the number of successful authentications is not 0. , after the client passes the first authentication, the method further includes: the server determines the life cycle of the first key; when the life cycle of the first key is greater than the preset life cycle When, the server determines to update the first key.
- the server can obtain the life cycle of the first key.
- the server determines that the life cycle of the first key is greater than the preset life cycle, the server updates the first key.
- the life cycle of the first key may include the number of uses of the first key or the use time of the first key.
- the life cycle of the key can be set empirically or preset, and can be updated. Specifically, when the life cycle is the number of uses of the first key, the server can set parameters in its file system or database that represent the number of uses of the first key. When the server generates the first key parameter, this parameter is set to 0. When the client successfully authenticates using the first key, this parameter will become 1. For example, its life cycle can be set to 100 times, so that this parameter After reaching 100, the server sends the generated third key parameter to the client, which is used to generate the third key for the client's next use, and the parameter is reset to 0.
- the server can record the initial timestamp when generating the first key parameters.
- the server can compare the current timestamp with the initial timestamp. Whether the difference exceeds the lifetime of the first key. For example, the life cycle of the first key can be set to 3 months. If the life cycle of the first key exceeds the life cycle of the first key, the third key parameter can be sent to the client to generate the third key and record the generation of the third key. key parameter or the timestamp when the third key parameter was sent to the client.
- the key used by the client will be updated regularly, even if the key currently used If the key is leaked, the key may have been updated by the time the attacker uses it, thereby improving the security of the system.
- the server can also determine the status of the first key based on the unique identifier, and the status of the first key is used to indicate whether the first key is safe; Wherein, the server determines whether to update the first key after the client passes the first authentication based on the number of successful authentications, including: the server determines whether to update the first key based on the number of successful authentications and the number of successful authentications. The status of the first key determines whether to update the first key after the client passes the first authentication.
- the server when the server determines whether to update the first key after the client passes the first authentication, it will also determine it based on the status of the first key, that is, based on whether the first key is safe and the number of successful authentications. Whether to update the first key.
- the server determines whether to update the first key after the client passes the first authentication based on the number of successful authentications and the status of the first key, including : When the status of the first key indicates that the first key is unsafe, the server may perform an identity review on the client after the client passes the first authentication; the service The client determines to update the first key after the client identity review passes.
- the server can monitor the security of the first key.
- the server determines that the security of the first key is threatened, after the client passes the first authentication, the server will conduct an identity review and verify the client's identity. After passing the review, the first key is updated. Specifically, the server can obtain a fourth key parameter, which is used to generate a fourth key, and the fourth key is used for the next authentication of the client; the server sends the fourth key parameter to the client. Key parameters.
- the server believes that the security of the currently used key has certain threats, after the client passes the first authentication, that is, after the server verifies the token through the method introduced above (the client holds the first key), the server will also perform further identity authentication on the client to verify that the person holding the first key is the real first client or the corresponding user. If the identity authentication fails, the client is not allowed to proceed to the next step. If authentication passes, the client is allowed to perform other operations and the key is updated.
- Identity verification methods can be as follows: for example, by verifying the bound mobile phone number, verifying the email address, verifying through preset identity verification questions, etc.
- the server can set the security indication parameter of the key.
- the security indication parameter can default to 1.
- the security indication parameter can be used to indicate the security of the key currently stored on the server.
- the server can set its security indication parameter to 0, so that after the client passes the first authentication using the first key and the identity verification passes, start Update key process.
- the server After the server sends the new fourth key parameter to the client, the server stores the new fourth key parameter or key, and resets the security indication parameter to 1.
- both the third key and the fourth key can be generated in a manner similar to the generation of the second key introduced above, which will not be described again here.
- the client when the client is reset by the user, such as restoring factory settings, the client loses the originally stored key; or before the client performs the first authentication, the attacker guesses the client's DUID and impersonates the client.
- the first authentication is performed, so the key stored in the server's file system or database has been updated, but the client only stores the pre-shared key, so when the client uses the pre-shared key for authentication, the authentication cannot succeed.
- a normal user can send a reset request to the server by using the client.
- the server receives the client's reset request.
- the server verifies that the client's identity is true.
- the server will update the previous text based on the reset request.
- the number of successful authentications is set to 0, and the key is reset to the pre-shared key. Then the client can use the pre-shared key to apply to the server for authentication.
- the server can verify whether the client's identity is authentic through the following methods: The user uses the client Bind an account on the client, register a mobile phone to send a verification code, register an email to send a verification link, bring a prototype to an after-sales service store, etc. to reset the key corresponding to the DUID on the server; or you can also verify the user's identity in a similar way to retrieval of the password. , requesting the server to reset the key through usage, friend information in the system, and preset key reset questions (for example, who is the primary school teacher?).
- the server After the server receives the reset request and the authentication is passed, it resets the client's key corresponding to the DUID stored in the server or the system connected to the server to the pre-shared key, and sets the number of successful authentications to 0.
- the server can record the relevant information of the reset key in its file system or database, such as the reset time and reason, the corresponding user's mobile phone number, email and other account information, the corresponding client's DUID and other information for subsequent use. Used for security audits.
- FIG 3 shows an authentication method provided by an embodiment of the present application.
- This authentication method uses a random number-based password verification function for first authentication, as shown in Figure 3.
- the method includes:
- S310 The client sends a request to the server for login authentication.
- S320 The server sends the first random number to the client.
- the first random number is used by the client to generate a token in combination with other token parameters.
- the client generates a token.
- S340 The client sends the generated token to the server to request authentication.
- S350 The server determines based on the DUID in the token that the number of successful authentications before this authentication is 0.
- an authentication success of 0 means that this authentication is the client's first authentication.
- the server determines that the client authentication is successful.
- the server will query the pre-shared key from the server's file system or database based on the number of successful authentications being 0, and use the pre-shared key to generate a token for verification in the same way as the client.
- Token' when Token' is consistent with the Token received by the server, the client authentication is considered successful.
- S350 and S360 can be different from that shown in Figure 3, that is, the server can also determine the number of successful authentications of the client before this authentication after performing authentication, so that when this authentication fails, It is no longer necessary to determine the number of successful authentications of the client.
- the server generates key parameters.
- the first key (Key1) used is a pre-shared key.
- the pre-shared key becomes invalid after the first authentication is successful, and the server needs to update the password. key thereby improving client security.
- the key parameter is used to generate a second key, which can be a random number. The second key is used for the next authentication of the client.
- the server sends the key parameter to the client.
- the client requests login authentication for the second time.
- S394 The server sends a second random number to the client, and the second random number is used to generate a token for this authentication.
- the key parameters in S380 can also be random numbers.
- the two can pass the identifier carried in the message. Determine which random number is used to generate the key and which random number is used to generate the token for this authentication. Or it can be determined by the order of sending. The random number of the key parameter will be sent after authentication, and the second random number used to generate the token will not be sent until the client requests login authentication for the second time.
- the client In S390, the client generates a second key according to the key parameters, and stores the second key in the client system for subsequent authentication.
- This step can also be set when the client needs to generate a token during subsequent authentication, that is, first generate a second key according to the second key parameter, and then use the second key to generate a token for authentication. Until then, the key parameters have been stored on the client's system.
- FIG. 4 shows another authentication method provided by the embodiment of the present application.
- This authentication method uses a symmetric encryption algorithm based on timestamps or sequence numbers for non-first-time authentication.
- the method includes:
- the client generates a token.
- Token DUID
- the token uses a symmetric encryption algorithm to encrypt the first key Key1 and [timestamp
- Token DUID
- S420 The client sends the generated token to the server to request authentication.
- the plaintext part of the token includes the client's unique identifier, so that after receiving the token, the server can determine the identity of the client based on the DUID and obtain the key required to decrypt the ciphertext part of the token.
- the server determines that the client authentication is successful.
- the server queries the shared key corresponding to the client based on the DUID, and uses the stored first key Key1 to successfully decrypt the encrypted part of the token, and obtains the timestamp or serial number, server identification and DUID. , after verifying that the above information meets the requirements, it is judged that the certification is passed.
- S440 The server determines based on the DUID that the number of successful authentications before this authentication is not 0.
- S450 The server determines that the life cycle of the first key is greater than the preset life cycle.
- the server determines that the life cycle of the key is greater than the preset life cycle through the life cycle record of the first key stored in the system, and can update the first key.
- the life cycle may be that the use time or number of times of the first key exceeds the preset time length or the preset number of times.
- the second key parameter is used to generate a second key, and the second key parameter may be a random number or a text field, etc.
- the server sends the second key parameter to the client.
- the client After receiving the second key parameter, the client can generate a second key based on the parameter and store it in the client's system for subsequent use in client authentication.
- Figure 5 shows another authentication method provided by an embodiment of the present application, which uses a one-way function based on a timestamp or sequence number for authentication.
- S510 The client generates a token for authentication.
- the token may be generated based on the first key Key1, the timestamp or the serial number, the unique identifier DUID.
- token Token [timestamp
- Key1 is the key used to encrypt [timestamp
- the server determines that the client authentication is successful.
- S540 The server determines that the number of successful authentications before this authentication is not 0.
- the server determines based on the DUID that the number of successful authentications before this authentication is not 0, that is, this authentication is not the first authentication.
- S550 The server determines that the life cycle of the first key is less than the preset life cycle.
- the server determines that this authentication is not the first authentication, and the life cycle of the first key is less than the preset life cycle. Therefore, the first key can still be used the next time the client requests authentication.
- Figure 6 shows another authentication method provided by the embodiment of the present application, which uses a symmetric encryption algorithm based on random numbers for authentication.
- S604 The server sends the first random number to the client, which is used to generate a token for this authentication.
- the client generates a token.
- the client generates a token based on the stored first key Key1, the received first random number, the server ID and the client's unique identifier.
- Token Token DUID
- S610 The server determines that the first key is unsafe.
- this step can be performed immediately after the client requests login authentication in S602, thereby eliminating the need for the client to request a random number to generate a token, or this step can be performed before the client requests login authentication, that is, the server has been monitoring the first One-key security.
- S612 The server determines that the client token passes the authentication.
- the server determines that the first key is unsafe, it will still use the key to authenticate the client. However, after the token authentication is passed, an identity review of the client will be added.
- S614 The server performs identity verification on the client, and the client's identity verification passes.
- the client passes the identity authentication, the client passes the authentication of the server and can access the server system, for example Access to the Internet of Things, etc.
- the client's identity check fails, it is proved that the client is counterfeit, the client is denied access to the Internet of Things, and no subsequent process is performed.
- the server can notify the user of the relevant information about the abnormal access by sending a reminder text message to the client user, so that the user can handle it in a timely manner.
- the server since the server has determined that the first key is not secure, the server can directly update the first key after the client passes the authentication, thereby enhancing the security of the system.
- S618 The server sends the key parameter to the client.
- the client generates a second key.
- the client In S620, the client generates a second key based on the new key parameters, and for this key, its life cycle number is cleared or time is restarted.
- FIG. 7 shows a communication device 700 provided by an embodiment of the present application.
- the communication device 700 includes a transceiver unit 710 and a processing unit 720.
- the transceiver unit 710 can implement corresponding communication functions, and the processing unit 720 is used for data processing. It should be understood that the communication device 700 is equivalent to the server described above.
- the communication device 700 may include a unit for executing the methods executed by the server in FIGS. 2 to 6 . Moreover, each unit in the communication device 700 and the above-mentioned other operations and/or functions are respectively intended to implement the corresponding processes executed by the server in the method embodiments of FIGS. 2 to 6 .
- the communication device 700 may also include a storage unit, which may be used to store instructions and/or data, and the processing unit 720 may read the instructions and/or data in the storage unit, so that the communication device 700 implements the foregoing.
- a storage unit which may be used to store instructions and/or data
- the processing unit 720 may read the instructions and/or data in the storage unit, so that the communication device 700 implements the foregoing.
- the transceiving unit 710 can be used to perform step S210, and the processing unit 720 can be used to perform steps S220 and S230.
- the communication device includes: a transceiver unit 710, configured to receive authentication information from the client.
- the authentication information is used for the first authentication of the client.
- the authentication information includes a token generated by a token parameter, so
- the token parameters include a first key and a unique identifier, and the unique identifier uniquely corresponds to the client;
- the processing unit 720 is configured to determine the number of successful authentications of the client based on the unique identifier, so The number of successful authentications is the number of successful authentications of the client before performing the first authentication; the processing unit 720 is also configured to determine whether the client passes the first authentication based on the number of successful authentications.
- the first key is updated after authentication.
- the processing unit 720 is specifically configured to, when the number of successful authentications is 0, determine to update the first key after the client passes the first authentication.
- the processing unit 720 when the number of successful authentications is not 0, is specifically configured to: determine the life cycle of the first key; when the life cycle of the first key is greater than When the life cycle is preset, it is determined to update the first key.
- the life cycle of the first key includes the number of uses of the first key or the usage time of the first key.
- the processing unit 720 is also configured to determine the status of the first key according to the unique identifier, and the status of the first key is used to indicate that the first key Whether it is safe; the processing unit 720 is specifically configured to: determine whether to update the first key after the client passes the first authentication based on the number of successful authentications and the status of the first key. .
- the processing unit 720 is specifically configured to: when the status of the first key indicates that the first key is unsafe, after the client passes the first authentication, The client performs an identity review; and after the client passes the identity review, it is determined to update the first key.
- the transceiver unit 710 is also used to receive a reset request from the client; the processing unit 720 is also used to verify that the identity of the client is authentic; the processing unit 720, It is also used to set the number of authentication successes to 0 according to the reset request.
- the token parameters also include a timestamp or a sequence number.
- the token parameter further includes a random number
- the method further includes: the server sending the random number to the client.
- the token parameters also include a server identifier.
- the token includes a plaintext part and a ciphertext part
- the ciphertext part is generated by a symmetric encryption function or a one-way function.
- the unique identifier is generated by at least one of the following: client identification, user identification, MAC address, SN serial number, IMEI, IMSI and random serial number.
- FIG. 8 shows another communication device 800 provided by an embodiment of the present application.
- the communication device 800 includes a transceiver unit 810, which can implement corresponding communication functions. It should be understood that the communication device 800 is equivalent to the client described above.
- the communication device 800 may include a unit for performing the methods performed by the client in FIGS. 3 to 6 . Moreover, each unit in the communication device 800 and the above-mentioned other operations and/or functions are respectively intended to implement the corresponding processes of the method embodiments in FIGS. 3 to 6 .
- the communication device 800 includes: a transceiver unit 810, configured to send authentication information to the server.
- the authentication information is used by the server to perform the first authentication of the communication device 800.
- the authentication information includes the following command: A token generated by token parameters.
- the token parameters include a first key and a unique identifier.
- the unique identifier uniquely corresponds to the client.
- the unique identifier is used by the server to determine the communication.
- the number of successful authentications of the device 800 which is the number of successful authentications of the communication device 800 before performing the first authentication.
- the token parameters also include a timestamp or a sequence number.
- the token parameter also includes a random number
- the transceiver unit is also used to receive the random number sent by the server.
- the communication device 800 further includes a processing unit 820, which is configured to generate the authentication information according to the random number.
- the token parameters also include a server identifier.
- the token includes a plaintext part and a ciphertext part
- the ciphertext part is generated by a symmetric encryption function or a one-way function.
- the unique identifier is generated by at least one of the following: client identification, user identification, media access control MAC address, Bluetooth MAC, serial SN number, International Mobile Subscriber Identity code IMEI, International Mobile User identification code IMSI and random serial number
- FIG. 9 shows another communication device 900 provided by an embodiment of the present application.
- the communication device 900 includes a processor 920.
- the processor 920 is used to implement corresponding control management operations.
- the processor 920 is used to support the device 900 for publishing information to perform the methods, operations or functions of the foregoing embodiments.
- the communication device 900 may also include: a memory 910 and a communication interface 930; the processor 920, the communication interface 930, and the memory 910 may be connected to each other or connected to each other through a bus 940.
- the communication interface 930 is used to support the communication device 900 to communicate with the subscribing device, etc.
- the memory 910 is used to store the program code and data of the communication device 900 .
- the processor 920 calls the code or data stored in the memory 910 to implement corresponding operations.
- the memory 910 may or may not be coupled with the processor.
- the coupling in the embodiment of this application is an indirect coupling or communication connection between communication devices, units or modules, which may be in electrical, mechanical or other forms, and is used for information interaction between communication devices, units or modules.
- the processor 920 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various illustrative logical blocks, modules, and circuits described in connection with this disclosure.
- the processor may also be a combination that implements computing functions, such as one or more microprocessors, A combination of word signal processor and microprocessor, etc.
- Communication interface 930 may be a transceiver, circuit, bus, module, or other type of communication interface.
- the bus 940 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, or the like.
- PCI peripheral component interconnect
- EISA extended industry standard architecture
- the communication device 900 is equivalent to the previously described server, and is used to perform the steps performed by the server in the method embodiments of FIGS. 2 to 6 .
- the communication device 900 is equivalent to the client described above, and is used to perform the steps performed by the client in the above method embodiments of FIGS. 3 to 6 .
- Embodiments of the present application also provide a computer-readable medium.
- the computer-readable medium stores program code.
- the computer program code When the computer program code is run on a computer, it causes the computer to perform the above-mentioned method implementation in Figures 2 to 6. The steps performed by the server in the example.
- Embodiments of the present application also provide a computer-readable medium.
- the computer-readable medium stores program code.
- the computer program code When the computer program code is run on a computer, it causes the computer to execute the above-mentioned method implementation in Figures 3 to 6. The steps performed by the client in the example.
- An embodiment of the present application also provides a chip, including: at least one processor and a memory.
- the at least one processor is coupled to the memory and is used to read and execute instructions in the memory to execute the above-mentioned Figures 2 to 2. Steps performed by the server in the method embodiment of Figure 6.
- An embodiment of the present application also provides a chip, including: at least one processor and a memory.
- the at least one processor is coupled to the memory and is used to read and execute instructions in the memory to execute the above-mentioned Figures 3 to 3. Steps performed by the client in the method embodiment of Figure 6.
- the disclosed systems, devices and methods can be implemented in other ways.
- the device embodiments described above are only illustrative.
- the division of the units is only a logical function division. In actual implementation, there may be other division methods.
- multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented.
- the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
- the functions described are implemented in the form of software functional units and sold or used as independent products, they can be stored on a computer-readable storage medium.
- the technical solution of the present application is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product.
- the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code. .
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本申请实施例提供了一种认证方法和通信装置。该认证方法包括:服务端接收来自客户端的认证信息,认证信息用于服务端对客户端进行第一认证,认证信息包括由令牌参数生成的令牌,令牌参数包括第一密钥和唯一标识符,唯一标识符与客户端唯一对应;服务端根据唯一标识符,确定客户端的认证成功次数,认证成功次数为客户端在进行第一认证之前的认证成功次数;服务端根据认证成功次数,确定是否在客户端通过第一认证后更新第一密钥。通过该认证方法和通信装置,服务端可以根据认证成功次数确定是否对认证过程中使用的第一密钥进行更新,能够提高认证过程的安全性。
Description
本申请要求于2022年06月08日提交中国专利局、申请号为202210642540.4、申请名称为“一种认证方法和通信装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请实施例涉及通信领域,尤其涉及一种认证方法和通信装置。
物联网(internet of things,IoT)为物物相连的互联网,能够实现物品与物品,人与物品之间的互联,实现对物体和过程的智能化感知、识别和管理。
为了保护物联网的安全,客户端在接入物联网时,需要由服务端对客户端进行身份认证,当该设备身份认证通过时才允许客户端接入物联网。客户端和服务端会存储共同的预共享密钥,并基于该预共享密钥进行认证,从而确定对方的合法性。但是一旦预共享密钥泄露,物联网的安全性便受到了威胁。
发明内容
本申请实施例提供一种认证方法和通信装置,能够更新客户端和服务端之间的共享密钥,提高认证过程的安全性。
第一方面,提供了一种认证方法,包括:服务端接收来自客户端的认证信息,所述认证信息用于所述服务端对所述客户端进行第一认证,所述认证信息包括由令牌参数生成的令牌,所述令牌参数包括第一密钥和唯一标识符,所述唯一标识符与所述客户端唯一对应;所述服务端根据所述唯一标识符,确定所述客户端的认证成功次数,所述认证成功次数为所述客户端在进行所述第一认证之前的认证成功次数;所述服务端根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥。
在该实施例中,服务端接收客户端的认证信息后,根据认证信息中的令牌,获得客户端对应的唯一标识符DUID,从而可以根据该DUID确定客户端在该次认证之前的认证成功次数,并基于该认证成功次数确定是否在第一认证成功后更新该第一密钥。
结合第一方面,在第一方面的某些实现方式中,所述令牌包括明文部分和密文部分,所述明文部分包括所述唯一标识符,所述密文部分是由密文参数生成的,所述密文参数包括所述唯一标识符和所述第一密钥。
在该实施例中,明文部分包括该唯一标识符,从而服务端可以根据明文部分的唯一标识符查询该客户端对应的认证成功次数,密文部分用于服务端对客户端进行认证。密文部分包括
在一种可能的实现方式中,唯一标识符可以不设置在令牌的明文部分,而是携带在认证信息中与令牌一起发送给服务端或者不与认证信息,而是通过其他信息发送给服务端,
从而服务端可以根据获得的唯一标识符对客户端进行认证,仅在密文参数中包括唯一标识符和第一密钥,能够减小令牌的长度,提高认证的安全性。
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:所述服务端根据所述DUID,确定所述DUID是否可以在服务端查询到;
当所述DUID不能在所述服务端查询到时,所述服务端确定所述客户端的第一认证不通过。
在该实施例中,服务端会根据DUID在其文件系统或数据库中查询是否存在该DUID,如果不存在该DUID,则证明该客户端是仿冒,因此确定该客户端的第一认证不通过,提高认证系统的安全性。
结合第一方面,在第一方面的某些实现方式中,所述服务端根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:当所述认证成功次数为0时,所述服务端确定在所述客户端通过所述第一认证后更新所述第一密钥。
在该实施例中,服务端确定客户端在该次认证之前的认证成功次数为0,即该次认证为首次认证。客户端通过该首次认证之后,服务端会立即更新与客户端的共享的第一密钥(预共享密钥),从而存储在客户端中的预共享密钥只能保护客户端一次,并在使用一次后立即更新,提高了客户端的安全性。
结合第一方面,在第一方面的某些实现方式中,所述服务端根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:当所述认证成功次数不为0时,在所述客户端通过所述第一认证后,所述服务端确定所述第一密钥的生命周期;当所述第一密钥的生命周期大于预设生命周期时,所述服务端确定更新所述第一密钥。
在该实施例中,服务端确定对于该客户端,在该次认证之前的认证成功次数不为0,即该次认证非首次认证。客户端的第一认证通过之后,服务端需要确定该次认证使用的第一密钥的生命周期,当第一密钥的生命周期超过预设生命周期时,服务端确定更新该第一密钥,从而便于该客户端后续的认证。
结合第一方面,在第一方面的某些实现方式中,所述第一密钥的生命周期包括所述第一密钥的使用次数或者所述第一密钥的使用时间。
在一些实施例中,第一密钥的生命周期为第一密钥的使用次数,服务端会在其数据库或文件系统中设置指示第一密钥使用次数的参数,当客户端还没有基于该第一密钥进行认证时,该使用次数预置为0,每当客户端进行成功认证之后,使用次数增加1。例如,密钥的生命周期为10次,如果当通过该第一认证后,使用次数为10,即第一密钥的生命周期达到预设生命周期,服务端会进行更新第一密钥的流程。
在另一些实施例中,第一密钥的生命周期为第一密钥的使用时间,服务端会在其系统中预置产生第一密钥的时间,例如可以规定用于生成第一密钥的第一密钥参数的获取时间为第一密钥的使用起始时间,在每一次认证成功之后,服务端会确定当前时间和第一密钥的使用起始时间的差值,当达到预设生命周期之后,例如3天,则更新第一密钥。
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:所述服务端根据所述唯一标识符,确定所述第一密钥的状态,所述第一密钥的状态用于指示所述第一密钥是否安全;其中,所述服务端根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:所述服务端根据所述认证成功次数和所述第一密钥的状态,确定是否在所述客户端通过所述第一认证后更新所述第一密钥。
在该实现方式中,服务端还会根据该唯一标识符,确定第一密钥的状态,从而客户端可以结合该第一密钥的状态和认证成功次数,确定是否在第一认证后更新第一密钥。
结合第一方面,在第一方面的某些实现方式中,所述服务端根据所述认证成功次数和所述第一密钥的状态,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:当所述第一密钥的状态指示所述第一密钥不安全时,所述服务端在所述客户端通过所述第一认证后对所述客户端进行身份复核;所述服务端在所述客户端身份复核通过后确定更新所述第一密钥。
在该实施例中,第一密钥的安全性可以是由服务端进行监视的。当第一密钥安全性受到威胁时,服务端在使用该第一密钥对客户端进行认证成功之后,服务端会对客户端进行身份复核,当身份复核通过后,会更新第一密钥,当身份复核失败之后,会拒绝客户端接入物联网。
结合第一方面,在第一方面的某些实现方式中,服务端更新第一密钥包括:服务端获取第二密钥参数,所述第二密钥参数用于生成第二密钥,所述第二密钥用于所述客户端的下一次认证;所述服务端向所述客户端发送所述第二密钥参数。
在该实施例中,服务端生成第二密钥参数并将该第二密钥参数发送给客户端,从而服务端和客户端可以按照约定的算法生成新的第二密钥,实现更新第一密钥。示意性的,该第二密钥参数可以为随机数,服务端和客户端通过同样的算法使用随机数和第一密钥生成第二密钥。
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:所述服务端接收所述客户端的重置请求;所述服务端验证所述客户端身份是真实的;所述服务端根据所述重置请求,将所述认证成功次数设置为0。
在该实施例中,如果客户端因为某些原因失去当前的共享密钥或者恢复出厂设置,无法向服务端认证,此时具有真实身份的用户可以使用客户端向服务端发送重置请求,将共享密钥恢复成预共享密钥(客户端出厂时存储的密钥),服务端接收到该请求验证客户端身份真实后,可以将服务端使用的密钥重置成预共享密钥,并将认证成功次数重置为0,从而后续服务端和客户端按照本申请的技术方案进行认证。
结合第一方面,在第一方面的某些实现方式中,所述令牌参数还包括时间戳或序列号。
在该实施例中,在令牌中设置时间戳或序列号,从而防止攻击者进行重放攻击,提高认证过程的安全性。
结合第一方面,在第一方面的某些实现方式中,所述令牌参数还包括随机数,所述方法还包括:所述服务端向所述客户端发送所述随机数。
在该实施例中,在令牌中设置随机数,并且随机数可以由服务端生成,在这种情况下,服务端将生成的随机数发送给客户端,便于客户端根据该随机数生成用于进行认证的令牌,提高认证过程的安全性,随机数由服务端生成,提高了随机数的安全性。
结合第一方面,在第一方面的某些实现方式中,所述令牌参数还包括服务端标识。
在该实施例中,在令牌中加入服务端标识,从而可以避免攻击者进行反射攻击,提高认证系统的安全性。
结合第一方面,在第一方面的某些实现方式中,所述令牌包括明文部分和密文部分,所述密文部分通过对称加密函数或单向函数生成。
结合第一方面,在第一方面的某些实现方式中,所述唯一标识符通过以下至少一项生
成:客户端标识、用户标识、媒体接入控制MAC地址、蓝牙MAC、序列SN号、国际移动用户身份码码IMEI、国际移动用户识别码IMSI和随机序列号。
在该实施例中,唯一标识符通过上述参数中的至少一项生成,从而唯一标识一个客户端,将唯一标识符结合到令牌中,提高认证过程的安全性。
在一些实施例中,使用的参数可能具有一定的规律,可以通过单向算法或者其他函数基于该参数生成没有规律的唯一标识符。
在另一些实施例中,可以结合以上参数的几项,通过级联直接作为唯一标识符,减小唯一标识符生成的复杂程度,提高本申请认证的方案的可靠性。
第二方面,提供了一种认证方法,包括:客户端向服务端发送认证信息,所述认证信息用于所述服务端对所述客户端进行第一认证,所述认证信息包括令牌,所述令牌是根据令牌参数生成的,所述令牌参数包括第一密钥和唯一标识符,所述唯一标识符与所述客户端唯一对应,所述唯一标识符用于所述服务端确定所述客户端在进行第一认证之前的认证成功次数。
在该实施例中,客户端向服务端发送认证信息,从而便于服务端根据该认证信息的令牌中的唯一标识符,确定客户端的认证成功次数,并根据该认证成功次数进行后续操作。
结合第二方面,在第二方面的某些实现方式中,所述令牌参数还包括时间戳或序列号。
结合第二方面,在第二方面的某些实现方式中,所述令牌参数还包括随机数,所述方法还包括:所述客户端接收所述服务端发送的随机数。
结合第二方面,在第二方面的某些实现方式中,所述方法还包括:所述客户端根据所述随机数,生成所述认证信息。
结合第二方面,在第二方面的某些实现方式中,所述令牌参数还包括服务端标识。
结合第二方面,在第二方面的某些实现方式中,所述令牌包括明文部分和密文部分,所述密文部分通过对称加密函数或单向函数生成。
结合第二方面,在第二方面的某些实现方式中,所述唯一标识符通过以下至少一项生成:客户端标识、用户标识、媒体接入控制MAC地址、蓝牙MAC、序列SN号、国际移动用户身份码码IMEI、国际移动用户识别码IMSI和随机序列号。
第三方面,提供了一种通信装置(例如服务端),该通信装置包括:收发单元,用于接收来自客户端的认证信息,所述认证信息用于所述客户端的第一认证,所述认证信息包括由令牌参数生成的令牌,所述令牌参数包括第一密钥和唯一标识符,所述唯一标识符与所述客户端唯一对应;处理单元,用于根据所述唯一标识符,确定所述客户端的认证成功次数,所述认证成功次数是所述客户端在进行所述第一认证之前的认证成功次数;所述处理单元,还用于根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥。
在该实施例中,通信装置通过收发单元接收客户端的认证信息,处理单元能够根据认证信息的令牌中的唯一标识符,确定该客户端的认证成功次数,从而根据该认证成功次数确定是否更新认证信息中的第一密钥。
结合第三方面,在第三方面的某些实现方式中,所述令牌包括明文部分和密文部分,所述明文部分包括所述唯一标识符,所述密文部分是由密文参数生成的,所述密文参数包括所述唯一标识符和所述第一密钥。
结合第三方面,在第三方面的某些实现方式中,所述处理单元,具体用于,当所述认
证成功次数为0时,确定在所述客户端通过所述第一认证后更新所述第一密钥。
结合第三方面,在第三方面的某些实现方式中,所述处理单元,具体用于,当所述认证成功次数不为0时,所述处理单元,用于:确定所述第一密钥的生命周期;当所述第一密钥的生命周期大于预设生命周期时,所述处理单元,还用于确定更新所述第一密钥。
结合第三方面,在第三方面的某些实现方式中,所述第一密钥的生命周期包括所述第一密钥的使用次数或者所述第一密钥的使用时间。
结合第三方面,在第三方面的某些实现方式中,所述处理单元,还用于根据所述唯一标识符,确定所述第一密钥的状态,所述第一密钥的状态用于指示所述第一密钥是否安全;所述处理单元,具体用于:根据所述认证成功次数和所述第一密钥的状态,确定是否在所述客户端通过所述第一认证后更新所述第一密钥。
结合第三方面,在第三方面的某些实现方式中,所述处理单元,具体用于,当所述第一密钥的状态指示第一密钥不安全时,在所述客户端通过所述第一认证后对所述客户端进行身份复核;在所述客户端通过所述身份复核后确定更新所述第一密钥。
结合第三方面,在第三方面的某些实现方式中,所述收发单元,还用于接收所述客户端的重置请求;所述处理单元,还用于验证所述客户端的身份是真实的;所述处理单元,还用于根据所述重置请求,将所述认证成功次数设置为0。
结合第三方面,在第三方面的某些实现方式中,所述令牌参数还包括时间戳或序列号。
结合第三方面,在第三方面的某些实现方式中,所述令牌参数还包括随机数,所述收发单元,还用于向所述客户端发送所述随机数。
结合第三方面,在第三方面的某些实现方式中,所述令牌参数还包括服务端标识。
结合第三方面,在第三方面的某些实现方式中,所述令牌包括明文部分和密文部分,所述密文部分通过对称加密函数或单向函数生成。
结合第三方面,在第三方面的某些实现方式中,所述唯一标识符通过以下至少一项生成:客户端标识、用户标识、媒体接入控制MAC地址、蓝牙MAC、序列SN号、国际移动用户身份码码IMEI、国际移动用户识别码IMSI和随机序列号。
第四方面,提供了一种通信装置(例如,客户端),包括:收发单元,用于向服务端发送认证信息,所述认证信息用于所述服务端对所述客户端进行第一认证,所述认证信息包括由令牌参数生成的令牌,所述令牌参数包括第一密钥和唯一标识符,所述唯一标识符与所述客户端唯一对应,所述唯一标识符用于所述服务端确定所述客户端的认证成功次数,所述认证成功次数是所述客户端在进行所述第一认证之前的认证成功次数。
结合第四方面,在第四方面的某些实现方式中,所述令牌参数还包括时间戳或序列号。
结合第四方面,在第四方面的某些实现方式中,所述令牌参数还包括随机数,所述收发单元,还用于接收所述服务端发送的随机数。
结合第四方面,在第四方面的某些实现方式中,所述通信装置还包括处理单元,所述处理单元用于根据所述随机数生成所述认证信息。
结合第四方面,在第四方面的某些实现方式中,所述令牌参数还包括服务端标识。
结合第四方面,在第四方面的某些实现方式中,所述令牌包括明文部分和密文部分,所述密文部分通过对称加密函数或单向函数生成。
结合第四方面,在第四方面的某些实现方式中,所述唯一标识符通过以下至少一项生成:客户端标识、用户标识、媒体接入控制MAC地址、蓝牙MAC、序列SN号、国际移
动用户身份码码IMEI、国际移动用户识别码IMSI和随机序列号。
第五方面,提供了一种通信装置(例如,服务端),该通信装置包括:一个或多个处理器;一个或多个存储器;所述一个或多个存储器存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器执行时,使得所述通信装置执行以下步骤:接收来自客户端的认证信息,所述认证信息用于所述服务端对所述客户端进行第一认证,所述认证信息包括由令牌参数生成的令牌,所述令牌参数包括第一密钥和唯一标识符,所述唯一标识符与所述客户端唯一对应;根据所述唯一标识符,确定所述客户端的认证成功次数,所述认证成功次数为所述客户端在进行所述第一认证之前的认证成功次数;根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥。
结合第五方面,在第五方面的某些实现方式中,当所述指令被所述一个或多个处理器执行时,使得所述通信装置执行以下步骤:当所述认证成功次数为0时,确定在所述客户端通过所述第一认证后更新所述第一密钥。
结合第五方面,在第五方面的某些实现方式中,当所述指令被所述一个或多个处理器执行时,使得所述通信装置执行以下步骤:当所述认证成功次数不为0时,在所述客户端通过所述第一认证后,确定所述第一密钥的生命周期;当所述第一密钥的生命周期大于预设生命周期时,确定更新所述第一密钥。
结合第五方面,在第五方面的某些实现方式中,所述第一密钥的生命周期包括所述第一密钥的使用次数或者所述第一密钥的使用时间。
结合第五方面,在第五方面的某些实现方式中,当所述指令被所述一个或多个处理器执行时,使得所述通信装置执行以下步骤:根据所述唯一标识符,确定所述第一密钥的状态,所述第一密钥的状态用于指示所述第一密钥是否安全;所述认证成功次数和所述第一密钥的状态,确定是否在所述客户端通过所述第一认证后更新所述第一密钥。
结合第五方面,在第五方面的某些实现方式中,当所述指令被所述一个或多个处理器执行时,使得所述通信装置执行以下步骤:当所述第一密钥的状态指示所述第一密钥不安全时,在所述客户端通过所述第一认证后对所述客户端进行身份复核;在所述客户端身份复核通过后确定更新所述第一密钥。
结合第五方面,在第五方面的某些实现方式中,当所述指令被所述一个或多个处理器执行时,使得所述通信装置执行以下步骤:接收所述客户端的重置请求;验证所述客户端身份是真实的;根据所述重置请求,将所述认证成功次数设置为0。
结合第五方面,在第五方面的某些实现方式中,所述令牌参数还包括时间戳或序列号。
结合第五方面,在第五方面的某些实现方式中,所述令牌参数还包括随机数,当所述指令被所述一个或多个处理器执行时,使得所述通信装置执行以下步骤:向所述客户端发送所述随机数。
结合第五方面,在第五方面的某些实现方式中,所述令牌参数还包括服务端标识。
结合第五方面,在第五方面的某些实现方式中,所述令牌包括明文部分和密文部分,所述密文部分通过对称加密函数或单向函数生成。
结合第五方面,在第五方面的某些实现方式中,所述唯一标识符通过以下至少一项生成:客户端标识、用户标识、媒体接入控制MAC地址、蓝牙MAC、序列SN号、国际移动用户身份码码IMEI、国际移动用户识别码IMSI和随机序列号。
第六方面,提供了一种通信装置(例如,客户端),该通信装置包括:一个或多个处理器;一个或多个存储器;所述一个或多个存储器存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器执行时,使得所述通信装置执行以下步骤:向服务端发送认证信息,所述认证信息用于所述服务端对所述客户端进行第一认证,所述认证信息包括由令牌参数生成的令牌,所述令牌参数包括第一密钥和唯一标识符,所述唯一标识符与所述客户端唯一对应,所述唯一标识符用于所述服务端确定所述客户端在进行第一认证之前的认证成功次数。
结合第六方面,在第六方面的某些实现方式中,所述令牌参数还包括时间戳或序列号。
结合第六方面,在第六方面的某些实现方式中,所述令牌参数还包括随机数,当所述指令被所述一个或多个处理器执行时,使得所述通信装置执行以下步骤:接收所述服务端发送的所述随机数。
结合第六方面,在第六方面的某些实现方式中,所述令牌参数还包括服务端标识。
结合第六方面,在第六方面的某些实现方式中,所述令牌包括明文部分和密文部分,所述密文部分通过对称加密函数或单向函数生成。
结合第六方面,在第六方面的某些实现方式中,所述唯一标识符通过以下至少一项生成:客户端标识、用户标识、媒体接入控制MAC地址、蓝牙MAC、序列SN号、国际移动用户身份码码IMEI、国际移动用户识别码IMSI和随机序列号。
第七方面,提供了一种计算机可读存储介质,包括计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行第一方面或第一方面任一种实现方式以及第二方面或第二方面任一种实现方式的方法。
第八方面,提供了一种通信装置,包括至少一个处理器,所述处理器与存储器耦合,所述存储器用于存储指令,所述指令被所述处理器运行时,使得所述处理器执行第一方面或第一方面任一种实现方式以及第二方面或第二方面任一种实现方式的方法。
第九方面,提供了一种计算机程序产品,所述计算机程序产品包括计算机程序代码或指令,所述计算机程序代码或指令在计算机上执行时,使得所述计算机执行第一方面或第一方面任一种实现方式以及第二方面或第二方面任一种实现方式的方法。
图1示出了本申请实施例适用的通信系统的架构图。
图2示出了本申请实施例提供的一种认证方法的示意性流程图。
图3示出了本申请实施例提供的另一种认证方法的示意性流程图。
图4示出了本申请实施例提供的另一种认证方法的示意性流程图。
图5示出了本申请实施例提供的另一种认证方法的示意性流程图。
图6示出了本申请实施例提供的另一种认证方法的示意性流程图。
图7示出了本申请实施例提供的另一种通信装置的示意性框图。
图8示出了本申请实施例提供的另一种通信装置的示意性框图。
图9示出了本申请实施例提供的另一种通信装置的示意性框图。
下面将结合附图,对本申请实施例中的技术方案进行描述。
下面对本申请实施例涉及的一些技术术语进行解释。
重放攻击(replay attacks):又称重播攻击、回放攻击,是指攻击者发送一个目的主机已接收过的包,来达到欺骗系统的目的,主要用于身份认证过程,破坏认证的正确性。重放攻击可以由拦截并重发数据的敌方进行。攻击者利用网络监听或者其他方式盗取通过认证密钥生成的认证信息,之后再把认证信息重新发给服务端。重放攻击在各种网络通信过程中都可能发生,是计算机世界黑客常用的攻击方式之一。
||:连接符,例如“A||B”表示“AB”。
本申请实施例的技术方案可以应用于各种通信系统,例如:机器类通信(machine type communication,MTC)、机器间通信长期演进技术(long term evolution-machine,LTE-M)、设备到设备(device-to device,D2D)网络、机器到机器(machine to machine,M2M)网络、物联网(internet of things,IoT)网络或者其他网络。例如,IoT网络可以包括车联网。其中,车联网系统中的通信方式统称为车到其他设备(vehicle to X,V2X,X可以代表任何事物),例如,该V2X可以包括:车辆到车辆(vehicle to vehicle,V2V)通信,车辆与基础设施(vehicle to infrastructure,V2I)通信、车辆与行人之间的通信(vehicle to pedestrian,V2P)或车辆与网络(vehicle to network,V2N)通信等。
本申请的客户端也可以称为用户设备、物联网客户端、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置等,下文统一称为客户端。客户端可以是MTC终端、带无线收发功能的电脑、物联网终端、虚拟现实客户端、增强现实客户端、可穿戴设备、车辆、D2D通信中的终端、V2X通信中的终端、智能办公中的终端、工业控制中的终端、无人驾驶中的终端、远程手术中的终端、智能电网中的终端、运输安全中的终端、智慧城市中的终端、或智慧家庭中的终端等。本申请的实施例对客户端所采用的具体技术和具体设备形态不做限定。
以物联网为例,图1示出了本申请实施例适用的通信系统的架构示意图。
如图1所示,该通信系统包括和服务端110、客户端120和客户端130,两个客户端和服务端110通过网络连接。例如,客户端120可以为手机等移动终端,客户端130可以为扫地机等智能客户端,服务端110可以为云端服务器或本地服务器,也可以为终端设备。客户端在接入物联网时,服务端110会对客户端进行身份认证,以便于对接入物联网的行为进行控制,提高物联网的安全性。
用于服务端对客户端的身份认证方案,一般包括由客户端A发起的认证或由服务端B发起的认证方式。
对于由客户端A发起的认证方式,客户端A在要接入物联网时,可以向服务端B发送认证消息,之后由服务端B验证该认证消息,从而对客户端A进行认证。
具体的,客户端A和服务端B都保存相同的预共享密钥(pre-sharedkey,PSK),客户端A向服务端B发送的认证消息包括通过该预共享密钥生成的令牌,例如客户端A向服务端B发送的令牌TokenAB=[TA|NA]||Text2||fKAB([TA|NA]||B||Text1)。
其中,TA为时间戳,NA为序列号,[TA|NA]表示选择其中之一,具体选择哪一个取决于客户端和服务端的技术能力和环境。fKAB(X)表示使用密码校验函数f和预共享密钥KAB对数据X计算的密码校验值。Text1和Text2是文本字段,Text1是B已知的,或者包含在Text2中。公式中的B表示服务端B的身份标识符,在令牌中是否包含身份标识符B是可选的,当包含身份标识符B时可以防止攻击方假冒服务端B对客户端A重用令牌
TokenAB,但是在不存在此类攻击的环境中可以将身份标识符B省去。
当服务端B收到来自客户端A的令牌时,服务端B可以检验时间戳或序列号,并计算fKAB([TA|NA]||B||Text1),将其与接收到的令牌TokenAB比较,并验证时间戳和序列号、身份标识符B的正确性,从而验证客户端A的身份。
在上述验证方式中,还可以将密码校验函数换成对称加密函数,例如,令牌TokenAB=Text2||eKAB([TA|NA]||B||Text1)。
对于由服务端B发起的认证方式,服务端B可以向客户端A发送随机数,服务端B还可以向客户端A发送文本字段Text1,以便于客户端根据该随机数和文本字段Text1生成令牌,客户端A将生成的令牌发送给服务端B用于进行身份认证,服务端B根据该令牌对客户端A进行身份认证。
可选的,在上述过程中,服务端B向客户端A发送随机数以及文本字段Text1可以是由于收到客户端A发送的请求登录认证的消息,从而向客户端发送用于认证的一些参数发起对于客户端A的身份认证。
通过上述的认证过程可以看出,预共享密钥KAB的保密性对整个认证过程的安全性具有重要作用,而预共享密钥一般出厂时确定,所有同类型的客户端会使用相同的预共享密钥。如果预共享密钥被攻击者暴力破解或泄露,由密码校验函数或对称加密函数加密的密文部分就会较容易被破解,物联网接入的安全性无法得到保证,并且所有该类型的客户端的安全性都受到威胁。
基于上述问题,本申请实施例提供了一种认证方法,能够增加认证过程的安全性。
图2示出了本申请实施例提供的一种认证方法,该方法包括:
S210,服务端接收来自客户端的认证信息,所述认证信息用于所述服务端对所述客户端进行第一认证,所述认证信息包括令牌,所述令牌是根据令牌参数生成的,所述令牌参数包括第一密钥和客户端的唯一标识符,唯一标识符与客户端唯一对应。
对应,客户端向服务端发送该认证信息。
在S210中,唯一标识符(device unique ID,DUID)与客户端唯一对应。客户端预出厂时,在服务端数据库(或文件系统)中预置每一台客户端的唯一标识符或者生成该唯一标识符的参数信息。每台客户端的唯一标识符唯一且足够长,从而不会容易通过枚举等方式破解其唯一标识符。不同客户端的唯一标识符不是连号且没有其他明显的规律,从而不容易通过一台设备的唯一标识符猜测出另一台设备的唯一标识符。
在本申请实施例中,唯一标识符可以通过以下至少一项生成:客户端标识(deviceID)、用户标识、媒体接入控制(mediaaccesscontrol,MAC)地址、蓝牙MAC、序列号(serialnumber,SN),国际移动设备身份码(internationalmobileequipmentidentity,IMEI)、国际移动用户识别码(international mobilesubscriberidentification,IMSI)和随机序列号。DUID还可以结合出厂日期、IP地址等进一步设置,从而提高其安全性。
在本申请实施例中,当认证是通过客户端上的应用向服务端申请认证时,唯一标识符也可以看成与客户端上需要向服务端认证的应用唯一对应。
在一些实施例中,客户端用于认证时的传输通道安全系数较高,可以通过将上述信息中的若干项通过级联或拼接形成唯一标识符。例如DUID满足:DUID=deviceID||APPID||MAC,在该DUID中,由于客户端标识和MAC地址的对应关系不容易被预测,因此,攻击者无法通过一台设备的DUID猜出另一台设备的DUID。
在另一些实施例中,为了提高客户端认证时的传输安全性,或者唯一标识符仅由SN序列号或MAC地址等有一定规律的参数生成,在某些情况下有被预测的可能性,可以通过使用函数生成该DUID,例如DUID可以通过哈希消息认证码(hash-basedmessageauthenticationcode,HMAC)、密钥导出函数算法2(password-basedkeyderivationfunction2,PBKDF2)、高级加密标准算法(advanceencryptionstandard,AES)、DES(data encryption standard,数据加密标准)等方式生成。示例性的,DUID=HMAC(Key,deviceID||APPID||MAC),其中Key为用于生成DUID的密钥。例如,客户端系统中可以预置该DUID,则服务端可以预置同样的DUID或者预置该密钥以及生成DUID的参数。或者客户端系统中可以预置生成DUID的参数,服务端和客户端可以共享该密钥,并通过同样的算法生成DUID以供使用。此处的用于生成DUID的密钥与用于生成认证信息的密钥一般不同。
认证信息可以是通过令牌(Token)的形式发送或者认证信息中包括令牌,是客户端向服务端证明自己身份的信息。用于生成令牌的令牌参数中可以包括第一密钥和该唯一标识符。
由于认证信息中包括上述不容易猜测的DUID,从而即使PSK泄露,由于该DUID是保密的,攻击者也无法直接仿冒客户端进行认证。在令牌中包括唯一标识符可以防止攻击方对客户端进行逆向分析和暴力破解,威胁客户端的安全性。
示例性的,认证信息可以通过单向函数生成,以HMAC为例,例如,令牌Token=时间戳||DUID||HMAC(Key1,时间戳||服务端标识||DUID)。
由上述令牌的示例可以看出,令牌中包括明文部分和密文部分。明文部分可以包括DUID,明文部分还可以包括一些防止重放攻击的参数,例如时间戳、序列号、随机数等。上述示例的令牌中,明文部分即为“时间戳||DUID”。密文部分可以通过密文参数生成,密文参数可以包括DUID,密文参数还可以包括一些用于防止重放攻击的参数,例如时间戳、序列号、随机数等。上述示例的令牌中,密文部分是“HMAC(Key1,时间戳||服务端标识||DUID)”。明文部分和密文部分可以连接形成整个令牌。当服务端收到该认证信息后,通过验证令牌的明文部分和密文部分,最终对客户端进行认证。
第一密钥即为Token中的Key1,客户端使用该第一密钥生成令牌的密文部分。具体的,例如,可以通过该第一密钥和时间戳||服务端标识||DUID,使用HMAC、PBKDF2等单向函数算法生成令牌的密文部分。
在本申请实施例中,服务端可以根据该认证信息对该客户端进行认证。服务端可以首先对明文中的DUID进行查询,在服务端的文件系统或数据库中查询该DUID存在后,该客户端或客户端的应用才可能通过服务端的认证。
之后服务端继续进行对防重放攻击的参数进行验证。以令牌Token=时间戳||DUID||HMAC(Key1,时间戳||服务端标识||DUID)为例,用于防止重放攻击的参数为时间戳。服务端可以设置仅对时间戳与当前时间戳的差值在一定范围内的认证信息进行认证,例如服务端可以确定时间戳与当前时间差是否在1min之内,如果时间戳与当前时间差值超过1min,判断该客户端的第一认证的结果为不通过,拒绝该客户端接入物联网。
在认证信息中明文部分的时间戳以及DUID都符合要求后,服务端可以处理该认证信息的密文部分,具体的,可以通过该DUID在服务端的数据库或文件系统中查找获取当前有效的密钥Key1’,使用该密钥和从明文部分获取的时间戳、DUID和存储的服务端标识,
通过与客户端同样的算法生成验证信息Token’=时间戳||DUID||HMAC(Key1’,时间戳||服务端标识||DUID),如果服务端生成的验证信息Token’与客户端发送的Token一样,这意味着服务端和客户端使用的是同样的算法和同样的密钥生成的令牌,由于一般情况下,密钥只有客户端和服务端知道,则服务端可以判断客户端通过认证。
令牌中的明文以及密文中用于防止重放攻击的参数可以替换成序列号,即用于生成令牌的令牌参数可以包括时间戳或序列号,序列号和时间戳的作用类似,也是为了防止重放攻击,服务端在收到包括序列号的认证信息后可以在服务端的文件系统或数据库查询该序列号是否是当前应该使用的序列号,如果不是则认证不通过。例如序列号1-5在之前的认证中已经被使用,则第一认证应该使用序列号6生成该次认证的认证信息,如果客户端在该第一认证使用的序列号不是6,可以确定该客户端的认证不通过。
在上述实施例中,时间戳以及序列号也可以不设置在令牌的明文中而仅设置在令牌的密文部分,例如可以通过在认证信息中与令牌同时传输,或者时间戳和序列号可以不在认证信息中传输,而是通过其他信息传输给服务端,从而服务端能根据该时间戳或序列号使用同样的算法生成密文部分进行验证。例如,Token=DUID||HMAC(Key2,[时间戳|序列号]||服务端标识||DUID)。其中,[时间戳|序列号]表示时间戳或序列号中二选一,Key2是用于生成令牌密文部分的密钥。
该时间戳也可以替换成随机数,在一些实施例中,随机数可以由客户端生成。在另一些实施例中,为了获得更加安全的随机数,可以由服务端生成随机数,并将该随机数发送给客户端,从而便于客户端根据该随机数发送认证信息。也就是说,所述令牌参数还包括随机数,所述方法还包括:所述服务端向所述客户端发送所述随机数。对应,客户端接收来自服务端发送的随机数。该随机数的发送可以是基于客户端向服务端的认证请求信息而触发。
在上述实施例中,随机数也可以不设置在令牌的明文中,由于服务端生成该随机数时,会由服务端将该随机数发送给客户端,因此也无需再额外发送随机数给服务端。例如,Token=DUID||HMAC(Key3,随机数||服务端标识||DUID),Key3是生成该令牌或者生成令牌密文部分的密钥。
也就是说,用于生成令牌的令牌参数可以包括时间戳、序列号、随机数中的一项。
DUID也可以不设置在令牌的明文中,而是在认证信息中单独发送,或者也可以不与包括令牌的信息一起发送,而在另外的信息中发送给服务端,在这种情况下,认证信息为包括该DUID的信息与令牌的信息。
认证信息中密文部分的服务端标识是为了防止反射攻击,即攻击者假冒客户端将激励获得的随机数反射给服务端。如果认证环境中不存在此类型的攻击,可以省去认证信息中的服务端标识,从而认证信息可以为:Token=时间戳||DUID||HMAC(Key4,时间戳||DUID),其中Key4是生成该令牌或者该令牌密文部分的密钥。
以上介绍了由单向函数生成令牌或令牌密文部分的实施例,令牌也可以通过其他函数或算法生成。
示例性的,令牌也可以使用对称加密算法生成。不同于单向函数,对称加密算法的密文部分可以通过加密使用的密钥还原出明文。因此,客户端使用密钥对文本字段进行加密形成密文后,服务端需要获知能够对密文进行解密的密钥,根据该密钥对密文部分进行解密,再验证解密后的文本字段中的各个参数是否符合要求。由于密文部分能够通过密钥解
密,因此,生成令牌的用于防止重放攻击的参数可以不设置在明文部分,而是通过解密后再由服务端验证。由于本申请中的密钥是可以更新的,且对于不同的客户端,服务端会设置不同的密钥(后文详细介绍),因此,服务端需要根据客户端的DUID,获知当前客户端使用的密钥,从而解密令牌的密文部分,令牌的明文部分可以包括DUID。例如:Token=DUID||eKey1([时间戳|序列号]||服务端标识||DUID),其中eKey1([时间戳|序列号]||DUID)表示用对称加密算法通过密钥Key1对[时间戳|序列号]||服务端标识||DUID进行加密。具体的,假设使用的对称加密算法是AES,Token=DUID||AES(Key1,[时间戳|序列号]||服务端标识||DUID)。明文部分为DUID,密文部分为通过AES算法用密钥(Key1)对文本字段([时间戳|序列号]||服务端标识||DUID))进行加密获得的结果。
同样,该时间戳或序列号可以替换成随机数,且在不包括反射攻击的场景下,可以省去密文部分的服务端标识。
当服务端收到该认证信息后,使用其和客户端共享的密钥对令牌中的密文部分进行解密,解密的过程可以理解为使用密钥用与加密算法的逆运算获得密文部分对应的明文。并验证时间戳或序列号以及DUID,当解密成功且时间戳或序列号以及DUID符合要求时,判断对客户端的认证通过。具体的,时间戳需要在预设时间范围之内,序列号需要为该次认证应该使用的目标序列号,DUID需要可以在服务端的文件系统或数据库中查询到。
在一些实施例中,DUID可以不设置在令牌的明文部分,而是通过与令牌同时或不同时发送给服务端设备用于服务端认证以及获取当前有效的密钥,例如可以与令牌同时在认证信息中发送给服务端设备。
无论认证信息中的令牌使用何种算法生成,上述示意的令牌形式仅是为了说明本申请的技术方案,令牌不限于与上述示意的形式一致。例如通过“||”连接的各个参量的顺序可以与前文示意的有一定差异。又如,用于生成密文的参数中还可以包括其他参数,例如,由服务端和客户端共享的其他文本字段等。
上述示例的认证信息的密文部分是以HMAC和AES算法为例,密文部分也可以用其他加密方式,例如SM4、DES、RC5等对称加密算法,或者PBKDF2、Scrypt等单向函数,此处为简洁不再赘述。
S220,所述服务端根据所述唯一标识符,确定所述客户端在进行第一认证之前的认证成功次数,所述认证成功次数为所述客户端在进行第一认证之前的认证成功次数。
S230,所述服务端根据所述认证成功次数,确定是否在所述客户端通过第一认证之后更新所述第一密钥。
本申请实施例提供的认证方法会根据DUID查询对应客户端的认证成功次数,并根据该认证成功次数确定是否更新第一密钥,供客户端的后续认证使用。
在一些实施例中,所述服务端根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:当认证成功次数为0时,服务端在客户端通过第一认证后确定更新第一密钥。
在该实施例中,第一密钥为预共享密钥,预共享密钥是客户端和服务端共享的初始密钥,该预共享密钥在客户端出厂时预置到客户端的系统中。对于不同的客户端,其预共享密钥都是相同的,之后每个客户端的有效的密钥会根据本申请的技术方案进行更新,且之后更新的密钥各不相同,从而提高每个客户端的安全性。
为了进一步增强该预共享密钥的安全性,在客户端设备的数量有限或者对于安全的要
求特别高时,可以对不同的客户端设置不同的预共享密钥,并将不同客户端DUID对应的预共享密钥存储在服务端的文件系统或数据库中,使得即使一个客户端的预共享密钥泄露,其他的设备的安全性不受到威胁。服务端在根据客户端的认证成功次数判断客户端的认证是首次认证时,可以从服务端的文件系统或数据库中查询对应DUID的预共享密钥,对该客户端进行认证。
当客户端的首次认证通过后,服务端会更新认证使用的密钥,从而使得预共享密钥只保护该客户端一次,且在首次认证使用后立即失效。具体的,服务端会获取第二密钥参数,服务端可以生成第二密钥参数或者可以通过与服务端相连的其他设备获取第二密钥参数,第二密钥参数可以用于生成第二密钥。例如第二密钥参数可以为随机数,第二密钥Key2=HMAC(Key1,N1),即第二密钥通过使用不同的算法计算随机数与第一密钥而获得,或者说第二密钥在第一密钥的基础上生成。服务端可以在其文件系统或数据库中存储用于生成第二密钥的第二密钥参数,也可以直接将获得的第二密钥存储在服务端的文件系统中。之后,服务端可以将第二密钥参数发送给客户端,以便于客户端根据与服务端使用同样的算法生成第二密钥,用于客户端的下一次认证。
上述第二密钥的生成方式也可以替换成别的算法,例如,Key2=PBKDF2(Key1,N1,iterCount,dkLen),其中,iterCount为迭代次数,客户端每更新一次密钥,使用该算法进行iterCount次迭代从而获得新的密钥,iterCount设置得较大可以增加迭代次数,从而增加密钥的安全性。dkLen是输出的Key2的长度。第二密钥也可以不是在第一密钥的基础上生成。无论第二密钥的生成方式如何,服务端和客户端通过预协商或规定按照同样的方法更新密钥即可。
在另一些实施例中,所述服务端根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:当认证成功次数不为0时,当所述客户端通过所述第一认证后,所述方法还包括:所述服务端确定所述第一密钥的生命周期;当所述第一密钥的生命周期大于预设生命周期时,所述服务端确定更新所述第一密钥。
在该实施例中,由于认证成功次数不为0,即该客户端的第一认证不是首次认证。在客户端通过该次认证后,服务端可以获取第一密钥的生命周期,当服务端确定该第一密钥的生命周期大于预设生命周期时,更新第一密钥。在本申请实施例中,第一密钥的生命周期可以包括第一密钥的使用次数或第一密钥的使用时间。
密钥的生命周期可以凭经验设置或者预置,并可以进行更新。具体的,当生命周期为第一密钥的使用次数时,服务端可以在其文件系统或数据库中设置用于表征第一密钥的使用次数的参数。在服务端生成第一密钥参数时,该参数设置为0,当客户端使用该第一密钥认证成功时,该参数会变为1,例如可以设置其生命周期为100次,从而该参数达到100后,服务端即向客户端发送生成的第三密钥参数,用于生成第三密钥,供客户端的下一次使用,该参数又重置为0。
当生命周期为第一密钥的使用时间时,服务端可以记录生成第一密钥参数时的初始时间戳,在接收到客户端发送的认证信息时,可以比较当前时间戳与初始时间戳的差值是否超过第一密钥的生命周期。例如可以设置第一密钥的生命周期为3个月,如果超过第一密钥的生命周期,可以向客户端发送第三密钥参数,用于生成第三密钥,并记录生成第三密钥参数或将第三密钥参数发送给客户端时的时间戳。
通过本申请实施例的技术方案,客户端使用的密钥会定期更新,即使当前使用的密钥
泄露,攻击者使用该密钥时,密钥可能也已经进行了更新,从而提高了系统的安全性。
在本申请实施例中,所述服务端还可以根据所述唯一标识符,确定所述第一密钥的状态,所述第一密钥的状态用于指示所述第一密钥是否安全;其中,所述服务端根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:所述服务端根据所述认证成功次数和所述第一密钥的状态,确定是否在所述客户端通过所述第一认证后更新所述第一密钥。
在该实施例中,服务端确定是否在该客户端通过第一认证后更新第一密钥时,还会结合第一密钥的状态确定,即根据第一密钥是否安全和认证成功次数确定是否更新第一密钥。
在本申请实施例中,所述服务端根据所述认证成功次数和所述第一密钥的状态,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:当所述第一密钥的状态指示所述第一密钥不安全时,所述服务端可以在所述客户端通过所述第一认证后对所述客户端进行身份复核;所述服务端在所述客户端身份复核通过后确定更新所述第一密钥。
即服务端可以监测第一密钥的安全性,当服务端确定第一密钥的安全性受到威胁时,在客户端通过该第一认证之后,服务端会进行身份复核,并在客户端身份复核通过后更新第一密钥。具体的,服务端可以获取第四密钥参数,第四密钥参数用于生成第四密钥,第四密钥用于所述客户端的下一次认证;服务端向客户端发送所述第四密钥参数。
在上述实施例中,由于服务端认为当前使用的密钥安全性有一定的威胁,在客户端通过该第一认证之后,即服务端通过前文介绍的方法验证令牌之后(客户端持有该第一密钥),服务端还会对客户端进行进一步的身份认证,以验证持有该第一密钥的是真正的第一客户端或对应的用户。如果身份认证未通过,则不允许客户端进行下一步操作。如果身份验证通过,允许客户端进行其他操作,并更新密钥。
身份验证的方式可以如下:例如通过验证绑定的手机号,验证邮箱,通过预设的身份验证问题验证等。
在具体实施时,服务端可以设置密钥的安全性指示参数,安全性指示参数可以默认为1,安全性指示参数可以用于指示当前服务端存储的密钥的安全性。当第一密钥的安全性受到威胁时,服务端可以将其安全性指示参数设置为0,从而在该客户端使用第一密钥的进行的第一认证通过后且身份验证通过后,启动更新密钥流程。在服务端将新的第四密钥参数发给客户端后,服务端存储该新的第四密钥参数或第四密钥,并将安全性指示参数重新设置为1。
在上述实施例中,第三密钥、第四密钥均可以通过类似于前文介绍的第二密钥的生成方式而生成,此处不再赘述。
在本申请实施例中,当客户端被用户重置,例如恢复出厂设置,从而客户端失去原来存储的密钥;或者在客户端进行首次认证之前,攻击者猜测出客户端的DUID并假冒客户端进行了首次认证,从而服务端文件系统或数据库中存储的密钥已经更新,而客户端只存储了预共享密钥,这样在客户端使用预共享密钥进行认证时,无法认证成功。此时,正常用户可以通过使用客户端向服务端发送重置请求,服务端接收所述客户端的重置请求,服务端验证该客户端的身份是真实的,服务端根据该重置请求,将前文所述的认证成功次数设置为0,并将密钥重置成预共享密钥。从而之后客户端可以使用预共享密钥向服务端申请进行认证。
具体的,重置过程中服务端验证客户端身份是否真实可以通过如下方式:用户使用客
户端绑定账号、注册手机发送验证码、注册邮箱发送验证链接、带样机到售后服务店等方式重置服务端对应的该DUID的密钥;或者也可以类似找回密码的方式验证用户身份,通过使用情况、系统中好友信息、预置的密钥重置问题(例如小学班主任是谁?)等方式请求服务端重置密钥。
服务端收到重置请求且身份验证通过后,将服务端或与服务端相连的系统中存储的对应DUID的客户端的密钥重置为预共享密钥,并将认证成功次数设置为0。此外,服务端可以在其文件系统或数据库中记录重置密钥的相关信息,例如重置时间以及原因,对应的用户的手机号、邮箱等账户信息,对应的客户端的DUID等信息,供后续进行安全审计使用。
图3示出了本申请实施例提供的一种认证方法。该认证方法使用基于随机数的密码校验函数进行首次认证,如图3所示,该方法包括:
S310,客户端向服务端发送请求,用于请求进行登录认证。
S320,服务端向客户端发送第一随机数。
在S320中,第一随机数用于客户端结合其他令牌参数生成令牌。
S330,客户端生成令牌。
在S330中,客户端使用第一密钥和其他令牌参数(服务端标识、客户端的唯一标识符DUID、随机数等)生成令牌。示例性的,令牌Token=DUID||HMAC(Key1,第一随机数||服务端标识||DUID)。由于随机数是服务端发送给客户端的,因此该随机数可以无需设置在令牌的明文中,以减小令牌的复杂程度。
在不存在反射攻击的场景中,可以无需在令牌中包括服务端标识。
S340,客户端向服务端发送生成的令牌用于请求认证。
S350,服务端根据令牌中的DUID,确定在该次认证之前,认证成功次数为0。
在S350中,认证成功为0意味着该次认证为客户端首次认证。
S360,服务端确定客户端认证成功。
在S360中,服务端会依据认证成功次数为0,从服务端的文件系统或数据库中查询到预共享密钥,并使用该预共享密钥按照与客户端相同的方式生成用于验证的令牌Token’,当Token’与服务端接收到的Token一致时,认为客户端认证成功。
应理解,S350和S360的顺序可以与图3所示的不同,即服务端也可以在进行认证之后再确定该客户端在该次认证之前的认证成功次数,这样当此次认证不通过时,可以无需再判断客户端的认证成功次数。
S370,服务端生成密钥参数。
在S370中,由于客户端首次认证成功,使用的第一密钥(Key1)为预共享密钥,根据本申请的技术方案,预共享密钥在首次认证成功之后即失效,服务端需要更新密钥从而提高客户端的安全性。该密钥参数用于生成第二密钥,该密钥参数可以为随机数,第二密钥用于客户端的下一次认证。
S380,服务端向客户端发送该密钥参数。
S390,客户端生成第二密钥。
S392,客户端第二次请求登录认证。
S394,服务端向客户端发送第二随机数,该第二随机数用于生成该次认证的令牌。
应理解,S380中的密钥参数也可以为随机数,这时两者可以通过信息中携带的标识
确定哪一个随机数是用于生成密钥,哪一个随机数用于生成该次认证的令牌。或者可以通过发送的次序来确定,密钥参数的随机数在认证之后就会发送,而用于生成令牌的第二随机数会在客户端第二次请求登录认证时才会发送。
在S390中客户端根据密钥参数生成第二密钥,并在客户端系统中存储该第二密钥用于后续的认证。该步骤也可以设置在客户端后续认证时需要生成令牌时,即先根据第二密钥参数生成第二密钥,再使用该第二密钥生成用于认证的令牌。在此之前,密钥参数一直存储在客户端的系统中。
图4示出了本申请实施例提供的另一种认证方法。该认证方法使用基于时间戳或序列号的对称加密算法进行非首次认证。该方法包括:
S410,客户端生成令牌。
在S410中,示例性的,令牌Token=DUID||eKey1([时间戳|序列号]||服务端标识||DUID)。该令牌使用对称加密算法对第一密钥Key1和[时间戳|序列号]||服务端标识||DUID进行加密运算,DUID为唯一标识符。以对称加密算法为AES算法为例,Token=DUID||AES(Key1,[时间戳|序列号]||服务端标识||DUID)。
S420,客户端向服务端发送生成的令牌用于请求认证。
在S420中,令牌的明文部分包括客户端的唯一标识符,从而便于服务端接收到该令牌后,根据DUID确定客户端的身份并获取对令牌密文部分进行解密所需要的密钥。
S430,服务端确定客户端认证成功。
在S430中,服务端根据DUID查询到该客户端对应的共享密钥,并利用存储的第一密钥Key1对令牌中的加密部分解密成功,获得时间戳或序列号、服务端标识和DUID,验证上述信息满足要求后,判断认证通过。
S440,服务端根据DUID,确定在该次认证之前,认证成功次数不为0。
在S440中,该次认证之前,认证成功次数不为0,该次认证不为首次认证。
S450,服务端确定第一密钥的生命周期大于预设生命周期。
在S450中,服务端通过系统中存储的该第一密钥的生命周期记录,判断该密钥生命周期大于预设生命周期,可以更新第一密钥。具体的,生命周期可以为第一密钥的使用时长或者使用次数超过预设时长或者预设次数。
S460,服务端生成第二密钥参数。
在S460中,第二密钥参数用于生成第二密钥,第二密钥参数可以为随机数或者文本字段等。
S470,服务端向客户端发送第二密钥参数。
客户端可以在收到该第二密钥参数之后,根据该参数生成第二密钥,存储在客户端的系统中,供后续该客户端认证使用。
图5示出了本申请实施例提供的另一种认证方法,该方法使用基于时间戳或序列号的单向函数进行认证。
S510,客户端生成用于认证的令牌。
在S510中,令牌可以基于第一密钥Key1,时间戳或序列号,唯一标识符DUID生成。示意性的,令牌Token=[时间戳|序列号]||DUID||HMAC(Key1,[时间戳|序列号]||DUID)。Key1为对[时间戳|序列号]||DUID进行加密的密钥。
S520,客户端向服务端发送令牌。
S530,服务端确定客户端认证成功。
S540,服务端确定该次认证之前,认证成功次数不为0。
在S540中,服务端根据DUID确定在该次认证之前,认证成功次数不为0,即该次认证非首次认证。
S550,服务端确定第一密钥的生命周期小于预设生命周期。
通过步骤S540和S550,服务端确定该次认证非首次认证,且第一密钥的生命周期小于预设生命周期,因此下一次客户端请求认证时,仍然可以使用该第一密钥。
图6示出了本申请实施例提供的另一种认证方法,该方法使用基于随机数的对称加密算法进行认证。
S602,客户端请求登录认证。
S604,服务端向客户端发送第一随机数,用于生成该次认证的令牌。
S606,客户端生成令牌。
在S606中,示意性的,客户端基于存储的第一密钥Key1,收到的第一随机数、服务端标识和客户端的唯一标识符生成令牌,令牌Token=DUID||AES(Key1,第一随机数||DUID)。
S608,客户端向服务端发送令牌。
S610,服务端确定该第一密钥不安全。
在S610中,该步骤可以在S602客户端请求登录认证之后即进行,从而无需客户端请求随机数生成令牌,或者该步骤可以在客户端请求登录认证之前就进行,即服务端一直在监测第一密钥的安全性。
S612,服务端确定该客户端令牌通过认证。
在S612中,虽然服务端确定第一密钥不安全,但是仍然会使用该密钥对客户端进行认证。但是在该令牌认证通过之后会增加对客户端进行的身份复核。
S614,服务端对客户端进行身份复核,且客户端的身份复核通过。
在S614中,由于第一密钥不安全,有被攻击者窃取的可能性,因此服务端需要对客户端进行身份复核,以防攻击方仿冒客户端进行身份认证。
进行身份复核可以通过一些预设步骤验证客户端用户的手机号、邮箱地址、账号保护问题等,当客户端通过该身份认证后,客户端即通过服务端的认证,能够接入服务端系统,例如接入物联网等。
如果在S614中,客户端的身份复核没有通过,则证明该客户端为仿冒的,拒绝客户端接入物联网,并且不再进行后续过程。服务端可以通过向客户端用户发送提醒短信等方式通知用户该次异常访问的相关信息,从而用户可以及时进行处理。
S616,服务端生成密钥参数。
在S616中,由于服务端已经确定第一密钥不安全,服务端可以在客户端通过该次认证之后,直接对第一密钥进行更新,从而增强系统的安全性。
S618,服务端向客户端发送该密钥参数。
S620,客户端生成第二密钥。
在S620中,客户端根据新的密钥参数生成第二密钥,且针对该密钥,其生命周期次数清零或者时间重新开始计算。
上文结合图2至图6详细说明了本申请实施例提供的方法。下面将结合图7和图8详
细说明本申请实施例提供的装置。装置实施例的描述与方法实施例的描述相互对应,因此,未详细描述的内容可以参见上文方法实施例,为了简洁,这里不再赘述。
图7示出了本申请实施例提供的一种通信装置700,该通信装置700包括收发单元710和处理单元720,收发单元710可以实现相应的通信功能,处理单元720用于进行数据处理。应理解:通信装置700相当于前面描述的服务端。
该通信装置700可以包括用于执行图2至图6中的由服务端执行的方法的单元。并且,该通信装置700中的各单元和上述其他操作和/或功能分别为了实现图2至图6的方法实施例中由服务端执行的相应流程。
可选地,该通信装置700还可以包括存储单元,该存储单元可以用于存储指令和/或数据,处理单元720可以读取存储单元中的指令和/或数据,以使得通信装置700实现前述方法实施例。
其中,当该通信装置700用于执行图2中的方法时,收发单元710可用于执行步骤S210,处理单元720可用于执行步骤S220和S230。
具体的,该通信装置包括:收发单元710,用于接收来自客户端的认证信息,所述认证信息用于所述客户端的第一认证,所述认证信息包括由令牌参数生成的令牌,所述令牌参数包括第一密钥和唯一标识符,所述唯一标识符与所述客户端唯一对应;处理单元720,用于根据所述唯一标识符,确定所述客户端的认证成功次数,所述认证成功次数是所述客户端在进行所述第一认证之前的认证成功次数;所述处理单元720,还用于根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥。
在本申请实施例中,所述处理单元720,具体用于,当所述认证成功次数为0时,在所述客户端通过所述第一认证后确定更新所述第一密钥。
在本申请实施例中,当所述认证成功次数不为0时,所述处理单元720,具体用于:确定所述第一密钥的生命周期;当所述第一密钥的生命周期大于预设生命周期时,确定更新所述第一密钥。
在本申请实施例中,所述第一密钥的生命周期包括所述第一密钥的使用次数或者所述第一密钥的使用时间。
在本申请实施例中,所述处理单元720,还用于根据所述唯一标识符,确定所述第一密钥的状态,所述第一密钥的状态用于指示所述第一密钥是否安全;所述处理单元720,具体用于:根据所述认证成功次数和所述第一密钥的状态,确定是否在所述客户端通过所述第一认证后更新所述第一密钥。
在本申请实施例中,所述处理单元720,具体用于,在当所述第一密钥的状态指示第一密钥不安全时,在所述客户端通过所述第一认证后对所述客户端进行身份复核;在所述客户端通过所述身份复核后确定更新所述第一密钥。
在本申请实施例中,所述收发单元710,还用于接收所述客户端的重置请求;所述处理单元720,还用于验证所述客户端的身份是真实的;所述处理单元720,还用于根据所述重置请求,将所述认证成功次数设置为0。
在本申请实施例中,所述令牌参数还包括时间戳或序列号。
在本申请实施例中,所述令牌参数还包括随机数,所述方法还包括:所述服务端向所述客户端发送所述随机数。
在本申请实施例中,所述令牌参数还包括服务端标识。
在本申请实施例中,所述令牌包括明文部分和密文部分,所述密文部分通过对称加密函数或单向函数生成。
在本申请实施例中,所述唯一标识符通过以下至少一项生成:客户端标识、用户标识、MAC地址、SN序列号、IMEI、IMSI和随机序列号。
图8示出了本申请实施例提供的另一种通信装置800。该通信装置800包括收发单元810,收发单元810可以实现相应的通信功能。应理解:通信装置800相当于前面描述的客户端。
该通信装置800可以包括用于执行图3至图6中的由客户端端执行的方法的单元。并且,该通信装置800中的各单元和上述其他操作和/或功能分别为了实现图3至图6的方法实施例的相应流程。
具体的,该通信装置800包括:收发单元810,用于向服务端发送认证信息,所述认证信息用于所述服务端对所述通信装置800进行第一认证,所述认证信息包括由令牌参数生成的令牌,所述令牌参数包括第一密钥和唯一标识符,所述唯一标识符与所述客户端唯一对应,所述唯一标识符用于所述服务端确定所述通信装置800的认证成功次数,所述认证成功次数是所述通信装置800在进行所述第一认证之前的认证成功次数。
在本申请实施例中,所述令牌参数还包括时间戳或序列号。
在本申请实施例中,所述令牌参数还包括随机数,所述收发单元还用于接收服务端发送的随机数。
在本申请实施例中,所述通信装置800还包括处理单元820,所述处理单元820用于根据所述随机数生成所述认证信息。
在本申请实施例中,所述令牌参数还包括服务端标识。
在本申请实施例中,所述令牌包括明文部分和密文部分,所述密文部分通过对称加密函数或单向函数生成。
在本申请实施例中,所述唯一标识符通过以下至少一项生成:客户端标识、用户标识、媒体接入控制MAC地址、蓝牙MAC、序列SN号、国际移动用户身份码码IMEI、国际移动用户识别码IMSI和随机序列号
图9示出了本申请实施例提供的另一种通信装置900。通信装置900包括:处理器920。在本申请的实施例中,处理器920用于实现相应的控制管理操作,例如,处理器920用于支持发布信息的装置900执行前述实施例的方法或操作或功能。可选的,通信装置900还可以包括:存储器910和通信接口930;处理器920、通信接口930以及存储器910可以相互连接或者通过总线940相互连接。其中,通信接口930用于支持该通信装置900与订阅端设备等进行通信,存储器910用于存储通信装置900的程序代码和数据。处理器920调用存储器910中存储的代码或者数据实现相应的操作。该存储器910可以跟处理器耦合在一起,也可以不耦合在一起。本申请实施例中的耦合是通信装置、单元或模块之间的间接耦合或通信连接,可以是电性,机械或其它的形式,用于通信装置、单元或模块之间的信息交互。
其中,处理器920可以是中央处理器单元,通用处理器,数字信号处理器,专用集成电路,现场可编程门阵列或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数
字信号处理器和微处理器的组合等等。通信接口930可以是收发器、电路、总线、模块或其它类型的通信接口。总线940可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
在一些实施例中,该通信装置900相当于前面描述的服务端,用于执行上述图2至图6的方法实施例中由服务端执行的步骤。
在另一些实施例中,通信装置900相当于前面描述的客户端,用于执行上述图3至图6的方法实施例中由客户端执行的步骤。
本申请实施例还提供一种计算机可读介质,所述计算机可读介质存储有程序代码,当所述计算机程序代码在计算机上运行时,使得所述计算机执行上述图2至图6的方法实施例中由服务端执行的步骤。
本申请实施例还提供一种计算机可读介质,所述计算机可读介质存储有程序代码,当所述计算机程序代码在计算机上运行时,使得所述计算机执行上述图3至图6的方法实施例中由客户端执行的步骤。
本申请实施例还提供一种芯片,包括:至少一个处理器和存储器,所述至少一个处理器与所述存储器耦合,用于读取并执行所述存储器中的指令,以执行上述图2至图6的方法实施例中由服务端执行的步骤。
本申请实施例还提供一种芯片,包括:至少一个处理器和存储器,所述至少一个处理器与所述存储器耦合,用于读取并执行所述存储器中的指令,以执行上述图3至图6的方法实施例中由客户端执行的步骤。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储
在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
Claims (11)
- 一种认证方法,其特征在于,包括:服务端接收来自客户端的认证信息,所述认证信息用于所述服务端对所述客户端进行第一认证,所述认证信息包括由令牌参数生成的令牌,所述令牌参数包括第一密钥和唯一标识符,所述唯一标识符与所述客户端唯一对应;所述服务端根据所述唯一标识符,确定所述客户端的认证成功次数,所述认证成功次数为所述客户端在进行所述第一认证之前的认证成功次数;所述服务端根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥。
- 根据权利要求1所述的方法,其特征在于,所述服务端根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:当所述认证成功次数为0时,所述服务端确定在所述客户端通过所述第一认证后更新所述第一密钥。
- 根据权利要求1或2所述的方法,其特征在于,所述服务端根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:当所述认证成功次数不为0时,在所述客户端通过所述第一认证后所述服务端确定所述第一密钥的生命周期;当所述第一密钥的生命周期大于预设生命周期时,所述服务端确定更新所述第一密钥。
- 根据权利要求3所述的方法,其特征在于,所述第一密钥的生命周期包括所述第一密钥的使用次数或者所述第一密钥的使用时间。
- 根据权利要求1至4中任一项所述的方法,其特征在于,所述方法还包括:所述服务端根据所述唯一标识符,确定所述第一密钥的状态,所述第一密钥的状态用于指示所述第一密钥是否安全;其中,所述服务端根据所述认证成功次数,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:所述服务端根据所述认证成功次数和所述第一密钥的状态,确定是否在所述客户端通过所述第一认证后更新所述第一密钥。
- 根据权利要求5所述的方法,其特征在于,所述服务端根据所述认证成功次数和所述第一密钥的状态,确定是否在所述客户端通过所述第一认证后更新所述第一密钥,包括:当所述第一密钥的状态指示所述第一密钥不安全时,所述服务端在所述客户端通过所述第一认证后对所述客户端进行身份复核;所述服务端在所述客户端身份复核通过后确定更新所述第一密钥。
- 根据权利要求1至6中任一项所述的方法,其特征在于,所述方法还包括:所述服务端接收所述客户端的重置请求;所述服务端验证所述客户端身份是真实的;所述服务端根据所述重置请求,将所述认证成功次数设置为0。
- 一种认证方法,其特征在于,包括:客户端向服务端发送认证信息,所述认证信息用于所述服务端对所述客户端进行第一认证,所述认证信息包括令牌,所述令牌是根据令牌参数生成的,所述令牌参数包括第一密钥和唯一标识符,所述唯一标识符与所述客户端唯一对应,所述唯一标识符用于所述服务端确定所述客户端在进行第一认证之前的认证成功次数。
- 根据权利要求1至8中任一项所述的方法,其特征在于,所述令牌参数还包括时间戳、序列号和随机数中的一项,和/或;所述唯一标识符通过以下至少一项生成:客户端标识、用户标识、媒体接入控制MAC地址、蓝牙MAC、序列SN号、国际移动用户身份码码IMEI、国际移动用户识别码IMSI和随机序列号。
- 一种计算机可读存储介质,包括计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1至7和9中任一项所述的方法或如权利要求8至9中任一项所述的方法。
- 一种通信装置,其特征在于,包括至少一个处理器,所述处理器与存储器耦合,所述存储器用于存储指令,所述指令被所述处理器运行时,使得所述处理器执行如权利要求1至7和9中任意一项所述的方法或如权利要求8至9中任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210642540.4 | 2022-06-08 | ||
CN202210642540.4A CN117240486A (zh) | 2022-06-08 | 2022-06-08 | 一种认证方法和通信装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023236925A1 true WO2023236925A1 (zh) | 2023-12-14 |
Family
ID=89081356
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/098486 WO2023236925A1 (zh) | 2022-06-08 | 2023-06-06 | 一种认证方法和通信装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117240486A (zh) |
WO (1) | WO2023236925A1 (zh) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140173283A1 (en) * | 2012-12-19 | 2014-06-19 | Kabushiki Kaisha Toshiba | Key management device, communication device, communication system, and computer program product |
US20160119291A1 (en) * | 2014-10-24 | 2016-04-28 | Netflix, Inc | Secure communication channel with token renewal mechanism |
CN110266642A (zh) * | 2019-05-15 | 2019-09-20 | 网宿科技股份有限公司 | 身份认证方法及服务器、电子设备 |
CN111212095A (zh) * | 2020-04-20 | 2020-05-29 | 国网电子商务有限公司 | 一种身份信息的认证方法、服务器、客户端及系统 |
KR20210126319A (ko) * | 2020-04-10 | 2021-10-20 | 한국전자통신연구원 | 키 관리 장치 및 방법 |
CN113676452A (zh) * | 2021-07-15 | 2021-11-19 | 北京思特奇信息技术股份有限公司 | 基于一次性密钥的重放攻击抵御方法及系统 |
-
2022
- 2022-06-08 CN CN202210642540.4A patent/CN117240486A/zh active Pending
-
2023
- 2023-06-06 WO PCT/CN2023/098486 patent/WO2023236925A1/zh unknown
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140173283A1 (en) * | 2012-12-19 | 2014-06-19 | Kabushiki Kaisha Toshiba | Key management device, communication device, communication system, and computer program product |
US20160119291A1 (en) * | 2014-10-24 | 2016-04-28 | Netflix, Inc | Secure communication channel with token renewal mechanism |
CN110266642A (zh) * | 2019-05-15 | 2019-09-20 | 网宿科技股份有限公司 | 身份认证方法及服务器、电子设备 |
KR20210126319A (ko) * | 2020-04-10 | 2021-10-20 | 한국전자통신연구원 | 키 관리 장치 및 방법 |
CN111212095A (zh) * | 2020-04-20 | 2020-05-29 | 国网电子商务有限公司 | 一种身份信息的认证方法、服务器、客户端及系统 |
CN113676452A (zh) * | 2021-07-15 | 2021-11-19 | 北京思特奇信息技术股份有限公司 | 基于一次性密钥的重放攻击抵御方法及系统 |
Also Published As
Publication number | Publication date |
---|---|
CN117240486A (zh) | 2023-12-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109347835B (zh) | 信息传输方法、客户端、服务器以及计算机可读存储介质 | |
Vanhoef et al. | Key reinstallation attacks: Forcing nonce reuse in WPA2 | |
Vanhoef et al. | Release the Kraken: new KRACKs in the 802.11 Standard | |
CN105162772B (zh) | 一种物联网设备认证与密钥协商方法和装置 | |
EP2590356B1 (en) | Method, device and system for authenticating gateway, node and server | |
CN103596173B (zh) | 无线网络认证方法、客户端及服务端无线网络认证装置 | |
CN104145465B (zh) | 机器类型通信中基于群组的自举的方法和装置 | |
WO2017028593A1 (zh) | 网络接入设备接入无线网络接入点的方法、网络接入设备、应用程序服务器和非易失性计算机可读存储介质 | |
US20140298037A1 (en) | Method, apparatus, and system for securely transmitting data | |
CN108243176B (zh) | 数据传输方法和装置 | |
CN100512201C (zh) | 用于处理分组业务的接入-请求消息的方法 | |
CN109167802B (zh) | 防止会话劫持的方法、服务器以及终端 | |
CN110545252B (zh) | 一种认证和信息保护的方法、终端、控制功能实体及应用服务器 | |
CN111030814A (zh) | 秘钥协商方法及装置 | |
WO2016188335A1 (zh) | 用户数据的访问控制方法、装置及系统 | |
WO2013034187A1 (en) | Secure communication | |
EP3808025A1 (en) | Decentralised authentication | |
CN109729000B (zh) | 一种即时通信方法及装置 | |
CN110855695A (zh) | 一种改进的sdn网络安全认证方法及系统 | |
KR20150135032A (ko) | Puf를 이용한 비밀키 업데이트 시스템 및 방법 | |
CN115473655B (zh) | 接入网络的终端认证方法、装置及存储介质 | |
CN104243452A (zh) | 一种云计算访问控制方法及系统 | |
WO2015180399A1 (zh) | 一种认证方法及装置系统 | |
CN105591748B (zh) | 一种认证方法和装置 | |
CN110035035B (zh) | 一种单点登录的二次认证方法及系统 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23819090 Country of ref document: EP Kind code of ref document: A1 |