[go: up one dir, main page]

CN111050322A - GBA-based client registration and key sharing method, device and system - Google Patents

GBA-based client registration and key sharing method, device and system Download PDF

Info

Publication number
CN111050322A
CN111050322A CN201910775078.3A CN201910775078A CN111050322A CN 111050322 A CN111050322 A CN 111050322A CN 201910775078 A CN201910775078 A CN 201910775078A CN 111050322 A CN111050322 A CN 111050322A
Authority
CN
China
Prior art keywords
key
service server
user terminal
user
bsf
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910775078.3A
Other languages
Chinese (zh)
Other versions
CN111050322B (en
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from PCT/CN2019/074725 external-priority patent/WO2020037958A1/en
Application filed by Individual filed Critical Individual
Publication of CN111050322A publication Critical patent/CN111050322A/en
Application granted granted Critical
Publication of CN111050322B publication Critical patent/CN111050322B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/041Key generation or derivation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0866Generation of secret information including derivation or calculation of cryptographic keys or passwords involving user or device identifiers, e.g. serial number, physical or biometrical information, DNA, hand-signature or measurable physical characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/321Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
    • H04L9/3213Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/02Protecting privacy or anonymity, e.g. protecting personally identifiable information [PII]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/043Key management, e.g. using generic bootstrapping architecture [GBA] using a trusted network node as an anchor
    • H04W12/0431Key distribution or pre-distribution; Key agreement
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W60/00Affiliation to network, e.g. registration; Terminating affiliation with the network, e.g. de-registration

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a method, a device and a system for client registration and key sharing based on GBA, wherein the method comprises the following steps: the user terminal running with the third-party application client performs security authentication with the BSF (bootstrap service) server based on the B-TID acquired in the GBA initialization process and the generated master key; after the security authentication is successful, the service server BSF is guided to provide secure registration information and service for the third-party application client, and further a user token or an application key is generated for the third-party application client. The invention solves the problem that the third-party application server imitates the malicious request to consume the calculation and storage resources of the BSF and other third-party application servers, and further solves the problem that the third-party application client can calculate the application keys of other third-party application clients on the same user terminal.

Description

基于GBA的客户端注册和密钥共享方法、装置及系统GBA-based client registration and key sharing method, device and system

【技术领域】【Technical field】

本发明涉及通信技术领域和互联网技术领域,尤其涉及一种基于通用引导架构(Generic Bootstrapping Architecture,GBA)的客户端注册和密钥共享方法、装置及系统。The present invention relates to the field of communication technologies and the field of Internet technologies, and in particular, to a method, device and system for client registration and key sharing based on Generic Bootstrapping Architecture (GBA).

【背景技术】【Background technique】

3GPP规范TS 33.220定义了一种适用于移动网络的通用安全认证机制—通用引导架构(Generic Bootstrapping Architecture,GBA),它属于通用认证架构(GenericAuthentication Architecture,GAA)的一部分。The 3GPP specification TS 33.220 defines a generic security authentication mechanism suitable for mobile networks—Generic Bootstrapping Architecture (GBA), which is a part of Generic Authentication Architecture (GAA).

GBA提供了一种基于认证和密钥协商机制(authentication and key agreement,AKA)在用户终端(user equipment,UE)和网络应用服务器(network applicationfunction,NAF)之间建立应用密钥的通用机制。GBA provides a general mechanism for establishing an application key between a user equipment (UE) and a network application function (NAF) based on an authentication and key agreement (AKA) mechanism.

GBA架构主要分为GBA初始化和应用密钥协商两个过程:The GBA architecture is mainly divided into two processes: GBA initialization and application key negotiation:

第一个过程是GBA初始化过程(GBA Bootstrapping):UE和引导业务服务器(bootstrapping server function,BSF)、BSF和归属用户服务器(home subscriberserver,HSS)/归属位置寄存器(home location register,HLR)之间基于AKA机制进行密钥协商,最终UE和BSF协商出一个GBA主密钥Ks,以及产生一个引导事务标识(bootstrappingtransaction identifier,B-TID),并且主密钥Ks和B-TID都分别存储在UE和BSF上。The first process is GBA Bootstrapping: between UE and bootstrapping server function (BSF), BSF and home subscriber server (HSS)/home location register (HLR) The key negotiation is performed based on the AKA mechanism, and finally the UE and the BSF negotiate a GBA master key Ks, and generate a bootstrapping transaction identifier (B-TID), and the master key Ks and B-TID are stored in the UE respectively. and BSF on.

第二个过程是应用密钥协商过程(Bootstrapping Usage Procedure):UE与NAF协商应用密钥,NAF根据UE发送的应用密钥协商请求,从BSF中获取应用密钥和用户信息,随后UE和NAF之间使用此应用密钥进行认证、消息加密等操作。更具体地,参考图7所示,该应用密钥协商过程包括如下步骤:The second process is the application key negotiation process (Bootstrapping Usage Procedure): the UE negotiates the application key with the NAF, and the NAF obtains the application key and user information from the BSF according to the application key negotiation request sent by the UE, and then the UE and NAF Use this application key for authentication, message encryption, and other operations. More specifically, referring to Figure 7, the application key negotiation process includes the following steps:

1.UE通过Ua接口向NAF发送应用连接请求,且请求消息中携带有B-TID,同时UE采用如下公式生成应用密钥Ks_(ext/int)_NAF。本步骤之前可以事先建立TLS链接,以保证Ua接口的通讯安全。1. The UE sends an application connection request to the NAF through the Ua interface, and the request message carries the B-TID, and the UE uses the following formula to generate the application key Ks_(ext/int)_NAF. Before this step, a TLS link can be established in advance to ensure the communication security of the Ua interface.

在“GBA_ME”模式下的计算公式:Calculation formula in "GBA_ME" mode:

Ks_NAF=KDF(Ks,"gba-me",RAND,IMPI,NAF_Id)Ks_NAF=KDF(Ks,"gba-me",RAND,IMPI,NAF_Id)

或者,在“GBA_U”模式下的计算公式:Or, the calculation formula in "GBA_U" mode:

Ks_ext_NAF=KDF(Ks,"gba-me",RAND,IMPI,NAF_Id)Ks_ext_NAF=KDF(Ks,"gba-me",RAND,IMPI,NAF_Id)

Ks_int_NAF=KDF(Ks,"gba-u",RAND,IMPI,NAF_Id)Ks_int_NAF=KDF(Ks,"gba-u",RAND,IMPI,NAF_Id)

其中,Ks是GBA初始化过程中生成的主密钥Ks,“gba-me”和“gba-u”是固定字符串,RAND是GBA初始化过程中生成的随机数,IMPI是IP多媒体私有标识(IP MultimediaPrivateIdentity),NAF_Id是NAF的标识,KDF是密钥派生算法的缩写(又称为密钥导出函数)。Among them, Ks is the master key Ks generated during the GBA initialization process, "gba-me" and "gba-u" are fixed strings, RAND is the random number generated during the GBA initialization process, and IMPI is the IP Multimedia Private Identifier (IP MultimediaPrivateIdentity), NAF_Id is the identifier of NAF, and KDF is the abbreviation of Key Derivation Algorithm (also known as Key Derivation Function).

NAF_Id由要访问的NAF的FQDN(Fully Qualified Domain Name,完全限定域名)和Ua接口上的协议标识(UaID)连接而成,连接方法可表述为:NAF_Id=FQDN||UaID。NAF_Id is formed by connecting the FQDN (Fully Qualified Domain Name, fully qualified domain name) of the NAF to be accessed and the protocol identifier (UaID) on the Ua interface. The connection method can be expressed as: NAF_Id=FQDN||UaID.

2.NAF收到UE的应用连接请求后,向BSF发出认证请求消息,其中携带B-TID、NAF_Id。2. After receiving the application connection request from the UE, the NAF sends an authentication request message to the BSF, which carries the B-TID and NAF_Id.

3.由于在第一个过程(即GBA初始化过程)完成后,BSF上已经存储有B-TID,以及存储有该B-TID对应的IMPI、主密钥Ks、Ks密钥有效期、GBA初始化时间、GBA用户安全设置信息(GUSS,GBA User Security Settings)等。3. After the first process (ie, the GBA initialization process) is completed, the B-TID has been stored on the BSF, and the IMPI corresponding to the B-TID, the master key Ks, the Ks key validity period, and the GBA initialization time are stored. , GBA User Security Settings (GUSS, GBA User Security Settings), etc.

在BSF接收到NAF的认证请求后,BSF根据NAF_Id中的FQDN验证发送方的身份,并根据B-TID查找对应的主密钥Ks。After the BSF receives the authentication request from the NAF, the BSF verifies the identity of the sender according to the FQDN in the NAF_Id, and searches for the corresponding master key Ks according to the B-TID.

如果BSF没有查找到对应的主密钥Ks或Ks已经过期,则BSF向NAF返回认证失败应答消息并要求UE重新发起GBA初始化过程。If the BSF does not find the corresponding master key Ks or the Ks has expired, the BSF returns an authentication failure response message to the NAF and requires the UE to re-initiate the GBA initialization process.

如果查找到相应的主密钥Ks并且在有效期内,BSF再使用与UE相同的应用密钥计算公式计算出应用密钥Ks_(ext/int)_NAF,然后向NAF服务器返回认证成功应答消息,并根据预先的设置在认证成功应答消息中把Ks_(ext/int)_NAF、Ks_(ext/int)_NAF有效期、GBA初始化时间、以及对应的用户安全设置信息(user security settings,USS)等发给NAF。If the corresponding master key Ks is found and within the validity period, the BSF uses the same application key calculation formula as the UE to calculate the application key Ks_(ext/int)_NAF, and then returns an authentication success response message to the NAF server, and Send Ks_(ext/int)_NAF, Ks_(ext/int)_NAF validity period, GBA initialization time, and corresponding user security settings (USS) to NAF in the authentication success response message according to the preset settings .

4.NAF存储Ks_(ext/int)_NAF和Ks_(ext/int)_NAF有效期信息后,返回认证成功应答消息给UE,这样UE和NAF之间建立了应用密钥Ks_(ext/int)_NAF,可以用于后续的认证、消息加密等操作。4. After NAF stores the validity period information of Ks_(ext/int)_NAF and Ks_(ext/int)_NAF, it returns the authentication success response message to the UE, so that the application key Ks_(ext/int)_NAF is established between the UE and NAF, It can be used for subsequent authentication, message encryption and other operations.

GBA架构在IMS业务中已经得到了一定的应用,例如多媒体广播多播服务(multimedia broadcast/multicast service,MBMS)、安全用户平面定位(secure userplane location,SUPL)等业务。The GBA architecture has been applied in IMS services to a certain extent, such as multimedia broadcast/multicast service (MBMS), secure user plane location (secure user plane location, SUPL) and other services.

随着用户终端的智能化(如移动智能手机)以及在互联网技术领域的广泛使用,用户在用户终端上会安装有大量的第三方应用客户端,而第三方应用客户端在使用过程中,通常需要先进行用户的身份认证,并与对应的第三方应用服务器之间协商共享密钥以满足数据加密等方面的需要。如果能将GBA架构应用在此领域,将极大提高安全性和增强用户体验,然而GBA架构的第二个过程即应用密钥协商过程并不能满足这方面的要求,以第三方应用服务器相当于NAF为例说明,其存在如下技术缺陷:With the intelligentization of user terminals (such as mobile smart phones) and the widespread use of Internet technology, users will install a large number of third-party application clients on user terminals. It is necessary to perform user identity authentication first, and negotiate a shared key with the corresponding third-party application server to meet the needs of data encryption and other aspects. If the GBA architecture can be applied in this field, it will greatly improve the security and enhance the user experience. However, the second process of the GBA architecture, that is, the application key negotiation process, cannot meet the requirements in this regard. A third-party application server is equivalent to As an example, NAF has the following technical defects:

缺陷一:由于第三方应用服务器是由不同的第三方应用服务商提供的,又由于NAF_Id是较容易通过公开途径或者软件逆向获取的参数。第三方应用服务器通过收集第三方应用客户端的应用连接请求中携带的B-TID,然后根据该B-TID以及其他第三方应用服务器的NAF_Id生成应用连接请求,从而可以仿冒其他第三方应用客户端向其他第三方应用服务器发起应用连接,从而会使得BSF进行不必要的应用密钥Ks_(ext/int)_NAF生成计算,以及会使得其他第三方应用服务器存储不必要的应用密钥Ks_(ext/int)_NAF,由此会消耗BSF和其他第三方应用服务器的计算、存储资源。由于每个第三方应用服务器都可以收集B-TID,则收集的B-TID越多,对其他第三方应用服务器的潜在危害越大。Defect 1: Because the third-party application server is provided by different third-party application service providers, and because NAF_Id is a parameter that is easier to obtain through public channels or software reverse. The third-party application server collects the B-TID carried in the application connection request of the third-party application client, and then generates the application connection request according to the B-TID and the NAF_Id of other third-party application servers, so that it can impersonate other third-party application clients to send Other third-party application servers initiate application connections, which will cause BSF to perform unnecessary application key Ks_(ext/int)_NAF generation calculations, and cause other third-party application servers to store unnecessary application keys Ks_(ext/int )_NAF, which consumes computing and storage resources of BSF and other third-party application servers. Since every third-party application server can collect B-TIDs, the more B-TIDs are collected, the greater the potential harm to other third-party application servers.

缺陷二:由于用户终端上会安装有大量的第三方应用客户端,它们是由不同的第三方应用服务商提供的,但GBA现有机制中应用密钥Ks_(ext/int)_NAF的计算方法,其中的“gba-me”、“gba-u”是固定的字符串参数,IMPI是在同一用户终端内都相同的固定参数,Ks、RAND是在一个Ks有效期内都相同的参数,NAF_Id是较容易通过公开途径或者软件逆向获取的参数,因此,同一用户终端上的第三方应用客户端能够较容易地计算出其他第三方应用客户端的应用密钥Ks_(ext/int)_NAF,从而来仿冒其他第三方应用客户端的访问。Defect 2: Since there are a large number of third-party application clients installed on the user terminal, they are provided by different third-party application service providers, but the calculation method of the application key Ks_(ext/int)_NAF in the existing GBA mechanism , where "gba-me" and "gba-u" are fixed string parameters, IMPI is the same fixed parameter within the same user terminal, Ks and RAND are the same parameters within the validity period of a Ks, and NAF_Id is It is easier to obtain parameters through public channels or reverse software. Therefore, the third-party application client on the same user terminal can easily calculate the application key Ks_(ext/int)_NAF of other third-party application clients, so as to counterfeit Access by other third-party application clients.

【发明内容】[Content of the invention]

本发明的主要目的在于提供一种基于GBA的客户端注册和密钥共享方法、装置及系统,旨在为用户终端中运行的第三方应用客户端提供一种安全的注册方法、装置及系统,解决第三方应用服务器仿冒恶意请求消耗引导业务服务器BSF和其他第三方应用服务器的计算、存储资源的问题,进而又解决第三方应用客户端能够较容易地计算出同一个用户终端上的其他第三方应用客户端的应用密钥的问题,从而更安全有效地让GBA架构应用在互联网技术领域。The main purpose of the present invention is to provide a GBA-based client registration and key sharing method, device and system, aiming to provide a secure registration method, device and system for a third-party application client running in a user terminal, Solve the problem that the third-party application server spoofed malicious requests consumes the computing and storage resources of the guiding business server BSF and other third-party application servers, and then solves the problem that the third-party application client can easily calculate other third-party applications on the same user terminal. The problem of the application key of the application client, so that the GBA architecture can be applied in the field of Internet technology more safely and effectively.

为达到上述目的,本发明提供了以下技术方案:To achieve the above object, the invention provides the following technical solutions:

第一方面,提供了一种基于GBA的客户端注册和密钥共享方法,应用于运行有第三方应用客户端的用户终端中,该方法包括:In a first aspect, a GBA-based client registration and key sharing method is provided, which is applied to a user terminal running a third-party application client, and the method includes:

执行GBA初始化过程,获取B-TID和生成第一主密钥Ks;Execute the GBA initialization process, obtain the B-TID and generate the first master key Ks;

基于所述第一主密钥Ks对第一验证信息加密生成第一加密值,所述第一验证信息与引导业务服务器BSF生成的第二验证信息的值相同;Encrypting the first verification information based on the first master key Ks to generate a first encrypted value, the first verification information is the same as the value of the second verification information generated by the bootstrap service server BSF;

将所述B-TID和所述第一加密值发送给所述引导业务服务器BSF;sending the B-TID and the first encrypted value to the bootstrap service server BSF;

接收所述引导业务服务器BSF提供的注册信息和服务,所述注册信息和服务是在所述引导业务服务器BSF验证所述第一加密值有效之后提供的。Receive registration information and services provided by the bootstrap service server BSF, where the registration information and services are provided after the bootstrap service server BSF verifies that the first encrypted value is valid.

优选的,所述用户终端与所述引导业务服务器BSF通过数据网络连接。Preferably, the user terminal is connected with the guidance service server BSF through a data network.

优选的,所述数据网络包括因特网、移动互联网。Preferably, the data network includes the Internet and the mobile Internet.

优选的,所述用户终端通过移动数据连接、WiFi连接或/和WLAN连接接入所述移动互联网。Preferably, the user terminal accesses the mobile Internet through a mobile data connection, a WiFi connection or/and a WLAN connection.

优选的,所述移动数据包括3G移动数据、4G移动数据、5G移动数据或6G移动数据。Preferably, the mobile data includes 3G mobile data, 4G mobile data, 5G mobile data or 6G mobile data.

优选的,所述基于所述第一主密钥Ks对第一验证信息加密生成第一加密值包括:Preferably, generating the first encrypted value by encrypting the first verification information based on the first master key Ks includes:

基于所述第一主密钥Ks生成第一认证密钥,其中,所述第一认证密钥的生成方式与所述引导业务服务器BSF生成第二认证密钥的生成方式一致,以使得所述第一认证密钥与所述引导业务服务器BSF生成的所述第二认证密钥的值相同;A first authentication key is generated based on the first master key Ks, wherein the generation method of the first authentication key is consistent with the generation method of the bootstrap service server BSF to generate the second authentication key, so that the The value of the first authentication key is the same as that of the second authentication key generated by the bootstrap service server BSF;

生成所述第一验证信息,其中,所述第一验证信息的生成方式与所述引导业务服务器BSF生成所述第二验证信息的生成方式一致,以使得所述第一验证信息与所述引导业务服务器BSF生成的所述第二验证信息的值相同;Generating the first verification information, wherein the generation method of the first verification information is consistent with the generation method of the guidance service server BSF to generate the second verification information, so that the first verification information is consistent with the guidance service server BSF. The value of the second verification information generated by the service server BSF is the same;

基于所述第一认证密钥对所述第一验证信息加密生成第一加密值。The first authentication information is encrypted based on the first authentication key to generate a first encrypted value.

优选的,所述基于所述第一主密钥Ks生成第一认证密钥包括:Preferably, the generating the first authentication key based on the first master key Ks includes:

将所述第一主密钥Ks作为所述第一认证密钥;或者,using the first master key Ks as the first authentication key; or,

基于包括所述第一主密钥Ks的信息生成所述第一认证密钥。The first authentication key is generated based on information including the first master key Ks.

优选的,所述基于包括所述第一主密钥Ks的信息生成所述第一认证密钥包括:Preferably, the generating the first authentication key based on the information including the first master key Ks includes:

基于包括所述第一主密钥Ks以及第一固定字符串或/和第一随机字符串或/和第一时间戳或/和所述B-TID或/和NAF_Id的信息生成第一认证密钥,所述第一固定字符串为预先配置的并且与所述引导业务服务器BSF预先配置的第一固定字符串的值相同的字符串,所述第一随机字符串为随机生成的字符串,所述第一时间戳为通过获取当前系统时间生成,所述NAF_Id为所述第三方应用客户端的标识;A first authentication key is generated based on information including the first master key Ks and a first fixed string or/and a first random string or/and a first timestamp or/and the B-TID or/and NAF_Id key, the first fixed character string is a pre-configured character string with the same value as the first fixed character string pre-configured by the guidance service server BSF, and the first random character string is a randomly generated character string, The first timestamp is generated by obtaining the current system time, and the NAF_Id is the identifier of the third-party application client;

若生成所述第一认证密钥的信息包括所述第一随机字符串或/和所述第一时间戳或/和所述NAF_Id,则将所述第一随机字符串或/和所述第一时间戳或/和所述NAF_Id传递给所述引导业务服务器BSF。If the information for generating the first authentication key includes the first random string or/and the first timestamp or/and the NAF_Id, the first random string or/and the first A timestamp or/and the NAF_Id are delivered to the bootstrapping service server BSF.

优选的,所述生成所述第一验证信息包括:Preferably, the generating the first verification information includes:

基于包括第二固定字符串或/和第二随机字符串或/和第二时间戳或/和所述B-TID或/和NAF_Id的信息生成所述第一验证信息,所述第二固定字符串为预先配置的并且与所述引导业务服务器BSF预先配置的第二固定字符串的值相同的字符串,所述第二随机字符串为随机生成的字符串,所述第二时间戳为通过获取当前系统时间生成,所述NAF_Id为所述第三方应用客户端的标识;The first verification information is generated based on information including a second fixed character string or/and a second random character string or/and a second timestamp or/and the B-TID or/and the NAF_Id, the second fixed character The string is a pre-configured character string with the same value as the second fixed character string pre-configured by the bootstrap service server BSF, the second random character string is a randomly generated character string, and the second time stamp is a Obtain the current system time generation, and the NAF_Id is the identifier of the third-party application client;

若生成所述第一验证信息包括基于所述第二随机字符串或/和所述第二时间戳或/和所述NAF_Id,则将所述第二随机字符串或/和所述第二时间戳或/和所述NAF_Id传递给所述引导业务服务器BSF。If generating the first verification information includes based on the second random string or/and the second timestamp or/and the NAF_Id, then the second random string or/and the second time The stamp or/and the NAF_Id are delivered to the bootstrapping service server BSF.

优选的,所述基于包括第二固定字符串或/和第二随机字符串或/和第二时间戳或/和所述B-TID或/和NAF_Id的信息生成所述第一验证信息包括:Preferably, the generating the first verification information based on the information including the second fixed character string or/and the second random character string or/and the second timestamp or/and the B-TID or/and the NAF_Id includes:

将所述第二固定字符串或所述第二随机字符串或所述第二时间戳或所述B-TID或所述NAF_Id中的一种作为所述第一验证信息;或者,Use one of the second fixed string or the second random string or the second timestamp or the B-TID or the NAF_Id as the first verification information; or,

将所述第二固定字符串或所述第二随机字符串或所述第二时间戳或所述B-TID或所述NAF_Id中的一种生成的哈希值作为所述第一验证信息;或者,Using the second fixed character string or the second random character string or the second timestamp or the hash value generated by one of the B-TID or the NAF_Id as the first verification information; or,

将包括所述第二固定字符串或/和所述第二随机字符串或/和所述第二时间戳或/和所述B-TID或/和所述NAF_Id的信息组合拼接后作为所述第一验证信息;或者,The information including the second fixed string or/and the second random string or/and the second timestamp or/and the B-TID or/and the NAF_Id is combined and spliced as the first verification information; or,

将包括所述第二固定字符串或/和所述第二随机字符串或/和所述第二时间戳或/和所述B-TID或/和所述NAF_Id的信息组合拼接后哈希计算生成的哈希值作为所述第一验证信息。Hash calculation after combining the information including the second fixed string or/and the second random string or/and the second timestamp or/and the B-TID or/and the NAF_Id The generated hash value is used as the first verification information.

优选的,所述基于所述第一认证密钥对所述第一验证信息加密生成第一加密值包括:Preferably, generating the first encrypted value by encrypting the first verification information based on the first authentication key includes:

使用签名加密算法基于所述第一认证密钥对所述第一验证信息签名加密生成所述第一加密值;或者,Using a signature encryption algorithm to sign and encrypt the first verification information based on the first authentication key to generate the first encrypted value; or,

使用对称加密算法基于所述第一认证密钥对包括所述第一验证信息的信息对称加密生成所述第一加密值。The first encrypted value is generated using a symmetric encryption algorithm based on the first authentication key for symmetric encryption of information including the first verification information.

优选的,所述方法还包括:Preferably, the method further includes:

在所述接收所述引导业务服务器BSF提供的注册信息和服务之前,将NAF_Id传递给所述引导业务服务器BSF,所述NAF_Id为所述第三方应用客户端的标识;Before receiving the registration information and services provided by the guidance service server BSF, passing the NAF_Id to the guidance service server BSF, where the NAF_Id is the identifier of the third-party application client;

所述注册信息和服务为所述引导业务服务器BSF为所述第三方应用客户端提供的注册信息和服务。The registration information and services are the registration information and services provided by the guidance service server BSF for the third-party application client.

优选的,所述将NAF_Id传递给所述引导业务服务器BSF包括:Preferably, the delivering the NAF_Id to the bootstrap service server BSF includes:

在所述将所述B-TID和所述第一加密值发送给所述引导业务服务器BSF的过程中,将NAF_Id传递给所述引导业务服务器BSF;或者,In the process of sending the B-TID and the first encrypted value to the guidance service server BSF, the NAF_Id is delivered to the guidance service server BSF; or,

在所述引导业务服务器BSF验证所述第一加密值有效之后,以及在所述接收所述引导业务服务器BSF提供的注册信息和服务之前,将NAF_Id传递给所述引导业务服务器BSF。After the bootstrap service server BSF verifies that the first encrypted value is valid, and before the receiving registration information and services provided by the bootstrap service server BSF, the NAF_Id is delivered to the bootstrap service server BSF.

优选的,所述接收所述引导业务服务器BSF提供的注册信息和服务包括:Preferably, the receiving registration information and services provided by the guidance service server BSF includes:

接收所述引导业务服务器BSF传递的第三方用户标识,所述第三方用户标识用于在所述第三方应用客户端中标识用户身份;或/和,receiving a third-party user identity transmitted by the guidance service server BSF, where the third-party user identity is used to identify a user identity in the third-party application client; or/and,

基于所述第一主密钥Ks生成第一应用密钥,所述第一应用密钥的生成方式与所述引导业务服务器BSF生成第二应用密钥的生成方式一致,所述第一应用密钥用于在所述第三方应用客户端中作为应用密钥;或/和,The first application key is generated based on the first master key Ks, and the generation method of the first application key is consistent with the generation method of the bootstrap service server BSF to generate the second application key. key is used as an application key in the third-party application client; or/and,

接收所述引导业务服务器BSF传递的用户令牌,所述用户令牌用于所述第三方应用客户端访问对应第三方应用服务器的认证鉴权。The user token transmitted by the guidance service server BSF is received, where the user token is used for the authentication and authentication of the third-party application client to access the corresponding third-party application server.

优选的,所述接收所述引导业务服务器BSF发送的第三方用户标识之后还包括:Preferably, after receiving the third-party user identifier sent by the guidance service server BSF, the method further includes:

基于所述第一主密钥Ks生成第一用户密钥,所述第一用户密钥的生成方式与所述引导业务服务器BSF生成第二用户密钥的生成方式一致,所述第一用户密钥用于在所述第三方应用客户端中作为所述第三方用户标识的密钥。The first user key is generated based on the first master key Ks, and the generation method of the first user key is consistent with the generation method of the bootstrap service server BSF to generate the second user key. The key is used as the key of the third-party user identification in the third-party application client.

优选的,所述基于所述第一主密钥Ks生成第一用户密钥包括:Preferably, the generating the first user key based on the first master key Ks includes:

基于包括所述第一主密钥Ks以及第三固定字符串或/和第三随机字符串或/和第三时间戳或/和所述B-TID或/和所述NAF_Id或/和所述第三方用户标识的信息生成第一用户密钥,所述第三固定字符串为预先配置的并且与所述引导业务服务器BSF预先配置的第三固定字符串的值相同的字符串,所述第三随机字符串或/和所述第三时间戳为所述引导业务服务器BSF所传递的。Based on including the first master key Ks and a third fixed string or/and a third random string or/and a third timestamp or/and the B-TID or/and the NAF_Id or/and the The information of the third-party user identification generates a first user key, and the third fixed character string is a character string that is preconfigured and has the same value as the third fixed character string preconfigured by the guidance service server BSF. The three random character strings or/and the third time stamp are transmitted by the bootstrap service server BSF.

优选的,所述基于所述第一主密钥Ks生成第一应用密钥包括:Preferably, the generating the first application key based on the first master key Ks includes:

基于所述第一主密钥Ks以及可选参数生成所述第一应用密钥;所述可选参数包括Salt、RAND、IMPI以及NAF_Id中的一个或多个,其中,The first application key is generated based on the first master key Ks and optional parameters; the optional parameters include one or more of Salt, RAND, IMPI and NAF_Id, wherein,

Salt是与所述引导业务服务器BSF相同的盐值;Salt is the same salt value as the bootstrap service server BSF;

RAND是所述GBA初始化过程中生成的RAND;RAND is the RAND generated during the GBA initialization;

IMPI是所述用户终端的IMPI;IMPI is the IMPI of the user terminal;

NAF_Id是所述NAF_Id;NAF_Id is the NAF_Id;

KDF是与所述引导业务服务器BSF相同的密钥派生算法;KDF is the same key derivation algorithm as the bootstrap service server BSF;

所述可选参数与所述引导业务服务器BSF生成第二应用密钥时的可选参数一致。The optional parameters are consistent with the optional parameters when the bootstrap service server BSF generates the second application key.

优选的,在所述将NAF_Id传递给所述引导业务服务器BSF之后,以及在所述接收所述引导业务服务器BSF提供的注册信息和服务之前,还包括:Preferably, after the delivering the NAF_Id to the guidance service server BSF, and before the receiving registration information and services provided by the guidance service server BSF, the method further includes:

向所述引导业务服务器BSF发送经终端用户确认的授权信息。The authorization information confirmed by the end user is sent to the bootstrap service server BSF.

优选的,所述向所述引导业务服务器BSF发送经终端用户确认的授权信息包括:Preferably, the sending of the authorization information confirmed by the end user to the guidance service server BSF includes:

接收所述引导业务服务器BSF发送的应用授权请求消息;receiving an application authorization request message sent by the guidance service server BSF;

显示应用授权验证界面;Display the application authorization verification interface;

接收终端用户在所述应用授权验证界面中输入的授权信息;Receive the authorization information input by the terminal user in the application authorization verification interface;

若所述授权信息表示确认授权,则向所述引导业务服务器BSF发送应用授权应答消息,所述应用授权应答消息为应用授权确认消息。If the authorization information indicates confirmation of authorization, an application authorization response message is sent to the bootstrap service server BSF, where the application authorization response message is an application authorization confirmation message.

第二方面,提供了一种基于GBA的客户端注册和密钥共享方法,应用于引导业务服务器BSF中,所述方法包括:In a second aspect, a GBA-based client registration and key sharing method is provided, which is applied to the bootstrap service server BSF, and the method includes:

与用户终端成功执行GBA初始化过程之后,接收所述用户终端发送的B-TID和第一加密值;After successfully performing the GBA initialization process with the user terminal, receive the B-TID and the first encrypted value sent by the user terminal;

根据所述B-TID获取对应的第二主密钥Ks;Obtain the corresponding second master key Ks according to the B-TID;

基于所述第二主密钥Ks和第二验证信息验证所述第一加密值,所述第二验证信息与所述用户终端生成的第一验证信息的值相同;Verifying the first encrypted value based on the second master key Ks and second verification information, the second verification information being the same as the value of the first verification information generated by the user terminal;

若验证所述第一加密值有效,则向所述用户终端提供注册信息和服务。If it is verified that the first encrypted value is valid, registration information and services are provided to the user terminal.

优选的,所述引导业务服务器BSF与所述用户终端通过数据网络连接。Preferably, the guidance service server BSF is connected with the user terminal through a data network.

优选的,所述数据网络包括因特网、移动互联网。Preferably, the data network includes the Internet and the mobile Internet.

优选的,所述基于所述第二主密钥Ks和第二验证信息验证所述第一加密值包括:Preferably, the verifying the first encrypted value based on the second master key Ks and the second verification information includes:

基于所述第二主密钥Ks生成第二认证密钥,其中,所述第二认证密钥的生成方式与所述用户终端生成第一认证密钥的生成方式一致,以使得所述第二认证密钥与所述用户终端生成的所述第一认证密钥的值相同;A second authentication key is generated based on the second master key Ks, wherein the generation method of the second authentication key is consistent with the generation method of the user terminal to generate the first authentication key, so that the second authentication key is generated The authentication key is the same as the value of the first authentication key generated by the user terminal;

生成所述第二验证信息,其中,所述第二验证信息的生成方式与所述用户终端生成第一验证信息的生成方式一致,以使得所述第二验证信息与所述用户终端生成的所述第一验证信息的值相同;The second verification information is generated, wherein the generation method of the second verification information is consistent with the generation method of the user terminal to generate the first verification information, so that the second verification information is the same as that generated by the user terminal. The value of the first verification information is the same;

基于所述第二认证密钥和所述第二验证信息验证所述第一加密值。The first encrypted value is verified based on the second authentication key and the second verification information.

优选的,所述基于所述第二主密钥Ks生成第二认证密钥包括:Preferably, the generating the second authentication key based on the second master key Ks includes:

将所述第二主密钥Ks作为所述第二认证密钥;或者,using the second master key Ks as the second authentication key; or,

基于包括所述第二主密钥Ks的信息生成所述第二认证密钥。The second authentication key is generated based on information including the second master key Ks.

优选的,所述基于包括所述第二主密钥Ks的信息生成所述第二认证密钥包括:Preferably, the generating the second authentication key based on the information including the second master key Ks includes:

基于包括所述第二主密钥Ks以及第一固定字符串或/和第一随机字符串或/和第一时间戳或/和所述B-TID或/和NAF_Id的信息生成第二认证密钥,所述第一固定字符串为预先配置的并且与所述用户终端预先配置的第一固定字符串的值相同的字符串,所述第一随机字符串或/和所述第一时间戳或/和所述NAF_Id为所述用户终端所传递的。A second authentication key is generated based on information including the second master key Ks and a first fixed string or/and a first random string or/and a first timestamp or/and the B-TID or/and NAF_Id key, the first fixed character string is a preconfigured character string with the same value as the first fixed character string preconfigured by the user terminal, the first random character string or/and the first timestamp Or/and the NAF_Id is delivered by the user terminal.

优选的,所述生成第二验证信息包括:Preferably, the generating the second verification information includes:

基于第二固定字符串或/和第二随机字符串或/和第二时间戳或/和所述B-TID或/和NAF_Id生成所述第二验证信息,所述第二固定字符串为预先配置的并且与所述用户终端预先配置的第二固定字符串的值相同的字符串,所述第二随机字符串或/和所述第二时间戳或/和所述NAF_Id为所述用户终端所传递的。The second verification information is generated based on a second fixed character string or/and a second random character string or/and a second timestamp or/and the B-TID or/and the NAF_Id, and the second fixed character string is a predetermined A string that is configured and has the same value as the second fixed string preconfigured by the user terminal, the second random character string or/and the second timestamp or/and the NAF_Id is the user terminal transmitted.

优选的,所述基于第二固定字符串或/和第二随机字符串或/和所述B-TID或/和NAF_Id生成所述第二验证信息包括:Preferably, the generating the second verification information based on the second fixed character string or/and the second random character string or/and the B-TID or/and the NAF_Id includes:

将所述第二固定字符串或所述第二随机字符串或所述第二时间戳或所述B-TID或所述NAF_Id中的一种作为所述第二验证信息;或者,Use one of the second fixed string or the second random string or the second timestamp or the B-TID or the NAF_Id as the second verification information; or,

将所述第二固定字符串或所述第二随机字符串或所述第二时间戳或所述B-TID或所述NAF_Id中的一种的哈希值作为所述第二验证信息;或者,Use the second fixed string or the second random string or the second timestamp or a hash value of one of the B-TID or the NAF_Id as the second verification information; or ,

将包括所述第二固定字符串或/和所述第二随机字符串或/和所述第二时间戳或/和所述B-TID或/和所述NAF_Id的信息组合拼接后作为所述第二验证信息;或者,The information including the second fixed string or/and the second random string or/and the second timestamp or/and the B-TID or/and the NAF_Id is combined and spliced as the second verification information; or,

将包括所述第二固定字符串或/和所述第二随机字符串或/和所述第二时间戳或/和所述B-TID或/和所述NAF_Id的信息组合拼接后哈希计算生成的哈希值作为所述第二验证信息。Hash calculation after combining the information including the second fixed string or/and the second random string or/and the second timestamp or/and the B-TID or/and the NAF_Id The generated hash value is used as the second verification information.

优选的,所述基于所述第二认证密钥和所述第二验证信息验证所述第一加密值包括:Preferably, the verifying the first encrypted value based on the second authentication key and the second verification information includes:

若所述用户终端使用签名加密算法生成所述第一加密值,则使用相同的签名加密算法基于所述第二认证密钥和所述第二验证信息验证所述第一加密值;或者,If the user terminal uses a signature encryption algorithm to generate the first encrypted value, then use the same signature encryption algorithm to verify the first encryption value based on the second authentication key and the second verification information; or,

若所述用户终端使用对称加密算法生成所述第一加密值,则使用相同的对称加密算法基于所述第二认证密钥和所述第二验证信息验证所述第一加密值。If the user terminal uses a symmetric encryption algorithm to generate the first encrypted value, the same symmetric encryption algorithm is used to verify the first encrypted value based on the second authentication key and the second verification information.

优选的,所述使用相同的签名加密算法基于所述第二认证密钥和所述第二验证信息验证所述第一加密值包括:Preferably, the using the same signature encryption algorithm to verify the first encrypted value based on the second authentication key and the second verification information includes:

使用和所述用户终端相同的签名加密算法,基于所述第二认证密钥对所述第二验证信息签名加密生成第二加密值;Using the same signature encryption algorithm as the user terminal, sign and encrypt the second verification information based on the second authentication key to generate a second encrypted value;

比较所述第二加密值与所述第一加密值是否一致;comparing whether the second encrypted value is consistent with the first encrypted value;

若一致,则确定验证所述第一加密值有效。If they are consistent, it is determined to verify that the first encrypted value is valid.

优选的,所述使用相同的对称加密算法基于所述第二认证密钥和所述第二验证信息验证所述第一加密值包括:Preferably, the using the same symmetric encryption algorithm to verify the first encrypted value based on the second authentication key and the second verification information includes:

使用和所述用户终端相同的对称加密算法,基于所述第二认证密钥对所述第一加密值解密获得明文,并从所述解密获得的明文中获取第一验证信息;Using the same symmetric encryption algorithm as the user terminal, decrypt the first encrypted value based on the second authentication key to obtain plaintext, and obtain first verification information from the plaintext obtained by the decryption;

比较所述第二验证信息与所述第一验证信息是否一致;comparing whether the second verification information is consistent with the first verification information;

若一致,则确定验证所述第一加密值有效。If they are consistent, it is determined to verify that the first encrypted value is valid.

优选的,所述方法还包括:Preferably, the method further includes:

在所述向所述用户终端提供注册信息和服务之前,获取所述用户终端传递的NAF_Id,所述NAF_Id为所述用户终端中运行的第三方应用客户端的标识;Before providing registration information and services to the user terminal, obtain the NAF_Id delivered by the user terminal, where the NAF_Id is an identifier of a third-party application client running in the user terminal;

所述向所述用户终端提供的注册信息和服务为向所述第三方应用客户端提供的注册信息和服务。The registration information and services provided to the user terminal are the registration information and services provided to the third-party application client.

优选的,所述获取所述用户终端传递的NAF_Id包括:Preferably, the acquiring the NAF_Id delivered by the user terminal includes:

在所述接收所述用户终端发送的B-TID和第一加密值的过程中,接收所述用户终端传递的NAF_Id;或者,In the process of receiving the B-TID and the first encrypted value sent by the user terminal, receive the NAF_Id sent by the user terminal; or,

在所述若验证所述第一加密值有效之后,以及在所述向所述用户终端提供注册信息和服务之前,接收所述用户终端传递的NAF_Id。After verifying that the first encrypted value is valid, and before providing registration information and services to the user terminal, the NAF_Id transmitted by the user terminal is received.

优选的,所述向所述用户终端提供注册信息和服务包括:Preferably, the providing registration information and services to the user terminal includes:

根据所述B-TID和所述NAF_Id获取对应的第三方用户标识,向所述用户终端传递所述第三方用户标识,以使得所述第三方用户标识用于在所述第三方应用客户端中标识用户身份;或/和,Obtain the corresponding third-party user identifier according to the B-TID and the NAF_Id, and deliver the third-party user identifier to the user terminal, so that the third-party user identifier is used in the third-party application client identify the user; or/and,

基于所述第二主密钥Ks生成第二应用密钥,所述第二应用密钥的生成方式与所述用户终端生成第一应用密钥的生成方式一致,并且建立所述B-TID和所述NAF_Id与所述第二应用密钥的对应关系;或/和,A second application key is generated based on the second master key Ks, the generation method of the second application key is consistent with the generation method of the user terminal to generate the first application key, and the B-TID and the corresponding relationship between the NAF_Id and the second application key; or/and,

生成与所述NAF_Id相关联的用户令牌,并且向所述用户终端传递所述用户令牌,所述用户令牌用于所述第三方应用客户端访问对应第三方应用服务器的认证鉴权。A user token associated with the NAF_Id is generated, and the user token is delivered to the user terminal, where the user token is used for authentication of the third-party application client to access the corresponding third-party application server.

优选的,所述根据所述B-TID和所述NAF_Id获取对应的第三方用户标识包括:Preferably, the obtaining the corresponding third-party user identifier according to the B-TID and the NAF_Id includes:

根据所述B-TID获取对应的IMPI;Obtain the corresponding IMPI according to the B-TID;

根据所述IMPI和所述NAF_Id查找对应的第三方用户标识;Find the corresponding third-party user identifier according to the IMPI and the NAF_Id;

若查找到对应的第三方用户标识,则确定所述查找到的对应的第三方用户标识为所述第三方用户标识;If the corresponding third-party user identifier is found, then determine that the found corresponding third-party user identifier is the third-party user identifier;

若没有查找到对应的第三方用户标识,则创建一个唯一的第三方用户标识,确定所述唯一的第三方用户标识为所述第三方用户标识,并且建立所述IMPI和所述NAF_Id与所述唯一的第三方用户标识的对应关系,以使得根据所述IMPI和所述NAF_Id能查找到所述唯一的第三方用户标识。If the corresponding third-party user ID is not found, create a unique third-party user ID, determine that the unique third-party user ID is the third-party user ID, and establish the IMPI and the NAF_Id with the The corresponding relationship of the unique third-party user identifier, so that the unique third-party user identifier can be found according to the IMPI and the NAF_Id.

优选的,在所述根据所述B-TID和所述NAF_Id获取对应的第三方用户标识之后还包括:Preferably, after obtaining the corresponding third-party user identifier according to the B-TID and the NAF_Id, the method further includes:

基于所述第二主密钥生成第二用户密钥,所述第二用户密钥的生成方式与所述用户终端生成第一用户密钥的生成方式一致;Generate a second user key based on the second master key, and the generation method of the second user key is consistent with the generation method of the user terminal to generate the first user key;

建立所述第三方用户标识与所述第二用户密钥的对应关系。A corresponding relationship between the third-party user identifier and the second user key is established.

优选的,所述基于所述第二主密钥Ks生成第二应用密钥包括:Preferably, the generating the second application key based on the second master key Ks includes:

基于所述第二主密钥Ks以及可选参数生成所述第二应用密钥;所述可选参数包括Salt、RAND、IMPI以及NAF_Id中的一个或多个,其中,The second application key is generated based on the second master key Ks and optional parameters; the optional parameters include one or more of Salt, RAND, IMPI and NAF_Id, wherein,

Salt是与所述用户终端相同的盐值;Salt is the same salt value as the user terminal;

RAND是所述B-TID对应的RAND;RAND is the RAND corresponding to the B-TID;

IMPI是所述B-TID对应的IMPI;IMPI is the IMPI corresponding to the B-TID;

NAF_Id是所述NAF_Id;NAF_Id is the NAF_Id;

KDF是与所述用户终端相同的密钥派生算法;KDF is the same key derivation algorithm as the user terminal;

所述可选参数与所述用户终端生成第一应用密钥时的可选参数一致。The optional parameters are consistent with the optional parameters when the user terminal generates the first application key.

优选的,所述生成与所述NAF_Id相关联的用户令牌包括:Preferably, the generating the user token associated with the NAF_Id includes:

使用随机生成的全局唯一字符串作为所述用户令牌;use a randomly generated globally unique string as the user token;

建立所述用户令牌与所述NAF_Id的关联关系。Establish an association relationship between the user token and the NAF_Id.

优选的,所述生成与所述NAF_Id相关联的用户令牌还包括:Preferably, the generating the user token associated with the NAF_Id further includes:

建立所述用户令牌与所述B-TID对应的IMPI的关联关系,以使得根据所述用户令牌能获取到所述B-TID对应的IMPI;或者,establishing an association relationship between the user token and the IMPI corresponding to the B-TID, so that the IMPI corresponding to the B-TID can be obtained according to the user token; or,

建立所述用户令牌与唯一用户标识的关联关系,所述唯一用户标识为预先建立的所述B-TID对应的IMPI所对应的唯一用户标识。An association relationship between the user token and a unique user identifier is established, and the unique user identifier is the unique user identifier corresponding to the IMPI corresponding to the B-TID established in advance.

优选的,在所述获取所述用户终端传递的NAF_Id和在所述若验证所述第一加密值有效之后,以及在所述向所述用户终端提供注册信息和服务之前,还包括:Preferably, after obtaining the NAF_Id transmitted by the user terminal and after verifying that the first encrypted value is valid, and before providing registration information and services to the user terminal, the method further includes:

获取所述用户终端发送的经终端用户确认的授权信息,若获取到所述用户终端发送的经终端用户确认的授权信息,则执行所述向所述用户终端提供注册信息和服务。Acquire the authorization information sent by the user terminal and confirmed by the terminal user, and if the authorization information sent by the user terminal and confirmed by the terminal user is acquired, execute the providing registration information and services to the user terminal.

优选的,所述获取所述用户终端发送的经终端用户确认的授权信息包括:Preferably, the obtaining the authorization information sent by the user terminal and confirmed by the terminal user includes:

向所述用户终端发送应用授权请求消息;sending an application authorization request message to the user terminal;

接收所述用户终端发送的应用授权应答消息;receiving an application authorization response message sent by the user terminal;

若所述应用授权应答消息为应用授权确认消息,则执行所述向所述用户终端提供注册信息和服务。If the application authorization response message is an application authorization confirmation message, performing the providing registration information and services to the user terminal.

优选的,所述应用授权请求消息包括:Preferably, the application authorization request message includes:

第三方应用名称,所述第三方应用名称是根据所述NAF_Id获取的第三方应用名称;或/和,third-party application name, the third-party application name is the third-party application name obtained according to the NAF_Id; or/and,

移动用户名称,所述移动用户名称是根据所述B-TID获取的移动用户名称。Mobile user name, the mobile user name is the mobile user name obtained according to the B-TID.

第三方面,提供一种基于GBA的客户端注册和密钥共享装置,其特征在于,所述装置应用于运行有第三方应用客户端的用户终端中,包括:存储器、处理器,所述处理器用于运行所述存储器所存储的程序,所述程序运行时执行包括上述第一方面应用于运行有第三方应用客户端的用户终端中的任一项所述方法。In a third aspect, a GBA-based client registration and key sharing device is provided, wherein the device is applied to a user terminal running a third-party application client, and includes: a memory and a processor, and the processor uses When running the program stored in the memory, the program executes any one of the methods described in the above-mentioned first aspect applied to a user terminal running a third-party application client.

提供一种基于GBA的客户端注册和密钥共享装置,其特征在于,所述装置应用于引导业务服务器BSF,包括:存储器、处理器,所述处理器用于运行所述存储器所存储的程序,所述程序运行时执行包括上述第二方面应用于引导业务服务器BSF中的任一项所述方法。A GBA-based client registration and key sharing device is provided, wherein the device is applied to a bootstrap service server BSF, comprising: a memory and a processor, wherein the processor is configured to run a program stored in the memory, The execution of the program when the program is executed includes the method described in any one of the second aspect applied to the bootstrap service server BSF.

提供一种基于GBA的客户端注册和密钥共享系统,其特征在于,所述系统包括:用户终端以及引导业务服务器BSF;所述用户终端包括上述应用于运行有第三方应用客户端的用户终端中所述的装置;所述引导业务服务器BSF包括上述应用于引导业务服务器BSF所述的装置。A GBA-based client registration and key sharing system is provided, wherein the system includes: a user terminal and a guidance service server BSF; The device; the guidance service server BSF includes the above-mentioned device applied to the guidance service server BSF.

提供一种存储介质,其特征在于,所述存储介质中存储有程序,所述程序用于实现包括上述第一方面应用于运行有第三方应用客户端的用户终端中的任一项所述方法。A storage medium is provided, wherein a program is stored in the storage medium, and the program is used to implement any one of the methods of the above-mentioned first aspect applied to a user terminal running a third-party application client.

提供一种存储介质,其特征在于,所述存储介质中存储有程序,所述程序用于实现包括上述第二方面应用于引导业务服务器BSF中的任一项所述方法。A storage medium is provided, wherein a program is stored in the storage medium, and the program is used to implement any one of the methods including the second aspect applied to the bootstrap service server BSF.

综上所述,本发明在GBA初始化过程之后,为在用户终端中运行的第三方应用客户端提供了安全的注册环境,引导业务服务器BSF只为通过验证的用户终端才提供相应的注册信息和服务,包括获取第三方用户标识、生成用户密钥、生成应用密钥和生成用户牌,有效解决了如背景技术中所述的GBA架构应用在互联网技术领域存在的技术缺陷。To sum up, after the GBA initialization process, the present invention provides a secure registration environment for the third-party application client running in the user terminal, and guides the service server BSF to provide the corresponding registration information and information only for the authenticated user terminal. The service, including obtaining a third-party user ID, generating a user key, generating an application key, and generating a user card, effectively solves the technical defects existing in the application of the GBA architecture as described in the background art in the field of Internet technology.

【附图说明】【Description of drawings】

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to the provided drawings without creative work.

图1为本发明实施例提供的基于GBA的客户端注册和密钥共享方法所涉及的一种实施环境结构示意图;1 is a schematic structural diagram of an implementation environment involved in a GBA-based client registration and key sharing method provided by an embodiment of the present invention;

图2为本发明提供的基于GBA的客户端注册和密钥共享方法实施例一的流程示意图;2 is a schematic flowchart of Embodiment 1 of the GBA-based client registration and key sharing method provided by the present invention;

图3为本发明提供的基于GBA的客户端注册和密钥共享方法实施例二的流程示意图;3 is a schematic flowchart of Embodiment 2 of the GBA-based client registration and key sharing method provided by the present invention;

图4为本发明提供的基于GBA的客户端注册和密钥共享方法实施例三的流程示意图;4 is a schematic flowchart of Embodiment 3 of the GBA-based client registration and key sharing method provided by the present invention;

图5为本发明提供的基于GBA的客户端注册和密钥共享方法实施例四的流程示意图;5 is a schematic flowchart of Embodiment 4 of the GBA-based client registration and key sharing method provided by the present invention;

图6为本发明提供的基于GBA的客户端注册和密钥共享方法实施例五的流程示意图;6 is a schematic flowchart of Embodiment 5 of the GBA-based client registration and key sharing method provided by the present invention;

图7为GBA应用密钥协商过程的流程示意图。FIG. 7 is a schematic flowchart of a GBA application key negotiation process.

本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments.

【具体实施方式】【Detailed ways】

为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.

一、相关名词术语1. Related terms

为了便于理解,对本文中涉及的一些名词作介绍和说明。In order to facilitate understanding, some terms involved in this article are introduced and explained.

NAF_Id:NAF_Id用于唯一地标识第三方应用服务器,以及用于标识该第三方应用服务器对应的第三方应用客户端。NAF_Id可以是完全限定域名(Fully Qualified DomainName,FQDN),也可以是FQDN和Ua接口上的协议标识(UaID)连接而成,也可以是一个字符串。NAF_Id: NAF_Id is used to uniquely identify the third-party application server and to identify the third-party application client corresponding to the third-party application server. NAF_Id can be a fully qualified domain name (Fully Qualified DomainName, FQDN), or a concatenation of FQDN and a protocol identifier (UaID) on the Ua interface, or a string.

签名加密算法:指用于加密地核实信息真实性的加密算法,只有信息的发送者才能产生的别人无法伪造的一段数字串,这段数字串同时也是对信息的发送者发送信息真实性的一个有效证明,例如消息认证码(诸如基于哈希的消息认证码HMAC、密码分组链接消息认证码CBC-MAC、伽罗瓦消息认证码GMAC等)、含密钥加密的哈希函数、基于RSA的数字方案(诸如RSA-PSS)、数字签名算法(DSA)和椭圆曲线数字签名算法等。Signature encryption algorithm: refers to the encryption algorithm used to encrypt the authenticity of information. Only the sender of the information can generate a digital string that cannot be forged by others. This digital string is also a part of the authenticity of the information sent by the sender Valid proofs, such as message authentication codes (such as hash-based message authentication code HMAC, cipher block chaining message authentication code CBC-MAC, Galois message authentication code GMAC, etc.), hash function with key encryption, RSA-based Digital schemes (such as RSA-PSS), Digital Signature Algorithms (DSA) and Elliptic Curve Digital Signature Algorithms, etc.

对称加密算法:指加密和解密使用相同密钥的加密算法,例如三重数据加密标准(Triple Data Encryption Standard,DES)、高级加密标准(Advanced EncryptionStandard,AES)等。Symmetric encryption algorithm: refers to an encryption algorithm that uses the same key for encryption and decryption, such as Triple Data Encryption Standard (DES) and Advanced Encryption Standard (AES).

二、实施环境结构示意图2. Schematic diagram of the implementation environment structure

请参考图1,其示出了本发明实施例提供的一种基于GBA的客户端注册和密钥共享方法所涉及的一种实施环境的结构示意图。该实施环境包括引导业务服务器BSF、用户终端、第三方应用客户端。Please refer to FIG. 1 , which shows a schematic structural diagram of an implementation environment involved in a GBA-based client registration and key sharing method provided by an embodiment of the present invention. The implementation environment includes a bootstrap service server BSF, a user terminal, and a third-party application client.

引导业务服务器BSF:BSF通常由通信运营服务商提供,通过因特网、移动互联网等数据网络与用户终端进行连接以执行GBA初始化过程,以及向用户终端提供注册信息和服务;通过通信运营商网络和专用接口与HSS(Home Subscriber Server,归属用户服务器)或/和HLR(Home Location Register,归属位置寄存器)连接以执行GBA初始化过程;需要说明的是,本申请中的BSF还可以与统一数据管理(unified data management,UDM)连接以执行GBA初始化过程。Bootstrap service server BSF: BSF is usually provided by communication operators, and is connected to user terminals through data networks such as the Internet and mobile Internet to perform the GBA initialization process, and provide registration information and services to user terminals; The interface is connected with HSS (Home Subscriber Server, Home Subscriber Server) or/and HLR (Home Location Register, Home Location Register) to perform the GBA initialization process; it should be noted that the BSF in this application can also data management, UDM) connection to perform the GBA initialization process.

