A method and system for authentication between a terminal side device and a network side device
Through the authentication protocol type interaction between the terminal-side device and the network-side device, the authentication interdependence problem caused by the authentication algorithm update after the device is upgraded is solved, and seamless authentication negotiation and improved authentication efficiency are achieved.
Patent Information
- Application Number
- CN202111324852.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2041-11-10
AI Technical Summary
After the terminal-side device and the network-side device are upgraded, they cannot be authenticated due to the update of the authentication algorithm, and there is a problem of interdependence.
Through the authentication protocol type interaction between the terminal-side device and the network-side device, the authentication protocol type supported by both parties is determined and authenticated according to the protocol type to avoid interdependence.
It realizes seamless authentication negotiation between terminal-side equipment and network-side equipment in the process of software and hardware resource iteration, improving authentication efficiency and reliability.
Smart Images

Figure CN114051244B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communications, and in particular, to an authentication method between a terminal side device and a network side device. Background Art
[0002] At present, the authentication method between the terminal side device and the network side device is usually completed by pre-buried public and private keys and a fixed algorithm. For example, in the IoT system, the IoT device and platform pre-store public and private keys and the same algorithm, and use the algorithm and public and private keys for authentication.
[0003] When the terminal side device or the network side device is upgraded, the authentication algorithm of the upgraded device is usually also upgraded. In this way, the authentication algorithm is no longer the same as the authentication algorithm of the non-upgraded device, resulting in authentication failure between the upgraded device and the non-upgraded device. Summary of the invention
[0004] The present invention provides an authentication method between a terminal side device and a network side device, so as to avoid mutual dependence between the terminal side device and / or the network side device during authentication.
[0005] The present invention provides an authentication method between a terminal side device and a network side device, the method comprising: on the side of any device of the terminal side device and the network side device,
[0006] The local device interacts with the other device on authentication protocol types to determine authentication protocol types supported by both devices, wherein the authentication protocol types correspond to authentication methods;
[0007] The local device performs authentication between the two devices according to the authentication method corresponding to the determined authentication protocol type, and enables the other device to perform authentication between the two devices according to the authentication method corresponding to the determined authentication protocol type.
[0008] Preferably, the authentication protocol type interaction between the local device and the counterpart device includes:
[0009] a first authentication protocol type supported by default by either device in the interaction between the two devices, and a second authentication protocol type selected from the authentication protocol type group when either device does not support the first authentication protocol type,
[0010] or
[0011] The two devices interact with each other and select a second authentication protocol type from the authentication protocol type group;
[0012] The authentication protocol type group includes at least one authentication protocol type, and each authentication protocol type corresponds to an authentication method.
[0013] Preferably, the second authentication protocol type is: an authentication protocol type with the highest priority in an authentication protocol type group, and the authentication protocol type group is the intersection of a terminal side device authentication protocol type group and a network side device authentication protocol type group;
[0014] The first authentication protocol type supported by either device of the two-party device interaction by default, and the second authentication protocol type selected from the authentication protocol type group when either device does not support the first authentication protocol type, include:
[0015] The local device sends the first authentication protocol type and the authentication protocol type group that are supported by either device by default to the other device, so that the other device selects the second authentication protocol type from the authentication protocol type group when the first authentication protocol type is not supported, and sends the adopted authentication protocol type to the local device.
[0016] Preferably, the second authentication protocol type selected from the authentication protocol type group by the two devices for interaction includes:
[0017] The local device sends an authentication protocol type group to the other device, so that the other device selects a second authentication protocol type from the authentication protocol type group and sends it to the local device,
[0018] The local device performs authentication between the two devices according to the authentication method corresponding to the determined authentication protocol type, and causes the other device to perform authentication between the two devices according to the authentication method corresponding to the determined authentication protocol type, including:
[0019] The two devices perform authentication using the authentication methods corresponding to the second authentication protocol type.
[0020] Preferably, the second authentication protocol type selected from the authentication protocol type group by the two devices for interaction includes:
[0021] The local device sends an authentication protocol type group to the other device, so that the other device selects a second authentication protocol type from the authentication protocol type group and sends it to the local device,
[0022] The local device receives the second authentication protocol type from the other device, determines whether it supports the second authentication protocol type, and if not, notifies the other device to reselect, or selects the authentication protocol type supported by the local device from the authentication protocol type group and sends it to the other device, so that the other device selects the authentication protocol type supported by the other device from the supported authentication protocol types and sends it to the local device.
[0023] Preferably, the authentication method includes one of a public-private key pair generation method, a master key generation method, a shared key generation method, an encryption and decryption method, and a digest generation method, or any combination thereof.
[0024] The second authentication protocol type is an optimal authentication protocol type selected according to the security level;
[0025] The authentication between the two devices includes:
[0026] The first authentication of the local device being authenticated by the other device, and
[0027] The second authentication is performed by the local device to authenticate the other device.
[0028] Preferably, the first authentication of the local device being authenticated by the other device includes:
[0029] On the local device side,
[0030] Generate the public and private key pair of your device according to the public and private key pair generation method corresponding to the authentication protocol type.
[0031] Generate a shared key for your device based on the shared key generation method corresponding to the authentication protocol type.
[0032] According to the encryption and decryption method corresponding to the authentication protocol type, the public key is encrypted using the shared key to obtain the encrypted public key.
[0033] The first device identification, device verification code and encrypted public key of the local device are sent to the other device, so that the other device:
[0034] Generate a shared key of the other party's device using the first device identifier and the device verification code according to a shared key generation method corresponding to the authentication protocol type,
[0035] According to the encryption and decryption method corresponding to the authentication protocol type, the shared key of the other party's device is used to decrypt the encrypted public key of the local device to obtain the public key of the local device.
[0036] According to the public-private key pair generation method corresponding to the authentication protocol type, the private key of the other party's device and the public key of the local device are used to generate the master key of the other party's device.
[0037] According to the encryption and decryption method corresponding to the authentication protocol type, the public key of the other party's device is encrypted using the total key of the other party's device to obtain the encrypted public key of the other party's device.
[0038] Preferably, the second authentication performed by the local device on the other device includes:
[0039] The local device receives the encrypted public key of the other device sent by the other device.
[0040] According to the encryption and decryption method corresponding to the authentication protocol type, use the shared key of the device to decrypt the encrypted public key of the other device to obtain the public key of the other device.
[0041] According to the public-private key pair generation method corresponding to the authentication protocol type, use the private key of your device and the public key of the other device to generate the master key of your device.
[0042] According to the digest generation method corresponding to the authentication protocol type, the digest of the first device identifier is generated using the total key of the local device to obtain a first result,
[0043] The first result is sent to the other device, so that the other device:
[0044] According to the digest generation method corresponding to the authentication protocol type, the digest of the first device identifier is generated using the total key of the other party's device to obtain a second result,
[0045] Verify the first result and the second result, and when the verification passes, generate a session key and a second device identifier,
[0046] According to the encryption and decryption method corresponding to the authentication protocol type, the session key and the second device identification are encrypted using the master key of the other party's device to obtain the encrypted session key and the second device identification.
[0047] Sending the second result, the encrypted session key, and the second device identifier to the local device;
[0048] The local device receives the second result, the encrypted session key and the second device identifier from the other device,
[0049] According to the digest generation method corresponding to the authentication protocol type, the digest of the first device identifier is generated using the total key of the local device to obtain a third result.
[0050] Verify the second result and the third result. When the verification passes, decrypt the encrypted session key and the second device identifier using the master key of the local device according to the encryption and decryption method corresponding to the authentication protocol type.
[0051] The present invention also provides a terminal side device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute steps of implementing an authentication method between any of the terminal side devices and the network side device.
[0052] The present invention further provides a network side device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute steps of implementing an authentication method between any terminal side device and the network side device.
[0053] The present invention further provides an Internet of Things system, comprising the above-mentioned terminal side device and the above-mentioned network side device.
[0054] The present invention provides an authentication method between a terminal side device and a network side device. Through the interaction of authentication protocol types between the two devices, the two parties can find at least one authentication protocol type through negotiation, so that the two parties perform authentication in accordance with the authentication method corresponding to the negotiated authentication protocol type, thereby avoiding the problem of mutual dependence of the two devices on the authentication method during the iteration of software and hardware resources. Furthermore, through the first authentication protocol type supported by the interactive device by default, and the second authentication protocol type selected from the authentication protocol type group when either device does not support the first authentication protocol type, or the second authentication protocol type selected from the authentication protocol type group through interaction, it is not only provided with abundant authentication protocol type negotiation resources, but also conducive to accelerating the negotiation speed of the authentication protocol type, thereby improving the authentication efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A schematic diagram of a process for authenticating a terminal-side device and a network-side device in an embodiment of the present application.
[0056] Figure 2a and 2b A flowchart of authentication between a terminal device and a network device.
[0057] Figure 3a and 3b The figure is a flowchart showing a situation in which the negotiation between the terminal side device and the network side device is inconsistent.
[0058] Figure 4 A flowchart of authentication between a terminal-side device and a network-side device according to Embodiment 2 of the present application.
[0059] Figure 5 A flowchart of authentication between a terminal-side device and a network-side device in Embodiment 3 of the present application is provided.
[0060] Figure 6 Another flowchart of authentication between a terminal-side device and a network-side device according to the third embodiment of the present application.
[0061] Figure 7 A flowchart of authentication between a terminal-side device and a network-side device in Embodiment 4 of the present application.
[0062] Figure 8 Another flowchart of authentication between a terminal-side device and a network-side device according to Embodiment 4 of the present application is provided.
[0063] Fig. 9 A schematic diagram of a terminal side device or a network side device.
[0064] Fig.10 A schematic diagram of a terminal side device or a network side device. DETAILED DESCRIPTION
[0065] In order to make the objectives, technical means and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings.
[0066] This application performs authentication through the authentication protocol type negotiated between the terminal side device and the network side device, using the authentication method corresponding to the authentication protocol type, thereby avoiding mutual dependence between the terminal side device and / or the network side device during authentication.
[0067] See also Figure 1 As shown, Figure 1 A schematic diagram of a process for authenticating a terminal side device and a network side device in an embodiment of the present application. The method includes:
[0068] Step 101: The terminal side device and the network side device interact with each other on authentication protocol types to determine the authentication protocol types supported by both devices, so that the terminal side device and the network side device negotiate to obtain an authentication protocol type.
[0069] Step 102, the two devices perform authentication between the two devices according to the authentication methods corresponding to the authentication protocol types supported;
[0070] in,
[0071] The authentication protocol type corresponds to an authentication method;
[0072] The authentication between the two devices includes:
[0073] A first authentication in which any one of the two devices is authenticated by the other device, and
[0074] The second authentication is performed by the local device to authenticate the other device.
[0075] Embodiment 1
[0076] In this embodiment, the two devices interact with the first authentication protocol type supported by the terminal side device by default, and the second authentication protocol type selected by the network side device from the authentication protocol type group when the terminal side device does not support the first authentication protocol type, wherein the authentication protocol type group is the intersection of the terminal side device authentication protocol type group and the network side device authentication protocol type group, and the second authentication protocol type is the authentication protocol type with the highest priority in the authentication protocol type group. If the two parties do not have a corresponding authentication type, the interaction will stop.
[0077] See also Figure 2a and 2b As shown, Figure 2a and 2b A flow chart of authentication between a terminal side device and a network side device. The authentication method includes:
[0078] On the terminal side, for example, IoT devices,
[0079] In step 201, the terminal side device obtains a first authentication protocol type, recorded as default_auth_type, which can be an authentication protocol type supported by the device by default, or an authentication protocol type supported by the network side device by default.
[0080] As shown in the following table, the first authentication protocol type corresponds to an authentication method, which includes one of a public-private key pair generation method, a Masterkey generation method, a shared key Sharekey generation method, an encryption and decryption method, and a digest generation method, or any combination thereof; the specific method is determined according to the authentication requirements, and the above method can be understood as a specific algorithm.
[0081]
[0082] Step 202, obtain the authentication type protocol group supported by the terminal side device, recorded as auth_type_group, the authentication type protocol group includes more than one authentication protocol type, each authentication protocol type corresponds to a public-private key pair generation method, a masterkey generation method, a shared key Sharekey generation method, an encryption and decryption method, a digest generation method or any combination thereof. It is determined specifically according to the requirements of the authentication. In this embodiment, it is a combination of all authentication methods. The above method can be understood as a specific algorithm.
[0083]
[0084] Step 203, read the first device identification and device verification code pre-stored in the terminal side device, which are respectively recorded as devid and devauthcode.
[0085] The first device identifier may be a device serial number, which is a string used to identify a device. Each physical device has a different identifier.
[0086] The device verification code is a string of characters stored in the device hardware, which is non-volatile and cannot be changed.
[0087] Step 204: Generate a public and private key pair of the terminal device according to the public and private key pair generation algorithm agreed upon by the first authentication protocol type obtained in step 201, denoted as dev_privatekey, dev_publickey,
[0088] Step 205: Generate the shared key of the terminal, denoted as dev_sharekey, using the pre-stored devid and devauthcode according to the shared key Sharekey generation algorithm agreed upon by the first authentication protocol type obtained in step 201.
[0089] Step 206: according to the encryption and decryption algorithm agreed upon by the first authentication protocol type obtained in step 201, the public key devic_publickey of the terminal is encrypted using the shared key Sharekey to obtain the encrypted devic_publickey, which is recorded as cipher(devic_publickey).
[0090] Step 207, transmitting the first authentication protocol type obtained in step 201, the authentication type protocol group obtained in step 202, the first device identifier devid and devauthcode obtained in step 203, and the cipher (devic_publickey) obtained in step 206 to the network side device through the TCP session.
[0091] In the above process, given that in most cases in actual applications the network side device is upgraded while the terminal side device is not, resulting in the inability to perform authentication, the probability that the terminal side device supports the default first authentication protocol type is relatively high. In this way, the parameters used for authentication can be calculated first, for example, calculating the public-private key pair, shared key, encrypted public key, etc.; in addition, the first authentication protocol type and authentication type protocol group are sent to the network side together with the first device identification, device verification code, and cipher (devic_publickey). This is beneficial to reduce the number of times the terminal side device sends to the network side device, thereby helping to improve the reliability of the authentication process.
[0092] As a variation, the first authentication protocol type and authentication type protocol group may be sent to the network side before reading the first device identification and device verification code pre-stored in the terminal side device, so as to negotiate the authentication protocol type with the network side.
[0093] On the network side, for example, platforms, servers, etc.
[0094] Step 208, determining whether the first authentication protocol type of the terminal side device is supported,
[0095] Step 209, determining the first authentication protocol type supported by the terminal side device,
[0096] Step 210: Generate a public-private key pair of the network side device according to the public-private key pair generation algorithm agreed upon in the first authentication protocol type, denoted as plt_privatekey, plt_publickey, where plt_privatekey is the private key and plt_publickey is the public key.
[0097] Step 211, according to the shared key generation algorithm agreed upon in the first authentication protocol type, use the pre-stored devid and devauthcode to generate a shared key of the network side device, recorded as plt_sharekey,
[0098] Step 212: Decrypt cipher(dev_publickey) using plt_sharekey as the key according to the encryption and decryption algorithm agreed upon by the first authentication protocol type to obtain dev_publickey.
[0099] Step 213: Generate the network side device master key, denoted as plt_masterkey, using the private key plt_privatekey and dev_publickey of the network side device according to the master key generation algorithm agreed upon in the first authentication protocol type.
[0100] Step 214: according to the encryption and decryption algorithm agreed upon in the first authentication protocol type, the public key plt_publickey of the network side device is encrypted using the network side device master key to obtain the encrypted public key of the network side device, which is recorded as cipher(plt_publickey).
[0101] Step 215: Transmit the cipher (plt_publickey) and the adopted authentication protocol type to the terminal side device through the TCP session.
[0102] On the terminal side device,
[0103] Step 216: Receive the authentication protocol type from the network side device, and determine that the authentication protocol type of the network side device is consistent with the authentication protocol type default_auth_type of the terminal side device.
[0104] Step 217: If they are consistent, the shared key dev_sharekey of the terminal device is used to decrypt the cipher (plt_publickey) according to the encryption and decryption algorithm agreed by default_auth_type to obtain the public key plt_publickey of the network device.
[0105] Step 218: According to the master key generation algorithm agreed upon by default_auth_type, the private key dev_privatekey of the terminal side device and the private key plt_publickey of the network side device are used to generate the master key of the terminal side device, which is recorded as dev_masterkey.
[0106] The total key is a key that is generated by the terminal side device and the network side device during the authentication process and is used for a relatively long time, and its life cycle is controlled by the network side device.
[0107] Step 219: According to the digest generation algorithm agreed upon by default_auth_type, the master key dev_masterkey of the terminal device is used to generate a digest of devid to obtain a first result, which is recorded as Digest(devid).
[0108] Step 220: Transmit the first result Digest (devid) to the network side device through the TCP session.
[0109] On the network side equipment,
[0110] Step 221, according to the digest generation algorithm agreed by default_auth_type, use the master key plt_masterkey of the network side device to generate a digest for devid, and obtain a second result, which is recorded as Digest1(devid)
[0111] Step 222, verify the first result Digest (devid) and the second result Digest1 (devid),
[0112] Step 223, when the verification passes, a session key sessionkey and a second device identifier deviceid are generated, and the second device identifier is assigned to the terminal side device by the network side device. Otherwise, the authentication fails and the authentication process ends.
[0113] Step 224: according to the encryption and decryption algorithm agreed by default_auth_type, use the master key plt_masterkey of the network side device to encrypt sessionkey and deviceid to obtain the encrypted session key cipher(sessionkey) and the encrypted second device identifier cipher(deviceid).
[0114] Step 225: According to the digest generation algorithm agreed upon by default_auth_type, the master key plt_masterkey of the network-side device is used to generate a digest of devid to obtain a third result, which is recorded as Digest2(devid).
[0115] Since the total key is usually within its life cycle, the third result is the same as the second result, and the third result may not be calculated any more.
[0116] Step 226, send cipher (deviceid), cipher (sessionkey), and Digest2 (devid) or Digest1 (devid) to the terminal side device through the TCP session.
[0117] On the terminal side device,
[0118] Step 227: According to the digest generation algorithm agreed upon by default_auth_type, the master key dev_masterkey of the terminal device is used to generate a digest of devid to obtain a fourth result, which is recorded as Digest3(devid).
[0119] Step 228, verify the third result Digest2(devid) and the fourth result Digest3(devid), or verify the second result Digest1(devid) and the fourth result Digest3(devid)
[0120] Step 229, when the verification passes, according to the encryption and decryption algorithm agreed upon by default_auth_type, use the master key dev_masterkey of the terminal side device to decrypt cipher(deviceid) and cipher(sessionkey) to obtain the session key sessionkey and the second device identifier deviceid. Otherwise, the authentication fails and the authentication process ends.
[0121] Step 230: In view of the possible change of the session link during the authentication process, the first result Digest (devid) is transmitted to the network side device again through the TCP session.
[0122] On the network side equipment,
[0123] Step 231, according to the digest generation algorithm agreed upon by default_auth_type, the master key plt_masterkey of the network side device is used to generate a digest for devid again through a digest generation algorithm (such as the hmac-sha384 algorithm), and a fifth result is obtained, which is recorded as Digest4(devid).
[0124] Since the total key is usually within the life cycle, the fifth result is the same as the second result, and the fifth result may not be calculated again.
[0125] Step 232, verifying the first result and the fifth result, or verifying the first result and the second result,
[0126] Step 233, when the verification passes, devid, deviceid, plt_masterkey, and sessionkey are stored as a record; otherwise, the authentication fails and the authentication process ends.
[0127] On the terminal side device,
[0128] Step 234, using the session key sessionkey as the key for communicating with the network side device, encrypting the context to be transmitted, and obtaining the encrypted context, recorded as cipher(context),
[0129] Step 235: Transmit the encrypted context cipher(context) to the network side device via the TCP session.
[0130] Steps 204 to 215 are the first authentication performed by the terminal side device on the network side device.
[0131] Steps 216 to 235 are the second authentication performed by the network side device on the terminal side device.
[0132] See also Figure 3a and 3b As shown, Figure 3a and 3b The figure is a flowchart showing a situation in which the negotiation between the terminal side device and the network side device is inconsistent.
[0133] On the terminal side device,
[0134] Steps 301 to 307 are the same as steps 301 to 307.
[0135] On the network side equipment,
[0136] Step 308, determining whether the first authentication protocol type of the terminal side device is supported,
[0137] Step 309: when it is not supported, a second authentication protocol type is selected from the authentication type protocol group according to the received authentication type protocol group auth_type_group, and the second authentication protocol type is the optimal authentication protocol type selected according to the security level, and is recorded as vote_auth_type.
[0138] Step 310: Transmit the second authentication protocol type to the terminal side device via the TCP session.
[0139] On the terminal side device,
[0140] Step 311, search for vote_auth_type in auth_type_group,
[0141] Step 312: set vote_auth_type as the authentication protocol type for this authentication.
[0142] Since the authentication type protocol group originates from the terminal side device, the second authentication protocol type must be included in the authentication type protocol group, and therefore, steps 311 to 312 may not be performed.
[0143] Step 313: Generate a public and private key pair of the terminal device according to the public and private key pair generation algorithm agreed upon by the authentication protocol type vote_auth_type obtained in step 312, denoted as dev_privatekey, dev_publickey,
[0144] Step 314: Generate a shared key for the terminal device, denoted as dev_sharekey, using the pre-stored devid and devauthcode according to the shared key generation algorithm agreed upon by the authentication protocol type vote_auth_type obtained in step 312.
[0145] Step 315: encrypt devic_public using the shared key according to the encryption and decryption algorithm agreed upon by the authentication protocol type vote_auth_type obtained in step 312, and obtain the encrypted devic_public, recorded as cipher(devic_public).
[0146] Step 316: Transmit the cipher (devic_public) obtained in step 315 to the network side device through the TCP session.
[0147] On the network side equipment,
[0148] Step 317: Generate a public-private key pair on the network side according to the public-private key pair generation algorithm specified in the selected authentication protocol type vote_auth_type, denoted as plt_privatekey, plt_publickey, where plt_privatekey is the private key and plt_publickey is the public key.
[0149] Step 318: Generate a shared key for the network device using the pre-stored devid and devauthcode according to the shared key generation algorithm specified in the authentication protocol type vote_auth_type, denoted as plt_sharekey.
[0150] Step 319: According to the encryption and decryption algorithm specified by the authentication protocol type vote_auth_type, use plt_sharekey as the key to decrypt cipher (dev_publickey) to obtain dev_publickey.
[0151] Step 320: Generate the master key of the network side device, denoted as plt_masterkey, using the private key plt_privatekey and dev_publickey of the network side device according to the master key generation algorithm agreed upon by the authentication protocol type vote_auth_type.
[0152] Step 321: according to the encryption and decryption algorithm agreed upon by the authentication protocol type vote_auth_type, the public key plt_publickey of the network side device is encrypted using the total key of the network side device to obtain the encrypted public key of the network side device, which is recorded as cipher(plt_publickey).
[0153] Step 322: Transmit the cipher (plt_publickey) to the terminal side device through the TCP session.
[0154] On the terminal side device,
[0155] Step 323: Decrypt cipher (plt_publickey) using the shared key dev_sharekey of the terminal device according to the encryption and decryption algorithm agreed by vote_auth_type to obtain the public key plt_publickey of the network device.
[0156] Step 324: According to the master key generation algorithm agreed upon by vote_auth_type, the private key dev_privatekey of the terminal side device and the private key plt_publickey of the network side device are used to generate the master key of the terminal side device, which is recorded as dev_masterkey.
[0157] Step 325: According to the digest generation algorithm agreed upon by vote_auth_type, the master key dev_masterkey of the terminal device is used to generate a digest of devid to obtain a first result, which is recorded as Digest(devid).
[0158] Step 326: Transmit the first result Digest (devid) to the network side device through the TCP session.
[0159] On the network side equipment,
[0160] Step 327: According to the digest generation algorithm agreed upon by vote_auth_type, the network-side master key plt_masterkey is used to generate a digest for devid, and a second result is obtained, which is recorded as Digest1(devid).
[0161] Step 328, verify the first result Digest (devid) and the second result Digest1 (devid),
[0162] Step 329: When the verification is passed, a session key sessionkey and a second device identifier deviceid are generated, and devid, deviceid, masterkey, and sessionkey are stored as a record.
[0163] Step 330: According to the encryption and decryption algorithm agreed by vote_auth_type, the master key plt_masterkey of the network side device is used to encrypt sessionkey and deviceid to obtain the encrypted session key cipher(sessionkey) and the encrypted second device identifier cipher(deviceid).
[0164] Step 331, send cipher (deviceid), cipher (sessionkey), and Digest1 (devid) to the terminal side device through the TCP session.
[0165] On the terminal side device,
[0166] Step 332: According to the digest generation algorithm agreed upon by vote_auth_type, the master key dev_masterkey of the terminal device is used to generate a digest for devid, and a third result is obtained, which is recorded as Digest2(devid).
[0167] Step 333: verify the second result Digest1(devid) and the third result Digest2(devid),
[0168] Step 334, when the verification passes, according to the encryption and decryption algorithm agreed upon by vote_auth_type, the master key dev_masterkey of the terminal side device is used to decrypt cipher(deviceid) and cipher(sessionkey) to obtain the session key sessionkey and the second device identifier deviceid.
[0169] Step 335: Use the session key sessionkey as the key for communicating with the network side to encrypt the context to be transmitted, and obtain the encrypted context, which is recorded as cipher(context).
[0170] Step 336: Transmit the encrypted context cipher(context) to the network side device via the TCP session.
[0171] Steps 304 to 316 are the first authentication performed by the terminal side device on the network side device.
[0172] Steps 317 to 335 are the second authentication performed by the network side device on the terminal side device.
[0173] In this embodiment, the decision-making power of negotiation lies with the network-side device, thereby ensuring that the optimal authentication protocol type is selected within the range of authentication protocol types supported by the terminal-side device.
[0174] Embodiment 2
[0175] See also Figure 4 As shown, Figure 4 This is a flow chart of authentication between a terminal side device and a network side device in Embodiment 2 of the present application. The authentication method includes:
[0176] Step 401: The network side device sends the first authentication protocol type and the authentication protocol type group supported by any device by default to the terminal side device.
[0177] Among them, the first authentication protocol type can be supported by the terminal side device by default. For example, when the terminal side device accesses the network side device, the network side can obtain the authentication protocol type supported by the terminal side device by default; the first authentication protocol type can also be supported by the network side device by default.
[0178] Step 402: The terminal side device determines whether it supports the first authentication protocol type.
[0179] If not supported, a second authentication protocol type is selected from the authentication protocol type group and sent to the network side device, where the second authentication protocol type is the optimal authentication protocol type supported by the terminal side device selected according to the security level.
[0180] If supported, the authentication method corresponding to the first authentication protocol type is used for authentication, and the supported first authentication protocol type is sent to the network side device.
[0181] Step 403: The network side device performs authentication according to the authentication method corresponding to the received authentication protocol type.
[0182] If the network side device receives the second authentication protocol type from the terminal side device, it performs authentication using the authentication method corresponding to the second authentication protocol type;
[0183] Otherwise, the network side device performs authentication using the authentication method corresponding to the first authentication protocol type.
[0184] The specific authentication process may be the same as that of the first embodiment.
[0185] Embodiment 3
[0186] In this embodiment, any local device of the two devices sends an authentication protocol type group to the other device, so that the other device selects a second authentication protocol type from the authentication protocol type group and sends it to the local device.
[0187] See also Figure 5 As shown, Figure 5 This is a flow chart of authentication between a terminal side device and a network side device in Embodiment 3 of the present application. The authentication method includes:
[0188] Step 501: The terminal side device sends the authentication protocol type group supported by the terminal side device to the network side device.
[0189] Step 502: The network side device selects a second authentication protocol type from the authentication protocol type group and sends it to the terminal side device, where the second authentication protocol type is the optimal authentication protocol type selected according to the security level.
[0190] Step 503: The terminal side device and the network side device respectively perform authentication using the authentication method corresponding to the second authentication protocol type.
[0191] The specific authentication process may be the same as that of the first embodiment.
[0192] See also Figure 6 As shown, Figure 6 This is another flow chart of authentication between a terminal side device and a network side device in Embodiment 3 of the present application. The authentication method includes:
[0193] Step 601: The network side device sends a terminal side device authentication protocol type group to the terminal side device.
[0194] Preferably, the authentication protocol type group is a collection of authentication protocol types supported by the terminal side device, which can be obtained when the terminal side device accesses the network.
[0195] Step 602: The terminal side device selects a second authentication protocol type from the authentication protocol type group and sends it to the network side device, where the second authentication protocol type is the optimal authentication protocol type selected according to the security level.
[0196] Step 603: The terminal side device and the network side device respectively perform authentication using the authentication method corresponding to the second authentication protocol type.
[0197] The specific authentication process may be the same as that of the first embodiment.
[0198] In this embodiment, any local device of the two devices sends an authentication protocol type group to the other device, so that the other device selects a second authentication protocol type from the authentication protocol type group and sends it to the local device.
[0199] Embodiment 4
[0200] In this embodiment, any local device of the terminal side device and the network side device sends an authentication protocol type group to the other device, so that the other device selects a second authentication protocol type from the authentication protocol type group and sends it to the local device.
[0201] The local device receives the second authentication protocol type from the other device, determines whether it supports the second authentication protocol type, and if not, notifies the other device to reselect. For example, the other device selects one by one in the authentication protocol type group and returns it to the local device until all authentication protocol types in the authentication protocol type group are traversed; or, in order to improve the efficiency of interaction, selects the authentication protocol type supported by the local device from the authentication protocol type group and sends it to the other device, so that the other device selects the authentication protocol type supported by the other device from the supported authentication protocol types and sends it to the local device.
[0202] See also Figure 7 As shown, Figure 7This is a flow chart of authentication between a terminal side device and a network side device in Embodiment 4 of the present application. The authentication method includes:
[0203] Step 701: The terminal side device sends an authentication protocol type group to the network side device.
[0204] Step 702: The network side device selects a second authentication protocol type from the authentication protocol type group and sends it to the terminal side device, where the second authentication protocol type is the optimal authentication protocol type selected according to the security level.
[0205] Step 703: The terminal side device receives the second authentication protocol type from the other party device and determines whether the second authentication protocol type is supported.
[0206] If it is not supported, the network side device is notified so that the network side device can reselect, or the authentication protocol type supported by the terminal side device is selected from the authentication protocol type group and sent to the network side device.
[0207] If supported, the second authentication protocol type is sent to the network side device.
[0208] Step 704: The terminal side device and the network side device respectively perform authentication using the authentication method corresponding to the authentication protocol type.
[0209] The specific authentication process may be the same as that of the first embodiment.
[0210] See also Figure 8 As shown, Figure 8 This is another flow chart of authentication between a terminal side device and a network side device in Embodiment 4 of the present application. The authentication method includes:
[0211] Step 801: The network side device sends an authentication protocol type group to the terminal side device.
[0212] Step 802: The terminal side device selects a second authentication protocol type from the authentication protocol type group and sends it to the network side device, where the second authentication protocol type is the optimal authentication protocol type supported by the terminal side device selected according to the security level.
[0213] Step 803: The network side device receives the second authentication protocol type from the other device and determines whether the second authentication protocol type is supported.
[0214] If it is not supported, the terminal side device is notified so that the terminal side device reselects, or the network side device selects the authentication protocol type supported by the network side device from the authentication protocol type group and sends it to the terminal side device.
[0215] If supported, the second authentication protocol type is sent to the terminal side device,
[0216] Step 804: The terminal side device and the network side device respectively perform authentication using the authentication method corresponding to the authentication protocol type.
[0217] The specific authentication process may be the same as that of the first embodiment.
[0218] See also Fig. 9 As shown, Fig. 9 A schematic diagram of a terminal side device or a network side device. The device includes:
[0219] An interaction module, used to interact with the other device on the authentication protocol type to determine the authentication protocol types supported by both devices, wherein the authentication protocol type corresponds to an authentication method;
[0220] The authentication module is used to authenticate the devices of both parties according to the authentication method corresponding to the determined authentication protocol type.
[0221] The interaction module includes:
[0222] The first interaction module is used to interact with the first authentication protocol type supported by any device by default.
[0223] The second interaction module is used to interact with a second authentication protocol type selected from the authentication protocol type group when the first authentication protocol type is not supported; or to interact with a second authentication protocol type selected from the authentication protocol type group.
[0224] The certification modules include:
[0225] A first authentication module, used for the first authentication of the local device by the other device;
[0226] The second authentication module is used for the local device to perform a second authentication on the other device.
[0227] See also Fig.10 As shown, Fig.10 A schematic diagram of a terminal side device or a network side device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute steps to implement an authentication method between the terminal side device and the network side device.
[0228] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0229] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0230] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the authentication method between the terminal side device and the network side device are implemented.
[0231] As for the apparatus / network-side device / storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0232] In this article, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0233] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An authentication method between a terminal side device and a network side device, characterized in that: The method includes, at any one of the terminal side device and the network side device, The local device sends the first authentication protocol type supported by any one of the devices by default and the authentication protocol type group supported by the local device to the other device, so that the other device selects a second authentication protocol type from the authentication protocol type group when the first authentication protocol type is not supported, and sends the authentication protocol type adopted by the other device to the local device, wherein the authentication protocol type corresponds to an authentication method, or, The local device sends the authentication protocol type group supported by the other device to the other device, so that the other device selects a second authentication protocol type from the authentication protocol type group and sends it to the local device, wherein the authentication protocol type group supported by the other device is obtained when the other device accesses. or, The local device sends an authentication protocol type group to the other device, so that the other device selects a second authentication protocol type from the authentication protocol type group and sends it to the local device. The local device receives the second authentication protocol type from the other device, determines whether it supports the second authentication protocol type, and if not, notifies the other device to reselect, or selects the authentication protocol type supported by the local device from the authentication protocol type group and sends it to the other device, so that the other device selects the authentication protocol type supported by the other device from the authentication protocol types supported by the local device, and sends it to the local device; the local device performs authentication between the two devices according to the authentication method corresponding to the determined authentication protocol type, and causes the other device to perform authentication between the two devices according to the authentication method corresponding to the determined authentication protocol type; in, The authentication protocol type group includes at least one authentication protocol type, each authentication protocol type corresponds to an authentication method, The authentication method includes one of a public-private key pair generation method, a master key generation method, a shared key generation method, an encryption and decryption method, and a digest generation method, or any combination thereof.
2. The authentication method according to claim 1, characterized in that: The second authentication protocol type is: an authentication protocol type with the highest priority in the authentication protocol type group.
3. The authentication method according to claim 1, characterized in that: The second authentication protocol type is an optimal authentication protocol type selected according to the security level; The authentication between the two devices includes: The first authentication of the local device being authenticated by the other device, and The second authentication is performed by the local device to authenticate the other device.
4. The authentication method according to claim 3, characterized in that: The first authentication of the local device being authenticated by the other device includes: On the local device side, Generate the public and private key pair of your device according to the public and private key pair generation method corresponding to the authentication protocol type. Generate a shared key for your device based on the shared key generation method corresponding to the authentication protocol type. According to the encryption and decryption method corresponding to the authentication protocol type, the public key is encrypted using the shared key to obtain the encrypted public key. The first device identification, device verification code and encrypted public key of the local device are sent to the other device, so that the other device: Generate a shared key of the other party's device using the first device identifier and the device verification code according to a shared key generation method corresponding to the authentication protocol type, According to the encryption and decryption method corresponding to the authentication protocol type, the shared key of the other party's device is used to decrypt the encrypted public key of the local device to obtain the public key of the local device. According to the public-private key pair generation method corresponding to the authentication protocol type, the private key of the other party's device and the public key of the local device are used to generate the master key of the other party's device. According to the encryption and decryption method corresponding to the authentication protocol type, the public key of the other party's device is encrypted using the total key of the other party's device to obtain the encrypted public key of the other party's device.
5. The authentication method according to claim 4, characterized in that: The second authentication of the local device to the other device includes: The local device receives the encrypted public key of the other device sent by the other device. According to the encryption and decryption method corresponding to the authentication protocol type, use the shared key of the device to decrypt the encrypted public key of the other device to obtain the public key of the other device. According to the public-private key pair generation method corresponding to the authentication protocol type, use the private key of your device and the public key of the other device to generate the master key of your device. According to the digest generation method corresponding to the authentication protocol type, a digest is generated for the first device identifier of the local device using the total key of the local device to obtain a first result, The first result is sent to the other device, so that the other device: According to the digest generation method corresponding to the authentication protocol type, the digest of the first device identifier is generated using the total key of the other party's device to obtain a second result, Verify the first result and the second result, and when the verification passes, generate a session key and a second device identifier, According to the encryption and decryption method corresponding to the authentication protocol type, the session key and the second device identification are encrypted using the master key of the other party's device to obtain the encrypted session key and the second device identification. Sending the second result, the encrypted session key, and the second device identifier to the local device; The local device receives the second result, the encrypted session key and the second device identifier from the other device, According to the digest generation method corresponding to the authentication protocol type, the digest of the first device identifier is generated using the total key of the local device to obtain a third result. Verify the second result and the third result. When the verification passes, decrypt the encrypted session key and the second device identifier using the master key of the local device according to the encryption and decryption method corresponding to the authentication protocol type.
6. A terminal side device, characterized in that: It comprises a memory and a processor, the memory stores a computer program, and the processor is configured to execute the steps of implementing the authentication method between the terminal side device and the network side device as claimed in any one of claims 1 to 5.
7. A network side device, characterized in that: It comprises a memory and a processor, the memory stores a computer program, and the processor is configured to execute the steps of implementing the authentication method between the terminal side device and the network side device as claimed in any one of claims 1 to 5.
8. An Internet of Things system, characterized in that: It includes the terminal side device as described in claim 6 and the network side device as described in claim 7.
Citation Information
Patent Citations
Method for negotiating the network authentication mode
CN101188608A
Method of using communication apparatus to select communication protocol
CN1753404A
