Method and device for acquiring secret key
Patent Information
- Application Number
- CN202280094629.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2024-11-19
AI Technical Summary
In communication systems, the binding of SIM cards to the operator's network causes users to need to replace SIM cards when switching networks, resulting in poor user experience.
The terminal sends a message to the first node to access the network, receives key information for authentication, and unbinds the SIM card from the network. The user can switch networks without changing the SIM card.
It improves the user experience and simplifies the network switching process. There is no need to use the key in the SIM card for authentication between the terminal and the target network.
Smart Images

Figure CN118985144A_ABST
Abstract
Description
Method and device for obtaining key Technical Field
[0001] The present application relates to the field of communications, and in particular to a method and device for obtaining a key. Background Art
[0002] In a communication system, a terminal can access the network provided by an operator through a subscriber identity module (SIM) card. Specifically, a user selects an operator and purchases a corresponding SIM card. The SIM card is pre-installed with the root key of the SIM card. Before the SIM card is used, the SIM card vendor can send the root key of the SIM card to the operator through the production network or offline. In this way, both the operator and the terminal have a root key that can be used for authentication. When the terminal accesses the network, the operator can perform authentication based on the root key of the SIM card and provide network services to the terminal after successful authentication.
[0003] From the above description, we can see that the SIM card is bound to the operator's network. If the user wants to switch networks, he needs to replace the SIM card, which is very inconvenient and poor user experience.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a method and apparatus for obtaining a key, which can unbind a SIM card from a network. If a user wants to switch networks, there is no need to replace the SIM card.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, a method for obtaining a key is provided. The communication device executing this method may be a terminal; it may also be a module implemented in the terminal, such as a chip or chip system. The following description uses a terminal as an example. The method includes: sending a first message to a first node, the first message indicating that the terminal wishes to access a network; and receiving a second message from the first node, the second message including key information, the key information being used to determine a first key, which is used for authentication between the terminal and the target network.
[0008] Based on the method provided in the first aspect above, the terminal can trigger the first node to configure the first key for the terminal, allowing the terminal to authenticate with the target network based on the first key. This eliminates the need for the terminal to authenticate with the target network using the key stored in the SIM card, effectively unbinding the SIM card from the network. If the user wants to switch networks, they don't need to replace the SIM card, improving the user experience.
[0009] In one possible implementation, the second message further includes an identifier of the first transaction and at least one of the following: an identifier of the target network or a public key of the target network; wherein the first transaction is a blockchain transaction corresponding to the first key.
[0010] Based on the above possible implementation, the first node may further send the identifier of the first transaction, and the identifier of the target network and / or the public key of the target network to the terminal, so that the terminal authenticates the target network based on the first key and this information.
[0011] In a possible implementation, the method further includes: sending a first request to the target network, the first request being used to request access to the target network, the first request including an identifier of the first transaction; and receiving an authentication message from the target network, the authentication message corresponding to the first key.
[0012] Based on the above possible implementation manner, the terminal may trigger authentication between the terminal and the target network.
[0013] In a possible implementation manner, the method further includes: sending the identifier of the terminal to the target network.
[0014] Based on the possible implementation manner described above, the terminal may indicate to the target network the terminal to be authenticated with the target network.
[0015] In one possible implementation, the method further includes: sending a second request to the first network, the second request being used to request access to the first network, the second request including an identifier of the first transaction and an identifier of the target network; receiving first indication information from the first network, the first indication information being used to instruct the terminal to generate a second key, the second key being used for authentication between the terminal and the first network; and generating the second key based on the first key and the identifier of the first network.
[0016] Based on the above possible implementation, the terminal can trigger the first network to obtain the second key for authentication with the terminal. In this way, the terminal and the second network can authenticate based on the second key without requiring the target network to participate in the authentication, simplifying the authentication process.
[0017] In a possible implementation, the method further includes: receiving an identifier of a second transaction from the first network, where the second transaction is a blockchain transaction corresponding to the second key.
[0018] Based on the possible implementation manner described above, the first network may send the identifier of the second transaction to the terminal, so that the terminal performs authentication with the first network in combination with the identifier of the second transaction.
[0019] In one possible implementation, the method further includes: sending a third message to the first node, the third message being used to indicate a third network; receiving second indication information from the first node, the second indication information being used to instruct the terminal to generate a third key, the third key being used for authentication between the terminal and the third network; and generating the third key based on the first key and an identifier of the third network.
[0020] Based on the above possible implementation manner, the terminal may trigger the first node to configure a third key for authentication between the terminal and the third network, so that authentication can be performed between the terminal and the third network based on the third key.
[0021] In one possible implementation, an identifier of a third transaction is received from the first node, where the third transaction is a blockchain transaction corresponding to the third key.
[0022] Based on the above possible implementation manner, the first node may send the identifier of the third transaction to the terminal, so that the terminal performs authentication with the third network in combination with the identifier of the third transaction.
[0023] In a possible implementation manner, the method further includes: sending a first random number to the first network.
[0024] Based on the above possible implementation, the terminal may send the first random number to the first network, so that the first network sends the first random number to the target network, so that the target network generates a second key for authentication between the terminal and the first network based on the first key and the first random number.
[0025] In a possible implementation, the identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a serial number of the terminal in the first transaction.
[0026] Based on the possible implementations described above, the transaction identifier corresponding to the key configured by the first node for each terminal can be unique. For example, if the first transaction includes information about a single terminal, the identifier includes the address of the first transaction. If the first transaction includes information about multiple terminals, the identifier includes the address of the first transaction and the terminal's sequence number within the first transaction. In this way, the terminal can authenticate with the network based on the identifier of its corresponding transaction.
[0027] In a possible implementation manner, the target network is determined according to a selection of a user corresponding to the terminal; or, the target network is determined according to a preset policy; or, the target network is determined by the first node.
[0028] Based on the above possible implementations, the target network can be flexibly selected.
[0029] In a possible implementation manner, the key information includes the first key; or the key information includes a third key, and the third key is used to determine the first key.
[0030] Based on the above possible implementation methods, the first node can directly indicate the first key for authentication with the target network to the terminal, or the first node can indicate the third key to the terminal so that the terminal generates the first key for authentication with the target network based on the third key.
[0031] In a possible implementation manner, the method further includes: sending a second random number to the first node.
[0032] Based on the above possible implementation manner, the terminal may send the second random number to the first node, so that the first node generates the first key according to the second random number.
[0033] In a possible implementation, the third key is used to determine the first key, including: the third key is used together with the identifier of the target network and the second random number to determine the first key.
[0034] Based on the foregoing possible implementation manner, the first key may be determined according to the third key, the identifier of the target network, and the second random number.
[0035] In a possible implementation manner, the first message includes information about the target network.
[0036] Based on the foregoing possible implementation manner, the terminal may indicate to the first node the target network that the terminal wants to access.
[0037] In a second aspect, a method for obtaining a key is provided. The communication device executing this method may be a first node; it may also be a module implemented in the first node, such as a chip or chip system. The following description uses the first node as an example. The method includes: receiving a first message from a terminal, the first message indicating that the terminal wishes to access a network; obtaining a first key used for authentication between the terminal and a target network; sending a third message to a blockchain node, the third message indicating the first key to the target network; and sending a second message to the terminal, the second message including key information determined based on the first key.
[0038] Based on the method provided in the second aspect above, upon triggering by the terminal, the first node can obtain the first key and indicate the first key to the terminal and the target network. This allows the terminal and the target network to authenticate based on the first key, without requiring authentication via the key stored in the SIM card. This allows the SIM card to be unbound from the network. If the user wants to switch networks, they do not need to replace the SIM card, improving the user experience.
[0039] In a possible implementation, before sending the second message to the terminal, the method further includes: obtaining an identifier of a first transaction, where the first transaction is a blockchain transaction corresponding to the first key.
[0040] Based on the above possible implementation, the first node may further obtain the identifier of the first transaction, so that the first node sends the identifier of the first transaction to the terminal, so that the terminal authenticates the target network based on the identifier of the first transaction and the first key.
[0041] In a possible implementation manner, the second message further includes an identifier of the first transaction and at least one of the following: an identifier of the target network or a public key of the target network.
[0042] Based on the above possible implementation, the first node may further send the identifier of the first transaction, and the identifier of the target network and / or the public key of the target network to the terminal, so that the terminal authenticates the target network based on the first key and this information.
[0043] In a possible implementation, the identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a serial number of the terminal in the first transaction.
[0044] Based on the possible implementations described above, the transaction identifier corresponding to the key configured by the first node for each terminal can be unique. For example, if the first transaction includes information about a single terminal, the identifier includes the address of the first transaction. If the first transaction includes information about multiple terminals, the identifier includes the address of the first transaction and the terminal's sequence number within the first transaction. In this way, the terminal can authenticate with the network based on the identifier of its corresponding transaction.
[0045] In one possible implementation, the method further includes: receiving a fourth message from the terminal, the fourth message being used to indicate the second network; sending a fifth message to the blockchain node, the fifth message including a fourth key, the fourth key being used for authentication between the terminal and the second network; and sending second indication information to the terminal, the second indication information being used to instruct the terminal to generate the fourth key.
[0046] Based on the foregoing possible implementation manner, based on the triggering of the terminal, the first node may generate a fourth key for authentication for the terminal and the second network, so that the terminal and the second network may perform authentication based on the fourth key.
[0047] In a possible implementation, the method further includes: obtaining an address of a third transaction, where the third transaction is a blockchain transaction corresponding to the fourth key.
[0048] Based on the above possible implementation manner, the first node can obtain the address of the third transaction corresponding to the fourth key.
[0049] In a possible implementation manner, the method further includes: sending an identifier of the third transaction to the terminal.
[0050] Based on the foregoing possible implementation manner, the first node may send the identifier of the third transaction to the terminal, so that the terminal and the second network perform authentication based on the fourth key and the identifier of the third transaction.
[0051] In a possible implementation manner, the key information includes the first key; or the key information includes a third key, and the third key is used to determine the first key.
[0052] Based on the above possible implementation methods, the first node can directly indicate the first key for authentication with the target network to the terminal, or the first node can indicate the third key to the terminal so that the terminal generates the first key for authentication with the target network based on the third key.
[0053] In a possible implementation manner, the method further includes: receiving a second random number from the terminal.
[0054] Based on the foregoing possible implementation manner, the first node may generate a first key according to the second random number.
[0055] In a possible implementation, the third key is used to determine the first key, including: the third key is used together with the identifier of the target network and the second random number to determine the first key.
[0056] Based on the foregoing possible implementation manner, the first key may be determined according to the third key, the identifier of the target network, and the second random number.
[0057] In one possible implementation, the blockchain node is included in the target network, and the third message is obtained by encrypting the first key using the public key of the target network.
[0058] Based on the above possible implementation methods, the blockchain node can decrypt the third message according to the private key of the target network to determine that the third message is related to itself.
[0059] In a possible implementation manner, the first message includes information about the target network.
[0060] Based on the foregoing possible implementation manner, the terminal may indicate to the first node the target network that the terminal wants to access.
[0061] In a third aspect, a method for obtaining a key is provided. The communication device executing this method can be a node in a target network; it can also be a module, such as a chip or chip system, implemented in a node in the target network. The following description uses a node in the target network as an example. The method includes: obtaining a third message; obtaining a first key based on the third message; the first key is used for authentication between a first terminal and the target network; obtaining an identifier for a first transaction, the first transaction being a blockchain transaction corresponding to the first key; verifying the first terminal based on the first key and the identifier of the first transaction; and sending a verification response message to the first terminal based on the verification result.
[0062] Based on the method provided in the third aspect, the node in the target network can obtain the first key and the identifier of the first transaction and authenticate the first terminal based on the first key and the identifier of the first transaction. This eliminates the need for authentication between the node in the target network and the first terminal using the key stored in the first terminal's SIM card, effectively unbinding the SIM card from the network. If the user wants to switch networks, they don't need to replace their SIM card, improving the user experience.
[0063] In one possible implementation, verifying the first terminal based on the first key and the identifier of the first transaction includes: receiving a first request from the first terminal, the first request being used to request access to the target network, the first request including the identifier of the first transaction; and sending an authentication message to the first terminal, the authentication message being obtained based on the first key, the first key being queried based on the first request.
[0064] Based on the above possible implementation manner, the node in the target network and the first terminal may be authenticated according to the first key and the identifier of the first transaction.
[0065] In one possible implementation, before sending the authentication message to the first terminal, the method further includes: sending a query message to the blockchain node, the query message being used to query the key corresponding to the first transaction, the query message including an identifier of the first transaction; and receiving a response message from the blockchain node, the response message including the first key.
[0066] Based on the above possible implementation methods, the nodes in the target network can also query the first key on the blockchain, so that the verification result of the first terminal is more accurate.
[0067] In a possible implementation manner, the method further includes: receiving an identifier of the first terminal from the first terminal.
[0068] Based on the foregoing possible implementation manner, the node in the target network may determine to authenticate the first terminal based on the identifier of the first terminal.
[0069] In one possible implementation, the method further includes: receiving a third request from the second terminal, the third request being used to request access to the target network, the third request including an identifier of a fourth transaction and an identifier of a third network, the fourth transaction being a blockchain transaction corresponding to a fifth key, the fifth key being used for authentication between the second terminal and the third network; sending the identifier of the fourth transaction to the third network; obtaining a sixth key, the sixth key being used for authentication between the second terminal and the target network; and sending third indication information to the second terminal, the third indication information being used to instruct the second terminal to generate the sixth key.
[0070] Based on the possible implementation described above, a node in the target network can, upon request from the second terminal, request the third network to configure a key for authentication between the target network and the second terminal, enabling the target network and the second terminal to authenticate based on the key. This eliminates the need for the third network to participate in the authentication process between the second terminal and the target network, simplifying the authentication process.
[0071] In a possible implementation, the method further includes: obtaining an identifier of a fifth transaction, where the fifth transaction is a blockchain transaction corresponding to the sixth key; and sending the identifier of the fifth transaction to the second terminal.
[0072] Based on the possible implementation manner described above, the node in the target network may send the identifier of the fifth transaction to the second terminal, so that the second terminal and the target network may perform authentication based on the identifier of the fifth transaction and the sixth key.
[0073] In one possible implementation, the method further includes: receiving an identifier of the first transaction from a second network; and sending a second key to the blockchain node, where the second key is used for authentication between the first terminal and the second network, and the second key is obtained based on the first key, and the first key is queried based on the identifier of the first transaction.
[0074] Based on the above possible implementation, a node in the target network can configure a second key for authentication between the second network and the first terminal, allowing the second network and the first terminal to authenticate based on the second key. This allows the second network and the first terminal to authenticate without the involvement of the target network, simplifying the authentication process.
[0075] In a possible implementation, the identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a serial number of the first terminal in the first transaction.
[0076] Based on the possible implementations described above, the transaction identifier corresponding to the key configured by the first node for each terminal can be unique. For example, if the first transaction includes information about a single terminal, the identifier includes the address of the first transaction. If the first transaction includes information about multiple terminals, the identifier includes the address of the first transaction and the terminal's sequence number within the first transaction. In this way, the terminal can authenticate with the network based on the identifier of its corresponding transaction.
[0077] In a fourth aspect, an authentication method is provided. The communication device executing this method may be a terminal; it may also be a module implemented in the terminal, such as a chip or chip system. The following description uses a terminal as an example. The method includes: obtaining a first transaction identifier and a first key, where the first transaction is a blockchain transaction corresponding to the first key; authenticating with a target network based on the first transaction identifier and the first key; and receiving a verification response message from the target network.
[0078] Based on the method provided in the fourth aspect, the terminal can obtain the identifier and first key of the first transaction and authenticate with the target network based on the identifier and first key of the first transaction. This eliminates the need for the target network to allocate a user permanent identifier (SUPI) to each terminal and manage a large number of SUPIs, thereby simplifying the authentication process and conserving storage resources of the target network.
[0079] In one possible implementation, authenticating with the target network based on the identifier of the first transaction and the first key includes: sending a first request to the target network, the first request being used to request access to the target network, the first request including the identifier of the first transaction; receiving an authentication message from the target network, the authentication message being obtained based on the first key, the first key being queried based on the first request; and verifying the authentication message.
[0080] Based on the above possible implementation methods, the terminal can send the identifier of the first transaction to the target network, so that the target network queries the first key based on the identifier of the first transaction, obtains the authentication message according to the first key, and sends it to the terminal to complete the authentication between the terminal and the target network.
[0081] In a possible implementation manner, the method further includes: sending the identifier of the terminal to the target network.
[0082] Based on the possible implementation manner described above, the terminal that wants to access the target network may be indicated to the target network.
[0083] In a possible implementation, the first request is obtained by encrypting the identifier of the first transaction using the public key of the target network.
[0084] Based on the above possible implementation manner, the terminal may encrypt the identifier of the first transaction and send it to the target network to improve communication security.
[0085] In a fifth aspect, a communication device is provided for implementing the method provided in the first aspect. The communication device may be the terminal in the first aspect, or a device including the terminal. The communication device includes modules, units, or means corresponding to the above method. The modules, units, or means may be implemented in hardware, software, or by executing corresponding software implementations in hardware. The hardware or software includes one or more modules or units corresponding to the above functions.
[0086] In one possible implementation, the communication device may include a transceiver module. The transceiver module, also referred to as a transceiver unit, is configured to implement the sending and / or receiving functions described in the first aspect and any possible implementation thereof. The transceiver module may be comprised of a transceiver circuit, a transceiver, a transceiver, or a communication interface.
[0087] In a possible implementation, the transceiver module includes a sending module and a receiving module, which are respectively used to implement the sending and receiving functions in the above-mentioned first aspect and any possible implementation thereof.
[0088] In a possible implementation, the communication device may further include a processing module. The processing module may be configured to implement the processing functions in the first aspect and any possible implementation thereof. The processing module may be, for example, a processor.
[0089] In one possible implementation, the transceiver module is used to send a first message to a first node, where the first message is used to indicate that the communication device wants to access the network; the transceiver module is also used to receive a second message from the first node, where the second message includes key information, where the key information is used to determine a first key, and the first key is used for authentication between the communication device and the target network.
[0090] In one possible implementation, the second message further includes an identifier of the first transaction and at least one of the following: an identifier of the target network or a public key of the target network; the first transaction is a blockchain transaction corresponding to the first key.
[0091] In one possible implementation, the transceiver module is further used to send a first request to the target network, where the first request is used to request access to the target network, and the first request includes an identifier of the first transaction; the transceiver module is further used to receive an authentication message from the target network, where the authentication message corresponds to the first key.
[0092] In a possible implementation, the transceiver module is further configured to send the identifier of the communication device to the target network.
[0093] In one possible implementation, the transceiver module is further configured to send a second request to the first network, where the second request is used to request access to the first network, and the second request includes an identifier of the first transaction and an identifier of the target network; the transceiver module is further configured to receive first indication information from the first network, where the first indication information is used to instruct the communication device to generate a second key, where the second key is used for authentication between the communication device and the first network; and the processing module is configured to generate the second key based on the first key and the identifier of the first network.
[0094] In a possible implementation, the transceiver module is further configured to receive an identifier of a second transaction from the first network, where the second transaction is a blockchain transaction corresponding to the second key.
[0095] In one possible implementation, the transceiver module is further used to send a third message to the first node, where the third message is used to indicate a third network; the transceiver module is further used to receive second indication information from the first node, where the second indication information is used to instruct the communication device to generate a third key, where the third key is used for authentication between the communication device and the third network; and the processing module is used to generate the third key based on the first key and an identifier of the third network.
[0096] In a possible implementation, the transceiver module is further configured to receive an identifier of a third transaction from the first node, where the third transaction is a blockchain transaction corresponding to the third key.
[0097] In a possible implementation, the transceiver module is further configured to send a first random number to the first network.
[0098] In a possible implementation, the identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a serial number of the communication device in the first transaction.
[0099] In a possible implementation manner, the target network is determined according to a selection of a user corresponding to the communication device; or, the target network is determined according to a preset policy; or, the target network is determined by the first node.
[0100] In a possible implementation manner, the key information includes the first key; or the key information includes a third key, and the third key is used to determine the first key.
[0101] In a possible implementation, the transceiver module is further configured to send a second random number to the first node.
[0102] In a possible implementation, the third key is used to determine the first key, including: the third key is used together with the identifier of the target network and the second random number to determine the first key.
[0103] In a possible implementation manner, the first message includes information about the target network.
[0104] In a sixth aspect, a communication device is provided for implementing the method provided in the second aspect. The communication device may be the first node in the second aspect, or a device comprising the first node. The communication device includes modules, units, or means corresponding to the above method. The modules, units, or means may be implemented in hardware, software, or by executing corresponding software implementations in hardware. The hardware or software includes one or more modules or units corresponding to the above functions.
[0105] In one possible implementation, the communication device may include a transceiver module and a processing module. The transceiver module, also referred to as a transceiver unit, is configured to implement the sending and / or receiving functions described in the second aspect and any possible implementation thereof. The transceiver module may be comprised of a transceiver circuit, a transceiver, a transceiver, or a communication interface. The processing module may be configured to implement the processing functions described in the second aspect and any possible implementation thereof. The processing module may be, for example, a processor.
[0106] In a possible implementation, the transceiver module includes a sending module and a receiving module, which are respectively used to implement the sending and receiving functions in the above-mentioned second aspect and any possible implementation thereof.
[0107] In one possible implementation, the transceiver module is used to receive a first message from a terminal, where the first message is used to indicate that the terminal wants to access a network; the processing module is used to obtain a first key, where the first key is used for authentication between the terminal and the target network; the transceiver module is also used to send a third message to the blockchain node, where the third message is used to indicate the first key to the target network; the transceiver module is also used to send a second message to the terminal, where the second message includes key information, where the key information is determined based on the first key.
[0108] In a possible implementation, the processing module is further configured to obtain an identifier of a first transaction, where the first transaction is a blockchain transaction corresponding to the first key.
[0109] In a possible implementation manner, the second message further includes an identifier of the first transaction and at least one of the following: an identifier of the target network or a public key of the target network.
[0110] In a possible implementation, the identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a serial number of the terminal in the first transaction.
[0111] In one possible implementation, the transceiver module is further used to receive a fourth message from the terminal, where the fourth message is used to indicate the second network; the transceiver module is further used to send a fifth message to the blockchain node, where the fifth message includes a fourth key, where the fourth key is used for authentication between the terminal and the second network; the transceiver module is further used to send second indication information to the terminal, where the second indication information is used to instruct the terminal to generate the fourth key.
[0112] In a possible implementation, the processing module is further configured to obtain an address of a third transaction, where the third transaction is a blockchain transaction corresponding to the fourth key.
[0113] In a possible implementation, the transceiver module is further configured to send an identifier of the third transaction to the terminal.
[0114] In a possible implementation manner, the key information includes the first key; or the key information includes a third key, and the third key is used to determine the first key.
[0115] In a possible implementation, the transceiver module is further configured to receive a second random number from the terminal.
[0116] In a possible implementation, the third key is used to determine the first key, including: the third key is used together with the identifier of the target network and the second random number to determine the first key.
[0117] In one possible implementation, the blockchain node is included in the target network, and the third message is obtained by encrypting the first key using the public key of the target network.
[0118] In a possible implementation manner, the first message includes information about the target network.
[0119] In a seventh aspect, a communication device is provided for implementing the method provided in the third aspect. The communication device may be a node in the target network in the third aspect, or a device comprising a node in the target network. The communication device includes a module, unit, or means corresponding to the above method, which may be implemented by hardware, software, or by executing corresponding software implementations in hardware. The hardware or software includes one or more modules or units corresponding to the above functions.
[0120] In one possible implementation, the communication device may include a processing module and a transmitting module. The processing module may be configured to implement the processing functions described in the third aspect and any possible implementation thereof. The processing module may, for example, be a processor. The transceiver module, also referred to as a transceiver unit, may be configured to implement the transmitting and / or receiving functions described in the third aspect and any possible implementation thereof. The transceiver module may be comprised of a transceiver circuit, a transceiver, a transceiver, or a communication interface.
[0121] In a possible implementation, the transceiver module includes a sending module and a receiving module, which are respectively used to implement the sending and receiving functions in the third aspect and any possible implementation thereof.
[0122] In one possible implementation, the processing module is used to obtain a third message; the processing module is also used to obtain a first key based on the third message; the first key is used for authentication between the first terminal and the target network; the processing module is also used to obtain an identifier of a first transaction, where the first transaction is a blockchain transaction corresponding to the first key; the processing module is also used to verify the first terminal based on the first key and the identifier of the first transaction; the transceiver module is used to send a verification response message to the first terminal based on the verification result.
[0123] In one possible implementation, the processing module is specifically configured to receive, through the transceiver module, a first request from the first terminal, the first request being used to request access to the target network and including an identifier of the first transaction; the processing module is further specifically configured to send, through the transceiver module, an authentication message to the first terminal, the authentication message being obtained based on a first key, the first key being queried based on the first request.
[0124] In one possible implementation, the transceiver module is further used to send a query message to the blockchain node, where the query message is used to query the key corresponding to the first transaction, and the query message includes an identifier of the first transaction; the transceiver module is further used to receive a response message from the blockchain node, where the response message includes the first key.
[0125] In a possible implementation, the transceiver module is further configured to receive an identifier of the first terminal from the first terminal.
[0126] In one possible implementation, the transceiver module is further used to receive a third request from the second terminal, where the third request is used to request access to the target network, and the third request includes an identifier of a fourth transaction and an identifier of a third network. The fourth transaction is a blockchain transaction corresponding to a fifth key, and the fifth key is used for authentication between the second terminal and the third network; the transceiver module is further used to send the identifier of the fourth transaction to the third network; the processing module is further used to obtain a sixth key, and the sixth key is used for authentication between the second terminal and the target network; the transceiver module is further used to send third indication information to the second terminal, where the third indication information is used to instruct the second terminal to generate the sixth key.
[0127] In one possible implementation, the processing module is further used to obtain an identifier of a fifth transaction, where the fifth transaction is a blockchain transaction corresponding to the sixth key; and the transceiver module is further used to send the identifier of the fifth transaction to the second terminal.
[0128] In one possible implementation, the transceiver module is further used to receive the identifier of the first transaction from the second network; the transceiver module is further used to send a second key to the blockchain node, where the second key is used for authentication between the first terminal and the second network, and the second key is obtained based on the first key, and the first key is queried based on the identifier of the first transaction.
[0129] In a possible implementation, the identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a serial number of the first terminal in the first transaction.
[0130] In an eighth aspect, a communication device is provided for implementing the method provided in the fourth aspect. The communication device may be the terminal in the fourth aspect, or a device comprising the terminal. The communication device includes a module, unit, or means corresponding to the method described above. The module, unit, or means may be implemented in hardware, software, or by executing the corresponding software implementation in hardware. The hardware or software includes one or more modules or units corresponding to the above functions.
[0131] In one possible implementation, the communication device may include a processing module and a transceiver module. The processing module may be configured to implement the processing functions described in the fourth aspect and any possible implementation thereof. The processing module may, for example, be a processor. The transceiver module, also referred to as a transceiver unit, may be configured to implement the transmitting and / or receiving functions described in the fourth aspect and any possible implementation thereof. The transceiver module may be comprised of a transceiver circuit, a transceiver, a transceiver, or a communication interface.
[0132] In a possible implementation, the transceiver module includes a sending module and a receiving module, which are respectively used to implement the sending and receiving functions in the above-mentioned fourth aspect and any possible implementation thereof.
[0133] In one possible implementation, the processing module is used to obtain an identifier and a first key of a first transaction, where the first transaction is a blockchain transaction corresponding to the first key; the processing module is further used to authenticate with a target network based on the identifier of the first transaction and the first key; and the transceiver module is used to receive a verification response message from the target network.
[0134] In one possible implementation, the processing module is specifically configured to send a first request to the target network through the transceiver module, where the first request is used to request access to the target network and includes an identifier of the first transaction; the processing module is further specifically configured to receive an authentication message from the target network through the transceiver module, where the authentication message is obtained based on the first key, where the first key is queried based on the first request; and the processing module is further specifically configured to verify the authentication message.
[0135] In a possible implementation, the transceiver module is further configured to send the identifier of the communication device to the target network.
[0136] In a possible implementation, the first request is obtained by encrypting the identifier of the first transaction using the public key of the target network.
[0137] In a ninth aspect, a communication device is provided, comprising: a processor; the processor is configured to be coupled to a memory and, after reading instructions from the memory, execute the method described in any of the above aspects in accordance with the instructions. The communication device may be the terminal described in the first aspect, or a device including the terminal described in the second aspect, or the first node described in the second aspect, or the first node described in the target network described in the third aspect, or the node described in the target network described in the third aspect, or the terminal described in the fourth aspect, or the terminal described in the fourth aspect, or the terminal described in the fourth aspect.
[0138] In a possible implementation, the communication device further includes a memory, which is used to store necessary program instructions and data.
[0139] In one possible implementation, the communication device is a chip or a chip system. Optionally, when the communication device is a chip system, it can be composed of a chip or include a chip and other discrete devices.
[0140] In the tenth aspect, a communication device is provided, comprising: a processor and an interface circuit; the interface circuit is used to receive a computer program or instruction and transmit it to the processor; the processor is used to execute the computer program or instruction so that the communication device executes the method described in any one of the above aspects.
[0141] In one possible implementation, the communication device is a chip or a chip system. Optionally, when the communication device is a chip system, it can be composed of a chip or include a chip and other discrete devices.
[0142] In an eleventh aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the computer-readable storage medium is run on a computer, the computer can execute the method described in any one of the above aspects.
[0143] In a twelfth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method described in any one of the above aspects.
[0144] Among them, the technical effects brought about by any possible implementation method in the fifth to twelfth aspects can be referred to the technical effects brought about by any aspect in the first to fourth aspects or different possible implementation methods in any aspect, and will not be repeated here.
[0145] In the thirteenth aspect, a communication system is provided, which includes a terminal for executing the method described in the first aspect, a first node for executing the method described in the second aspect, and a node in a target network for executing the method described in the third aspect.
[0146] It is understandable that, provided that the solutions are not contradictory, the solutions in each aspect can be combined. BRIEF DESCRIPTION OF THE DRAWINGS
[0147] FIG1A is a schematic diagram of a communication system architecture according to an embodiment of the present application;
[0148] FIG1B is a schematic diagram of a network architecture according to an embodiment of the present application;
[0149] FIG1C is a second schematic diagram of the network architecture provided in an embodiment of the present application;
[0150] FIG1D is a second schematic diagram of a communication system architecture provided in an embodiment of the present application;
[0151] FIG2 is a schematic diagram of the hardware structure of a communication device provided in an embodiment of the present application;
[0152] FIG3 is a flowchart of a method for obtaining a key according to an embodiment of the present application;
[0153] FIG4 is a flow chart of an authentication method according to an embodiment of the present application;
[0154] FIG5 is a second flow chart of a method for obtaining a key provided in an embodiment of the present application;
[0155] FIG6 is a flow chart of a method for updating a key according to an embodiment of the present application;
[0156] FIG7 is a first structural diagram of a communication device provided in an embodiment of the present application;
[0157] FIG8 is a second structural diagram of the communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0158] Before introducing the embodiments of the present application, the relevant technical terms involved in the embodiments of the present application are explained. It is understood that these explanations are intended to make the embodiments of the present application easier to understand and should not be regarded as limiting the scope of protection claimed by the embodiments of the present application.
[0159] 1. Blockchain (BC)
[0160] In the embodiments of the present application, blockchain is a tamper-proof technology protected by cryptographic mechanisms. Generally speaking, blockchain nodes can run on physical nodes, or they can run in a virtual environment within a physical node, without limitation.
[0161] In one possible design, blockchain is a ledger technology. This ledger is distributed and can be maintained synchronously by multiple nodes. These multiple nodes can use cryptographic mechanisms to prevent tampering when maintaining the ledger.
[0162] For example, a blockchain is a distributed ledger composed of sequentially linked data blocks in chronological order, creating a chained data structure and cryptographically guaranteed to be tamper-proof and unforgeable. Generally speaking, a blockchain system consists of multiple nodes. Since there is no centralized management authority, all nodes must reach a consensus on each block's information, meaning that each node stores the same blockchain information. Due to the unique characteristics of blockchain technology, blockchain can serve as a unified, trusted platform for historical event tracing and / or automated network management. For example, blockchain can implement at least one of the following functions: log auditing, automated settlement, or secure access and verification.
[0163] It is understandable that in the embodiments of the present application, the blockchain may also have other naming methods, such as distributed ledger or account book, etc., without limitation.
[0164] 2. Terminal
[0165] In the embodiment of the present application, the terminal is a device with wireless transceiver capabilities. The terminal can be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; it can also be deployed on the water (such as a ship, etc.); it can also be deployed in the air (for example, on an airplane, a balloon, and a satellite, etc.). The terminal can also be called a terminal device, and the terminal device can be a user equipment (UE), where the UE includes a handheld device, a vehicle-mounted device, a wearable device, or a computing device with wireless communication capabilities. Exemplarily, the UE can be a mobile phone, a tablet computer, or a computer with wireless transceiver capabilities. The terminal device can also be a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in unmanned driving, a wireless terminal in telemedicine, a wireless terminal in a smart grid, a wireless terminal in a smart city, or a wireless terminal in a smart home, etc.
[0166] As an example and not a limitation, in this application, the terminal may be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. For example, a wearable device is not only a hardware device, but also a device that achieves powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include devices that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as devices that focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0167] In the present application, the terminal may be a terminal in an Internet of Things (IoT) system. IoT is an important component of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network of human-machine interconnection and object-to-object interconnection. The terminal in the present application may be a terminal in machine type communication (MTC). The terminal in the present application may be an on-board module, on-board module, on-board component, on-board chip or on-board unit built into a vehicle as one or more components or units. The vehicle may implement the method of the present application through the built-in on-board module, on-board module, on-board component, on-board chip or on-board unit.
[0168] 3. Key providing device
[0169] In the embodiments of the present application, the key providing device can be any device with computing capabilities that can provide keys for other devices or apparatuses. For example, the key providing device can provide a key for a terminal to authenticate (or authorize) with a network. The key providing device can be maintained by the terminal manufacturer or by a third party other than the terminal manufacturer, without limitation.
[0170] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0171] The method provided in the embodiments of the present application can be used in various communication systems capable of obtaining a key. The method provided in the embodiments of the present application is described below using the communication system shown in Figures 1A and 1D as an example. Figures 1A and 1D are merely schematic diagrams and do not limit the applicable scenarios of the technical solutions provided in this application.
[0172] As shown in Figure 1A, it is a schematic diagram of the architecture of a communication system 10 provided in an embodiment of the present application. In Figure 1A, the communication system 10 may include a node 101, a terminal 102 capable of communicating with the node 101, and a network 103.
[0173] The network 103 may include at least one node. Node 101 and terminal 102 may communicate with the network 103 via nodes in the network 103. For example, node 101 may communicate with the network 103 via node 1031 in the network 103, and terminal 102 may communicate with the network 103 via node 1032 in the network 103.
[0174] In Figure 1A, network 103 can provide services to terminal 102. For example, network 103 is a carrier's network that can provide wireless access services to terminal 102. It should be understood that network 103 can also be other types of networks, such as a wireless local area network, without limitation. Node 101 can provide keys for terminal 102 and network 103 to communicate with each other. Node 101 can be a key provisioning device. For an introduction to terminals and key provisioning devices, please refer to the previous explanations of technical terms used in the embodiments of this application and will not be elaborated upon here.
[0175] In one possible design, node 101 is a blockchain node, and / or node 1031 is a blockchain node. Specifically, communication system 10 may include any of the following scenarios: Scenario 1, where node 101 is a blockchain node and node 1031 is a blockchain node; Scenario 2, where node 101 is not a blockchain node and node 1031 is a blockchain node; and Scenario 3, where node 101 is a blockchain node and node 1031 is not a blockchain node. Each of these scenarios is described below.
[0176] Scenario 1: Node 101 is a blockchain node, and node 1031 is a blockchain node.
[0177] In scenario 1, the architecture of network 103 may be as shown in FIG1B . In FIG1B , the network includes an access and mobility management function (AMF) network element, a session management function (SMF) network element, a user plane function (UPF) network element, access network equipment, and a blockchain (BC) network element. Optionally, the network also includes a unified data management (UDM)-unified data repository (UDR) extension network element, and / or a network exposure function (NEF) network element, etc. It will be understood that FIG1B is only a schematic diagram of the network. In specific applications, the network may include more or fewer network elements than shown in FIG1B , without limitation. For example, the network does not include a UDM-UDR extension network element, but includes a UDM network element and / or a UDR network element.
[0178] In scenario 1, the network element corresponding to node 1031 in FIG1B is a BC network element, that is, node 101 can communicate with network 103 through the BC network element. If terminal 102 communicates with network 103 through node 1032, the network element corresponding to node 1032 in FIG1B is an access network device.
[0179] Scenario 2: Node 101 is not a blockchain node, and node 1031 is a blockchain node.
[0180] In scenario 2, the network architecture of network 103 may be as shown in FIG1B . The network element corresponding to node 1031 in FIG1B is a BC network element, meaning that node 101 can communicate with network 103 via the BC network element. If terminal 102 communicates with network 103 via node 1032, the network element corresponding to node 1032 in FIG1B is an access network device.
[0181] Scenario 3: Node 101 is a blockchain node, and node 1031 is not a blockchain node.
[0182] In scenario 3, the network architecture of network 103 may be as shown in FIG1C . In FIG1C , the network includes AMF network elements, SMF network elements, UPF network elements, access network equipment, and ledger anchor function (
[0183] The network may also include UDM-UDR extended network elements and / or NEF network elements. It should be understood that Figure 1C is merely a schematic diagram of the network. In specific applications, the network may include more or fewer network elements than shown in Figure 1C, without limitation. For example, the network may include UDM network elements and / or UDR network elements instead of UDM-UDR extended network elements.
[0184] In scenario 3, the network element corresponding to node 1031 in FIG1C is a LAF network element, that is, node 101 can communicate with network 103 through the LAF network element. If terminal 102 communicates with network 103 through node 1032, the network element corresponding to node 1032 in FIG1C is an access network device.
[0185] Optionally, communication system 10 further includes a network 104 capable of communicating with node 101. Network 104 can provide services for terminal 102. For example, if network 104 is a carrier's network, and terminal 102 moves from the coverage area of network 103 to the coverage area of network 104, network 104 can provide wireless access services for terminal 102. The carrier corresponding to network 104 and the carrier corresponding to network 103 can be the same or different, without limitation.
[0186] Network 104 may include at least one node. Node 101 may communicate with network 104 through nodes in network 104, such as node 1041. If terminal 102 moves from the coverage area of network 103 to the coverage area of network 104, terminal 102 may also communicate with network 104 through nodes in network 104, such as node 1042.
[0187] It is understood that network 104 may or may not include blockchain nodes, without limitation. If network 104 includes blockchain nodes, the architecture of network 104 may be as shown in FIG1B . If network 104 does not include blockchain nodes, the architecture of network 104 may be as shown in FIG1C .
[0188] The communication system 10 shown in FIG1A is for illustrative purposes only and is not intended to limit the technical solutions of the present application. Those skilled in the art will appreciate that, in a specific implementation, the communication system 10 may further include other devices, and the number of terminals, networks, and nodes shown in FIG1A may be determined based on specific needs and is not limited thereto.
[0189] FIG1D is a schematic diagram of the architecture of another communication system 11 provided in an embodiment of the present application. In FIG1D , the communication system 11 may include a node 111, a terminal 112 capable of communicating with the node 111, a blockchain node 114, and a network 113 capable of communicating with the blockchain node 114.
[0190] The network 113 may include at least one node. The blockchain node 114 and the terminal 112 may communicate with the network 113 via the nodes in the network 113. For example, the blockchain node 114 may communicate with the network 113 via the node 1131 in the network 113, and the terminal 112 may communicate with the network 113 via the node 1132 in the network 113.
[0191] In Figure 1D , network 113 can provide services for terminal 112. For example, network 113 is a carrier's network that can provide wireless access services for terminal 112. It should be understood that network 113 can also be other types of networks, such as a wireless local area network, without limitation. Node 111 can provide keys for terminal 112 and network 113 to communicate with each other. Node 111 can be a key provisioning device. For an introduction to terminals and key provisioning devices, please refer to the previous explanations of technical terms related to the embodiments of this application and will not be repeated here.
[0192] In one possible implementation, at least one of node 111 and node 1131 is not a blockchain node. Specifically, communication system 11 may include any of the following scenarios: Scenario 4, where both node 111 and node 1131 are not blockchain nodes; Scenario 5, where both node 111 and node 1131 are not blockchain nodes; and Scenario 6, where both node 111 and node 1131 are blockchain nodes. Each of these scenarios is described below.
[0193] Scenario 4: Node 111 is not a blockchain node, and node 1131 is not a blockchain node.
[0194] In scenario 4, the network architecture of network 113 can be as shown in Figure 1C. The network element corresponding to node 1131 in Figure 1C is the LAF network element, meaning that blockchain node 114 can communicate with network 113 via the LAF network element. If terminal 112 communicates with network 113 via node 1132, the network element corresponding to node 1132 in Figure 1C is an access network device.
[0195] Scenario 5: Node 111 is a blockchain node, and node 1131 is not a blockchain node.
[0196] In scenario 5, the network architecture of network 113 can be as shown in Figure 1C. The network element corresponding to node 1131 in Figure 1C is the LAF network element, meaning that blockchain node 114 can communicate with network 113 via the LAF network element. If terminal 112 communicates with network 113 via node 1132, the network element corresponding to node 1132 in Figure 1C is an access network device.
[0197] Scenario 6: Node 111 is not a blockchain node, and node 1131 is a blockchain node.
[0198] In scenario 6, the network architecture of network 113 can be as shown in Figure 1B. The network element corresponding to node 1131 in Figure 1B is the BC network element, meaning that blockchain node 114 can communicate with network 113 via the BC network element. If terminal 112 communicates with network 113 via node 1132, the network element corresponding to node 1132 in Figure 1B is the access network device.
[0199] Optionally, communication system 11 further includes a network 115 capable of communicating with blockchain node 114. Network 115 can provide services for terminal 112. For example, if network 115 is a carrier's network, and terminal 112 moves from the coverage area of network 113 to the coverage area of network 115, network 115 can provide wireless access services for terminal 112. The carrier corresponding to network 115 can be the same as or different from the carrier corresponding to network 113, without limitation.
[0200] Network 115 may include at least one node. Node 111 may communicate with network 115 through nodes in network 115, such as node 1151. If terminal 112 moves from the coverage area of network 113 to the coverage area of network 115, terminal 112 may also communicate with network 115 through nodes in network 115, such as node 1152.
[0201] It is understood that network 115 may or may not include blockchain nodes, without limitation. If network 115 includes blockchain nodes, the architecture of network 115 may be as shown in FIG1B . If network 115 does not include blockchain nodes, the architecture of network 115 may be as shown in FIG1C .
[0202] The communication system 11 shown in FIG1D is for illustrative purposes only and is not intended to limit the technical solutions of this application. Those skilled in the art will appreciate that, in a specific implementation, the communication system 11 may also include other devices, and the number of terminals, networks, and nodes shown in FIG1D may also be determined based on specific needs and is not limited thereto.
[0203] Optionally, each node or device in Figure 1A or Figure 1D of the embodiment of the present application (for example, node 101, node 1031, terminal 102, node 111, node 1131, or terminal 112, etc.) can also be referred to as a communication device, which can be a general device or a dedicated device, and the embodiment of the present application does not make specific limitations on this.
[0204] Optionally, the relevant functions of each node or device in FIG. 1A or FIG. 1D of the embodiment of the present application can be implemented by a single device, or can be implemented by multiple devices together, or can be implemented by one or more functional modules within a single device, and the embodiment of the present application does not specifically limit this. It is understood that the above functions can be network elements in hardware devices, software functions running on dedicated hardware, or a combination of hardware and software, or virtualization functions instantiated on a platform (e.g., a cloud platform).
[0205] In specific implementations, each node or device in FIG. 1A or FIG. 1D of the embodiment of the present application may adopt the structure shown in FIG. 2 , or include the components shown in FIG. 2 . FIG. 2 is a schematic diagram of the hardware structure of a communication device applicable to the embodiment of the present application. The communication device 20 includes at least one processor 201 and at least one communication interface 204 for implementing the method provided in the embodiment of the present application. The communication device 20 may also include a communication circuit 202 and a memory 203.
[0206] The processor 201 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0207] The communication link 202 may include a path for transmitting information between the above components, such as a bus.
[0208] Communication interface 204 is used to communicate with other devices or communication networks. Communication interface 204 can be any transceiver-like device, such as an Ethernet interface, a radio access network (RAN) interface, a wireless local area network (WLAN) interface, a transceiver, a pin, a bus, or a transceiver circuit.
[0209] The memory 203 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this. The memory can be independent and coupled to the processor 201 via the communication line 202. The memory 203 can also be integrated with the processor 201. The memory provided in the embodiment of the present application can generally be non-volatile.
[0210] Among them, the memory 203 is used to store computer-executable instructions involved in executing the solutions provided in the embodiments of the present application, and is controlled by the processor 201. The processor 201 is used to execute the computer-executable instructions stored in the memory 203, thereby implementing the methods provided in the embodiments of the present application. Alternatively, optionally, in the embodiments of the present application, the processor 201 may also perform processing-related functions in the methods provided in the following embodiments of the present application, and the communication interface 204 is responsible for communicating with other devices or communication networks, which is not specifically limited in the embodiments of the present application.
[0211] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.
[0212] The coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units or modules, which can be electrical, mechanical or other forms, and is used for information exchange between devices, units or modules.
[0213] As an embodiment, the processor 201 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 2 .
[0214] As an embodiment, the communication device 20 may include multiple processors, such as processor 201 and processor 207 in Figure 2. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0215] As an embodiment, the communication device 20 may further include an output device 205 and / or an input device 206. The output device 205 is coupled to the processor 201 and can display information in a variety of ways. For example, the output device 205 can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 206 is coupled to the processor 201 and can receive user input in a variety of ways. For example, the input device 206 can be a mouse, a keyboard, a touch screen device, or a sensor device.
[0216] It is understandable that the composition structure shown in Figure 2 does not constitute a limitation on the communication device. In addition to the components shown in Figure 2, the communication device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0217] The method provided by the embodiment of the present application will be described below with reference to the accompanying drawings. Each network element in the following embodiment may include the components shown in FIG2 , which will not be described in detail.
[0218] It can be understood that the message names between network elements or the names of parameters in the messages in the following embodiments of the present application are only examples, and other names may be used in specific implementations. The embodiments of the present application do not specifically limit this.
[0219] It can be understood that in the embodiments of the present application, " / " can indicate that the objects associated with each other are in an "or" relationship, for example, A / B can indicate A or B; "and / or" can be used to describe that there are three relationships between the associated objects, for example, A and / or B can indicate: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In addition, expressions similar to "at least one of A, B and C" or "at least one of A, B or C" are usually used to indicate any of the following: A exists alone; B exists alone; C exists alone; A and B exist at the same time; A and C exist at the same time; B and C exist at the same time; A, B and C exist at the same time. The above uses A, B and C as an example to illustrate the optional items of the item. When there are more elements in the expression, the meaning of the expression can be obtained according to the above rules.
[0220] In order to facilitate the description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" can be used to distinguish technical features with the same or similar functions. The words such as "first" and "second" do not limit the quantity and execution order, and the words such as "first" and "second" do not necessarily limit them to be different. In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" should not be interpreted as being more preferred or more advantageous than other embodiments or design. The use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0221] It will be understood that the “embodiment” mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the various embodiments in the entire specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It will be understood that in the various embodiments of the present application, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0222] It can be understood that in this application, "when", "if" and "if" all mean that corresponding processing will be taken under certain objective circumstances, and do not limit the time, nor do they require judgment actions when implementing them, nor do they mean that there are other limitations.
[0223] The term "simultaneously" in this application may be understood as at the same time point, within a period of time, or within the same cycle.
[0224] It is understood that some optional features in the embodiments of the present application may, in certain scenarios, be implemented independently of other features, such as the solution on which they are currently based, to solve corresponding technical problems and achieve corresponding effects. They may also be combined with other features in certain scenarios as needed. Accordingly, the devices provided in the embodiments of the present application may also implement these features or functions accordingly, which will not be described in detail here.
[0225] It can be understood that the same step or steps or technical features with the same functions in the embodiments of the present application can be referenced and borrowed from each other in different embodiments.
[0226] It is understood that in the embodiments of the present application, any node and / or terminal may perform some or all of the steps in the embodiments of the present application. These steps are merely examples, and the embodiments of the present application may also perform other steps or variations of various steps. In addition, the various steps may be performed in a different order than those presented in the embodiments of the present application, and it is possible that not all of the steps in the embodiments of the present application need to be performed.
[0227] As shown in FIG3 , a method for obtaining a key provided in an embodiment of the present application may include the following steps:
[0228] S301: A terminal sends a first message to a first node. Correspondingly, the first node receives the first message from the terminal.
[0229] The terminal may be the terminal 102 in FIG. 1A , and the first node may be the node 101 in FIG. 1A ; or, the terminal may be the terminal 112 in FIG. 1D , and the first node may be the node 111 in FIG. 1D .
[0230] In this embodiment of the present application, the first message can be used to indicate that the terminal intends to access a network. Thus, after receiving the first message, the first node can determine the network the terminal intends to access, i.e., determine the target network for the terminal. The first node can also generate a key for the terminal and the target network to facilitate communication between the terminal and the target network. For example, the terminal can authenticate with the target network using the generated key.
[0231] Optionally, the first message includes information about the target network. In this way, the terminal can indicate to the first node the network it wishes to access, so that the first node can generate a key for the terminal and the target network, enabling communication between the terminal and the target network. For example, if the terminal is terminal 102 in Figure 1A and the first node is node 101 in Figure 1A, the target network is network 103 in Figure 1A. If the terminal is terminal 112 in Figure 1D and the first node is node 111 in Figure 1D, the target network is network 113 in Figure 1D.
[0232] In one possible design, the target network information is used to indicate the target network. For example, the target network information includes an identifier of the target network.
[0233] In one possible design, the target network is determined according to a selection of a user corresponding to the terminal; or, the target network is determined according to a preset policy.
[0234] Exemplarily, a user selects a target network through software on a terminal, and the terminal determines the target network in response to the user's operation. Alternatively, the terminal determines the target network based on network access requirement information submitted by the user, such as data traffic requirement information and / or call time requirement information. Alternatively, the terminal determines the target network based on environmental information, such as the terminal's location information and / or the signal quality of surrounding networks measured by the terminal.
[0235] Optionally, the terminal further sends a second random number to the first node so that the first node generates a key according to the second random number. Correspondingly, the first node receives the second random number from the terminal.
[0236] It can be understood that the second random number can be included in the first message and sent to the first node, or sent to the first node through another message, without limitation.
[0237] S302: The first node obtains a first key.
[0238] In the embodiment of the present application, the first key can be used for authentication between the terminal and the target network. The first key is a symmetric key.
[0239] In one possible implementation, the first node generates the first key using a key generation algorithm, or obtains the first key from another device capable of generating keys.
[0240] It can be understood that if the first node also receives the second random number, the first node generates the first key according to the key generation algorithm and the second random number.
[0241] S303: The first node sends a third message to the blockchain node. In response, the blockchain node receives the third message from the first node.
[0242] In this embodiment of the present application, the third message may be used to indicate the first key to the target network.
[0243] For example, if the blockchain node is included in the target network, the third message is obtained by encrypting the first key using the target network's public key (e.g., the public key of a node in the target network). Upon receiving the third message, the target network can decrypt it using its own private key to obtain the first key.
[0244] For another example, if the blockchain node is not included in the target network, the third message is generated by encrypting the first key and the fourth instruction information using the blockchain node's public key. The fourth instruction information instructs the blockchain node to send the first key to the target network. For example, the fourth instruction information includes the identifier of the target network. After receiving the third message, the blockchain node decrypts it using its private key to obtain the first key and the fourth instruction information, and then sends the first key to the target network based on the fourth instruction information.
[0245] Optionally, after receiving the third message, the blockchain node sends a response message to the third message to the first node to indicate to the first node that the third message has been received.
[0246] As will be appreciated, in S303, the first node may trigger the generation of a blockchain transaction corresponding to the first key (hereinafter referred to as the first transaction) on the blockchain. For example, if the first node is a node in the blockchain, the first node itself triggers the generation of the first transaction; if the first node is not a node in the blockchain, the first node triggers a blockchain node to generate the first transaction. Subsequently, the target network may obtain the third message, for example, via the blockchain. This is explained in detail below with reference to Scenarios 1 to 6 above.
[0247] For Scenario 1, the blockchain node in S303 is node 1031 in Figure 1A. Node 101 generates the first transaction, uses the first key as the content of the first transaction, encrypts the first transaction with node 1031's public key on the blockchain, signs the first key with node 1031's private key on the blockchain, obtains a third message, and publishes the third message to the blockchain. After the nodes on the blockchain reach consensus, the first transaction is uploaded to the blockchain. Subsequently, each node on the blockchain verifies the signature using node 101's public key on the blockchain and decrypts it using its own private key on the blockchain. If verification and decryption are successful, it indicates that the first transaction is related to itself and that it can obtain the first key. In this example, node 1031 is able to verify and decrypt successfully, obtaining the first key. Thus, the target network (network 103 in this example) obtains the first key. Optionally, the target network also obtains an identifier for the first transaction on the blockchain.
[0248] As an example, the format of the third message can be as follows: {EncapPK_node1031(TX(Initial:node101, Receiver:node1031, Content:first key)), Sigsk-node101}, which may indicate that the sender of the third message is node101, the receiver of the third message is node1031, and the content of the third message includes the first key. EncapPK_node1031(TX(Initial:node101, Receiver:node1031, Content:first key)) represents the information encrypted with the public key of node1031 on the chain with the first key. Sigsk-node101 represents the information signed with the private key of node101 on the chain with the first key.
[0249] For scenario 2, the blockchain node in S303 is node 1031 in Figure 1A. Node 101 encrypts the first key with the public key of node 1031 to obtain the third message, and sends the third message to node 1031. After receiving the third message, node 1031 decrypts the third message with its own private key to obtain the first key. In this way, the target network (network 103 in this example) obtains the first key. Subsequently, node 1031 generates the first transaction, uses the first key as the content of the first transaction, encrypts the first transaction, and publishes the encrypted message to the blockchain. After the nodes on the blockchain reach a consensus, the first transaction is uploaded to the chain. It can be understood that after the first transaction is uploaded to the chain, the target network can obtain the identifier of the first transaction on the chain.
[0250] For scenario 3, the blockchain nodes in S303 are nodes in the blockchain other than node 101, such as the blockchain node corresponding to the target network (in this example, network 103). A blockchain node corresponding to a target network can be understood as a node on the blockchain that can communicate with the target network. Node 101 generates a first transaction, using the first key and the fourth indication as the content of the first transaction. Node 101 encrypts the first transaction using the public key of the blockchain node corresponding to network 103. It signs the first key with the private key of node 101, generates a third message, and publishes the third message to the blockchain. After the nodes on the blockchain reach consensus, the first transaction is uploaded to the blockchain. Subsequently, each node on the blockchain verifies the signature using node 101's public key and decrypts it using its own private key. Successful verification and decryption confirm that the first transaction is relevant to it and that it has access to the first key and the fourth indication. It should be understood that in this example, the blockchain node corresponding to network 103 successfully verifies and decrypts the information, obtaining the first key and the fourth indication. It then encrypts the first key using the public key of node 1031 and sends the encrypted information to node 1031 based on the fourth indication. Node 1031 receives the encrypted information and decrypts it using its own private key to obtain the first key. Thus, the target network obtains the first key. Optionally, the blockchain node corresponding to network 103 also obtains the identifier of the first transaction on the blockchain and sends it to node 1031. Thus, the target network obtains the identifier of the first transaction.
[0251] As an example, the format of the third message is as follows: {EncapPK_blockchain node corresponding to network 103 (TX(Initial: node 101, Receiver: blockchain node corresponding to network 103, Content: first key and fourth indication information)), Sigsk-node 101}, which may indicate that the sender of the third message is node 101, the receiver of the third message is the blockchain node corresponding to network 103, and the content of the third message includes the first key and the fourth indication information. EncapPK_blockchain node corresponding to network 103 (TX(Initial: node 101, Receiver: blockchain node corresponding to network 103, Content: first key and fourth indication information)) represents the information encrypted with the public key of the blockchain node corresponding to network 103 on the chain. Sigsk-node 101 represents the information signed with the first key using the private key of node 101 on the chain.
[0252] For scenario 4, the blockchain node in S303 is blockchain node 114 in Figure 1D. Blockchain node 114 is the blockchain node corresponding to node 111, that is, the node on the blockchain that can communicate with node 111. Node 111 encrypts the first key and the fourth indication information using the public key of blockchain node 114, obtaining a third message, and sends the third message to blockchain node 114. After receiving the third message, blockchain node 114 decrypts the third message using its own private key to obtain the first key and the fourth indication information. Subsequently, blockchain node 114 generates a first transaction, using the first key and the fourth indication information as the content of the first transaction. It encrypts the first transaction using the public key of the blockchain node corresponding to network 113 on the blockchain, signs the first key using the private key of blockchain node 114 on the blockchain, obtains message 1, and publishes message 1 to the blockchain. After the nodes on the blockchain reach consensus, the first transaction is uploaded to the blockchain. Subsequently, each node on the blockchain verifies the signature using the public key of blockchain node 114 and decrypts it using its own private key. Successful verification and decryption confirm that the first transaction is related to it and that it has access to the first key and fourth indication information. In this example, the blockchain node corresponding to network 113 successfully verifies and decrypts the signature, obtaining the first key and fourth indication information. It then encrypts the first key using the public key of node 1131 and sends the encrypted information to node 1131 based on the fourth indication information. Node 1131 receives the encrypted information and decrypts it using its own private key to obtain the first key. Thus, the target network (in this example, network 113) obtains the first key. Optionally, the blockchain node corresponding to network 113 obtains the identifier of the first transaction on the blockchain and sends it to node 1131. This allows the target network to obtain the identifier of the first transaction.
[0253] For scenario 5, the blockchain node in S303 is blockchain node 114 in Figure 1D . Blockchain node 114 is the blockchain node corresponding to the target network (in this example, network 113), i.e., a node on the blockchain that can communicate with the target network. Node 111 generates a first transaction, uses the first key and fourth indication information as the content of the first transaction, encrypts the first transaction using the public key of the blockchain node corresponding to network 113, signs the first key using the private key of node 111, obtains a third message, and publishes the third message to the blockchain. After the nodes on the blockchain reach consensus, the first transaction is uploaded to the blockchain. Subsequently, each node on the blockchain verifies the signature using the public key of node 111 and decrypts it using its own private key. If verification and decryption are successful, it indicates that the first transaction is related to itself and that it has obtained the first key and fourth indication information. It should be understood that the blockchain node corresponding to network 113 is able to successfully verify and decrypt, obtain the first key and fourth indication information, encrypt the first key using the public key of node 1131, and send the encrypted information to node 1131 based on the fourth indication information. Node 1131 receives the encrypted information and decrypts it using its private key to obtain the first key. The target network then obtains the first key. Optionally, the blockchain node corresponding to network 113 obtains the identifier of the first transaction on the blockchain and sends it to node 1131. The target network then obtains the identifier of the first transaction.
[0254] As an example, the format of the third message is as follows: {EncapPK_blockchain node corresponding to network 113 (TX(Initial: node 111, Receiver: blockchain node corresponding to network 113, Content: first key and fourth indication information)), Sigsk-node 111}, which may indicate that the sender of the third message is node 111, the receiver of the third message is the blockchain node corresponding to network 113, and the content of the third message includes the first key and the fourth indication information. EncapPK_blockchain node corresponding to network 113 (TX(Initial: node 111, Receiver: blockchain node corresponding to network 113, Content: first key and fourth indication information)) represents the information encrypted with the public key of the blockchain node corresponding to network 113 on the chain. Sigsk-node 111 represents the information signed with the first key using the private key of node 111 on the chain.
[0255] For scenario 6, the blockchain node in S303 is blockchain node 114 in Figure 1D. Blockchain node 114 is the blockchain node corresponding to node 111, that is, the node on the blockchain that can communicate with node 111. Node 111 encrypts the first key and the fourth indication information using the public key of blockchain node 114, obtaining a third message, and sends the third message to blockchain node 114. After receiving the third message, blockchain node 114 decrypts the third message using its own private key to obtain the first key and the fourth indication information. Subsequently, blockchain node 114 generates a first transaction, using the first key as the content of the first transaction. It encrypts the first transaction using the public key of node 1131 on the blockchain, signs the first key using the private key of blockchain node 114 on the blockchain, obtains message 2, and publishes message 2 to the blockchain. After the nodes on the blockchain reach consensus, the first transaction is uploaded to the blockchain. Subsequently, each node on the blockchain verifies the signature using the public key of blockchain node 114 on the blockchain and decrypts it using its own private key on the blockchain. If verification and decryption are successful, it indicates that the first transaction is related to itself and that it has access to the first key. In this example, node 1131 successfully verifies and decrypts the data, obtaining the first key. Thus, the target network (network 113 in this example) obtains the first key. Optionally, the target network also obtains an identifier for the first transaction on the blockchain.
[0256] It is understood that the format of the third message is merely exemplary. In specific applications, the message may include more or less information than the example above, without limitation. For example, in scenario 3, the third message may not include the fourth indication information, but may implicitly instruct the blockchain node corresponding to network 103 to send the first key to node 1031.
[0257] In one possible implementation, the first node also obtains an identifier for the first transaction. For example, if the first node is a node in a blockchain, the first node obtains the identifier for the first transaction directly from the blockchain; if the first node is not a node in a blockchain, the first node receives the identifier for the first transaction from a blockchain node.
[0258] In one possible design, the identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and the serial number of the terminal in the first transaction. The first transaction address is the address of the first transaction on the blockchain.
[0259] It will be appreciated that if the first transaction includes information about a single terminal, the identifier of the first transaction includes the address of the first transaction. If the first transaction includes information about multiple terminals, the identifier of the first transaction includes the address of the first transaction and the terminal's sequence number in the first transaction. This ensures that the transaction identifier corresponding to the key configured by the first node for each terminal is unique.
[0260] As an example, if the first transaction includes the key corresponding to terminal 1, the address of the first transaction can be used as the identifier of the first transaction. If the first transaction includes: {sequence number 1: key corresponding to terminal 1, sequence number 2: key corresponding to terminal 2}, then for terminal 1, sequence number 1 can be added to the end of the address of the first transaction as the identifier of the first transaction, and for terminal 2, sequence number 2 can be added to the end of the address of the first transaction as the identifier of the first transaction.
[0261] S304: The first node sends a second message to the terminal. Correspondingly, the terminal receives the second message from the first node.
[0262] In an embodiment of the present application, the second message may include key information. The key information is determined based on the first key. Upon receiving the second message, the terminal may determine the first key based on the key information. Optionally, the second message may also include an identifier of the first transaction and at least one of the following: an identifier of the target network or a public key of the target network.
[0263] In one possible implementation, the key information includes the first key, or the key information is the first key. That is, the first node can include the first key in a second message and send it to the terminal. Upon receiving the second message, the terminal obtains the first key. The first node also sends the first key to the target network via the blockchain. This allows authentication between the terminal and the target network based on the first key.
[0264] In another possible implementation, the key information includes a third key, or the key information is the third key. The third key is determined based on the first key. Specifically, the first node first obtains the third key, generates the first key based on the third key, sends the first key to the target network via the blockchain, and sends the third key to the terminal. After receiving the third key, the terminal can generate the first key based on the third key. This allows authentication between the terminal and the target network using the first key. Furthermore, the target network can obtain the first key but not the third key, so the third key, as the root key from which the first key is derived, can be hidden and protected. Subsequently, the first node can also update the authentication key between the terminal and the target network based on the third key, or configure authentication keys between the terminal and other networks based on the third key. This not only facilitates operation but also improves communication security between the terminal and the network.
[0265] In one possible design, the first key is derived based on the third key and the target network identifier; alternatively, the first key is derived based on the third key, the target network identifier, and a second random number. In other words, the first node and the terminal may use a key generation algorithm to calculate the first key from the third key and the target network identifier, or alternatively, use a key generation algorithm to calculate the first key from the third key, the target network identifier, and the second random number.
[0266] In a possible implementation, the first node performs an over-the-air card write to the terminal via a secure interface, and writes the content included in the second message into the terminal.
[0267] As an example, the second message includes: HTTPS: UE-Root_Key, Target-OP-profile (ID OP , PK OP ), TX-addr. Among them, UE-Root_Key is the third key, Target-OP-profile is the information of the target network, ID OP is the identifier of the target network, PK OP is the public key of the target network, and TX-addr is the identifier of the first transaction.
[0268] Optionally, after S304, the terminal may update the key according to the method shown in FIG6 below.
[0269] Among them, the actions of the terminal or first node or target network (which can be a node in the target network) in the above S301-S304 can be executed by the processor 201 in the communication device 20 shown in Figure 2 calling the application code stored in the memory 203, and the embodiment of the present application does not impose any restrictions on this.
[0270] Based on the method shown in Figure 3, the terminal can trigger the first node to configure a first key for the terminal and the target network. Subsequently, the terminal and the target network can authenticate or authorize the terminal using the first key, allowing the terminal to access the target network. This eliminates the need to use the key stored in the SIM card for authentication or authorization between the terminal and the target network, effectively unbinding the SIM card from the network. This allows the user to switch networks without having to replace the SIM card, enabling flexible network access and improving the user experience.
[0271] As shown in FIG4 , an authentication method provided in an embodiment of the present application may include the following steps:
[0272] S401: The terminal obtains an identifier and a first key of a first transaction.
[0273] The terminal may be terminal 102 in FIG. 1A , or terminal 112 in FIG. 1D . The first transaction is a blockchain transaction corresponding to a first key. The first key may be used for authentication between the terminal and the target network.
[0274] It can be understood that if the terminal is terminal 102 in FIG. 1A , the target network may be network 103 in FIG. 1A ; if the terminal is terminal 112 in FIG. 1D , the target network may be network 113 in FIG. 1D .
[0275] In one possible implementation, the terminal obtains the identifier and first key of the first transaction using the method shown in FIG3 . For example, the terminal receives a second message from the first node, where the second message includes key information and the identifier of the first transaction. The key information and the identifier of the first transaction may also be included in separate messages, without limitation. Alternatively, the terminal obtains the identifier and first key of the first transaction using other methods, without limitation.
[0276] S402: The target network obtains the identifier and the first key of the first transaction.
[0277] It is understood that the execution entity of S402 can be the second node in the target network. For example, if the target network is network 103 in Figure 1A, then node 1031 obtains the identifier and first key of the first transaction, i.e., the second node is node 1031. If the target network is network 113 in Figure 1D, then node 1131 obtains the identifier and first key of the first transaction, i.e., the second node is node 1131.
[0278] In one possible implementation, the target network obtains the identifier and first key of the first transaction using the method shown in FIG3 . For example, the target network obtains the identifier and first key of the first transaction on-chain, or obtains the identifier and first key of the first transaction from a blockchain node or the first node. Alternatively, the target network obtains the identifier and first key of the first transaction using other methods, which are not limited.
[0279] It is understandable that the present application does not limit the execution order of S401 and S402. For example, S401 may be executed first and then S402, or S402 may be executed first and then S401, or S401 and S402 may be executed simultaneously.
[0280] S403: The terminal and the target network perform authentication based on the first transaction identifier and the first key.
[0281] It is understood that the execution entity of S403 can be a third node in the target network. For example, if the target network is network 103 in Figure 1A, authentication between the terminal and node 1032 is performed based on the identifier of the first transaction and the first key, i.e., the third node is node 1032. If the target network is network 113 in Figure 1D, authentication between the terminal and node 1132 is performed based on the identifier of the first transaction and the first key, i.e., the third node is node 1132. In the above example, the second node and the third node are different. However, in specific applications, the second node and the third node can also be the same, without limitation.
[0282] In one possible implementation, the terminal sends a first request to the target network. The first request may be used to request access to the target network. After receiving the first request, the target network sends an authentication message to the terminal. The authentication message is obtained based on a first key, which can also be described as corresponding to the first key. Thus, after receiving the authentication message, the terminal can verify the authentication message.
[0283] In an embodiment of the present application, the first request may include an identifier of the first transaction. Thus, after receiving the first request, the target network may obtain the first key based on the identifier of the first transaction, for example, by querying the first key using the identifier of the first transaction as an index.
[0284] Optionally, the terminal further sends an identifier of the terminal to the target network to indicate to the target network that the terminal is to be authenticated. It is understandable that the identifier of the terminal may be included in the first request and sent to the target network, or the identifier of the terminal may be included in other messages and sent to the target network, without limitation.
[0285] As an example, the terminal encrypts the identifier of the first transaction using the public key of the target network to obtain a first request, and then sends the first request to the target network. After receiving the first request, the target network decrypts it using its private key to obtain the identifier of the first transaction, obtains the first key based on the identifier of the first transaction, obtains an authentication message based on the first key and the identifier of the target network, and sends the authentication message to the terminal. After receiving the authentication message, the terminal verifies the authentication message based on the first key and the identifier of the target network.
[0286] As another example, the terminal uses the target network's public key to encrypt the first transaction identifier and the terminal identifier to obtain a first request, and then sends the first request to the target network. After receiving the first request, the target network decrypts it using the target network's private key to obtain the first transaction identifier and the terminal identifier. It then obtains the first key based on the first transaction identifier, and then obtains an authentication message based on the first key, the target network identifier (which may be replaced by the target network's serial number), and a third random number generated by the target network. The authentication message and the third random number are then sent to the terminal. After receiving the authentication message and the third random number, the terminal verifies the authentication message based on the first key, the target network identifier, and the third random number.
[0287] In a possible implementation, after the target network obtains the identifier of the first transaction according to the first request, the first key may be queried in the target network according to the identifier of the first transaction.
[0288] For example, before S403, the third node obtains the first transaction identifier and the first key from the second node. After obtaining the first transaction identifier in accordance with the first request, the third node can locally query the first key based on the first transaction identifier. Alternatively, after obtaining the first transaction identifier in accordance with the first request, the third node sends the first transaction identifier to the second node. After receiving the first transaction identifier, the second node locally queries the first key based on the first transaction identifier and sends the first key to the third node.
[0289] Optionally, the target network verifies the identity of the first transaction through the blockchain.
[0290] For example, the target network sends a query message to a blockchain node. This query message can be used to query the key corresponding to the first transaction. For example, the query message can include the identifier of the first transaction. After receiving the query message, the blockchain node can query the first key based on the identifier of the first transaction and send a response message to the target network. The response message includes the first key. After receiving the response message, the target network verifies whether the first key it has queried is identical to the first key sent by the blockchain node. If they are identical, it sends an authentication message to the terminal. If not, it sends an authentication failure message to the terminal.
[0291] Optionally, after verifying the authentication message, the terminal sends a verification result to the target network. Accordingly, the target network receives the verification result from the terminal. The verification result may include verification failure or verification success.
[0292] Optionally, after receiving the verification result, the target network sends a verification response message to the terminal based on the verification result. Accordingly, the terminal receives the verification response message from the target network. The verification response message may indicate that the authentication was successful or failed, or may indicate that access to the target network is permitted or denied.
[0293] Among them, the actions of the terminal or target network (which can be a node in the target network) in the above S401-S403 can be executed by the processor 201 in the communication device 20 shown in Figure 2 calling the application code stored in the memory 203, and the embodiment of the present application does not impose any restrictions on this.
[0294] Based on the method shown in FIG4 , the terminal and the target network can authenticate each other using the first transaction identifier and the first key. This eliminates the need for the target network to assign a user permanent identifier (SUPI) to each terminal and manage a large number of SUPIs. This simplifies the authentication process and conserves storage resources on the target network.
[0295] As shown in FIG5 , another method for obtaining a key provided in an embodiment of the present application may include the following steps:
[0296] S501: The terminal obtains an identifier and a first key of a first transaction.
[0297] S502: The target network obtains the identifier and the first key of the first transaction.
[0298] S501-S502 are the same as S401-S402 in the method shown in FIG4 . For related descriptions, reference may be made to the method shown in FIG4 , and details will not be repeated here.
[0299] S503: The terminal sends a second request to the first network. Correspondingly, the first network receives the second request from the terminal.
[0300] In a possible design, the target network is the network of the terminal's home location, and the first network is the network of the terminal's roaming location.
[0301] Example 1, taking the communication system 10 shown in Figure 1A as an example, the first network is network 104. After the terminal 102 moves from the coverage area of network 103 to the coverage area of network 104, it sends a second request to network 104, for example, sends a second request to node 1042.
[0302] Example 2, taking the communication system 11 shown in Figure 1D as an example, the first network is network 115. After the terminal 112 moves from the coverage area of network 113 to the coverage area of network 115, it sends a second request to network 115, for example, sends a second request to node 1152.
[0303] In the embodiment of the present application, the second request may be used to request access to the first network. The second request may include an identifier of the first transaction and an identifier of the target network.
[0304] Optionally, the terminal further sends a first random number to the first network. Accordingly, the first network receives the first random number from the terminal. It is understood that the first random number may be included in the second request and sent to the first network, or may be included in other messages and sent to the first network, without limitation.
[0305] S504: The first network sends the identifier of the first transaction to the target network. Correspondingly, the target network receives the identifier of the first transaction from the first network.
[0306] In one possible implementation, the first network determines, based on the identifier of the target network, to send the identifier of the first transaction to the target network. After receiving the identifier of the first transaction, the target network obtains the first key based on the identifier of the first transaction.
[0307] For example 1 above, after receiving the second request, node 1042 sends the identifier of the first transaction to node 1032 based on the identifier of network 103. After receiving the identifier of the first transaction, node 1032 performs a query based on the identifier of the first transaction to obtain the first key.
[0308] For example 2 above, after receiving the second request, node 1152 sends the identifier of the first transaction to node 1132 based on the identifier of network 113. After receiving the identifier of the first transaction, node 1132 performs a query based on the identifier of the first transaction to obtain the first key.
[0309] Optionally, the first network sends the first random number to the target network. Correspondingly, the target network receives the first random number from the first network.
[0310] Optionally, the first network sends an identifier of the first network to the target network, and correspondingly, the target network receives the identifier of the first network from the first network.
[0311] Optionally, the first network sends an identifier of the target network to the target network. Correspondingly, the target network receives the identifier of the target network from the first network.
[0312] It is understandable that the first transaction identifier, the first random number, the first network identifier and the target network identifier may be included in one message and sent to the target network, or may be included in different messages and sent to the target network, without limitation.
[0313] S505: The target network sends the second key to the blockchain node. In response, the blockchain node receives the second key from the target network.
[0314] In one possible design, the second key can be used for authentication between the terminal and the first network. The second key is obtained based on the first key.
[0315] In Example 1 above, node 1032 derives the second key from the first key. For example, node 1032 calculates the second key from the first key using a key generation algorithm, or calculates the second key from the first key and the identifier of network 104 using a key generation algorithm, or calculates the second key from the first key, the identifier of network 104, and a first random number using a key generation algorithm, and sends the second key to the blockchain node. For example, after obtaining the second key, node 1032 sends the second key to node 1031. After receiving the second key, node 1031 sends the second key to the blockchain node.
[0316] In Example 2 above, node 1132 derives the second key from the first key. For example, node 1132 calculates the second key from the first key using a key generation algorithm, or calculates the second key from the first key and the identifier of network 115 using a key generation algorithm, or calculates the second key from the first key, the identifier of network 115, and a first random number using a key generation algorithm, and sends the second key to the blockchain node. For example, after obtaining the second key, node 1132 sends the second key to node 1131. After receiving the second key, node 1131 sends the second key to the blockchain node.
[0317] It is understood that in S505, the target network may trigger the generation of a blockchain transaction corresponding to the second key (hereinafter referred to as the second transaction) on the blockchain. For example, if node 1031 or node 1131 is a node in the blockchain, node 1031 or node 1131 itself triggers the generation of the second transaction; if node 1031 or node 1131 is not a node in the blockchain, node 1031 or node 1131 triggers the blockchain node to generate the second transaction. Subsequently, the first network may obtain the second key through the blockchain. Optionally, the first network also obtains an identifier for the second transaction. The above process is similar to the process in S303 where the first node sends the third message to the blockchain node. Please refer to the corresponding description in S303 and will not be repeated here.
[0318] In one possible design, the identifier of the second transaction includes the address of the second transaction, or the identifier of the second transaction includes the address of the second transaction and the serial number of the terminal in the second transaction. The second transaction address is the address of the second transaction on the blockchain.
[0319] S506: The first network sends first indication information to the terminal. Correspondingly, the terminal receives the first indication information from the first network.
[0320] In the embodiment of the present application, the first indication information can be used to instruct the terminal to generate a second key or instruct the terminal to generate a new key.
[0321] For the above example 1, the node 1032 sends the first indication information to the terminal 102. For the above example 2, the node 1132 sends the first indication information to the terminal 112.
[0322] Optionally, the first network further sends an identifier of the second transaction to the terminal. Correspondingly, the terminal receives the identifier of the second transaction from the first network.
[0323] It is understandable that the second transaction identifier and the first indication information may be included in one message and sent to the terminal, or may be included in different messages and sent to the terminal, without limitation.
[0324] S507: The terminal generates a second key based on the first key.
[0325] For Example 1 above, terminal 102 obtains the second key based on the first key. For example, terminal 102 calculates the second key based on the first key according to the key generation algorithm, or calculates the second key based on the first key and the identifier of network 104 according to the key generation algorithm, or calculates the second key based on the first key, the identifier of network 104, and the first random number according to the key generation algorithm.
[0326] For Example 2 above, terminal 112 obtains the second key based on the first key. For example, terminal 112 calculates the second key based on the first key according to the key generation algorithm, or calculates the second key based on the first key and the identifier of network 115 according to the key generation algorithm, or calculates the second key based on the first key, the identifier of network 115, and the first random number according to the key generation algorithm.
[0327] It can be understood that after S507 , the terminal and the first network can obtain the second key and the identifier of the second transaction.
[0328] Optionally, after S507, the terminal and the first network may perform authentication based on the second key and the identifier of the second transaction. For details, please refer to the corresponding introduction in S403.
[0329] Optionally, after S507, the terminal may update the key according to the method shown in FIG6 below.
[0330] Among them, the actions of the terminal or target network (which may be a node in the target network) or the first network (which may be a node in the first network) in the above S501-S507 can be executed by the processor 201 in the communication device 20 shown in Figure 2 calling the application code stored in the memory 203, and the embodiment of the present application does not impose any restrictions on this.
[0331] Based on the method shown in Figure 5, the target network can configure a second key for the first network and the terminal. Subsequently, the terminal and the first network can perform authentication or authorization based on the second key without the target network participating in the authentication, thus simplifying the authentication process.
[0332] As shown in FIG6 , a method for updating a key provided in an embodiment of the present application may include the following steps:
[0333] S601: The terminal obtains an identifier and a first key of a first transaction.
[0334] S602: The target network obtains the identifier and the first key of the first transaction.
[0335] S601-S602 are the same as S401-S402 in the method shown in FIG4 . For related descriptions, reference may be made to the method shown in FIG4 , and details will not be repeated here.
[0336] S603: The terminal sends a fourth message to the first node. Correspondingly, the first node receives the fourth message from the terminal.
[0337] If the terminal is terminal 102 in FIG. 1A , the first node is node 101 in FIG. 1A ; or, if the terminal is terminal 112 in FIG. 1D , the first node is node 111 in FIG. 1D .
[0338] In this embodiment of the present application, the fourth message may be used to indicate the second network. For example, the fourth message includes an identifier of the second network. The second network and the target network may be the same or different. For example, the second network may be network 103 or network 104 in Figure 1A ; or, the second network may be network 113 or network 115 in Figure 1D .
[0339] It is understood that if the second network is the same as the target network, it indicates that the terminal triggers an update of the authentication key between the terminal and the target network. If the second network is different from the target network, it indicates that the terminal is about to switch to the second network, and the terminal triggers the first node to configure the authentication key between the terminal and the second network.
[0340] It is understandable that S603 may not be included in the method shown in Figure 6. At this time, the first node may trigger the key update.
[0341] Optionally, the terminal sends a fourth random number to the first node. Correspondingly, the first node receives the fourth random number from the terminal.
[0342] It can be understood that the fourth random number is included in a fourth message and sent to the first node, or the fourth random number is included in a message different from the fourth message and sent to the first node.
[0343] S604: The first node sends a fifth message to the blockchain node. In response, the blockchain node receives the fifth message from the first node.
[0344] In this embodiment of the present application, the fifth message includes a fourth key. The fourth key can be used for authentication between the terminal and the second network.
[0345] It is understood that after receiving the fourth message, the first node generates a fourth key based on the first key. For example, the first node calculates the first key according to the key generation algorithm to obtain the fourth key, or calculates the first key and the identifier of the second network according to the key generation algorithm to obtain the fourth key, or calculates the first key, the identifier of the second network, and a fourth random number according to the key generation algorithm to obtain the fourth key. Subsequently, the first node may send a fifth message to the blockchain node.
[0346] As will be appreciated, in S604, the first node may trigger the generation of a blockchain transaction (hereinafter referred to as the third transaction) corresponding to the fourth key on the blockchain. For example, if the first node is a node in the blockchain, the first node itself triggers the generation of the third transaction; if the first node is not a node in the blockchain, the first node triggers the blockchain node to generate the third transaction. Subsequently, the second network may obtain the fourth key from the blockchain. Optionally, the second network also obtains an identifier for the third transaction. This process is similar to the process in S303 where the first node sends the third message to the blockchain node. For details, please refer to the corresponding description in S303 and will not be repeated here.
[0347] In one possible design, the identifier of the third transaction includes the address of the third transaction, or the identifier of the third transaction includes the address of the third transaction and the serial number of the terminal in the third transaction. The third transaction address is the address of the third transaction on the blockchain.
[0348] Optionally, after receiving the fifth message, the blockchain node sends a response message to the first node to indicate to the first node that the fifth message has been received.
[0349] S605: The first node sends second indication information to the terminal. Correspondingly, the terminal receives the second indication information from the first node.
[0350] In the embodiment of the present application, the second indication information can be used to instruct the terminal to generate a fourth key, or to instruct the terminal to generate a new key.
[0351] Optionally, the first node sends an identifier of the third transaction to the terminal. Correspondingly, the terminal receives the identifier of the third transaction from the first node.
[0352] It is understandable that the third transaction identifier and the second indication information may be included in one message and sent to the terminal, or may be included in different messages and sent to the terminal, without limitation.
[0353] S606: The terminal generates a fourth key based on the first key.
[0354] For example, the terminal calculates the first key according to the key generation algorithm to obtain the fourth key, or calculates the first key and the identifier of the second network according to the key generation algorithm to obtain the fourth key, or calculates the first key, the identifier of the second network and the fourth random number according to the key generation algorithm to obtain the fourth key.
[0355] It can be understood that after S606 , the terminal and the second network can obtain the fourth key and the identifier of the third transaction.
[0356] Optionally, after S606, the terminal and the second network may perform authentication based on the fourth key and the identifier of the third transaction. For details, please refer to the corresponding introduction in S403.
[0357] Among them, the actions of the terminal or first node or target network (which can be a node in the target network) in the above S601-S606 can be executed by the processor 201 in the communication device 20 shown in Figure 2 calling the application code stored in the memory 203, and the embodiment of the present application does not impose any restrictions on this.
[0358] Based on the method shown in Figure 6, the terminal can trigger the first node to configure keys for the terminal and the second network. If the second network is the same as the target network, the terminal can trigger an update of the authentication key between the terminal and the target network, improving communication security. If the second network is different from the target network, the terminal can access the second network based on the key configured by the first node without having to change the SIM card, which is very convenient.
[0359] The various embodiments mentioned above in this application can be combined without limitation if there is no contradiction between the solutions.
[0360] It can be understood that in the above embodiments, the methods and / or steps implemented by the terminal can also be implemented by components (such as chips or circuits) that can be used for the terminal; the methods and / or steps implemented by the first node can also be implemented by components (such as chips or circuits) that can be used for the first node; the methods and / or steps implemented by the node in the target network can also be implemented by components (such as chips or circuits) that can be used for nodes in the target network; the methods and / or steps implemented by the node in the first network can also be implemented by components (such as chips or circuits) that can be used for nodes in the first network; the methods and / or steps implemented by the node in the second network can also be implemented by components (such as chips or circuits) that can be used for nodes in the second network.
[0361] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of interaction between various network elements. Accordingly, the embodiment of the present application also provides a communication device, which can be a terminal in the above method embodiment, or a device including the above terminal, or a component that can be used for a terminal; or, the communication device can be a first node in the above method embodiment, or a device including the above first node, or a component that can be used for a first node; or, the communication device can be a node in the target network in the above method embodiment, or a device including the above target node, or a component that can be used for a node in the target network; or, the communication device can be a node in the first network in the above method embodiment, or a device including the above first node, or a component that can be used for a node in the first network; or, the communication device can be a node in the second network in the above method embodiment, or a device including the above second node, or a component that can be used for a node in the second network. It can be understood that in order to implement the above functions, the above terminal or the first node or the node in the target network or the node in the first network or the node in the second network, etc., includes hardware structures and / or software modules corresponding to the execution of each function. It should be readily apparent to those skilled in the art that, in combination with the units and algorithmic operations of the various examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0362] In an embodiment of the present application, the functional modules of the terminal or the first node or the node in the target network or the node in the first network or the node in the second network can be divided according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It is understandable that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0363] For example, FIG7 shows a schematic diagram of the structure of a communication device 70, where the functional modules are divided in an integrated manner. The communication device 70 includes a transceiver module 701. Optionally, the communication device 70 also includes a processing module 702. The transceiver module 701, also known as a transceiver unit, is used to perform transceiver operations and may be, for example, a transceiver circuit, a transceiver, a transceiver, or a communication interface. The processing module 702, also known as a processing unit, is used to perform operations other than transceiver operations and may be, for example, a processing circuit or a processor.
[0364] In some embodiments, the communication device 70 may further include a storage module (not shown in FIG. 7 ) for storing program instructions and data.
[0365] Exemplarily, the communication device 70 is used to implement the functions of a terminal. The communication device 70 is, for example, the terminal described in the embodiment shown in FIG3 , the embodiment shown in FIG4 , the embodiment shown in FIG5 , or the embodiment shown in FIG6 .
[0366] The transceiver module 701 is configured to send a first message to the first node, where the first message is used to instruct the communication device 70 to access the network. For example, the transceiver module 701 may be configured to execute S301.
[0367] The transceiver module 701 is further configured to receive a second message from the first node, the second message including key information, the key information being used to determine a first key used for authentication between the communication device 70 and the target network. For example, the transceiver module 701 is further configured to execute S304.
[0368] In one possible implementation, the second message further includes an identifier of the first transaction and at least one of the following: an identifier of the target network or a public key of the target network; the first transaction is a blockchain transaction corresponding to the first key.
[0369] In one possible implementation, the transceiver module 701 is further used to send a first request to the target network, where the first request is used to request access to the target network, and the first request includes an identifier of the first transaction; the transceiver module 701 is further used to receive an authentication message from the target network, where the authentication message corresponds to the first key.
[0370] In a possible implementation, the transceiver module 701 is further configured to send the identifier of the communication device 70 to the target network.
[0371] In one possible implementation, the transceiver module 701 is further configured to send a second request to the first network, where the second request is used to request access to the first network, and the second request includes an identifier of the first transaction and an identifier of the target network. The transceiver module 701 is further configured to receive first indication information from the first network, where the first indication information is used to instruct the communication device 70 to generate a second key, where the second key is used for authentication between the communication device 70 and the first network. The processing module 702 is configured to generate the second key based on the first key and the identifier of the first network.
[0372] In a possible implementation, the transceiver module 701 is further configured to receive an identifier of a second transaction from the first network, where the second transaction is a blockchain transaction corresponding to the second key.
[0373] In one possible implementation, the transceiver module 701 is further configured to send a third message to the first node, where the third message is used to indicate the third network; the transceiver module 701 is further configured to receive second indication information from the first node, where the second indication information is used to instruct the communication device 70 to generate a third key, where the third key is used for authentication between the communication device 70 and the third network; and the processing module 702 is configured to generate the third key based on the first key and an identifier of the third network.
[0374] In a possible implementation, the transceiver module 701 is further configured to receive an identifier of a third transaction from the first node, where the third transaction is a blockchain transaction corresponding to the third key.
[0375] In a possible implementation, the transceiver module 701 is further configured to send the first random number to the first network.
[0376] In a possible implementation, the identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a serial number of the communication device 70 in the first transaction.
[0377] In a possible implementation, the target network is determined according to a selection of a user corresponding to the communication device 70; or, the target network is determined according to a preset policy; or, the target network is determined by the first node.
[0378] In a possible implementation manner, the key information includes a first key; or the key information includes a third key, and the third key is used to determine the first key.
[0379] In a possible implementation, the transceiver module 701 is further configured to send a second random number to the first node.
[0380] In a possible implementation, the third key is used to determine the first key, including: the third key is used together with the identifier of the target network and the second random number to determine the first key.
[0381] In a possible implementation manner, the first message includes information of the target network.
[0382] When used to implement the functions of the terminal, for other functions that the communication device 70 can implement, please refer to the embodiment shown in Figure 3, the method embodiment shown in Figure 4, the embodiment shown in Figure 5 or the relevant introduction of the embodiment shown in Figure 6, and no further details will be given.
[0383] In a simple embodiment, those skilled in the art can imagine that the communication device 70 can be in the form shown in Figure 2. For example, the processor 201 in Figure 2 can call the computer-executable instructions stored in the memory 203 to enable the communication device 70 to perform the method described in the above method embodiment.
[0384] Exemplarily, the functions / implementation processes of the transceiver module 701 and the processing module 702 in FIG7 can be implemented by the processor 201 in FIG2 calling computer-executable instructions stored in the memory 203. Alternatively, the functions / implementation processes of the processing module 702 in FIG7 can be implemented by the processor 201 in FIG2 calling computer-executable instructions stored in the memory 203, and the functions / implementation processes of the transceiver module 701 in FIG7 can be implemented by the communication interface 204 in FIG2.
[0385] For example, FIG8 illustrates a schematic diagram of the structure of a communication device 80, where the functional modules are integrated. Communication device 80 includes a transceiver module 801 and a processing module 802. Transceiver module 801, also known as a transceiver unit, performs transceiver operations and may, for example, be a transceiver circuit, a transceiver, a transceiver, or a communication interface. Processing module 802, also known as a processing unit, performs operations other than transceiver operations and may, for example, be a processing circuit or a processor.
[0386] In some embodiments, the communication device 80 may further include a storage module (not shown in FIG. 8 ) for storing program instructions and data.
[0387] Exemplarily, the communication device 80 is used to implement the function of the first node. The communication device 80 is, for example, the first node described in the embodiment shown in FIG3 or the embodiment shown in FIG6.
[0388] The transceiver module 801 is configured to receive a first message from a terminal, where the first message is used to indicate that the terminal wants to access a network. For example, the transceiver module 801 may be configured to execute S301.
[0389] The processing module 802 is configured to obtain a first key, where the first key is used for authentication between the terminal and the target network. For example, the processing module 802 may be configured to execute S302.
[0390] The transceiver module 801 is further configured to send a third message to the blockchain node, where the third message is configured to indicate the first key to the target network. For example, the transceiver module 801 may also be configured to execute S303.
[0391] The transceiver module 801 is further configured to send a second message to the terminal, where the second message includes key information, where the key information is determined based on the first key. For example, the transceiver module 801 may also be configured to execute S304.
[0392] In a possible implementation, the processing module 802 is further configured to obtain an identifier of a first transaction, where the first transaction is a blockchain transaction corresponding to the first key.
[0393] In a possible implementation manner, the second message further includes an identifier of the first transaction and at least one of the following: an identifier of the target network or a public key of the target network.
[0394] In a possible implementation, the identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a serial number of the terminal in the first transaction.
[0395] In one possible implementation, the transceiver module 801 is further used to receive a fourth message from the terminal, where the fourth message is used to indicate the second network; the transceiver module 801 is further used to send a fifth message to the blockchain node, where the fifth message includes a fourth key, where the fourth key is used for authentication between the terminal and the second network; the transceiver module 801 is further used to send second indication information to the terminal, where the second indication information is used to instruct the terminal to generate a fourth key.
[0396] In a possible implementation, the processing module 802 is further configured to obtain an address of a third transaction, where the third transaction is a blockchain transaction corresponding to the fourth key.
[0397] In a possible implementation, the transceiver module 801 is further configured to send an identifier of the third transaction to the terminal.
[0398] In a possible implementation manner, the key information includes the first key; or the key information includes a third key, and the third key is used to determine the first key.
[0399] In a possible implementation, the transceiver module 801 is further configured to receive a second random number from the terminal.
[0400] In a possible implementation, the third key is used to determine the first key, including: the third key is used together with the identifier of the target network and the second random number to determine the first key.
[0401] In one possible implementation, the blockchain node is included in the target network, and the third message is obtained by encrypting the first key using the public key of the target network.
[0402] In a possible implementation manner, the first message includes information of the target network.
[0403] When used to implement the function of the first node, regarding other functions that the communication device 80 can implement, please refer to the relevant introduction of the embodiment shown in Figure 3 or the embodiment shown in Figure 6, and no further details will be given.
[0404] Alternatively, illustratively, the communication device 80 is used to implement the function of a node in the target network. The communication device 80 is, for example, a node in the target network described in the embodiment shown in FIG4 , the embodiment shown in FIG5 , or the embodiment shown in FIG6 .
[0405] The processing module 802 is configured to obtain a third message.
[0406] The processing module 802 is further configured to obtain a first key according to the third message; the first key is used for authentication between the first terminal and the target network.
[0407] The processing module 802 is further configured to obtain an identifier of a first transaction, where the first transaction is a blockchain transaction corresponding to the first key.
[0408] The processing module 802 is further configured to verify the first terminal according to the first key and the identifier of the first transaction.
[0409] The transceiver module 801 is further configured to send a verification response message to the first terminal according to the verification result.
[0410] In one possible implementation, the processing module 802 is specifically configured to receive a first request from the first terminal through the transceiver module 801, where the first request is used to request access to the target network and includes an identifier of the first transaction. The processing module 802 is further specifically configured to send an authentication message to the first terminal through the transceiver module 801, where the authentication message is obtained based on a first key, and the first key is queried based on the first request.
[0411] In one possible implementation, the transceiver module 801 is further used to send a query message to the blockchain node, where the query message is used to query the key corresponding to the first transaction, and the query message includes an identifier of the first transaction; the transceiver module 801 is further used to receive a response message from the blockchain node, where the response message includes the first key.
[0412] In a possible implementation, the transceiver module 801 is further configured to receive an identifier of the first terminal from the first terminal.
[0413] In one possible implementation, the transceiver module 801 is further used to receive a third request from the second terminal, where the third request is used to request access to the target network, and the third request includes an identifier of a fourth transaction and an identifier of a third network. The fourth transaction is a blockchain transaction corresponding to a fifth key, and the fifth key is used for authentication between the second terminal and the third network; the transceiver module 801 is further used to send the identifier of the fourth transaction to the third network; the processing module 802 is further used to obtain a sixth key, which is used for authentication between the second terminal and the target network; the transceiver module 801 is further used to send third indication information to the second terminal, where the third indication information is used to instruct the second terminal to generate a sixth key.
[0414] In one possible implementation, the processing module 802 is further configured to obtain an identifier of a fifth transaction, where the fifth transaction is a blockchain transaction corresponding to the sixth key; and the transceiver module 801 is further configured to send the identifier of the fifth transaction to the second terminal.
[0415] In one possible implementation, the transceiver module 801 is further used to receive an identifier of the first transaction from the second network; the transceiver module 801 is further used to send a second key to the blockchain node, where the second key is used for authentication between the first terminal and the second network, and the second key is obtained based on the first key, and the first key is queried based on the identifier of the first transaction.
[0416] In a possible implementation, the identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a sequence number of the first terminal in the first transaction.
[0417] When used to implement the function of a node in a target network, regarding other functions that the communication device 80 can implement, reference can be made to the relevant introduction of the embodiment shown in FIG3 or the embodiment shown in FIG6 , and no further details will be given.
[0418] Alternatively, illustratively, the communication device 80 is used to implement the functions of a terminal. The communication device 80 is, for example, the terminal described in the embodiment shown in FIG4 .
[0419] The processing module 802 is configured to obtain an identifier and a first key of a first transaction, where the first transaction is a blockchain transaction corresponding to the first key. For example, the processing module 802 may be configured to execute S401.
[0420] The processing module 802 is further configured to authenticate with the target network according to the identifier of the first transaction and the first key. For example, the processing module 802 may also be configured to execute S403.
[0421] The transceiver module 801 is configured to receive a verification response message from a target network.
[0422] In one possible implementation, the processing module 802 is specifically configured to send a first request to the target network through the transceiver module 801, where the first request is used to request access to the target network and includes an identifier of the first transaction. The processing module 802 is further specifically configured to receive an authentication message from the target network through the transceiver module 801, where the authentication message is obtained based on a first key that is queried based on the first request. The processing module 802 is further specifically configured to verify the authentication message.
[0423] In a possible implementation, the transceiver module 801 is further configured to send the identifier 80 of the communication device 80 to the target network.
[0424] In a possible implementation, the first request is obtained by encrypting the identifier of the first transaction using a public key of the target network.
[0425] When used to implement the functions of the terminal, for other functions that the communication device 80 can implement, reference can be made to the relevant introduction of the embodiment shown in FIG4 , and no further details will be given.
[0426] In a simple embodiment, those skilled in the art can imagine that the communication device 80 can be in the form shown in Figure 2. For example, the processor 201 in Figure 2 can call the computer-executable instructions stored in the memory 203 to enable the communication device 80 to perform the method described in the above method embodiment.
[0427] Exemplarily, the functions / implementation processes of the transceiver module 801 and the processing module 802 in FIG8 can be implemented by the processor 201 in FIG2 calling computer-executable instructions stored in the memory 203. Alternatively, the functions / implementation processes of the processing module 802 in FIG8 can be implemented by the processor 201 in FIG2 calling computer-executable instructions stored in the memory 203, and the functions / implementation processes of the transceiver module 801 in FIG8 can be implemented by the communication interface 204 in FIG2.
[0428] It is understandable that one or more of the above modules or units can be implemented by software, hardware or a combination of the two. When any of the above modules or units is implemented by software, the software exists in the form of computer program instructions and is stored in a memory, and a processor can be used to execute the program instructions and implement the above method flow. The processor can be built into an SoC (system on chip) or an ASIC, or it can be an independent semiconductor chip. In addition to the core used to execute software instructions to perform calculations or processing within the processor, it can further include necessary hardware accelerators, such as field programmable gate arrays (FPGAs), PLDs (programmable logic devices), or logic circuits that implement dedicated logic operations.
[0429] When the above modules or units are implemented in hardware, the hardware can be any one or any combination of a CPU, a microprocessor, a digital signal processing (DSP) chip, a microcontroller unit (MCU), an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator or a non-integrated discrete device, which can run the necessary software or not rely on the software to execute the above method flow.
[0430] Optionally, an embodiment of the present application further provides a chip system, comprising: at least one processor and an interface, wherein the at least one processor is coupled to a memory via the interface, and when the at least one processor executes a computer program or instruction in the memory, the method in any of the above method embodiments is executed. In one possible implementation, the chip system also includes a memory. Optionally, the chip system can be composed of a chip, or can include a chip and other discrete devices, which is not specifically limited in the embodiment of the present application.
[0431] Optionally, an embodiment of the present application further provides a computer-readable storage medium. All or part of the processes in the above-mentioned method embodiments can be completed by a computer program to instruct the relevant hardware, and the program can be stored in the above-mentioned computer-readable storage medium. When the program is executed, it may include the processes of the above-mentioned method embodiments. The computer-readable storage medium can be an internal storage unit of the communication device of any of the aforementioned embodiments, such as a hard disk or memory of the communication device. The above-mentioned computer-readable storage medium can also be an external storage device of the above-mentioned communication device, such as a plug-in hard disk equipped on the above-mentioned communication device, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. Further, the above-mentioned computer-readable storage medium can also include both the internal storage unit of the above-mentioned communication device and an external storage device. The above-mentioned computer-readable storage medium is used to store the above-mentioned computer program and other programs and data required by the above-mentioned communication device. The above-mentioned computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.
[0432] Optionally, embodiments of the present application further provide a computer program product. All or part of the processes in the above method embodiments may be completed by a computer program instructing the relevant hardware. The program may be stored in the above computer program product, and when executed, the program may include the processes of the above method embodiments.
[0433] Optionally, an embodiment of the present application further provides a computer instruction. All or part of the processes in the above method embodiments can be completed by computer instructions to instruct related hardware (such as a computer, a processor, an access network device, a mobility management network element, or a session management network element). The program can be stored in the above computer-readable storage medium or in the above computer program product.
[0434] Optionally, an embodiment of the present application further provides a communication system, including: the terminal and the first node in the above embodiment.
[0435] Optionally, an embodiment of the present application further provides a communication system, comprising: the terminal in the above embodiment and a node in the target network.
[0436] Optionally, an embodiment of the present application further provides a communication system, including: the terminal in the above embodiment, the first node and a node in the target network.
[0437] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0438] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0439] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0440] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0441] The above is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for obtaining a key, characterized in that: Applied to a terminal, the method includes: Sending a first message to the first node, where the first message is used to indicate that the terminal wants to access a network; A second message is received from the first node, where the second message includes key information, where the key information is used to determine a first key, where the first key is used for authentication between the terminal and a target network.
2. The method according to claim 1, characterized in that The second message further includes an identifier of the first transaction and at least one of: an identifier of the target network or a public key of the target network; The first transaction is a blockchain transaction corresponding to the first key.
3. The method according to claim 2, characterized in that The method further comprises: Sending a first request to the target network, where the first request is used to request access to the target network, and the first request includes an identifier of the first transaction; An authentication message is received from the target network, where the authentication message corresponds to the first key.
4. The method according to claim 3, characterized in that The method further comprises: The terminal identifier is sent to the target network.
5. The method according to any one of claims 2 to 4, characterized in that The method further comprises: Sending a second request, where the second request is used to request access to the first network, and the second request includes an identifier of the first transaction and an identifier of the target network; receiving first indication information, where the first indication information is used to instruct the terminal to generate a second key, where the second key is used for authentication between the terminal and the first network; The second key is generated according to the first key and the identifier of the first network.
6. The method according to claim 5, characterized in that The method further comprises: An identifier of a second transaction is received, where the second transaction is a blockchain transaction corresponding to the second key.
7. The method according to claim 5 or 6, characterized in that The method further comprises: A first random number is sent to the first network.
8. The method according to any one of claims 2 to 7, characterized in that The identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a serial number of the terminal in the first transaction.
9. The method according to any one of claims 1 to 8, characterized in that The target network is determined according to a selection of a user corresponding to the terminal; or, the target network is determined according to a preset policy; or, the target network is determined by the first node.
10. The method according to any one of claims 1 to 9, characterized in that The key information includes the first key; or, The key information includes a third key, and the third key is used to determine the first key.
11. The method according to claim 10, characterized in that The method further comprises: A second random number is sent to the first node.
12. The method according to claim 11, characterized in that The third key is used to determine the first key, including: The third key is used to determine the first key together with the identifier of the target network and the second random number.
13. The method according to any one of claims 1 to 12, characterized in that The first message includes information of the target network.
14. A method for obtaining a key, characterized in that: The method comprises: receiving a first message from a terminal, where the first message is used to indicate that the terminal wants to access a network; Obtaining a first key, where the first key is used for authentication between the terminal and the target network; Sending a third message to the blockchain node, wherein the third message is used to indicate the first key to the target network; A second message is sent to the terminal, where the second message includes key information, where the key information is determined according to the first key.
15. The method according to claim 14, characterized in that Before sending the second message to the terminal, the method further includes: Obtain an identifier of a first transaction, where the first transaction is a blockchain transaction corresponding to the first key.
16. The method according to claim 15, characterized in that The second message further includes an identifier of the first transaction and at least one of the following: an identifier of the target network or a public key of the target network.
17. The method according to claim 16, characterized in that The identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a serial number of the terminal in the first transaction.
18. The method according to any one of claims 14 to 17, characterized in that The method further comprises: receiving a fourth message from the terminal, where the fourth message is used to indicate a second network; Sending a fifth message to the blockchain node, where the fifth message includes a fourth key, where the fourth key is used for authentication between the terminal and the second network; Second indication information is sent to the terminal, where the second indication information is used to instruct the terminal to generate the fourth key.
19. The method according to claim 18, characterized in that The method further comprises: Obtain an address of a third transaction, where the third transaction is a blockchain transaction corresponding to the fourth key.
20. The method according to claim 19, characterized in that The method further comprises: The identifier of the third transaction is sent to the terminal.
21. The method according to any one of claims 14 to 20, characterized in that The key information includes the first key; or, The key information includes a third key, and the third key is used to determine the first key.
22. The method according to claim 21, characterized in that The method further comprises: A second random number is received from the terminal.
23. The method according to claim 22, characterized in that The third key is used to determine the first key, including: The third key is used to determine the first key together with the identifier of the target network and the second random number.
24. The method according to any one of claims 14 to 23, wherein: The blockchain node is included in the target network, and the third message is obtained by encrypting the first key with the public key of the target network.
25. The method according to any one of claims 14 to 24, characterized in that The first message includes information of the target network.
26. A method for obtaining a key, characterized in that: Applied to a node in a target network, the method comprises: Get the third message; Obtaining a first key according to the third message; the first key is used for authentication between the first terminal and the target network; Obtaining an identifier of a first transaction, where the first transaction is a blockchain transaction corresponding to the first key; authenticating the first terminal based on the first key and the identifier of the first transaction; Send a verification response message to the first terminal according to the verification result.
27. The method according to claim 26, characterized in that The verifying the first terminal according to the first key and the first transaction identifier includes: receiving a first request from the first terminal, the first request being used to request access to the target network, the first request including an identifier of the first transaction; An authentication message is sent to the first terminal, where the authentication message is obtained according to a first key, and the first key is queried according to the first request.
28. The method according to claim 27, characterized in that Before sending the authentication message to the first terminal, the method further includes: Sending a query message to a blockchain node, the query message being used to query a key corresponding to the first transaction, the query message including an identifier of the first transaction; A response message is received from a blockchain node, where the response message includes the first key.
29. The method according to claim 27 or 28, characterized in that The method further comprises: An identification of the first terminal is received from the first terminal.
30. The method according to any one of claims 26 to 29, characterized in that The method further comprises: receiving a third request from a second terminal, the third request being used to request access to the target network, the third request including an identifier of a fourth transaction and an identifier of a third network, the fourth transaction being a blockchain transaction corresponding to a fifth key, the fifth key being used for authentication between the second terminal and the third network; sending an identifier of the fourth transaction to a third network; Obtaining a sixth key, where the sixth key is used for authentication between the second terminal and the target network; Send third indication information to the second terminal, where the third indication information is used to instruct the second terminal to generate the sixth key.
31. The method according to claim 30, wherein The method further comprises: Obtaining an identifier of a fifth transaction, where the fifth transaction is a blockchain transaction corresponding to the sixth key; The identifier of the fifth transaction is sent to the second terminal.
32. The method according to any one of claims 26 to 29, wherein: The method further comprises: receiving an identification of the first transaction from a second network; A second key is sent to the blockchain node, where the second key is used for authentication between the first terminal and the second network, and the second key is obtained based on the first key, and the first key is queried based on the identifier of the first transaction.
33. The method according to any one of claims 26 to 28 and 32, characterized in that The identifier of the first transaction includes the address of the first transaction, or the identifier of the first transaction includes the address of the first transaction and a serial number of the first terminal in the first transaction.
34. An authentication method, characterized in that: Applied to a terminal, the method includes: Obtaining a first transaction identifier and a first key, where the first transaction is a blockchain transaction corresponding to the first key; authenticating with a target network based on the first transaction identifier and the first key; A verification response message is received from the target network.
35. The method according to claim 34, wherein The authenticating with the target network according to the first transaction identifier and the first key includes: Sending a first request to the target network, where the first request is used to request access to the target network, and the first request includes an identifier of the first transaction; receiving an authentication message from the target network, where the authentication message is obtained based on the first key, and the first key is queried based on the first request; The authentication message is verified.
36. The method according to claim 35, characterized in that The method further comprises: The terminal identifier is sent to the target network.
37. The method according to claim 35 or 36, characterized in that The first request is obtained by encrypting the identifier of the first transaction using the public key of the target network.
38. A communication device, characterized in that: Comprising a unit or module for executing the method as claimed in any one of claims 1 to 13, or comprising a unit or module for executing the method as claimed in any one of claims 14 to 25, or comprising a unit or module for executing the method as claimed in any one of claims 26 to 33, or comprising a unit or module for executing the method as claimed in any one of claims 34 to 37.
39. A communication device, characterized in that: include: A processor, the processor being coupled to a memory, the memory being used to store a program or instruction, which, when executed by the processor, causes the apparatus to perform the method according to any one of claims 1 to 13, or the method according to any one of claims 14 to 25, or the method according to any one of claims 26 to 33, or the method according to any one of claims 34 to 37.
40. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instructions are executed, the computer performs the method of any one of claims 1 to 13, or the method of any one of claims 14 to 25, or the method of any one of claims 26 to 33, or the method of any one of claims 34 to 37.
41. A computer program product, comprising computer program code, characterized in that: When the computer program code runs on a computer, the computer implements the method of any one of claims 1 to 13, or the method of any one of claims 14 to 25, or the method of any one of claims 26 to 33, or the method of any one of claims 34 to 37.