用户终端:用户终端通过WLAN、WiFi、移动数据(包括3G/4G/5G/6G移动数据)、LAN、固定宽带等有线或无线方式接入网络并与引导业务服务器BSF进行数据连接,该网络包括因特网、移动互联网等数据网络。用户终端支持GBA功能,通常是智能手机,也可以是智能电视、机顶盒、平板电脑、便携计算机、台式计算机等。User terminal: The user terminal accesses the network through wired or wireless means such as WLAN, WiFi, mobile data (including 3G/4G/5G/6G mobile data), LAN, fixed broadband, etc., and performs data connection with the guidance service server BSF. The network includes Internet, mobile Internet and other data networks. The user terminal supports the GBA function, and is usually a smart phone, and may also be a smart TV, a set-top box, a tablet computer, a portable computer, a desktop computer, and the like.

第三方应用客户端:运行在用户终端的操作系统中的应用程序,由第三方应用服务商提供。Third-party application client: an application program running in the operating system of the user terminal, provided by a third-party application service provider.

可以理解的是,在实际实施环境中,可以包括一个、多个或大量的用户终端,每个用户终端中可以运行一个或多个由不同第三方应用服务商提供的第三方应用客户端,每个第三方应用客户端可以连接访问对应的第三方应用服务器,从而获取对应的第三方应用服务器提供的业务应用数据和服务。It can be understood that, in the actual implementation environment, it may include one, more or a large number of user terminals, and each user terminal may run one or more third-party application clients provided by different third-party application service providers, each Each third-party application client can connect to access the corresponding third-party application server, so as to obtain business application data and services provided by the corresponding third-party application server.

为了简洁,在不影响本发明实施的前提下,实施图中忽略了GBA架构中其他的组件,例如归属用户服务器(Home Subscriber Server,HSS)、归属位置寄存器(HomeLocation Register、HLR)、认证代理功能(Authentication Proxy,AP)、用户归属功能(Subscriber Locator Function,SLF)等,然而,本领域技术人员可理解的是在必要应用场景中已经使用了这些组件。For the sake of brevity, without affecting the implementation of the present invention, other components in the GBA architecture are ignored in the implementation diagram, such as the Home Subscriber Server (HSS), the Home Location Register (HLR), and the authentication proxy function. (Authentication Proxy, AP), Subscriber Locator Function (Subscriber Locator Function, SLF), etc. However, those skilled in the art can understand that these components have been used in necessary application scenarios.

还需要说明的是,在实际业务应用环境中,还应当有第三方应用服务器。第三方应用服务器相当于GBA架构中的NAF,由第三方应用服务商提供,用于和第三方应用客户端通过网络相连,向第三方应用客户端提供用户提供所需的业务应用数据和服务,例如资讯、购物、社交等;用于和引导业务服务器BSF通过网络相连,向引导业务服务器BSF获取或验证第三方应用客户端提交的验证信息,例如B-TID、应用密钥、用户令牌等信息。It should also be noted that, in an actual business application environment, there should also be a third-party application server. The third-party application server is equivalent to the NAF in the GBA architecture. It is provided by the third-party application service provider and is used to connect with the third-party application client through the network to provide the third-party application client with the required business application data and services. For example, information, shopping, social networking, etc.; it is used to connect with the guidance service server BSF through the network, and obtain or verify the verification information submitted by the third-party application client to the guidance service server BSF, such as B-TID, application key, user token, etc. information.

本领域技术人员可以理解,图1中示出的实施环境结构并不构成对实施环境的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the implementation environment structure shown in FIG. 1 does not constitute a limitation to the implementation environment, and may include more or less components than the one shown, or combine some components, or arrange different components.

三、实施前提3. Prerequisites for Implementation

在实施本发明各实施例之前,用户终端与引导业务服务器BSF已经成功执行完成GBA初始化过程,用户终端上有B-TID及对应的Ks(即第一主密钥Ks)、RAND;引导业务服务器BSF上存储有B-TID及对应的Ks(即第二主密钥Ks)、RAND,并且建立了B-TID与对应的Ks(即第二主密钥Ks)、RAND的对应关系,同时引导业务服务器BSF上存储有B-TID与用户终端的IMPI(IP多媒体私有标识,IP Multimedia Private Identity)的对应关系,即通过B-TID能够查找和获取到对应的IMPI。Before implementing the embodiments of the present invention, the user terminal and the guidance service server BSF have successfully completed the GBA initialization process, and the user terminal has the B-TID and the corresponding Ks (ie the first master key Ks), RAND; the guidance service server The BSF stores the B-TID and the corresponding Ks (that is, the second master key Ks), and RAND, and establishes the correspondence between the B-TID and the corresponding Ks (that is, the second master key Ks), and RAND. The service server BSF stores the correspondence between the B-TID and the IMPI (IP Multimedia Private Identity, IP Multimedia Private Identity) of the user terminal, that is, the corresponding IMPI can be searched and acquired through the B-TID.

四、基于GBA的客户端注册和密钥共享方法实施例一4. Embodiment 1 of the method for client registration and key sharing based on GBA

请参考图2,其示出了本发明提供的基于GBA的客户端注册和密钥共享方法实施例一的流程图,该实施例可用于图1所示的实施环境中。该实施例包括:Please refer to FIG. 2 , which shows a flowchart of Embodiment 1 of the GBA-based client registration and key sharing method provided by the present invention, and this embodiment can be used in the implementation environment shown in FIG. 1 . This embodiment includes:

用户终端在获取到用于启动基于GBA的客户端注册和密钥共享过程的操作指示之后,启动基于GBA的客户端注册和密钥共享过程,该过程可以包括如下三个子过程和相应的步骤:After acquiring the operation instruction for starting the GBA-based client registration and key sharing process, the user terminal starts the GBA-based client registration and key sharing process, which may include the following three sub-processes and corresponding steps:

第一子过程:用户终端与引导业务服务器BSF基于相同的B-TID和值相同的主密钥Ks生成值相同的认证密钥。具体可以包括:The first sub-process: the user terminal and the bootstrap service server BSF generate an authentication key with the same value based on the same B-TID and the master key Ks with the same value. Specifically, it can include:

步骤201.用户终端获取B-TID和第一主密钥Ks。Step 201. The user terminal obtains the B-TID and the first master key Ks.

用户终端获取B-TID和第一主密钥Ks,相对应的,在用户终端与引导业务服务器BSF成功执行GBA初始化过程之后,在引导业务服务器BSF上存储有该B-TID以及与该B-TID对应的第二主密钥Ks。The user terminal acquires the B-TID and the first master key Ks. Correspondingly, after the user terminal and the guiding service server BSF successfully perform the GBA initialization process, the B-TID and the B-TID are stored on the guiding service server BSF. The second master key Ks corresponding to the TID.

步骤202.用户终端基于该第一主密钥Ks生成第一认证密钥。Step 202. The user terminal generates a first authentication key based on the first master key Ks.

例如,可将该第一主密钥Ks作为第一认证密钥。For example, the first master key Ks can be used as the first authentication key.

又例如,基于包括该第一主密钥Ks以及第一固定字符串(1)或/和第一随机字符串或/和第一时间戳或/和该B-TID或/和NAF_Id的信息生成第一认证密钥;其中,该第一固定字符串(1)为预先配置的并且与引导业务服务器BSF上预先配置的第一固定字符串(2)的值相同的字符串,该第一随机字符串为本地随机生成的字符串,该第一时间戳为通过获取用户终端的当前系统时间生成。具体地,以密钥派生算法公式为例,可以表示为:DK=PBKDF2(passphrase,Salt,c,dkLen),其中:DK是生成的第一认证密钥,PBKDF2是密钥派生算法,passphrase是该第一主密钥Ks并且和第一固定字符串(1)或/和第一随机字符串或/和第一时间戳或/和该B-TID或/和NAF_Id组合拼接的字符串;Salt是盐值,在本例中是一个固定字符串;c是迭代次数;dkLen是密钥输出长度,可以根据使用的加密算法生成符合要求的密钥长度。For another example, it is generated based on information including the first master key Ks and the first fixed character string (1) or/and the first random character string or/and the first timestamp or/and the B-TID or/and the NAF_Id A first authentication key; wherein, the first fixed character string (1) is a character string that is preconfigured and has the same value as the first fixed character string (2) preconfigured on the guidance service server BSF, and the first random character string The string is a locally randomly generated string, and the first timestamp is generated by acquiring the current system time of the user terminal. Specifically, taking the key derivation algorithm formula as an example, it can be expressed as: DK=PBKDF2(passphrase, Salt, c, dkLen), where: DK is the generated first authentication key, PBKDF2 is the key derivation algorithm, and passphrase is The first master key Ks and the first fixed character string (1) or/and the first random character string or/and the first timestamp or/and the B-TID or/and the NAF_Id are combined and spliced into a character string; Salt is the salt value, which is a fixed string in this example; c is the number of iterations; dkLen is the key output length, which can be generated according to the required encryption algorithm.

NAF_Id是用户终端中运行的第三方应用客户端的标识,例如,在第三方应用客户端软件安装包内已经内置存储并且在安装后存储在配置文件中,用户终端从该配置文件中获取该NAF_Id;或者,由第三方应用客户端向对应的第三方应用服务器发送请求后获得,再由用户终端从该第三方应用客户端获取,或者由第三方应用客户端发送给用户终端。NAF_Id is the identifier of the third-party application client running in the user terminal. For example, it is stored in the third-party application client software installation package and stored in the configuration file after installation, and the user terminal obtains the NAF_Id from the configuration file; Alternatively, it is obtained after the third-party application client sends a request to the corresponding third-party application server, and then obtained by the user terminal from the third-party application client, or sent by the third-party application client to the user terminal.

步骤203.用户终端将该B-TID以及生成第一认证密钥的信息发送给引导业务服务器BSF。Step 203. The user terminal sends the B-TID and the information for generating the first authentication key to the bootstrap service server BSF.

用户终端将该B-TID发送给引导业务服务器BSF,以使得引导业务服务器BSF根据该B-TID能获取到对应的第二主密钥Ks。The user terminal sends the B-TID to the guidance service server BSF, so that the guidance service server BSF can obtain the corresponding second master key Ks according to the B-TID.

为了使得引导业务服务器BSF生成与第一认证密钥的值相同的第二认证密钥,则如果生成第一认证密钥的信息还包括第一随机字符串或/和第一时间戳或/和NAF_Id,则将该第一随机字符串或/和该第一时间戳或/和该NAF_Id发送给引导业务服务器BSF。In order for the bootstrap service server BSF to generate a second authentication key with the same value as the first authentication key, if the information for generating the first authentication key further includes a first random string or/and a first timestamp or/and NAF_Id, then send the first random character string or/and the first timestamp or/and the NAF_Id to the bootstrap service server BSF.

相应地,引导业务服务器BSF接收用户终端发送的该B-TID以及该第一随机字符串或/和第一时间戳或/和该NAF_Id。Correspondingly, the guiding service server BSF receives the B-TID and the first random character string or/and the first timestamp or/and the NAF_Id sent by the user terminal.

可以理解,如果上述生成第一认证密钥的信息还包括第一固定字符串(1),由于在引导业务服务器BSF上可以预先配置相同值的第一固定字符串(2),则可以不用将该第一固定字符串(1)发送给引导业务服务器BSF。It can be understood that if the above-mentioned information for generating the first authentication key also includes the first fixed character string (1), since the first fixed character string (2) of the same value can be preconfigured on the guidance service server BSF, it is not necessary to The first fixed character string (1) is sent to the guidance service server BSF.

步骤204.引导业务服务器BSF根据该B-TID获取第二主密钥Ks。Step 204. Guide the service server BSF to obtain the second master key Ks according to the B-TID.

在引导业务服务器BSF上存储有B-TID和第二主密钥Ks的对应关系。The corresponding relationship between the B-TID and the second master key Ks is stored on the bootstrap service server BSF.

引导业务服务器BSF根据该B-TID在该对应关系中查找和获取对应的第二主密钥Ks。The bootstrap service server BSF searches and obtains the corresponding second master key Ks in the corresponding relationship according to the B-TID.

步骤205.引导业务服务器BSF基于该第二主密钥Ks生成第二认证密钥。Step 205. Guide the service server BSF to generate a second authentication key based on the second master key Ks.

引导业务服务器BSF使用和用户终端相同的认证密钥生成方式,基于该第二主密钥Ks生成第二认证密钥,相同的认证密钥生成方式包括相同的密钥派生算法公式、相同的输入信息、相同的输入参数、相同的字符串组合拼接方式等,以使得生成的第二认证密钥与用户终端生成的第一认证密钥的值相同。Guide the service server BSF to use the same authentication key generation method as the user terminal, generate a second authentication key based on the second master key Ks, and the same authentication key generation method includes the same key derivation algorithm formula, the same input information, the same input parameters, the same string combination and splicing method, etc., so that the generated second authentication key has the same value as the first authentication key generated by the user terminal.

例如,以使用和步骤202用户终端相同的认证密钥生成方式为例,如果用户终端使用第一主密钥Ks作为第一认证密钥,则引导业务服务器BSF使用该第二主密钥Ks作为第二认证密钥。For example, taking the same authentication key generation method as the user terminal in step 202 as an example, if the user terminal uses the first master key Ks as the first authentication key, the guiding service server BSF uses the second master key Ks as the first authentication key. The second authentication key.

又例如,以使用和步骤202用户终端相同的认证密钥生成方式为例,如果用户终端基于包括该第一主密钥Ks以及第一固定字符串(1)或/和第一随机字符串或/和第一时间戳或/和该B-TID或/和NAF_Id生成第一认证密钥,则引导业务服务器BSF基于包括该第二主密钥Ks以及第一固定字符串(2)或/和第一随机字符串或/和第一时间戳或/和该B-TID或/和NAF_Id的信息生成第一认证密钥,并且该第二认证密钥的生成方式与用户终端生成第一认证密钥的生成方式一致;其中,该第一固定字符串(2)为预先配置的并且与用户终端预先配置的第一固定字符串(1)的值相同的字符串,该第一随机字符串或/和第一时间戳或/和NAF_Id为用户终端所发送的。可以理解,如果用户终端生成第一认证密钥还包括其他的输入信息或输入参数,则引导业务服务器BSF生成第二认证密钥也需包括使用相同的输入信息或输入参数,以使得生成的第二认证密钥和用户终端生成的第一认证密钥的值相同。For another example, taking the same authentication key generation method as the user terminal in step 202 as an example, if the user terminal includes the first master key Ks and the first fixed character string (1) or/and the first random character string or and/and the first timestamp or/and the B-TID or/and the NAF_Id to generate a first authentication key, then the bootstrap service server BSF is based on including the second master key Ks and the first fixed character string (2) or/and The first random character string or/and the first time stamp or/and the information of the B-TID or/and the NAF_Id generates the first authentication key, and the generation method of the second authentication key is the same as that for the user terminal to generate the first authentication key. The keys are generated in the same manner; wherein, the first fixed character string (2) is a character string that is preconfigured and has the same value as the first fixed character string (1) preconfigured by the user terminal, and the first random character string or / and the first timestamp or/and NAF_Id are sent by the user terminal. It can be understood that if the generation of the first authentication key by the user terminal also includes other input information or input parameters, then guiding the service server BSF to generate the second authentication key also needs to include the use of the same input information or input parameters, so that the generated first authentication key is generated. The value of the second authentication key is the same as that of the first authentication key generated by the user terminal.

具体地,以步骤202相对应的示例为例,密钥派生算法公式为:DK=PBKDF2(passphrase,Salt,c,dkLen),其中:DK是生成的第二认证密钥,PBKDF2是与用户终端相同的密钥派生算法,passphrase是该第二主密钥Ks并且和第一固定字符串(2)或/和第一随机字符串或/和第一时间戳或/和该B-TID或/和NAF_Id组合拼接的字符串;Salt是盐值,是一个与用户终端相同的固定字符串;c是与用户终端中相同的迭代次数;dkLen是与用户终端中相同的密钥输出长度。Specifically, taking the example corresponding to step 202 as an example, the key derivation algorithm formula is: DK=PBKDF2(passphrase, Salt, c, dkLen), wherein: DK is the generated second authentication key, PBKDF2 is the The same key derivation algorithm, passphrase is the second master key Ks and the first fixed string (2) or/and the first random string or/and the first timestamp or/and the B-TID or/ The string concatenated with NAF_Id; Salt is the salt value, which is the same fixed string as the user terminal; c is the same number of iterations as the user terminal; dkLen is the same key output length as the user terminal.

至此,由于在成功执行GBA初始化过程之后,同一B-TID在用户终端上对应的第一主密钥Ks和在引导业务服务器BSF上对应的第二主密钥Ks的值是相同的,而由于第一认证密钥和第二认证密钥是使用相同的密钥生成方式、基于值相同的主密钥Ks生成的,因此,第一认证密钥和第二认证密钥的值也是相同的。So far, after the GBA initialization process is successfully performed, the values of the first master key Ks corresponding to the same B-TID on the user terminal and the second master key Ks corresponding to the bootstrap service server BSF are the same. The first authentication key and the second authentication key are generated using the same key generation method and based on the master key Ks with the same value. Therefore, the values of the first authentication key and the second authentication key are also the same.

第二子过程:用户终端与引导业务服务器BSF生成值相同的验证信息。具体可以包括:The second sub-process: the user terminal and the bootstrap service server BSF generate authentication information with the same value. Specifically, it can include:

步骤206.用户终端生成第一验证信息。Step 206. The user terminal generates first verification information.

用户终端生成第一验证信息,以使得该第一验证信息用于加密,并且要使得该第一验证信息与引导业务服务器BSF生成的第二验证信息的值相同。The user terminal generates the first verification information, so that the first verification information is used for encryption, and the value of the first verification information is the same as that of the second verification information generated by the bootstrap service server BSF.

用户终端可以将第二固定字符串(1)或第二随机字符串或第二时间戳或该B-TID或该NAF_Id中的一种作为第一验证信息;或者,用户终端可以将第二固定字符串(1)或第二随机字符串或第二时间戳或该B-TID或该NAF_Id中的一种使用哈希算法进行哈希计算,将生成的哈希值作为第一验证信息;或者,用户终端将包括第二固定字符串(1)或/和第二随机字符串或/和第二时间戳或/和该B-TID或/和该NAF_Id的信息组合拼接后生成第一验证信息;或者,用户终端将包括第二固定字符串(1)或/和第二随机字符串或/和第二时间戳或/和该B-TID或/和该NAF_Id的信息组合拼接后生成的信息,再使用哈希算法进行哈希计算,将生成的哈希值作为第一验证信息。The user terminal may use one of the second fixed character string (1) or the second random character string or the second timestamp or the B-TID or the NAF_Id as the first verification information; One of the character string (1) or the second random character string or the second timestamp or the B-TID or the NAF_Id is hashed with a hash algorithm, and the generated hash value is used as the first verification information; or , the user terminal generates the first verification information after splicing the information including the second fixed character string (1) or/and the second random character string or/and the second timestamp or/and the B-TID or/and the NAF_Id Or, the user terminal will include the information generated after the second fixed character string (1) or/and the second random character string or/and the second time stamp or/and the information of the B-TID or/and the NAF_Id combined and spliced , and then use the hash algorithm to perform hash calculation, and use the generated hash value as the first verification information.

其中,该第二固定字符串(1)为预先配置的与引导业务服务器BSF上预先配置的第二固定字符串(2)的值相同的字符串,该第二随机字符串为本地随机生成的字符串,该第二时间戳为通过获取用户终端的当前系统时间生成。Wherein, the second fixed character string (1) is a preconfigured character string with the same value as the second fixed character string (2) preconfigured on the guiding service server BSF, and the second random character string is randomly generated locally String, the second timestamp is generated by obtaining the current system time of the user terminal.

步骤207.用户终端将生成第一验证信息的信息发送给引导业务服务器BSF。Step 207. The user terminal sends the information for generating the first verification information to the guidance service server BSF.

在用户终端生成第一验证信息之后,为了使得引导业务服务器BSF生成与第一验证信息的值相同的第二验证信息,如果生成的第一验证信息还包括第二随机字符串或/和第二时间戳或/和该B-TID或/和该NAF_Id,则将该第二随机字符串或/和该第二时间戳或/和该B-TID或/和该NAF_Id发送给引导业务服务器BSF。After the user terminal generates the first verification information, in order for the bootstrap service server BSF to generate the second verification information with the same value as the first verification information, if the generated first verification information further includes a second random character string or/and a second timestamp or/and the B-TID or/and the NAF_Id, send the second random string or/and the second timestamp or/and the B-TID or/and the NAF_Id to the bootstrap service server BSF.

相应地,引导业务服务器BSF接收用户终端发送的该第二随机字符串或/和该第二时间戳或/和该B-TID或/和该NAF_Id。Correspondingly, the guiding service server BSF receives the second random character string or/and the second timestamp or/and the B-TID or/and the NAF_Id sent by the user terminal.

可以理解,如果上述生成第一验证信息的信息还包括第二固定字符串(1),由于在引导业务服务器BSF上可以预先配置相同值的固定字符串(2),则可以不用将该第二固定字符串(1)发送给引导业务服务器BSF。It can be understood that if the above-mentioned information for generating the first verification information also includes the second fixed character string (1), since the fixed character string (2) of the same value can be preconfigured on the guidance service server BSF, the second fixed character string (2) may not be used. The fixed character string (1) is sent to the bootstrap service server BSF.

可以理解,本步骤还可以与上述步骤203合并成一个步骤实施,即用户终端可以将该B-TID以及生成第一认证密钥的信息和生成第一验证信息的信息在一个发送请求中同时发送给引导业务服务器BSF,相应地,则上述引导业务服务器BSF生成第二认证密钥、生成第二验证信息的步骤也在该合并的步骤后实施。It can be understood that this step can also be combined with the above-mentioned step 203 to be implemented in one step, that is, the user terminal can send the B-TID and the information for generating the first authentication key and the information for generating the first verification information in a sending request at the same time. For the guidance service server BSF, correspondingly, the above-mentioned steps of generating the second authentication key and generating the second verification information by the guidance service server BSF are also implemented after the merging step.

可以理解,如果合并成一个步骤实施,则两个步骤中如果生成第一认证密钥的信息与生成第一验证信息的信息有相同的信息,则可以不用重复发送该相同的信息。It can be understood that, if implemented in one step, if the information for generating the first authentication key and the information for generating the first verification information have the same information in the two steps, the same information need not be sent repeatedly.

步骤208.引导业务服务器BSF生成第二验证信息。Step 208. Guide the service server BSF to generate the second verification information.

引导业务服务器BSF生成第二验证信息,并且要使得该生成的第二验证信息的值与用户终端生成的第一验证信息的值相同。The guiding service server BSF generates the second authentication information, and the value of the generated second authentication information is to be the same as the value of the first authentication information generated by the user terminal.

以使用和步骤206相同的验证信息生成方式为例,如果用户终端将第二固定字符串(1)或第二随机字符串或第二时间戳或该B-TID或该NAF_Id中的一种作为第一验证信息,则引导业务服务器BSF将第二固定字符串(2)或第二随机字符串或第二时间戳或该B-TID或该NAF_Id中的一种作为第二验证信息。Taking the same authentication information generation method as in step 206 as an example, if the user terminal uses one of the second fixed character string (1) or the second random character string or the second timestamp or the B-TID or the NAF_Id as the For the first verification information, the guiding service server BSF takes one of the second fixed character string (2) or the second random character string or the second timestamp or the B-TID or the NAF_Id as the second verification information.

以使用和步骤206相同的验证信息生成方式为例,如果用户终端将第二固定字符串(1)或第二随机字符串或第二时间戳或该B-TID或该NAF_Id中的一种的哈希值作为第一验证信息,则引导业务服务器BSF将第二固定字符串(2)或第二随机字符串或第二时间戳或该B-TID或该NAF_Id中相同的一种使用相同的哈希算法进行哈希计算,并将生成的哈希值作为第二验证信息。Taking the same authentication information generation method as in step 206 as an example, if the user terminal uses one of the second fixed character string (1) or the second random character string or the second timestamp or the B-TID or the NAF_Id The hash value is used as the first verification information, and the service server BSF is guided to use the same one of the second fixed string (2) or the second random string or the second timestamp or the B-TID or the NAF_Id. The hash algorithm performs hash calculation, and uses the generated hash value as the second verification information.

以使用和步骤206相同的验证信息生成方式为例,如果用户终端将包括第二固定字符串(1)或/和第二随机字符串或/和第二时间戳或/和该B-TID或/和该NAF_Id的信息生成第一验证信息,则引导业务服务器BSF将包括第二固定字符串(2)或/和第二随机字符串或/和第二时间戳或/和该B-TID或/和该NAF_Id的信息生成第二验证信息。例如,如果用户终端将第二固定字符串(1)或/和第二随机字符串或/和第二时间戳或/和该B-TID或/和该NAF_Id组合拼接后作为第一验证信息,则引导业务服务器BSF将第二固定字符串(2)或/和第二随机字符串或/和第二时间戳或/和该B-TID或/和该NAF_Id使用相同的方式组合拼接后作为第二验证信息。Taking the same authentication information generation method as in step 206 as an example, if the user terminal will include the second fixed character string (1) or/and the second random character string or/and the second time stamp or/and the B-TID or / and the information of the NAF_Id to generate the first verification information, then the bootstrap service server BSF will include the second fixed character string (2) or/and the second random character string or/and the second time stamp or/and the B-TID or / and the information of the NAF_Id to generate the second verification information. For example, if the user terminal combines the second fixed string (1) or/and the second random string or/and the second timestamp or/and the B-TID or/and the NAF_Id as the first verification information, Then guide the service server BSF to combine the second fixed character string (2) or/and the second random character string or/and the second timestamp or/and the B-TID or/and the NAF_Id in the same way as the first 2. Verification information.

以使用和步骤206相同的验证信息生成方式为例,如果用户终端将包括第二固定字符串(1)或/和第二随机字符串或/和第二时间戳或/和该B-TID或/和该NAF_Id的信息组合拼接后哈希计算生成的哈希值作为第一验证信息,则引导业务服务器BSF将包括第二固定字符串(2)或/和第二随机字符串或/和第二时间戳或/和该B-TID或/和该NAF_Id的信息使用相同的方式组合拼接后生成的信息,再使用相同的哈希算法对该组合拼接后的信息进行哈希计算,并将生成的哈希值作为第二验证信息。Taking the same authentication information generation method as in step 206 as an example, if the user terminal will include the second fixed character string (1) or/and the second random character string or/and the second time stamp or/and the B-TID or /The hash value generated by hash calculation after splicing with the information of this NAF_Id is used as the first verification information, then the guidance service server BSF will include the second fixed character string (2) or/and the second random character string or/and the first Two timestamps or/and the information of the B-TID or/and the NAF_Id use the same method to combine the information generated after splicing, and then use the same hash algorithm to perform hash calculation on the combined and spliced information, and generate The hash value is used as the second verification information.

其中,该第二固定字符串(2)为预先配置的并且与用户终端上预先配置的第二固定字符串(1)的值相同的字符串,该第二随机字符串或/和该第二时间戳或/和该NAF_Id为用户终端所发送的。Wherein, the second fixed character string (2) is a preconfigured character string with the same value as the second fixed character string (1) preconfigured on the user terminal, the second random character string or/and the second The timestamp or/and the NAF_Id are sent by the user terminal.

可以理解,如果用户终端生成第一验证信息还包括其他的输入信息,则引导业务服务器BSF生成第二验证信息也需包括使用相同的输入信息,以使得生成的第二验证信息和用户终端生成的第一验证信息的值相同。It can be understood that if the generation of the first verification information by the user terminal also includes other input information, then guiding the service server BSF to generate the second verification information also needs to include using the same input information, so that the generated second verification information and the user terminal generate the same input information. The value of the first verification information is the same.

至此,由于第二验证信息和第一验证信息是使用相同的验证信息生成方式、基于相同值的信息生成的,因此,第二验证信息和第一验证信息的值也是相同的。So far, since the second verification information and the first verification information are generated using the same verification information generation method and based on information of the same value, the values of the second verification information and the first verification information are also the same.

进一步地,如果生成第一验证信息的信息还包括第二时间戳,则引导业务服务器BSF在接收到该第二时间戳之后,将该第二时间戳与引导业务服务器BSF的当前系统时间进行比较,确定两者的时间差是否在预先设定的有效范围内:如果是在有效的范围内,则执行后续步骤;如果不是在有效的范围内,则不执行后续步骤。Further, if the information for generating the first verification information also includes a second time stamp, the bootstrap service server BSF compares the second time stamp with the current system time of the bootstrap service server BSF after receiving the second time stamp. , to determine whether the time difference between the two is within the preset valid range: if it is within the valid range, execute the subsequent steps; if it is not within the valid range, do not execute the subsequent steps.

第三子过程:用户终端与引导业务服务器BSF基于值相同的认证密钥和值相同的验证信息实现安全认证。具体可以包括:The third sub-process: the user terminal and the bootstrap service server BSF implement security authentication based on the authentication key with the same value and the verification information with the same value. Specifically, it can include:

步骤209.用户终端基于该第一认证密钥对该第一验证信息加密生成第一加密值。Step 209. The user terminal encrypts the first authentication information based on the first authentication key to generate a first encrypted value.

根据上述步骤中生成的第一认证密钥和第一验证信息,用户终端基于该第一认证密钥对该第一验证信息加密生成第一加密值。根据所使用的加密算法,可以包括多种实施方式,至少可以包括:According to the first authentication key and the first verification information generated in the above steps, the user terminal encrypts the first verification information based on the first authentication key to generate a first encrypted value. Depending on the encryption algorithm used, various implementations may be included, at least including:

第一种实施方式,用户终端使用签名加密算法基于该第一认证密钥对该第一验证信息签名加密生成第一加密值。In a first implementation manner, the user terminal uses a signature encryption algorithm to sign and encrypt the first verification information based on the first authentication key to generate a first encrypted value.

用户终端使用签名加密算法基于该第一认证密钥对该第一验证信息签名加密计算生成的第一加密值,即为签名值,签名值可以唯一地识别第一验证信息,只有使用相同的签名加密算法、相同值的签名密钥、相同值的待签名信息才可以生成相同的签名值。The first encrypted value generated by the user terminal using the signature encryption algorithm to sign and encrypt the first verification information based on the first authentication key is the signature value. The signature value can uniquely identify the first verification information, and only the same signature is used. The same signature value can only be generated by the encryption algorithm, the signature key of the same value, and the information to be signed of the same value.

例如,以签名加密算法使用哈希消息认证码为例,签名方式可以表示为:Signature=HMAC_SHA256(k,m),其中m是待签名信息即该第一验证信息,k是签名密钥即该第一认证密钥,HMAC_SHA256是签名加密算法,Signature是签名值即第一加密值。For example, taking the hash message authentication code as an example for the signature encryption algorithm, the signature method can be expressed as: Signature=HMAC_SHA256(k,m), where m is the information to be signed, that is, the first verification information, and k is the signature key, that is, the first verification information. The first authentication key, HMAC_SHA256 is the signature encryption algorithm, and Signature is the signature value, that is, the first encryption value.

又例如,以签名加密算法使用含密钥加密的哈希函数为例,签名方式可以表示为:Signature=SHA256(k||m),其中m是待签名信息即该第一验证信息,k是签名密钥即该第一认证密钥,“k||m”表示将k和m组合拼接,SHA256是哈希函数,Signature是签名值即第一加密值。For another example, taking the signature encryption algorithm using a hash function encrypted with a key as an example, the signature method can be expressed as: Signature=SHA256(k||m), where m is the information to be signed, that is, the first verification information, and k is the first verification information. The signature key is the first authentication key, "k||m" represents the combination of k and m, SHA256 is the hash function, and Signature is the signature value, that is, the first encrypted value.

第二种实施方式,用户终端使用对称加密算法基于该第一认证密钥对包括该第一验证信息的信息对称加密生成第一加密值。In the second implementation manner, the user terminal uses a symmetric encryption algorithm based on the first authentication key to symmetrically encrypt the information including the first verification information to generate a first encrypted value.

用户终端使用对称加密算法基于该第一认证密钥对包括该第一验证信息的信息对称加密生成第一加密值,该第一加密值即为包括该第一验证信息的信息的密文,只有使用相同的对称加密算法、相同值的密钥才可以将该密文解密后得到原来的明文。The user terminal uses a symmetric encryption algorithm to symmetrically encrypt the information including the first verification information based on the first authentication key to generate a first encrypted value, where the first encrypted value is the ciphertext of the information including the first verification information, and only Only by using the same symmetric encryption algorithm and key of the same value can the ciphertext be decrypted to obtain the original plaintext.

例如,以对称加密算法使用AES为例,加密方式可以表示为:s=AES_ENCRYPT(m,k),其中m是明文,该明文是该第一验证信息,或者是包括该第一验证信息的信息,k是加密密钥即该第一认证密钥,AES_ENCRYPT是加密算法,s是加密结果即第一加密值。For example, taking the symmetric encryption algorithm using AES as an example, the encryption method can be expressed as: s=AES_ENCRYPT(m,k), where m is the plaintext, and the plaintext is the first verification information, or the information including the first verification information , k is the encryption key, that is, the first authentication key, AES_ENCRYPT is the encryption algorithm, and s is the encryption result, that is, the first encryption value.

上述的包括该第一验证信息的信息,是指在生成的信息中还包括该第一验证信息和其他信息,例如将该第一验证信息和其他信息组合拼接后所生成的信息,对于该其他信息,如非特别说明,在本实施例中并不进行限定。The above-mentioned information including the first verification information means that the generated information also includes the first verification information and other information, for example, the information generated after combining and splicing the first verification information and other information, for the other information. Information, unless otherwise specified, is not limited in this embodiment.

步骤210.用户终端向引导业务服务器BSF发送安全认证请求,该安全认证请求包括该第一加密值。Step 210. The user terminal sends a security authentication request to the bootstrap service server BSF, where the security authentication request includes the first encrypted value.

用户终端向引导业务服务器BSF发送安全认证请求,该安全认证请求包括该第一加密值,以使得引导业务服务器BSF通过验证该第一加密值而实现对用户终端的安全认证。The user terminal sends a security authentication request to the guidance service server BSF, where the security authentication request includes the first encrypted value, so that the guidance service server BSF implements security authentication for the user terminal by verifying the first encrypted value.

相应地,引导业务服务器BSF接收用户终端发送的安全认证请求,并且获取该安全认证请求中包括的该第一加密值。Correspondingly, the guiding service server BSF receives the security authentication request sent by the user terminal, and acquires the first encrypted value included in the security authentication request.

可以理解,本步骤还可以与上述步骤203或/和步骤207合并成一个步骤实施,即用户终端可以将该第一加密值与该B-TID以及生成第一认证密钥的信息、或/和生成第一验证信息的信息在一个发送请求中同时发送给引导业务服务器BSF,相应地,则引导业务服务器BSF生成第二认证密钥、生成第二验证信息的步骤也在该合并的步骤后实施。It can be understood that this step can also be combined with the above-mentioned step 203 or/and step 207 into one step, that is, the user terminal can combine the first encrypted value with the B-TID and the information for generating the first authentication key, or/and The information of generating the first verification information is simultaneously sent to the guiding service server BSF in a sending request, and accordingly, the steps of guiding the service server BSF to generate the second authentication key and generating the second verification information are also implemented after the merging step. .

步骤211.引导业务服务器BSF基于该第二认证密钥和该第二验证信息验证该第一加密值。Step 211. Guide the service server BSF to verify the first encrypted value based on the second authentication key and the second verification information.

与用户终端中生成第一加密值可以包括的多种实施方式相对应的,引导业务服务器BSF基于该第二认证密钥和该第二验证信息验证该第一加密值需使用相对应的实施方式,包括:Corresponding to the various implementations that can be included in the generation of the first encrypted value in the user terminal, the guiding service server BSF needs to use the corresponding implementation to verify the first encrypted value based on the second authentication key and the second verification information. ,include:

第一种实施方式,与用户终端使用签名加密算法生成第一加密值的实施方式相对应的,引导业务服务器BSF使用和用户终端相同的签名加密算法,基于该第二认证密钥和该第二验证信息验证该第一加密值。具体可以包括:The first implementation manner, corresponding to the implementation manner in which the user terminal uses a signature encryption algorithm to generate the first encrypted value, guides the service server BSF to use the same signature encryption algorithm as the user terminal, based on the second authentication key and the second The verification information verifies the first encrypted value. Specifically, it can include:

步骤211a.引导业务服务器BSF使用和用户终端相同的签名加密算法,基于该第二认证密钥对该第二验证信息签名加密生成第二加密值。Step 211a. Instruct the service server BSF to use the same signature encryption algorithm as that of the user terminal to sign and encrypt the second verification information based on the second authentication key to generate a second encrypted value.

引导业务服务器BSF使用和用户终端相同的签名加密算法基于该第二认证密钥对该第二验证信息签名加密生成签名值,该签名值即为第二加密值。The bootstrap service server BSF uses the same signature encryption algorithm as the user terminal to sign and encrypt the second verification information based on the second authentication key to generate a signature value, where the signature value is the second encryption value.

例如,以签名加密算法使用和步骤209用户终端中相同的哈希消息认证码为例,签名方式可以表示为:Signature=HMAC_SHA256(k,m),其中m是待签名信息即第二验证信息,k是签名密钥即第二认证密钥,HMAC_SHA256是与用户终端相同的哈希消息认证码,Signature是签名值即第二加密值。For example, taking the same hash message authentication code used in the user terminal in step 209 as an example for the signature encryption algorithm, the signature method can be expressed as: Signature=HMAC_SHA256(k,m), where m is the information to be signed, that is, the second verification information, k is the signature key, that is, the second authentication key, HMAC_SHA256 is the same hash message authentication code as the user terminal, and Signature is the signature value, that is, the second encrypted value.

又例如,以签名算法使用和步骤209用户终端中相同的含密钥加密的哈希函数为例,签名方式可以表示为:Signature=SHA256(k||m),其中m是待签名信息即第二验证信息,k是签名密钥即第二认证密钥,SHA256是与用户终端相同的哈希函数,Signature是签名值即第二加密值。For another example, taking the same hash function encrypted with a key as that used in the user terminal in step 209 for the signature algorithm as an example, the signature method can be expressed as: Signature=SHA256(k||m), where m is the information to be signed, that is, the first Second verification information, k is the signature key, that is, the second authentication key, SHA256 is the same hash function as the user terminal, and Signature is the signature value, that is, the second encrypted value.

至此,由于引导业务服务器BSF使用的是和用户终端相同的签名算法,第二验证信息和第一验证信息是值相同的待签名信息,第二认证密钥和第一认证密钥是值相同的签名密钥,则生成的第二加密值和第一加密值相同。So far, since the bootstrap service server BSF uses the same signature algorithm as the user terminal, the second verification information and the first verification information are information to be signed with the same value, and the second authentication key and the first authentication key have the same value. signature key, the generated second encrypted value is the same as the first encrypted value.

步骤211b.引导业务服务器BSF比较该第二加密值与该第一加密值是否一致;若一致,则确定验证该第一加密值有效。Step 211b. Guide the service server BSF to compare whether the second encrypted value is consistent with the first encrypted value; if they are consistent, determine to verify that the first encrypted value is valid.

引导业务服务器BSF比较该第二加密值和该第一加密值是否一致,并根据比较结果执行相应的操作,包括:The bootstrap service server BSF compares whether the second encrypted value is consistent with the first encrypted value, and performs corresponding operations according to the comparison result, including:

如果比较结果是一致的,则确定验证该第一加密值有效。If the comparison results are consistent, it is determined to verify that the first encrypted value is valid.

如果比较结果是不一致的,则确定验证该第一加密值无效。If the comparison result is inconsistent, it is determined that the verification of the first encrypted value is invalid.

第二种实施方式,与用户终端使用对称加密算法生成第一加密值相对应的,引导业务服务器BSF使用和用户终端相同的对称加密算法,基于该第二认证密钥和该第二验证信息验证该第二加密值。具体可以包括:In the second embodiment, corresponding to the user terminal using the symmetric encryption algorithm to generate the first encryption value, the service server BSF is guided to use the same symmetric encryption algorithm as the user terminal, and verify based on the second authentication key and the second verification information. the second encrypted value. Specifically, it can include:

步骤211i.引导业务服务器BSF使用和用户终端相同的对称加密算法,基于该第二认证密钥对该第一加密值解密获得明文,并从该明文中获取第一验证信息。Step 211i. Instruct the service server BSF to use the same symmetric encryption algorithm as that of the user terminal, decrypt the first encrypted value based on the second authentication key to obtain plaintext, and obtain the first verification information from the plaintext.

引导业务服务器BSF使用和用户终端相同的对称加密算法基于该第二认证密钥对该第一加密值解密,从而获得解密后的明文。The bootstrap service server BSF uses the same symmetric encryption algorithm as the user terminal to decrypt the first encrypted value based on the second authentication key, so as to obtain the decrypted plaintext.

例如,以对称加密算法使用和步骤209用户终端中相同的AES为例,解密方式可以表示为:m=AES_DENCRYPT(s,k),其中m是解密后的结果值,即解密后的明文,k是解密密钥即该第二认证密钥,AES_DENCRYPT是解密算法,s是密文即第一加密值。For example, taking the same AES as the symmetric encryption algorithm used in the user terminal in step 209 as an example, the decryption method can be expressed as: m=AES_DENCRYPT(s,k), where m is the result value after decryption, that is, the decrypted plaintext, k is the decryption key, that is, the second authentication key, AES_DENCRYPT is the decryption algorithm, and s is the ciphertext, that is, the first encrypted value.

由于该明文是第一验证信息或者是包括该第一验证信息的信息,因此,可以从该明文中获取到解密后的第一验证信息。Since the plaintext is the first verification information or information including the first verification information, the decrypted first verification information can be obtained from the plaintext.

步骤211i i.引导业务服务器BSF比较该第二验证信息与该第一验证信息是否一致;若一致,则确定验证该第一加密值有效。Step 211i i. The guiding service server BSF compares whether the second verification information is consistent with the first verification information; if they are consistent, it is determined that the verification of the first encrypted value is valid.

引导业务服务器BSF比较该第二验证信息和该解密后的第一验证信息是否一致,并根据比较结果执行相应的操作,包括:The guidance service server BSF compares whether the second verification information is consistent with the decrypted first verification information, and performs corresponding operations according to the comparison result, including:

如果比较结果是一致的,则确定验证该第一加密值有效。If the comparison results are consistent, it is determined to verify that the first encrypted value is valid.

如果比较结果是不一致的,则确定验证该第一加密值验证无效。If the comparison result is inconsistent, it is determined that the verification of the first encrypted value is invalid.

步骤212.引导业务服务器BSF根据对第一加密值的验证结果确定安全认证是否成功并执行相应的操作。Step 212 . Guide the service server BSF to determine whether the security authentication is successful according to the verification result of the first encrypted value and perform corresponding operations.

引导业务服务器BSF根据对该第一加密值的验证结果确定安全认证是否成功,并执行相应的操作,包括:The bootstrap service server BSF determines whether the security authentication is successful according to the verification result of the first encrypted value, and performs corresponding operations, including:

若确定验证该第一加密值验证有效,则确定安全认证成功。If it is determined that the verification of the first encrypted value is valid, it is determined that the security authentication is successful.

若确定验证该第一加密值验证无效,则确定安全认证失败。If it is determined that the verification of the first encrypted value is invalid, it is determined that the security authentication fails.

在确定安全认证成功之后,引导业务服务器BSF可以向向用户终端提供注册信息和服务,还可以保持与用户终端的会话状态以接收用户终端传递的信息,或者为用户终端生成认证令牌等。相应地,用户终端接收引导业务服务器BSF提供的注册信息和服务,或者通过与引导业务服务器BSF保持的会话状态或接收的认证令牌向引导业务服务器BSF传递信息等。After determining that the security authentication is successful, the bootstrap service server BSF can provide registration information and services to the user terminal, maintain a session state with the user terminal to receive information transmitted by the user terminal, or generate an authentication token for the user terminal. Correspondingly, the user terminal receives the registration information and services provided by the guidance service server BSF, or transmits information to the guidance service server BSF through the session state maintained with the guidance service server BSF or the received authentication token.

在确定安全认证失败之后,引导业务服务器BSF向用户终端发送注册失败应答消息。相应地,用户终端接收引导业务服务器BSF发送的注册失败应答消息。After determining that the security authentication fails, the guiding service server BSF sends a registration failure response message to the user terminal. Correspondingly, the user terminal receives the registration failure response message sent by the bootstrap service server BSF.

综上所述,本实施例提供的方法,主要是基于用户终端中的B-TID和第一主密钥Ks,以及基于引导业务服务器BSF中存储的相同的B-TID和对应的第二主密钥Ks,引导业务服务器BSF通过使用和用户终端相同的加密算法对用户终端进行安全认证,在确定安全认证成功之后,可以为用户终端及用户终端上运行的第三方应用客户端安全地提供相应的注册信息和服务。To sum up, the method provided in this embodiment is mainly based on the B-TID and the first master key Ks in the user terminal, and the same B-TID and the corresponding second master key stored in the bootstrap service server BSF. The key Ks guides the service server BSF to perform security authentication on the user terminal by using the same encryption algorithm as the user terminal. After determining that the security authentication is successful, it can securely provide the user terminal and the third-party application client running on the user terminal. registration information and services.

五、基于GBA的客户端注册和密钥共享方法实施例二V. Embodiment 2 of the GBA-based client registration and key sharing method

请参考图3,其示出了本发明提供的基于GBA的客户端注册和密钥共享方法实施例二的流程图,该方法可用于图1所示的实施环境中。作为基于基于GBA的客户端注册和密钥共享方法实施例一提供的更为优选的实施例,本实施例进一步为用户终端中运行的第三方应用客户端提供了注册信息,该注册信息包括第三方用户标识和用户密钥。Please refer to FIG. 3 , which shows a flowchart of Embodiment 2 of the GBA-based client registration and key sharing method provided by the present invention, and the method can be used in the implementation environment shown in FIG. 1 . As a more preferred embodiment provided by Embodiment 1 of the GBA-based client registration and key sharing method, this embodiment further provides registration information for the third-party application client running in the user terminal, and the registration information includes the first Three-party user ID and user key.

为了让引导业务服务器BSF为用户终端中运行的第三方应用客户端提供相应的注册信息和服务,用户终端需将第三方应用客户端对应的NAF_Id传递给引导业务服务器BSF。In order for the guidance service server BSF to provide corresponding registration information and services for the third-party application client running in the user terminal, the user terminal needs to transmit the NAF_Id corresponding to the third-party application client to the guidance service server BSF.

具体的,用户终端将NAF_Id传递给引导业务服务器BSF可以包括多种实施方式,例如可以包括:Specifically, transmitting the NAF_Id by the user terminal to the guidance service server BSF may include various implementations, for example, may include:

第一种实施方式,在用户终端向引导业务服务器BSF的安全认证过程中,用户终端将NAF_Id传递给引导业务服务器BSF。In the first implementation manner, during the security authentication process of the user terminal to the guidance service server BSF, the user terminal transmits the NAF_Id to the guidance service server BSF.

用户终端将该NAF_Id传递给引导业务服务器BSF,可以以一个单独的发送请求将该NAF_Id发送给引导业务服务器BSF,也可以合并在其他的发送请求中将该NAF_Id发送给引导业务服务器BSF。例如,以上述基于GBA的客户端注册和密钥共享方法实施例一为例,可以合并在上述步骤210的安全认证请求中,或者合并在上述步骤203或/和步骤207用户终端发送该B-TID以及生成第一认证密钥的信息、或/和发送生成第一验证信息的信息的步骤中,以使得引导业务服务器BSF在接收到生成第一认证密钥或生成第一验证信息的信息时,同时接收和获取该NAF_Id。The user terminal transmits the NAF_Id to the steering service server BSF, and can send the NAF_Id to the steering service server BSF in a single sending request, or can send the NAF_Id to the steering service server BSF in other sending requests. For example, taking the first embodiment of the above GBA-based client registration and key sharing method as an example, it can be incorporated in the security authentication request in the above step 210, or in the above step 203 or/and step 207. The user terminal sends the B- In the step of TID and the information of generating the first authentication key, or/and sending the information of generating the first authentication information, so that the guidance service server BSF receives the information of generating the first authentication key or generating the first authentication information when receiving the information of generating the first authentication key or generating the first authentication information , receive and obtain the NAF_Id at the same time.

第二种实施方式,在用户终端向引导业务服务器BSF的安全认证成功之后,以及在引导业务服务器BSF向用户终端提供注册信息和服务之前,用户终端通过与引导业务服务器BSF间保持的会话状态或认证令牌将NAF_Id传递给引导业务服务器BSF。In the second embodiment, after the security authentication of the user terminal to the guidance service server BSF is successful, and before the guidance service server BSF provides registration information and services to the user terminal, the user terminal passes the session state or session state maintained with the guidance service server BSF. The authentication token passes the NAF_Id to the Bootstrap Service Server BSF.

例如,以上述基于GBA的客户端注册和密钥共享方法实施例一为例,在用户终端与引导业务服务器BSF进行安全认证成功之后,用户终端与引导业务服务器BSF间保持会话状态或认证令牌,用户终端通过该会话状态或认证令牌向引导业务服务器BSF传递第三方应用标识。For example, taking the first embodiment of the above-mentioned GBA-based client registration and key sharing method as an example, after the user terminal and the bootstrap service server BSF successfully perform security authentication, a session state or an authentication token is maintained between the user terminal and the bootstrap service server BSF. , the user terminal transmits the third-party application identifier to the guidance service server BSF through the session state or the authentication token.

在用户终端将NAF_Id传递给引导业务服务器BSF、以及引导业务服务器BSF确定安全认证成功之后,引导业务服务器BSF可以为用户终端中运行的第三方应用客户端提供包括第三方用户标识和用户密钥的注册信息,即本实施例的下述步骤应用在基于GBA的客户端注册和密钥共享方法实施例一之后。具体可以包括:After the user terminal transmits the NAF_Id to the bootstrap service server BSF, and the bootstrap service server BSF determines that the security authentication is successful, the bootstrap service server BSF may provide the third-party application client running in the user terminal with the third-party user ID and user key. Registration information, that is, the following steps in this embodiment are applied after the first embodiment of the GBA-based client registration and key sharing method. Specifically, it can include:

步骤301.引导业务服务器BSF根据B-TID和NAF_Id获取对应的第三方用户标识。Step 301. Guide the service server BSF to obtain the corresponding third-party user identifier according to the B-TID and NAF_Id.

引导业务服务器BSF根据B-TID和NAF_Id获取对应的第三方用户标识,具体可以包括:The guidance service server BSF obtains the corresponding third-party user identifier according to the B-TID and NAF_Id, which may specifically include:

步骤301a.引导业务服务器BSF根据该B-TID获取对应的IMPI。Step 301a. Guide the service server BSF to obtain the corresponding IMPI according to the B-TID.

在成功执行GBA初始化过程之后,在引导业务服务器BSF上存储有B-TID与IMPI的对应关系,即根据B-TID能查找和获取对应的IMPI。After the GBA initialization process is successfully performed, the corresponding relationship between the B-TID and the IMPI is stored on the bootstrap service server BSF, that is, the corresponding IMPI can be searched and acquired according to the B-TID.

引导业务服务器BSF根据该B-TID在该对应关系中查找和获取对应的IMPI。The guidance service server BSF searches and obtains the corresponding IMPI in the corresponding relationship according to the B-TID.

步骤301b.引导业务服务器BSF根据该IMPI和该NAF_Id查找对应的第三方用户标识。Step 301b. Guide the service server BSF to search for the corresponding third-party user identifier according to the IMPI and the NAF_Id.

在引导业务服务器BSF上存储有IMPI和NAF_Id与第三方用户标识的账户对应关系,即根据IMPI和NAF_Id在该账户对应关系中能够查找到对应的第三方用户标识。The account correspondence between the IMPI and NAF_Id and the third-party user identifier is stored on the guidance service server BSF, that is, the corresponding third-party user identifier can be found in the account correspondence according to the IMPI and NAF_Id.

引导业务服务器BSF根据该IMPI和该NAF_Id在该账户对应关系中查找对应的第三方用户标识。The guidance service server BSF searches for the corresponding third-party user identifier in the account correspondence according to the IMPI and the NAF_Id.

如果查找到对应的第三方用户标识,则说明引导业务服务器BSF已经为该IMPI创建了用于该NAF_Id的第三方用户标识,则引导业务服务器BSF获取对应的第三方用户标识,然后执行下述步骤302或步骤303。If the corresponding third-party user ID is found, it means that the guiding service server BSF has created a third-party user ID for the NAF_Id for the IMPI, then the guiding service server BSF obtains the corresponding third-party user ID, and then executes the following steps 302 or step 303.

如果没有查找到对应的第三方用户标识,则说明引导业务服务器BSF没有为该IMPI创建过用于该NAF_Id的第三方用户标识,则执行下述步骤301c。If the corresponding third-party user ID is not found, it means that the bootstrap service server BSF has not created a third-party user ID for the NAF_Id for the IMPI, and the following step 301c is executed.

步骤301c.引导业务服务器BSF创建一个唯一的第三方用户标识。Step 301c. Instruct the service server BSF to create a unique third-party user identifier.

引导业务服务器BSF创建一个新用户标识,该新用户标识是引导业务服务器BSF上所有的第三方用户标识中唯一的标识,也可以是在步骤301a所述的账户对应关系中该NAF_Id对应的所有第三方用户标识中唯一的标识,然后将该新用户标识作为第三方用户标识。Guiding the service server BSF to create a new user identity, the new user identity is the unique identity among all the third-party user identities on the guidance service server BSF, or can be all the corresponding NAF_Ids in the account corresponding relationship described in step 301a. The unique ID among the three-party user IDs, and then the new user ID is used as the third-party user ID.

步骤301d.引导业务服务器BSF建立和存储该IMPI和该NAF_Id与该第三方用户标识的对应关系。Step 301d. Guide the service server BSF to establish and store the correspondence between the IMPI and the NAF_Id and the third-party user identifier.

引导业务服务器BSF在步骤301a所述的账户对应关系中新增该IMPI和该NAF_Id与该第三方用户标识的对应关系,即根据该IMPI和该NAF_Id在该账户对应关系中将能查找和获取到该第三方用户标识。The guidance service server BSF adds the corresponding relationship between the IMPI and the NAF_Id and the third-party user identifier in the account corresponding relationship described in step 301a, that is, according to the IMPI and the NAF_Id in the account corresponding relationship, it will be able to find and obtain the This third-party user ID.

步骤301b、步骤301c和步骤301d,还可以是,引导业务服务器BSF预先建立有用于该NAF_Id的应用用户关系表,在该应用用户关系表中存储有IMPI与第三方用户标识的一一对应关系。引导业务服务器BSF根据该IMPI在该应用用户关系表中查找第三方用户标识,如果没有查找到第三方用户标识,则创建一个唯一的第三方用户标识,并且在该应用用户关系表中新增该IMPI和该第三方用户标识的一一对应关系,如果查找到第三方用户标识,则获取该第三方用户标识。In step 301b, step 301c and step 301d, the guidance service server BSF may pre-establish an application user relationship table for the NAF_Id, and the application user relationship table stores a one-to-one correspondence between IMPI and third-party user IDs. Guide the service server BSF to look up the third-party user ID in the application user relationship table according to the IMPI, and if no third-party user ID is found, create a unique third-party user ID, and add the third-party user ID to the application user relationship table. There is a one-to-one correspondence between the IMPI and the third-party user ID. If the third-party user ID is found, the third-party user ID is obtained.

步骤301b、步骤301c和步骤301d,还可以是,引导业务服务器BSF预先建立有用于该IMPI的移动用户关系表,在该移动用户关系表中存储有NAF_Id与第三方用户标识的一一对应关系。引导业务服务器BSF根据该NAF_Id在该移动用户关系表中查找第三方用户标识,如果没有查找到第三方用户标识,则创建一个唯一的第三方用户标识,并且在该移动用户关系表中新增该NAF_Id和该第三方用户标识的一一对应关系,如果查找到第三方用户标识,则获取该第三方用户标识。In step 301b, step 301c and step 301d, the guidance service server BSF may pre-establish a mobile user relationship table for the IMPI, and the mobile user relationship table stores a one-to-one correspondence between NAF_Id and third-party user ID. Guide the service server BSF to look up the third-party user ID in the mobile user relationship table according to the NAF_Id, and if no third-party user ID is found, create a unique third-party user ID, and add the third-party user ID to the mobile user relationship table. There is a one-to-one correspondence between NAF_Id and the third-party user ID. If the third-party user ID is found, the third-party user ID is obtained.

步骤302.可选的,引导业务服务器BSF基于第二主密钥Ks生成该第三方用户标识对应的第二用户密钥。Step 302. Optionally, guide the service server BSF to generate a second user key corresponding to the third-party user identifier based on the second master key Ks.

生成第二用户密钥,具体可以包括如下步骤:Generating the second user key may specifically include the following steps:

步骤302a.引导业务服务器BSF基于该第二主密钥Ks生成第二用户密钥。Step 302a. Guide the service server BSF to generate a second user key based on the second master key Ks.

引导业务服务器BSF基于该第二主密钥Ks生成第二用户密钥。The bootstrap service server BSF generates a second user key based on the second master key Ks.

进一步的,引导业务服务器BSF基于包括该第二主密钥Ks以及第三固定字符串(2)或/和第三随机字符串或/和第三时间戳或/和该B-TID或/和该NAF_Id或/和该第三方用户标识的信息生成第二用户密钥;其中,该第三固定字符串(2)为预先配置的并且与用户终端上预先配置的第三固定字符串(1)的值相同的字符串,该第三随机字符串为本地随机生成的字符串,该第三时间戳为通过获取引导业务服务器BSF的当前系统时间生成。具体地,以密钥派生算法公式为例,可以表示为:DK=PBKDF2(passphrase,Salt,c,dkLen),其中:DK是生成的第二用户密钥,PBKDF2是密钥派生算法,passphrase是该第二主密钥Ks以及第三固定字符串或/和第三随机字符串或/和第三时间戳或/和该B-TID或/和NAF_Id或/和该第三方用户标识组合拼接的字符串;Salt是盐值,在本例中是一个固定字符串;c是迭代次数;dkLen是密钥输出长度,可以根据需要生成符合要求的密钥长度。Further, the guidance service server BSF is based on including the second master key Ks and the third fixed character string (2) or/and the third random character string or/and the third time stamp or/and the B-TID or/and The NAF_Id or/and the information of the third-party user identification generates a second user key; wherein, the third fixed character string (2) is preconfigured and is the same as the third fixed character string (1) preconfigured on the user terminal The string with the same value of , the third random string is a locally randomly generated string, and the third timestamp is generated by acquiring the current system time of the bootstrap service server BSF. Specifically, taking the key derivation algorithm formula as an example, it can be expressed as: DK=PBKDF2(passphrase, Salt, c, dkLen), where: DK is the generated second user key, PBKDF2 is the key derivation algorithm, and passphrase is The second master key Ks and the third fixed string or/and the third random string or/and the third timestamp or/and the B-TID or/and the NAF_Id or/and the third-party user ID are combined String; Salt is the salt value, which is a fixed string in this example; c is the number of iterations; dkLen is the key output length, and a key length that meets the requirements can be generated as needed.

步骤302b.引导业务服务器BSF建立该第三方用户标识与该第二用户密钥的对应关系。Step 302b. Guide the service server BSF to establish a correspondence between the third-party user identifier and the second user key.

引导业务服务器BSF建立该第三方用户标识与该第二用户密钥的对应关系,以使得根据该第三方用户标识在该对应关系中能获取到对应的第二用户密钥。The guiding service server BSF establishes a corresponding relationship between the third-party user identifier and the second user key, so that the corresponding second user key can be obtained in the corresponding relationship according to the third-party user identifier.

如果该第三方用户标识是引导业务服务器BSF上所有的第三方用户标识中唯一的标识,则建立该第三方用户标识与该第二用户密钥的对应关系。If the third-party user identifier is a unique identifier among all the third-party user identifiers on the bootstrap service server BSF, a corresponding relationship between the third-party user identifier and the second user key is established.

如果该第三方用户标识是该NAF_Id对应的所有第三方用户标识中唯一的标识,则建立该第三方用户标识和该NAF_Id与该第二用户密钥的对应关系。If the third-party user identifier is the unique identifier among all the third-party user identifiers corresponding to the NAF_Id, a corresponding relationship between the third-party user identifier and the NAF_Id and the second user key is established.

例如,引导业务服务器BSF预先建立有用于该NAF_Id的账户密钥关系表,在该账户密钥关系表中存储有第三方用户标识与该第二用户密钥的一一对应关系。引导业务服务器BSF根据该第三方用户标识在该账户密钥关系表中查找第二用户密钥,如果没有查找到第二用户密钥,则在该账户密钥关系表中新增该第三方用户标识与该第二用户密钥的一一对应关系,如果查找到第二用户密钥,则在该账户密钥关系表中使用本步骤新生成的该第二用户密钥替换该第三方用户标识已有的用户密钥。For example, the bootstrap service server BSF pre-establishes an account-key relationship table for the NAF_Id, and the account-key relationship table stores a one-to-one correspondence between the third-party user ID and the second user key. Guide the service server BSF to search for the second user key in the account key relationship table according to the third party user identifier, and if the second user key is not found, then add the third party user in the account key relationship table The one-to-one correspondence between the identifier and the second user key, if the second user key is found, the third-party user identifier is replaced with the second user key newly generated in this step in the account key relationship table Existing user key.

以结合步骤301为例,如果在引导业务服务器BSF上预先建立用于该NAF_Id的应用用户关系表,或者如果在引导业务服务器BSF预先建立有用于该IMPI的移动用户关系表,则也可以在该应用用户关系表或移动用户关系表建立及更新该第三方用户标识与该第二用户密钥的一一对应关系,在此不再赘述。Taking combining step 301 as an example, if the application user relationship table for the NAF_Id is pre-established on the guidance service server BSF, or if the mobile user relationship table for the IMPI is pre-established on the guidance service server BSF, it can also be used in this The user relationship table or the mobile user relationship table is used to establish and update the one-to-one correspondence between the third-party user identifier and the second user key, which will not be repeated here.

需要说明的是,上述步骤302还可以在下述步骤303之后执行,本发明并不对此进行限定。It should be noted that, the above step 302 may also be executed after the following step 303, which is not limited in the present invention.

至此,引导业务服务器BSF建立了该第三方用户标识与该第二用户密钥的对应关系,引导业务服务器BSF可以本地存储该对应关系,或者将该对应关系同步发送给第三方认证服务器,或者将该对应关系同步发送给对应该NAF_Id的第三方应用服务器,从而使得第三方应用服务器可以基于该对应关系实现对第三方应用客户端的身份认证、数据加密等操作。So far, the guiding service server BSF has established the corresponding relationship between the third-party user identifier and the second user key, and the guiding service server BSF can store the corresponding relationship locally, or send the corresponding relationship to the third-party authentication server synchronously, or send the corresponding relationship to the third-party authentication server. The corresponding relationship is synchronously sent to the third-party application server corresponding to the NAF_Id, so that the third-party application server can implement operations such as identity authentication and data encryption for the third-party application client based on the corresponding relationship.

步骤303.引导业务服务器BSF将该第三方用户标识传递给用户终端。Step 303. Instruct the service server BSF to transfer the third-party user identifier to the user terminal.

引导业务服务器BSF将该第三方用户标识传递给用户终端,例如,在引导业务服务器BSF向用户终端发送的注册成功应答消息中,包括该第三方用户标识。The guiding service server BSF transmits the third-party user identifier to the user terminal. For example, the registration success response message sent by the guiding service server BSF to the user terminal includes the third-party user identifier.

与步骤302a相对应的,如果生成的第二用户密钥还包括第三随机字符串或/和第三时间戳,则还将该第三随机字符串或/和该第三时间戳传递给用户终端。Corresponding to step 302a, if the generated second user key further includes a third random string or/and a third timestamp, then the third random string or/and the third timestamp is also delivered to the user terminal.

步骤304.用户终端接收引导业务服务器BSF传递的该第三方用户标识。Step 304. The user terminal receives the third-party user identity transmitted by the bootstrap service server BSF.

用户终端接收引导业务服务器BSF传递的该第三方用户标识,例如,接收引导业务服务器BSF发送的注册成功应答消息,在该注册成功应答消息中获取该第三方用户标识。The user terminal receives the third-party user identifier transmitted by the bootstrap service server BSF, for example, receives a registration success response message sent by the bootstrap service server BSF, and obtains the third-party user ID in the registration success response message.

又例如,上述步骤303和304还可以是,用户终端与引导业务服务器BSF进行安全认证成功之后保持有会话状态或认证令牌,用户终端通过该会话状态或认证令牌向引导业务服务器BSF发送获取第三方用户标识的请求,引导业务服务器BSF反馈该第三方用户标识,用户终端接收并获取该第三方用户标识。For another example, the above steps 303 and 304 may also be that after the user terminal successfully performs security authentication with the guidance service server BSF, the user terminal maintains a session state or an authentication token, and the user terminal sends the obtained information to the guidance service server BSF through the session state or the authentication token. The request for the third-party user identification guides the service server BSF to feed back the third-party user identification, and the user terminal receives and obtains the third-party user identification.

在用户终端接收到该第三方用户标识之后,将该第三方用户标识传递给第三方应用客户端。如果实施了上述步骤302,则执行下述步骤305以生成第一用户密钥,并将该生成的第一用户密钥同时发送给对应的第三方应用客户端。After the user terminal receives the third-party user identification, it transfers the third-party user identification to the third-party application client. If the above step 302 is implemented, the following step 305 is performed to generate a first user key, and the generated first user key is sent to the corresponding third-party application client at the same time.

步骤305.可选的,用户终端使用和引导业务服务器BSF相同的用户密钥生成方式,基于第一主密钥Ks生成第一用户密钥。Step 305. Optionally, the user terminal generates the first user key based on the first master key Ks using the same user key generation method as the bootstrap service server BSF.

与上述步骤302相对应的,用户终端使用和引导业务服务器BSF相同的用户密钥生成方式,基于该第一主密钥Ks生成第一用户密钥。Corresponding to the above step 302, the user terminal generates the first user key based on the first master key Ks using the same user key generation method as the bootstrap service server BSF.

相应的,如果在步骤302中引导业务服务器BSF基于包括该第二主密钥Ks以及第三固定字符串(2)或/和第三随机字符串或/和第三时间戳或/和该B-TID或/和NAF_Id或/和该第三方用户标识的信息生成第二用户密钥,则用户终端基于包括该第一主密钥Ks以及第三固定字符串(1)或/和第三随机字符串或/和第三时间戳或/和该B-TID或/和NAF_Id或/和该第三方用户标识的信息生成第一用户密钥;其中,该第三固定字符串(1)为预先配置的并且与引导业务服务器BSF上预先配置的第三固定字符串(2)的值相同的字符串,该第三随机字符串或/和第三时间戳为引导业务服务器BSF所传递的。具体地,以使用和步骤502引导业务服务器BSF相同的密钥派生算法为例,密钥派生算法公式可以表示为DK=PBKDF2(passphrase,Salt,c,dkLen),其中:DK是生成的第一用户密钥;PBKDF2是与引导业务服务器BSF相同的密钥派生算法;passphrase是该第一主密钥Ks以及第三固定字符串(1)或/和第三随机字符串或/和第三时间戳或/和该B-TID或/和NAF_Id或/和该第三方用户标识组合拼接的字符串,并且组合拼接方式与引导业务服务器BSF一致;Salt是盐值,是一个与引导业务服务器BSF相同的固定字符串;c是与引导业务服务器BSF相同的迭代次数;dkLen是与引导业务服务器BSF相同的密钥输出长度。Correspondingly, if in step 302, the service server BSF is guided to include the second master key Ks and the third fixed character string (2) or/and the third random character string or/and the third time stamp or/and the B -TID or/and NAF_Id or/and the information of the third-party user identification to generate a second user key, then the user terminal is based on the information including the first master key Ks and the third fixed string (1) or/and the third random String or/and the third time stamp or/and the B-TID or/and NAF_Id or/and the information of the third-party user identification to generate the first user key; wherein, the third fixed string (1) is a A string that is configured and has the same value as the third fixed string (2) pre-configured on the bootstrap service server BSF, where the third random string or/and the third time stamp are transmitted by the bootstrap service server BSF. Specifically, taking the use of the same key derivation algorithm as that used to guide the service server BSF in step 502 as an example, the key derivation algorithm formula can be expressed as DK=PBKDF2(passphrase, Salt, c, dkLen), where: DK is the generated first User key; PBKDF2 is the same key derivation algorithm as the bootstrap service server BSF; passphrase is the first master key Ks and the third fixed string (1) or/and the third random string or/and the third time Stamp or/and the B-TID or/and NAF_Id or/and the third-party user ID combined and spliced string, and the combined splicing method is consistent with the guide service server BSF; Salt is the salt value, which is the same as the guide service server BSF The fixed string of ; c is the same number of iterations as the bootstrap service server BSF; dkLen is the same key output length as the bootstrap service server BSF.

至此,由于用户终端上生成的第一主密钥Ks和在引导业务服务器BSF上生成的第二主密钥Ks的值相同,并且由于第一用户密钥和第二用户密钥是使用相同的用户密钥生成方式、基于相同值的主密钥生成的,因此,第一用户密钥和第二用户密钥的值也是相同的。So far, since the value of the first master key Ks generated on the user terminal and the second master key Ks generated on the bootstrap service server BSF is the same, and since the first user key and the second user key are the same The user key is generated based on the master key with the same value. Therefore, the values of the first user key and the second user key are also the same.

用户终端将该第三方用户标识和该第一用户密钥传递给该NAF_Id对应的第三方应用客户端,第三方应用客户端将可以根据该第三方用户标识和该第一用户密钥向对应的第三方应用服务器进行身份认证、数据加密等操作;而由于第三方应用服务器与引导业务服务器BSF通过网络相连接,因此第三方应用服务器可以基于引导业务服务器BSF建立的第三方用户标识与第二用户密钥的对应关系实现对第三方应用客户端的身份认证、数据加密等操作。The user terminal transmits the third-party user identifier and the first user key to the third-party application client corresponding to the NAF_Id, and the third-party application client can send the corresponding data to the corresponding third-party user identifier and the first user key according to the third-party user identifier and the first user key. The third-party application server performs operations such as identity authentication and data encryption; and since the third-party application server is connected to the guidance service server BSF through the network, the third-party application server can communicate with the second user based on the third-party user identifier established by the guidance service server BSF. The correspondence between the keys realizes operations such as identity authentication and data encryption for third-party application clients.

如上流程,在基于GBA的客户端注册和密钥共享方法实施例一的基础上,本实施例中还进一步在用户终端和引导业务服务器BSF上为用户终端中运行的第三方应用客户端生成了第三方用户标识和用户密钥,不仅具有实施例一具有的效果,带来的效果至少还包括:第一方面,自动为第三方应用客户端获取第三方用户标识和对应的用户密钥,减少了终端用户的输入操作,提升了用户的使用体验;第二方面,用户终端中运行的第三方应用客户端将可以根据获取的第三方用户标识以及生成的用户密钥向对应的第三方应用服务器实现快捷、安全的身份认证、数据加密等操作;第三方面,由于引导业务服务器BSF是在确定用户终端安全认证成功之后,才生成用于第三方应用客户端的第三方用户标识和用户密钥,而不是响应于第三方应用服务器提交的B-TID生成应用密钥,有效解决了背景技术中的缺陷一,即GBA架构的第二个过程应用密钥协商过程中第三方应用服务器仿冒恶意请求消耗引导业务服务器BSF和其他第三方应用服务器的计算、存储资源的问题。As shown in the above process, on the basis of Embodiment 1 of the GBA-based client registration and key sharing method, in this embodiment, the user terminal and the guidance service server BSF are further generated for the third-party application client running in the user terminal. The third-party user ID and user key not only have the effects of the first embodiment, but also include at least the following effects: in the first aspect, the third-party user ID and the corresponding user key are automatically obtained for the third-party application client, reducing the number of In the second aspect, the third-party application client running in the user terminal can send the corresponding third-party application server to the corresponding third-party application server according to the obtained third-party user ID and the generated user key. Realize fast and safe identity authentication, data encryption and other operations; in the third aspect, since the guidance service server BSF only generates the third-party user ID and user key for the third-party application client after determining that the user terminal has been successfully authenticated, Instead of generating the application key in response to the B-TID submitted by the third-party application server, it effectively solves the first defect in the background technology, that is, the third-party application server in the second process of the GBA architecture application key negotiation process counterfeit malicious request consumption The problem of guiding the computing and storage resources of the business server BSF and other third-party application servers.

六、基于GBA的客户端注册和密钥共享方法实施例三VI. Embodiment 3 of the GBA-based Client Registration and Key Sharing Method

请参考图4,其示出了本发明提供的基于GBA的客户端注册和密钥共享方法实施例三的流程图,该方法可用于图1所示的实施环境中。作为基于基于GBA的客户端注册和密钥共享方法实施例一提供的更为优选的实施例,本实施例进一步为用户终端中运行的第三方应用客户端提供了注册信息,该注册信息包括应用密钥。Please refer to FIG. 4 , which shows a flowchart of Embodiment 3 of the GBA-based client registration and key sharing method provided by the present invention, and the method can be used in the implementation environment shown in FIG. 1 . As a more preferred embodiment provided by Embodiment 1 of the GBA-based client registration and key sharing method, this embodiment further provides registration information for the third-party application client running in the user terminal, where the registration information includes application key.

为了让引导业务服务器BSF为用户终端中运行的第三方应用客户端提供相应的注册信息和服务,则用户终端需将第三方应用客户端对应的NAF_Id传递给引导业务服务器BSF。具体实施方式可以参照上述基于GBA的客户端注册和密钥共享方法实施例二,在此不再赘述。In order for the guidance service server BSF to provide corresponding registration information and services for the third-party application client running in the user terminal, the user terminal needs to transmit the NAF_Id corresponding to the third-party application client to the guidance service server BSF. For specific embodiments, reference may be made to the second embodiment of the above-mentioned GBA-based client registration and key sharing method, which will not be repeated here.

在用户终端将NAF_Id传递给引导业务服务器BSF、以及引导业务服务器BSF确定安全认证成功之后,引导业务服务器BSF可以为用户终端中运行的第三方应用客户端提供包括应用密钥的注册信息,即本实施例的下述步骤应用在基于GBA的客户端注册和密钥共享方法实施例一之后。具体可以包括:After the user terminal transmits the NAF_Id to the bootstrap service server BSF, and the bootstrap service server BSF determines that the security authentication is successful, the bootstrap service server BSF can provide the third-party application client running in the user terminal with registration information including the application key, that is, the local The following steps of the embodiment are applied after the first embodiment of the GBA-based client registration and key sharing method. Specifically, it can include:

步骤401.引导业务服务器BSF基于该第二主密钥Ks生成第二应用密钥。Step 401. Guide the service server BSF to generate a second application key based on the second master key Ks.

引导业务服务器BSF使用密钥派生算法基于该第二主密钥Ks生成第二应用密钥,进一步的,引导业务服务器BSF使用密钥派生算法基于第二主密钥Ks以及和/或盐值、和/或RAND、和/或IMPI、和/或NAF_Id生成第二应用密钥。Guide the service server BSF to use a key derivation algorithm to generate a second application key based on the second master key Ks, and further guide the service server BSF to use a key derivation algorithm based on the second master key Ks and/or the salt value, and/or RAND, and/or IMPI, and/or NAF_Id to generate a second application key.

密钥派生算法公式可以表示为:Key=KDF(Ks,Salt,RAND,IMPI,NAF_Id)。其中,Key是第二应用密钥;Ks是该第二主密钥Ks;Salt是盐值,该盐值可以是一个固定字符串,也可以是一个随机值,当是一个随机值时,则引导业务服务器BSF须将该值传递给用户终端;RAND是B-TID对应的RAND;IMPI是B-TID对应的IMPI;NAF_Id是从客户端注册请求中获取的NAF_Id;KDF是密钥派生算法。Ks是必选参数,Salt、RAND、IMPI、NAF_Id是可选参数。The key derivation algorithm formula can be expressed as: Key=KDF(Ks, Salt, RAND, IMPI, NAF_Id). Among them, Key is the second application key; Ks is the second master key Ks; Salt is the salt value, which can be a fixed string or a random value. When it is a random value, then The bootstrap service server BSF shall pass this value to the user terminal; RAND is the RAND corresponding to the B-TID; IMPI is the IMPI corresponding to the B-TID; NAF_Id is the NAF_Id obtained from the client registration request; KDF is the key derivation algorithm. Ks is a required parameter, and Salt, RAND, IMPI, and NAF_Id are optional parameters.

以使用密钥派生算法公式Key=KDF(Ks,"gba-me",RAND,IMPI,NAF_Id)为例,第二应用密钥生成步骤如下:Taking the key derivation algorithm formula Key=KDF(Ks,"gba-me",RAND,IMPI,NAF_Id) as an example, the second application key generation steps are as follows:

步骤401a.引导业务服务器BSF根据该B-TID获取对应的IMPI。Step 401a. Guide the service server BSF to obtain the corresponding IMPI according to the B-TID.

在成功执行GBA初始化过程之后,在引导业务服务器BSF上存储有B-TID与IMPI的对应关系,即根据B-TID能查找和获取对应的IMPI。After the GBA initialization process is successfully performed, the corresponding relationship between the B-TID and the IMPI is stored on the bootstrap service server BSF, that is, the corresponding IMPI can be searched and acquired according to the B-TID.

引导业务服务器BSF根据该B-TID在该对应关系中查找和获取对应的IMPI。The guidance service server BSF searches and obtains the corresponding IMPI in the corresponding relationship according to the B-TID.

步骤401b.引导业务服务器BSF根据该B-TID获取RAND。Step 401b. Guide the service server BSF to obtain the RAND according to the B-TID.

在GBA初始化过程之后,在引导业务服务器BSF上存储有B-TID与RAND的对应关系,即根据B-TID能查找和获取对应的RAND。After the GBA initialization process, the corresponding relationship between the B-TID and the RAND is stored on the bootstrap service server BSF, that is, the corresponding RAND can be searched and acquired according to the B-TID.

引导业务服务器BSF根据该B-TID在该对应关系中查找和获取对应的RAND。The guidance service server BSF searches and obtains the corresponding RAND in the corresponding relationship according to the B-TID.

另外,由于B-TID的生成格式为“base64encode(RAND)@BSF_servers_domain_name”,因此,也可以从该B-TID中获取对应的RAND。In addition, since the generation format of the B-TID is "base64encode(RAND)@BSF_servers_domain_name", the corresponding RAND can also be obtained from the B-TID.

步骤401c.引导业务服务器BSF基于该第二主密钥Ks以及"gba-me"、该RAND、该IMPI和该NAF_Id生成第二应用密钥。Step 401c. Guide the service server BSF to generate a second application key based on the second master key Ks and "gba-me", the RAND, the IMPI and the NAF_Id.

引导业务服务器BSF基于该第二主密钥Ks以及"gba-me"、该RAND、该IMPI和该NAF_Id生成第二应用密钥,计算公式为:The bootstrap service server BSF generates a second application key based on the second master key Ks and "gba-me", the RAND, the IMPI and the NAF_Id, and the calculation formula is:

Key=KDF(Ks,"gba-me",RAND,IMPI,NAF_Id)Key=KDF(Ks,"gba-me",RAND,IMPI,NAF_Id)

步骤402.引导业务服务器BSF建立该B-TID和该NAF_Id与该第二应用密钥的对应关系。Step 402. Guide the service server BSF to establish the corresponding relationship between the B-TID and the NAF_Id and the second application key.

引导业务服务器BSF建立该B-TID和该NAF_Id与该第二应用密钥的对应关系,以使得根据该B-TID和该NAF_Id能查找到该第二应用密钥。The bootstrap service server BSF establishes a correspondence between the B-TID and the NAF_Id and the second application key, so that the second application key can be found according to the B-TID and the NAF_Id.

例如,引导业务服务器BSF预先建立有用于该NAF_Id的账户密钥关系表,在该账户密钥关系表中存储有B-TID和第二应用密钥的一一对应关系。引导业务服务器BSF根据该B-TID在该账户密钥关系表中查找第二应用密钥,如果没有查找到第二应用密钥,则在该账户密钥关系表中新增该B-TID和该第二应用密钥的一一对应关系,如果查找到第二应用密钥,则在该账户密钥关系表中使用本次新生成的该第二应用密钥替换该B-TID已有的第二应用密钥。For example, the bootstrap service server BSF pre-establishes an account-key relationship table for the NAF_Id, and the account-key relationship table stores a one-to-one correspondence between the B-TID and the second application key. Guide the service server BSF to search for the second application key in the account key relationship table according to the B-TID, if the second application key is not found, then add the B-TID and the account key relationship table in the account key relationship table. The one-to-one correspondence of the second application key, if the second application key is found, the new second application key generated this time is used in the account key relationship table to replace the existing B-TID The second application key.

需要说明的是,上述步骤401和步骤402还可以在下述步骤403之后执行,本发明并不对此进行限定。It should be noted that, the above steps 401 and 402 may also be executed after the following step 403, which is not limited in the present invention.

步骤403.引导业务服务器BSF向用户终端发送注册应答消息,该注册应答消息是注册成功应答消息。Step 403. The guiding service server BSF sends a registration response message to the user terminal, where the registration response message is a registration success response message.

与步骤401相对应的,如果生成第二应用密钥的参数还包括Salt盐值,向用户终端发送该注册成功应答消息,还包括该Salt盐值。Corresponding to step 401, if the parameter for generating the second application key also includes the Salt value, the registration success response message is sent to the user terminal, including the Salt value.

步骤404.用户终端接收引导业务服务器BSF发送的注册应答消息并执行相应的操作。Step 404. The user terminal receives the registration response message sent by the bootstrap service server BSF and performs corresponding operations.

用户终端接收引导业务服务器BSF发送的注册应答消息,该注册应答消息是注册成功应答消息。The user terminal receives a registration response message sent by the bootstrap service server BSF, where the registration response message is a registration success response message.

用户终端根据该客户端注册应答消息执行相应的操作,包括:The user terminal performs corresponding operations according to the client registration response message, including:

如果该注册应答消息是注册成功应答消息,则执行下述步骤405。If the registration response message is a registration success response message, the following step 405 is performed.

否则,则不执行下述步骤。Otherwise, the following steps are not performed.

步骤405.用户终端使用和引导业务服务器BSF相同的应用密钥生成方式,基于该第一主密钥Ks生成第一应用密钥。Step 405. The user terminal uses the same application key generation method as the bootstrap service server BSF, and generates a first application key based on the first master key Ks.

用户终端使用和引导业务服务器BSF相同的应用密钥生成方式,基于该第一主密钥Ks生成第一应用密钥。The user terminal generates the first application key based on the first master key Ks using the same application key generation method as the bootstrap service server BSF.

以步骤401中引导业务服务器BSF使用的密钥派生算法公式为例:Key=KDF(Ks,Salt,RAND,IMPI,NAF_Id)。其中:Key是第一应用密钥;Ks是该第一主密钥Ks;Salt是与引导业务服务器BSF相同的盐值,如果引导业务服务器BSF的盐值是一个固定字符串,则Salt是一个相同的固定字符串,如果引导业务服务器BSF的盐值是一个随机值,则用户终端接收引导业务服务器BSF传递的该盐值;RAND是GBA初始化过程中生成的RAND;IMPI是该用户终端的IMPI;NAF_Id是该第三方应用客户端对应的NAF_Id;KDF是与引导业务服务器BSF相同的密钥派生算法。Ks是必选参数,Salt、RAND、IMPI、NAF_Id是可选参数,并且选择的可选参数与引导业务服务器BSF一致。Take the key derivation algorithm formula used by the guiding service server BSF in step 401 as an example: Key=KDF(Ks, Salt, RAND, IMPI, NAF_Id). Among them: Key is the first application key; Ks is the first master key Ks; Salt is the same salt value as the bootstrap service server BSF, if the salt value of the bootstrap service server BSF is a fixed string, then Salt is a The same fixed string, if the salt value of the bootstrap service server BSF is a random value, the user terminal receives the salt value transmitted by the bootstrap service server BSF; RAND is the RAND generated during the GBA initialization process; IMPI is the IMPI of the user terminal ; NAF_Id is the NAF_Id corresponding to the third-party application client; KDF is the same key derivation algorithm as the bootstrap service server BSF. Ks is a mandatory parameter, Salt, RAND, IMPI, and NAF_Id are optional parameters, and the selected optional parameters are consistent with the bootstrap service server BSF.

相应地,以步骤401中引导业务服务器BSF使用的密钥派生算法公式Key=KDF(Ks,"gba-me",RAND,IMPI,NAF_Id)为例,第一应用密钥生成步骤如下:Correspondingly, taking the key derivation algorithm formula Key=KDF(Ks, "gba-me", RAND, IMPI, NAF_Id) used by the guiding service server BSF in step 401 as an example, the first application key generation step is as follows:

步骤405a.用户终端获取用户终端的IMPI。Step 405a. The user terminal obtains the IMPI of the user terminal.

用户终端获取用户终端的IMPI,该IMPI与GBA初始化过程中获取的IMPI是相同的IMPI。例如,使用与GBA初始化过程中一致的方法从IP多媒体服务识别模块(ISIM,IPMultimedia Services Identity Module)中获取IMPI。The user terminal acquires the IMPI of the user terminal, which is the same IMPI as the IMPI acquired in the GBA initialization process. For example, the IMPI is obtained from an IP Multimedia Services Identity Module (ISIM, IP Multimedia Services Identity Module) using a method consistent with the GBA initialization process.

步骤405b.用户终端获取RAND。Step 405b. The user terminal obtains the RAND.

在GBA初始化过程之后,在用户终端上存储有B-TID及对应的RAND,用户终端获取该RAND。After the GBA initialization process, the B-TID and the corresponding RAND are stored on the user terminal, and the user terminal obtains the RAND.

另外,由于B-TID的生成格式为“base64encode(RAND)@BSF_servers_domain_name”,因此,也可以从该B-TID中获取对应的RAND。In addition, since the generation format of the B-TID is "base64encode(RAND)@BSF_servers_domain_name", the corresponding RAND can also be obtained from the B-TID.

步骤405c.用户终端基于第一主密钥Ks以及"gba-me"、该RAND、该IMPI和该NAF_Id生成第一应用密钥。Step 405c. The user terminal generates a first application key based on the first master key Ks and "gba-me", the RAND, the IMPI and the NAF_Id.

用户终端基于第一主密钥Ks以及"gba-me"、该RAND、该IMPI和该NAF_Id生成第二应用密钥,计算公式为:The user terminal generates a second application key based on the first master key Ks and "gba-me", the RAND, the IMPI and the NAF_Id, and the calculation formula is:

Key=KDF(Ks,"gba-me",RAND,IMPI,NAF_Id)Key=KDF(Ks,"gba-me",RAND,IMPI,NAF_Id)

至此,由于在成功执行GBA初始化过程之后,在用户终端上存储的B-TID及对应的RAND、Ks(即第一主密钥Ks)与引导业务服务器BSF上存储的该B-TID对应的RAND、Ks(即第二主密钥Ks)是相同的,而用户终端上获取的IMPI和引导业务服务器BSF上存储的该B-TID对应的IMPI是相同的,又由于用户终端和引导业务服务器BSF使用的是相同的应用密钥生成方式、相同的NAF_Id、相同的盐值,则生成的第一应用密钥和第二应用密钥的值是相同的。用户终端将该B-TID和第一应用密钥传递给NAF_Id对应的第三方应用客户端,第三方应用客户端基于该B-TID和第一应用密钥,将可以向第三方应用服务器实现快捷、安全的身份认证、数据加密等操作;而由于第三方应用服务器与引导业务服务器BSF通过网络相连接,因此第三方应用服务器可以基于引导业务服务器BSF建立的B-TID和NAF_Id与第二应用密钥的对应关系,从而实现对第三方应用客户端的身份认证、数据加密等操作。So far, after the GBA initialization process is successfully performed, the B-TID and the corresponding RAND, Ks (ie the first master key Ks) stored on the user terminal and the RAND corresponding to the B-TID stored on the boot service server BSF , Ks (that is, the second master key Ks) are the same, and the IMPI obtained on the user terminal and the IMPI corresponding to the B-TID stored on the guidance service server BSF are the same, and because the user terminal and the guidance service server BSF If the same application key generation method, the same NAF_Id, and the same salt value are used, the values of the generated first application key and the second application key are the same. The user terminal transmits the B-TID and the first application key to the third-party application client corresponding to the NAF_Id, and the third-party application client can implement a shortcut to the third-party application server based on the B-TID and the first application key , safe identity authentication, data encryption and other operations; and because the third-party application server is connected with the guidance service server BSF through the network, the third-party application server can be based on the B-TID and NAF_Id established by the guidance service server BSF. The corresponding relationship of the key, so as to realize the identity authentication and data encryption of the third-party application client.

如上流程,在基于GBA的客户端注册和密钥共享方法实施例一的基础上,本实施例中还进一步在用户终端和引导业务服务器BSF上为用户终端中运行的第三方应用客户端生成了应用密钥,不仅具有实施例一具有的效果,带来的效果至少还包括:第一方面,由于引导业务服务器BSF是在确定用户终端安全认证成功之后,才生成用于第三方应用客户端的应用密钥,而不是响应于第三方应用服务器提交的B-TID生成应用密钥,有效解决了背景技术中的缺陷一,即GBA架构的第二个过程应用密钥协商过程中第三方应用服务器仿冒恶意请求消耗引导业务服务器BSF和其他第三方应用服务器的计算、存储资源的问题;第二方面,即使是在同一GBA初始化过程之后为同一第三方应用客户端执行多次提供应用密钥的过程,如果Salt使用的是随机值,则生成的应用密钥也不相同,从而提高安全性;第三方面,可以自动为第三方应用客户端获取应用密钥,该应用密钥将可以用于第三方应用客户端向对应的第三方应用服务器的身份认证、数据加密等操作,减少了终端用户的输入操作,提升了用户的使用体验。As shown in the above process, on the basis of Embodiment 1 of the GBA-based client registration and key sharing method, in this embodiment, the user terminal and the guidance service server BSF are further generated for the third-party application client running in the user terminal. The application key not only has the effects of the first embodiment, but also has the following effects: first, since the bootstrap service server BSF generates an application for the third-party application client after determining that the security authentication of the user terminal is successful Instead of generating the application key in response to the B-TID submitted by the third-party application server, it effectively solves the defect one in the background technology, that is, the third-party application server counterfeiting in the second process of the GBA architecture application key negotiation process Malicious requests consume the computing and storage resources of the bootstrap service server BSF and other third-party application servers; secondly, even after the same GBA initialization process is performed for the same third-party application client to provide the application key multiple times, If Salt uses a random value, the generated application key will also be different, thereby improving security; thirdly, the application key can be automatically obtained for the third-party application client, and the application key can be used for third-party applications. The operation of identity authentication and data encryption of the application client to the corresponding third-party application server reduces the input operation of the end user and improves the user experience.

七、基于GBA的客户端注册和密钥共享方法实施例四7. Embodiment 4 of the GBA-based client registration and key sharing method

请参考图5,其示出了本发明提供的基于GBA的客户端注册和密钥共享方法实施例四的流程图,该方法可用于图1所示的实施环境中。作为基于基于GBA的客户端注册和密钥共享方法实施例一提供的更为优选的实施例,本实施例进一步为用户终端中运行的第三方应用客户端提供了注册信息,该注册信息包括为用户终端中运行的第三方应用客户端生成用户令牌。Please refer to FIG. 5 , which shows a flowchart of Embodiment 4 of the GBA-based client registration and key sharing method provided by the present invention, and the method can be used in the implementation environment shown in FIG. 1 . As a more preferred embodiment provided by Embodiment 1 of the GBA-based client registration and key sharing method, this embodiment further provides registration information for the third-party application client running in the user terminal, and the registration information includes: The third-party application client running in the user terminal generates the user token.

为了让引导业务服务器BSF为用户终端中运行的第三方应用客户端提供相应的注册信息和服务,则用户终端需将第三方应用客户端对应的NAF_Id传递给引导业务服务器BSF。具体实施方式可以参照上述基于GBA的客户端注册和密钥共享方法实施例二,在此不再赘述。In order for the guidance service server BSF to provide corresponding registration information and services for the third-party application client running in the user terminal, the user terminal needs to transmit the NAF_Id corresponding to the third-party application client to the guidance service server BSF. For specific embodiments, reference may be made to the second embodiment of the above-mentioned GBA-based client registration and key sharing method, which will not be repeated here.

在用户终端将NAF_Id传递给引导业务服务器BSF、以及引导业务服务器BSF确定安全认证成功之后,引导业务服务器BSF可以为用户终端中运行的第三方应用客户端提供包括用户令牌的注册信息,即本实施例的下述步骤应用在基于GBA的客户端注册和密钥共享方法实施例一之后。具体可以包括:After the user terminal transmits the NAF_Id to the bootstrap service server BSF, and the bootstrap service server BSF determines that the security authentication is successful, the bootstrap service server BSF can provide the third-party application client running in the user terminal with registration information including the user token, that is, this The following steps of the embodiment are applied after the first embodiment of the GBA-based client registration and key sharing method. Specifically, it can include:

步骤501.引导业务服务器BSF生成用户令牌。Step 501. Guide the service server BSF to generate a user token.

引导业务服务器BSF生成用户令牌,该用户令牌是唯一的,并且具有足够的长度和足够的随机性,使得难以被猜测破解。The business server BSF is guided to generate a user token that is unique and of sufficient length and randomness to be difficult to crack by guessing.

步骤502.引导业务服务器BSF将该用户令牌与该NAF_Id或/和该B-TID对应的IMPI相关联。Step 502. Direct the service server BSF to associate the user token with the NAF_Id or/and the IMPI corresponding to the B-TID.

引导业务服务器BSF建立该用户令牌与该NAF_Id的关联关系,引导业务服务器BSF可以本地存储该关联关系,或者将该关联关系同步发送给第三方认证服务器,或者将该关联关系同步发送给该NAF_Id对应的第三方应用服务器。然后,基于该关联关系,如果运行在用户终端的第三方应用客户端有相同的用户令牌,第三方应用服务器将可以根据该关联关系实现对第三方应用客户端的认证,例如,以将该用户令牌同步发送给该NAF_Id对应的第三方应用服务器为例,该第三方应用服务器接收第三方应用客户端发送的包括用户令牌的认证请求,在该关联关系中查找是否有该用户令牌,若有,则认证成功,从而可确定发送该认证请求的发送方是该第三方应用服务器对应的第三方应用客户端;又例如,以将该关联关系同步发送给第三方认证服务器为例,第三方应用服务器在接收到第三方应用客户端发送的包括用户令牌的认证请求之后,将该认证请求转发给第三方认证服务器,由第三方认证服务器根据该关联关系对该认证请求进行验证,从而确定认证是否成功。The guidance service server BSF establishes the association relationship between the user token and the NAF_Id, and the guidance service server BSF may store the association relationship locally, or send the association relationship to a third-party authentication server synchronously, or synchronously send the association relationship to the NAF_Id The corresponding third-party application server. Then, based on the association relationship, if the third-party application client running on the user terminal has the same user token, the third-party application server will be able to authenticate the third-party application client according to the association relationship, for example, to authenticate the user For example, the token is sent to the third-party application server corresponding to the NAF_Id synchronously. The third-party application server receives the authentication request including the user token sent by the third-party application client, and checks whether the user token exists in the association relationship. If so, the authentication is successful, so it can be determined that the sender of the authentication request is the third-party application client corresponding to the third-party application server; for another example, taking the synchronous sending of the association relationship to the third-party authentication server as an example, the third After receiving the authentication request including the user token sent by the third-party application client, the third-party application server forwards the authentication request to the third-party authentication server, and the third-party authentication server verifies the authentication request according to the association relationship, thereby Determine if authentication was successful.

进一步的,为了给同一用户提供持续的应用服务,还应当建立该用户令牌与该B-TID对应的IMPI的关联关系,以使得能根据该用户令牌能查找到该B-TID对应的IMPI,从而为同一用户提供持续的服务。例如,以将该关联关系同步发送给该NAF_Id对应的第三方应用服务器为例,该第三方应用服务器接收包括用户令牌的认证请求,根据该用户令牌在该关联关系中查找对应的IMPI,若查找到,则可以向该IMPI关联的用户提供持续的应用服务。获取该B-TID对应的IMPI的实施方式,可以参照上述步骤401a中的实施方式,在此不再赘述。Further, in order to provide the same user with continuous application services, an association relationship between the user token and the IMPI corresponding to the B-TID should also be established, so that the IMPI corresponding to the B-TID can be found according to the user token. , so as to provide continuous service for the same user. For example, taking the association relationship synchronously sent to the third-party application server corresponding to the NAF_Id as an example, the third-party application server receives the authentication request including the user token, and searches for the corresponding IMPI in the association relationship according to the user token, If found, a continuous application service can be provided to the user associated with the IMPI. For the implementation manner of acquiring the IMPI corresponding to the B-TID, reference may be made to the implementation manner in the foregoing step 401a, which will not be repeated here.

进一步的,为了不致于在第三方应用服务器上泄露IMPI,还可以预先创建一个与该IMPI对应的唯一用户标识,再建立该用户令牌与该NAF_Id和该唯一用户标识的关联关系,根据该IMPI在该关联关系中获取该唯一用户标识,从而避免用户的IMPI泄露给第三方应用服务器。Further, in order not to leak the IMPI on the third-party application server, a unique user ID corresponding to the IMPI can also be created in advance, and then the association relationship between the user token and the NAF_Id and the unique user ID can be established. According to the IMPI The unique user identifier is obtained in the association relationship, thereby avoiding leakage of the user's IMPI to a third-party application server.

需要说明的是,还应当提供清理机制,对于已经失效的用户令牌应当及时清理相应的关联关系,例如在用户令牌验证一次后删除该用户令牌相应的关联关系,或者给用户令牌设定一个有效期,依据有效期及时删除已过有效期的用户令牌相应的关联关系。具体清理机制在此不赘述。It should be noted that a clean-up mechanism should also be provided, and the corresponding association relationship should be cleaned up in time for the expired user token, for example, after the user token is verified once, the corresponding association relationship of the user token should be deleted, or the user token should be set. Set a validity period, and delete the corresponding association relationship of the user token that has passed the validity period in time according to the validity period. The specific cleaning mechanism is not described here.

步骤503.引导业务服务器BSF向用户终端发送注册应答消息,该注册应答消息是注册成功应答消息,并且包括该用户令牌。Step 503. The guiding service server BSF sends a registration response message to the user terminal, where the registration response message is a registration success response message and includes the user token.

步骤504.用户终端接收引导业务服务器BSF发送的注册应答消息并执行相应的操作。Step 504. The user terminal receives the registration response message sent by the bootstrap service server BSF and performs corresponding operations.

用户终端接收引导业务服务器BSF发送的注册应答消息,该注册应答消息是注册成功应答消息。The user terminal receives a registration response message sent by the bootstrap service server BSF, where the registration response message is a registration success response message.

用户终端根据该注册应答消息执行相应的操作,包括:The user terminal performs corresponding operations according to the registration response message, including:

如果该注册应答消息是注册成功应答消息,则获取该注册成功应答消息中的用户令牌,并且将该用户令牌传递给NAF_Id对应的第三方应用客户端,第三方应用客户端基于该用户令牌,将可以向第三方应用服务器实现认证鉴权。If the registration response message is a registration success response message, the user token in the registration success response message is obtained, and the user token is passed to the third-party application client corresponding to the NAF_Id, and the third-party application client is based on the user token. card, will be able to achieve authentication and authentication to the third-party application server.

否则,则结束本流程。Otherwise, the process ends.

如上实施例过程,为用户终端中运行的第三方应用客户端生成了用户令牌。带来的效果包括:第一方面,自动为第三方应用客户端获取用户令牌,减少了终端用户的输入操作,提升了用户的使用体验;第二方面,该用户令牌将可以用于第三方应用客户端向对应的第三方应用服务器的认证鉴权,从而提升用户的使用体验;第三方面,在用于认证鉴权时,该用户令牌由于不需要进行加密计算等操作,因此,更适用于一些轻量级的应用客户端(如基于HTML5、JavaScript的客户端程序);第四方面,由于引导业务服务器BSF是在确定用户终端安全认证成功之后,才生成用于第三方应用客户端的用户令牌,而不是响应于第三方应用服务器提交的B-TID生成应用密钥,有效解决了背景技术中的缺陷一。In the process of the above embodiment, a user token is generated for the third-party application client running in the user terminal. The effects include: firstly, the user token is automatically obtained for the third-party application client, which reduces the input operation of the end user and improves the user experience; secondly, the user token can be used for the third-party application client. The third-party application client authenticates the corresponding third-party application server, thereby improving the user experience; thirdly, when used for authentication and authentication, the user token does not need to perform encryption calculations and other operations, so it is more convenient to use. Applicable to some lightweight application clients (such as HTML5 and JavaScript-based client programs); in the fourth aspect, since the bootstrap service server BSF determines that the security authentication of the user terminal is successful, it generates a third-party application client Instead of generating the application key in response to the B-TID submitted by the third-party application server, the user token is used to effectively solve the first defect in the background art.

八、基于GBA的客户端注册和密钥共享方法实施例五8. Embodiment 5 of the method for client registration and key sharing based on GBA

请参考图6,其示出了本发明提供的基于GBA的客户端注册和密钥共享方法实施例五的流程图,该方法可用于图1所示的实施环境中。作为基于基于GBA的客户端注册和密钥共享方法实施例二提供的更为优选的实施例,本实施例还进一步实现了终端用户的授权确认过程。Please refer to FIG. 6 , which shows a flowchart of Embodiment 5 of the GBA-based client registration and key sharing method provided by the present invention, and the method can be used in the implementation environment shown in FIG. 1 . As a more preferred embodiment provided by Embodiment 2 of the GBA-based client registration and key sharing method, this embodiment further implements the authorization confirmation process of the terminal user.

该方法的下述步骤在基于GBA的客户端注册和密钥共享方法实施例二的基础上,应用在用户终端将NAF_Id传递给引导业务服务器BSF、以及引导业务服务器BSF确定安全认证成功之后,以及应用在引导业务服务器BSF为用户终端中运行的第三方应用客户端提供包括第三方用户标识和用户密钥的注册信息的过程之前(即步骤301之前),具体包括如下几个步骤:The following steps of the method are based on the second embodiment of the GBA-based client registration and key sharing method, and are applied after the user terminal transmits the NAF_Id to the bootstrap service server BSF, and the bootstrap service server BSF determines that the security authentication is successful, and Before the process of guiding the service server BSF to provide the registration information including the third-party user ID and the user key for the third-party application client running in the user terminal (that is, before step 301), it specifically includes the following steps:

步骤a.引导业务服务器BSF向用户终端发送应用授权请求消息。Step a. Guide the service server BSF to send an application authorization request message to the user terminal.

该应用授权请求消息中可以包括:The application authorization request message may include:

或/和第三方应用名称,该名称是用于识别第三方应用客户端和第三方应用服务器的名称,在引导业务服务器BSF上预先存储有NAF_Id和第三方应用名称的对应关系,引导业务服务器BSF根据NAF_Id在该对应关系中查找和获取对应的第三方应用名称。Or/and the name of the third-party application, which is the name used to identify the third-party application client and the third-party application server, and the corresponding relationship between the NAF_Id and the name of the third-party application is pre-stored on the guidance service server BSF, and the guidance service server BSF Find and obtain the corresponding third-party application name in the corresponding relationship according to the NAF_Id.

或/和移动用户名称,该名称是用于识别移动用户的名称,在引导业务服务器BSF上预先存储有IMPI和移动用户名称的对应关系,引导业务服务器BSF根据IMPI在该对应关系中查找和获取对应的移动用户名称。IMPI由引导业务服务器BSF根据B-TID获取:在GBA初始化过程之后,在引导业务服务器BSF上存储有B-TID与IMPI的对应关系,即根据B-TID能查找和获取对应的IMPI,引导业务服务器BSF根据该B-TID在该对应关系中查找和获取对应的IMPI。Or/and the mobile user name, this name is the name used to identify the mobile user, the corresponding relationship between IMPI and the mobile user name is pre-stored on the guiding service server BSF, and the guiding service server BSF searches and obtains in this corresponding relationship according to the IMPI The corresponding mobile user name. The IMPI is obtained by the guidance service server BSF according to the B-TID: after the GBA initialization process, the corresponding relationship between the B-TID and the IMPI is stored on the guidance service server BSF, that is, the corresponding IMPI can be searched and obtained according to the B-TID, and the guidance service The server BSF searches and obtains the corresponding IMPI in the corresponding relationship according to the B-TID.

相应地,用户终端接收引导业务服务器BSF发送的应用授权请求消息。Correspondingly, the user terminal receives the application authorization request message sent by the bootstrap service server BSF.

步骤b.用户终端显示应用授权验证界面。Step b. The user terminal displays an application authorization verification interface.

用户终端接收到引导业务服务器BSF发送的应用授权请求消息之后,调用并显示应用授权验证界面,以询问终端用户是否同意向该第三方应用授权。After receiving the application authorization request message sent by the guidance service server BSF, the user terminal invokes and displays the application authorization verification interface to ask the terminal user whether to authorize the third-party application.

在显示的应用授权验证界面上,可以显示应用授权请求消息中所包括的第三方应用名称或/和移动用户名称,具体为:On the displayed application authorization verification interface, the third-party application name or/and mobile user name included in the application authorization request message can be displayed, specifically:

第三方应用名称,即将要授权的第三方应用客户端和第三方应用服务器的名称;The name of the third-party application, the names of the third-party application client and the third-party application server to be authorized;

移动用户名称,即将要授权的移动用户名称。Mobile user name, the name of the mobile user to be authorized.

在显示应用授权验证界面之后,终端用户可以输入表示确认授权或者表示取消授权的授权信息。After the application authorization verification interface is displayed, the end user can input authorization information indicating confirmation of authorization or cancellation of authorization.

可选地,在显示的应用授权验证界面上,还可以包括安全验证码输入框,以询问终端用户输入安全验证码。该安全验证码用于进一步地验证终端用户的授权,相应地,在引导业务服务器BSF上预先存储有B-TID和安全验证码的对应关系。Optionally, on the displayed application authorization verification interface, a security verification code input box may also be included to ask the terminal user to input the security verification code. The security verification code is used to further verify the authorization of the terminal user. Accordingly, the corresponding relationship between the B-TID and the security verification code is pre-stored on the guidance service server BSF.

步骤c.用户终端接收终端用户在应用授权验证界面中输入的授权信息。Step c. The user terminal receives the authorization information input by the terminal user in the application authorization verification interface.

用户根据显示的应用授权验证界面,在该界面中输入(包括触发)表示确认授权或取消授权的授权信息。相应地,用户终端接收用户在应用授权验证界面中输入的授权信息。According to the displayed application authorization verification interface, the user inputs (including triggering) authorization information indicating confirmation of authorization or cancellation of authorization in the interface. Correspondingly, the user terminal receives the authorization information input by the user in the application authorization verification interface.

步骤d.用户终端向引导业务服务器BSF发送应用授权应答消息,该应用授权应答消息是应用授权确认消息或者是应用授权取消消息。Step d. The user terminal sends an application authorization response message to the guidance service server BSF, where the application authorization response message is an application authorization confirmation message or an application authorization cancellation message.

用户终端根据终端用户输入的授权信息执行相应的操作,包括:The user terminal performs corresponding operations according to the authorization information input by the terminal user, including:

如果授权信息是表示确认授权的授权信息,则用户终端向引导业务服务器BSF发送的应用授权应答消息是应用授权确认消息。If the authorization information is the authorization information indicating the authorization confirmation, the application authorization response message sent by the user terminal to the bootstrap service server BSF is the application authorization confirmation message.

可选地,如果在显示的应用授权验证界面上还包括安全验证码输入框,并且用户终端接收的终端用户输入的授权消息中包括安全验证码,则用户终端向引导业务服务器BSF发送的应用授权确认消息中还包括该安全验证码。Optionally, if the displayed application authorization verification interface also includes a security verification code input box, and the authorization message input by the terminal user received by the user terminal includes the security verification code, then the user terminal authorizes the application sent by the guiding service server BSF. The confirmation message also includes the security verification code.

如果授权信息是表示取消授权的授权信息,则用户终端向引导业务服务器BSF发送的应用授权应答消息是应用授权取消消息。If the authorization information is authorization information indicating cancellation of authorization, the application authorization response message sent by the user terminal to the guidance service server BSF is an application authorization cancellation message.

步骤e.引导业务服务器BSF接收用户终端发送的应用授权应答消息并执行相应的操作。Step e. Guide the service server BSF to receive the application authorization response message sent by the user terminal and perform corresponding operations.

引导业务服务器BSF接收用户终端发送的应用授权应答消息,该应用授权应答消息是表示确认授权或者是表示取消授权的应用授权应答消息。The bootstrap service server BSF receives an application authorization response message sent by the user terminal, where the application authorization response message is an application authorization response message indicating confirmation of authorization or cancellation of authorization.

引导业务服务器BSF根据该应用授权应答消息执行相应的操作,包括:Guide the service server BSF to perform corresponding operations according to the application authorization response message, including:

如果该应用授权应答消息是应用授权确认消息,则继续执行后续步骤,即继续执行引导业务服务器BSF向用户终端提供为第三方应用客户端提供的注册信息和服务的过程。If the application authorization response message is an application authorization confirmation message, continue to perform the subsequent steps, that is, continue to perform the process of instructing the service server BSF to provide the user terminal with the registration information and services provided for the third-party application client.

可选地,在引导业务服务器BSF上预先存储有B-TID和安全验证码的对应关系,如果在引导业务服务器BSF接收的应用授权确认消息中包括安全验证码,则引导业务服务器BSF根据B-TID在该对应关系中查找和获取对应的安全验证码,并且比较两个安全验证码是否一致:如果一致,则继续执行后续步骤;如果不一致,则结束流程,不执行后续步骤。Optionally, the corresponding relationship between the B-TID and the security verification code is pre-stored on the guiding service server BSF, and if the application authorization confirmation message received by the guiding service server BSF includes the security verification code, then the guiding service server BSF is based on the B-TID. TID searches and obtains the corresponding security verification code in the corresponding relationship, and compares whether the two security verification codes are consistent: if they are consistent, continue to perform the next steps; if they are inconsistent, end the process and do not perform the subsequent steps.

如果该应用授权应答消息是应用授权取消消息,则结束流程,不执行后续步骤。If the application authorization response message is an application authorization cancellation message, the process ends, and subsequent steps are not performed.

本实施例提供的方法,在基于GBA的客户端注册和密钥共享方法实施例一的基础上,增加了让终端用户验证授权的过程,通过增加这一过程,可以更加确认客户端注册信息的提供得到了终端用户的授权许可,避免由于误操作等原因给非必要的第三方应用客户端进行了授权,从而能够有效解决背景技术中的缺陷二即GBA架构中同一用户终端上的第三方应用客户端能够较容易地计算出其他第三方应用客户端应用密钥的问题。The method provided in this embodiment, on the basis of the first embodiment of the GBA-based client registration and key sharing method, adds a process of allowing the terminal user to verify authorization. By adding this process, it is possible to further confirm the authenticity of the client registration information. The authorization of the terminal user is provided to avoid authorization of unnecessary third-party application clients due to misoperation and other reasons, thereby effectively solving the second defect in the background technology, that is, third-party applications on the same user terminal in the GBA architecture. The client can easily calculate the problem of the client application key of other third-party applications.

本实施例还可以与基于GBA的客户端注册和密钥共享方法实施例三组成一个新的实施例,即将本实施例的方法步骤应用在用户终端将NAF_Id传递给引导业务服务器BSF、以及引导业务服务器BSF确定安全认证成功之后,以及应用在引导业务服务器BSF为用户终端中运行的第三方应用客户端提供包括应用密钥的过程之前(即步骤401之前),具体过程不赘述。This embodiment can also be combined with Embodiment 3 of the GBA-based client registration and key sharing method to form a new embodiment, that is, the method steps of this embodiment are applied to the user terminal to transfer the NAF_Id to the guidance service server BSF, and the guidance service After the server BSF determines that the security authentication is successful, and before the application guides the service server BSF to provide the third-party application client running in the user terminal with the application key (ie, before step 401 ), the specific process will not be repeated.

本实施例还可以与基于GBA的客户端注册和密钥共享方法实施例四组成一个新的实施例,即将本实施例的方法步骤应用在用户终端将NAF_Id传递给引导业务服务器BSF、以及引导业务服务器BSF确定安全认证成功之后,以及应用在引导业务服务器BSF为用户终端中运行的第三方应用客户端提供包括用户令牌的过程之前(即步骤501之前),具体过程不赘述。This embodiment can also be combined with Embodiment 4 of the GBA-based client registration and key sharing method to form a new embodiment, that is, the method steps of this embodiment are applied to the user terminal to transfer the NAF_Id to the guidance service server BSF, and the guidance service After the server BSF determines that the security authentication is successful, and before the application guides the service server BSF to provide the third-party application client running in the user terminal with the user token (ie, before step 501 ), the specific process will not be repeated.

需要说明的是,在本文中,术语“包括”、“包含”、“传递”、“发送”或者任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者系统不仅包括那些要素,而且还可以包括没有明确列出的其他要素,或者是还可以包括为这种过程、方法、产品或者系统所固有的要素。It should be noted that the terms "comprising", "comprising", "transmitting", "sending" or any other variation herein are intended to encompass non-exclusive inclusion such that a process, method, product of a series of elements is included Or the system may include not only those elements, but may also include other elements not expressly listed, or may also include elements inherent to such a process, method, product, or system.

术语“第一”、“第二”、“第三”等(如果存在)仅用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解,这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。The terms "first," "second," "third," etc., if present, are used only to distinguish between similar objects, and are not used to describe a particular order or precedence. It is to be understood that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein can be practiced in sequences other than those illustrated or described herein.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages or disadvantages of the embodiments.

可以以许多方式来实现本发明的方法、装置和系统。例如,可通过软件、硬件、固件或者软件、硬件、固件的任何组合来实现本发明的方法、装置和系统。用于方法的步骤的上述顺序仅是为了进行说明,本发明的方法的步骤不限于以上具体描述的顺序,除非以其它方式特别说明。此外,在一些实施例中,还可将本发明实施为记录在记录介质中的程序,这些程序包括用于实现根据本发明的方法的机器可读指令。因而,本发明还覆盖存储用于执行根据本发明的方法的程序的记录介质。The method, apparatus and system of the present invention can be implemented in many ways. For example, the methods, apparatus, and systems of the present invention may be implemented in software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of the steps of the method is for illustration only, and the steps of the method of the present invention are not limited to the order specifically described above unless specifically stated otherwise. Furthermore, in some embodiments, the present invention can also be implemented as programs recorded in a recording medium, the programs comprising machine-readable instructions for implementing the methods according to the present invention. Thus, the present invention also covers a recording medium storing a program for executing the method according to the present invention.

以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in other related technical fields , are similarly included in the scope of patent protection of the present invention.

Claims (10)

1.基于GBA的客户端注册和密钥共享方法,其特征在于,应用于运行有第三方应用客户端的用户终端中,所述方法包括:1. client registration and key sharing method based on GBA, is characterized in that, is applied in the user terminal that runs the third-party application client, described method comprises: 执行GBA初始化过程,获取B-TID和生成第一主密钥Ks;Execute the GBA initialization process, obtain the B-TID and generate the first master key Ks; 基于所述第一主密钥Ks对第一验证信息加密生成第一加密值,所述第一验证信息与引导业务服务器BSF生成的第二验证信息的值相同;Encrypting the first verification information based on the first master key Ks to generate a first encrypted value, the first verification information is the same as the value of the second verification information generated by the bootstrap service server BSF; 将所述B-TID和所述第一加密值发送给所述引导业务服务器BSF;sending the B-TID and the first encrypted value to the bootstrap service server BSF; 接收所述引导业务服务器BSF提供的注册信息和服务,所述注册信息和服务是在所述引导业务服务器BSF验证所述第一加密值有效之后提供的。Receive registration information and services provided by the bootstrap service server BSF, where the registration information and services are provided after the bootstrap service server BSF verifies that the first encrypted value is valid. 2.根据权利要求1所述的方法,其特征在于,所述基于所述第一主密钥Ks对第一验证信息加密生成第一加密值包括:2. The method according to claim 1, wherein the generating the first encrypted value by encrypting the first verification information based on the first master key Ks comprises: 基于所述第一主密钥Ks生成第一认证密钥,其中,所述第一认证密钥的生成方式与所述引导业务服务器BSF生成第二认证密钥的生成方式一致,以使得所述第一认证密钥与所述引导业务服务器BSF生成的所述第二认证密钥的值相同;A first authentication key is generated based on the first master key Ks, wherein the generation method of the first authentication key is consistent with the generation method of the bootstrap service server BSF to generate the second authentication key, so that the The value of the first authentication key is the same as that of the second authentication key generated by the bootstrap service server BSF; 生成所述第一验证信息,其中,所述第一验证信息的生成方式与所述引导业务服务器BSF生成所述第二验证信息的生成方式一致,以使得所述第一验证信息与所述引导业务服务器BSF生成的所述第二验证信息的值相同;Generating the first verification information, wherein the generation method of the first verification information is consistent with the generation method of the guidance service server BSF to generate the second verification information, so that the first verification information is consistent with the guidance service server BSF. The value of the second verification information generated by the service server BSF is the same; 基于所述第一认证密钥对所述第一验证信息加密生成第一加密值。The first authentication information is encrypted based on the first authentication key to generate a first encrypted value. 3.根据权利要求1所述的方法,其特征在于,所述方法还包括:3. The method according to claim 1, wherein the method further comprises: 在所述接收所述引导业务服务器BSF提供的注册信息和服务之前,将NAF_Id传递给所述引导业务服务器BSF,所述NAF_Id为所述第三方应用客户端的标识;Before receiving the registration information and services provided by the guidance service server BSF, passing the NAF_Id to the guidance service server BSF, where the NAF_Id is the identifier of the third-party application client; 所述注册信息和服务为所述引导业务服务器BSF为所述第三方应用客户端提供的注册信息和服务。The registration information and services are the registration information and services provided by the guidance service server BSF for the third-party application client. 4.基于GBA的客户端注册和密钥共享方法,其特征在于,应用于引导业务服务器BSF中,所述方法包括:4. client registration and key sharing method based on GBA, is characterized in that, is applied in guiding service server BSF, and described method comprises: 与用户终端成功执行GBA初始化过程之后,接收所述用户终端发送的B-TID和第一加密值;After successfully performing the GBA initialization process with the user terminal, receive the B-TID and the first encrypted value sent by the user terminal; 根据所述B-TID获取对应的第二主密钥Ks;Obtain the corresponding second master key Ks according to the B-TID; 基于所述第二主密钥Ks和第二验证信息验证所述第一加密值,所述第二验证信息与所述用户终端生成的第一验证信息的值相同;Verifying the first encrypted value based on the second master key Ks and second verification information, the second verification information being the same as the value of the first verification information generated by the user terminal; 若验证所述第一加密值有效,则向所述用户终端提供注册信息和服务。If it is verified that the first encrypted value is valid, registration information and services are provided to the user terminal. 5.根据权利要求4所述的方法,其特征在于,所述基于所述第二主密钥Ks和第二验证信息验证所述第一加密值包括:5. The method according to claim 4, wherein the verifying the first encrypted value based on the second master key Ks and the second verification information comprises: 基于所述第二主密钥Ks生成第二认证密钥,其中,所述第二认证密钥的生成方式与所述用户终端生成第一认证密钥的生成方式一致,以使得所述第二认证密钥与所述用户终端生成的所述第一认证密钥的值相同;A second authentication key is generated based on the second master key Ks, wherein the generation method of the second authentication key is consistent with the generation method of the user terminal to generate the first authentication key, so that the second authentication key is generated The authentication key is the same as the value of the first authentication key generated by the user terminal; 生成所述第二验证信息,其中,所述第二验证信息的生成方式与所述用户终端生成第一验证信息的生成方式一致,以使得所述第二验证信息与所述用户终端生成的所述第一验证信息的值相同;The second verification information is generated, wherein the generation method of the second verification information is consistent with the generation method of the user terminal to generate the first verification information, so that the second verification information is the same as that generated by the user terminal. The value of the first verification information is the same; 基于所述第二认证密钥和所述第二验证信息验证所述第一加密值。The first encrypted value is verified based on the second authentication key and the second verification information. 6.根据权利要求4所述的方法,其特征在于,所述方法还包括:6. The method according to claim 4, wherein the method further comprises: 在所述向所述用户终端提供注册信息和服务之前,获取所述用户终端传递的NAF_Id,所述NAF_Id为所述用户终端中运行的第三方应用客户端的标识;Before providing registration information and services to the user terminal, obtain the NAF_Id delivered by the user terminal, where the NAF_Id is an identifier of a third-party application client running in the user terminal; 所述向所述用户终端提供的注册信息和服务为向所述第三方应用客户端提供的注册信息和服务。The registration information and services provided to the user terminal are the registration information and services provided to the third-party application client. 7.基于GBA的客户端注册和密钥共享装置,其特征在于,所述装置应用于运行有第三方应用客户端的用户终端中,包括:存储器、处理器,所述处理器用于运行所述存储器所存储的程序,所述程序运行时执行包括权利要求1至3中任一项所述的方法。7. GBA-based client registration and key sharing device, wherein the device is applied in a user terminal running a third-party application client, comprising: a memory, a processor, and the processor is used to run the memory The stored program, which executes when the program runs, comprises the method of any one of claims 1 to 3. 8.基于GBA的客户端注册和密钥共享装置,其特征在于,所述装置应用于引导业务服务器BSF,包括:存储器、处理器,所述处理器用于运行所述存储器所存储的程序,所述程序运行时执行包括权利要求4至7中任一项所述的方法。8. GBA-based client registration and key sharing device, characterized in that, the device is applied to a boot service server BSF, including: a memory, a processor, and the processor is used to run a program stored in the memory, and the The execution of the program when the program is executed includes the method of any one of claims 4 to 7. 9.基于GBA的客户端注册和密钥共享系统,其特征在于,所述系统包括:用户终端以及引导业务服务器BSF;9. GBA-based client registration and key sharing system, characterized in that the system comprises: a user terminal and a guidance service server BSF; 所述用户终端包括如权利要求7所述的装置;the user terminal comprising the apparatus of claim 7; 所述引导业务服务器BSF包括如权利要求8所述的装置。The bootstrap service server BSF comprises the apparatus of claim 8 . 10.一种存储介质,其特征在于,所述存储介质中存储有程序,所述程序用于实现包括权利要求1至3中任一项所述的方法;或/和,所述程序用于实现包括权利要求4至7中任一项所述的方法。10. A storage medium, wherein a program is stored in the storage medium, and the program is used to implement the method according to any one of claims 1 to 3; or/and, the program is used for Implementation includes the method of any of claims 4-7.
CN201910775078.3A 2018-08-23 2019-08-22 GBA-based client registration and key sharing method, device and system Active CN111050322B (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN2018109782125 2018-08-23
CN201810978212.5A CN109121135A (en) 2018-08-23 2018-08-23 Client registers and key sharing method, apparatus and system based on GBA
CNPCT/CN2019/074725 2019-02-04
PCT/CN2019/074725 WO2020037958A1 (en) 2018-08-23 2019-02-04 Gba-based client registration and key sharing method, device, and system

Publications (2)

Publication Number Publication Date
CN111050322A true CN111050322A (en) 2020-04-21
CN111050322B CN111050322B (en) 2023-06-30

Family

ID=64860912

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201810978212.5A Pending CN109121135A (en) 2018-08-23 2018-08-23 Client registers and key sharing method, apparatus and system based on GBA
CN201910775078.3A Active CN111050322B (en) 2018-08-23 2019-08-22 GBA-based client registration and key sharing method, device and system

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201810978212.5A Pending CN109121135A (en) 2018-08-23 2018-08-23 Client registers and key sharing method, apparatus and system based on GBA

Country Status (1)

Country Link
CN (2) CN109121135A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113518349A (en) * 2020-10-23 2021-10-19 中国移动通信有限公司研究院 Service management method, device, system and storage medium
CN113992367A (en) * 2021-10-18 2022-01-28 四川托普信息技术职业学院 Data encryption transmission system and method thereof
CN118659930A (en) * 2024-08-19 2024-09-17 中国第一汽车股份有限公司 Application identity authentication method, device, storage medium and vehicle
US12490093B2 (en) 2021-03-22 2025-12-02 China Mobile Communication Co., Ltd Research Institute Configuration method and apparatus for terminal device, and communication device

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020037958A1 (en) * 2018-08-23 2020-02-27 刘高峰 Gba-based client registration and key sharing method, device, and system
WO2020249861A1 (en) * 2019-06-08 2020-12-17 Nokia Technologies Oy Communication security between user equipment and third-party application using communication network-based key
CN111327583B (en) * 2019-08-22 2022-03-04 刘高峰 Identity authentication method, intelligent equipment and authentication server
CN115336377B (en) * 2020-04-24 2024-11-29 Oppo广东移动通信有限公司 Multimedia broadcast multicast service authentication method, device, equipment and storage medium
CN113518348B (en) * 2020-06-30 2023-05-09 中国移动通信有限公司研究院 Service processing method, device, system and storage medium
CN114584289B (en) * 2020-12-01 2024-09-27 中国电信股份有限公司 Method for generating secret key and related equipment
CN112436939B (en) * 2020-12-11 2022-05-03 杭州海康威视数字技术股份有限公司 Key negotiation method, device and system and electronic equipment
CN115884181A (en) * 2022-11-29 2023-03-31 中移互联网有限公司 Application login method, device, equipment and storage medium based on 5G message
CN118233087A (en) * 2022-12-21 2024-06-21 中国移动通信有限公司研究院 Identification processing method, device and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060205388A1 (en) * 2005-02-04 2006-09-14 James Semple Secure bootstrapping for wireless communications
CN102264069A (en) * 2010-05-28 2011-11-30 中国移动通信集团公司 Authentication control method, device and system based on general boot framework
CN102413464A (en) * 2011-11-24 2012-04-11 杭州东信北邮信息技术有限公司 GBA (General Bootstrapping Architecture)-based secret key negotiation system and method of telecommunication capability open platform
US20130152208A1 (en) * 2011-12-09 2013-06-13 Verizon Patent And Licensing Inc. Security key management based on service packaging

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060205388A1 (en) * 2005-02-04 2006-09-14 James Semple Secure bootstrapping for wireless communications
CN102264069A (en) * 2010-05-28 2011-11-30 中国移动通信集团公司 Authentication control method, device and system based on general boot framework
CN102413464A (en) * 2011-11-24 2012-04-11 杭州东信北邮信息技术有限公司 GBA (General Bootstrapping Architecture)-based secret key negotiation system and method of telecommunication capability open platform
US20130152208A1 (en) * 2011-12-09 2013-06-13 Verizon Patent And Licensing Inc. Security key management based on service packaging

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"\"COM13-LS147-Y2722\"" *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113518349A (en) * 2020-10-23 2021-10-19 中国移动通信有限公司研究院 Service management method, device, system and storage medium
US12490093B2 (en) 2021-03-22 2025-12-02 China Mobile Communication Co., Ltd Research Institute Configuration method and apparatus for terminal device, and communication device
CN113992367A (en) * 2021-10-18 2022-01-28 四川托普信息技术职业学院 Data encryption transmission system and method thereof
CN118659930A (en) * 2024-08-19 2024-09-17 中国第一汽车股份有限公司 Application identity authentication method, device, storage medium and vehicle
CN118659930B (en) * 2024-08-19 2024-12-27 中国第一汽车股份有限公司 Identity authentication method and device for application, storage medium and vehicle

Also Published As

Publication number Publication date
CN109121135A (en) 2019-01-01
CN111050322B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN111050322B (en) GBA-based client registration and key sharing method, device and system
CN111050314B (en) Client registration method, device and system
CN111327582B (en) Authorization method, device and system based on OAuth protocol
US8522025B2 (en) Authenticating an application
CN101616410B (en) Access method and access system for cellular mobile communication network
US10411884B2 (en) Secure bootstrapping architecture method based on password-based digest authentication
JP4741664B2 (en) Method and apparatus for authentication and privacy
CN105554747B (en) Wireless network connecting method, apparatus and system
CN112566119B (en) Terminal authentication method, device, computer equipment and storage medium
WO2017028593A1 (en) Method for making a network access device access a wireless network access point, network access device, application server, and non-volatile computer readable storage medium
KR20080089500A (en) Methods, systems, and authentication centers for authentication in end-to-end communications based on mobile networks
CN108353279B (en) Authentication method and authentication system
CN109075973B (en) Method for carrying out unified authentication on network and service by using ID-based cryptography
CN102547701A (en) Authentication method and wireless access point as well as authentication server
CN111327583A (en) Identity authentication method, intelligent equipment and authentication server
CN106788989A (en) A kind of method and apparatus for setting up safe encryption channel
CN104683343B (en) A kind of method of terminal quick registration Wi-Fi hotspot
EP1982547B1 (en) Method and system for recursive authentication in a mobile network
CN117729056B (en) Equipment identity authentication method and system
US8726023B2 (en) Authentication using GAA functionality for unidirectional network connections
WO2023241176A1 (en) Communication method and apparatus, device, storage medium, and program product
EP1933498A1 (en) Method, system and device for negotiating about cipher key shared by ue and external equipment
US20080137859A1 (en) Public key passing
WO2017197968A1 (en) Data transmission method and device
CN115362664A (en) Communication method, device and equipment based on Internet of things

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant