Summary of the invention
The objective of the invention is to, provide a kind of key to generate and transfer approach, make by this method can for system negotiates n to session key, satisfy system for many demands to session key.
According to an aspect of the present invention, provide a kind of key generation method, may further comprise the steps:
Step 1, user's subscribed services device and subscriber equipment are shared root key in advance, first key transmits identifying algorithm, second key transmission identifying algorithm, encryption key generating algorithm, Integrity Key generating algorithm, Anonymity Key generating algorithm, user's subscribed services device has anonymous cryptographic algorithm, and the user has the Anonymity Key decipherment algorithm;
Step 2, described user's subscribed services device generates n random number, uses the HASH digest algorithm to calculate the summary and the generation HASH value of a described n random number;
Step 3, described user's subscribed services device utilizes described root key, described first key transmission identifying algorithm, described HASH value, non-sensitive parameter, sensitive parameter to generate first authentication code, utilize described root key, described second key to transmit identifying algorithm, described HASH value generation first Expected Response, utilize described Anonymity Key generating algorithm, described root key, described HASH value to generate Anonymity Key, and utilize Anonymity Key, sensitive parameter and user's subscribed services device to have anonymous cryptographic algorithm to generate user's subscribed services device and have anonymous encryption function; And
Step 4, described user's subscribed services device utilizes described encryption key generating algorithm, described root key, a described n random number to generate n encryption key respectively, utilizes described Integrity Key generating algorithm, described root key and a described n random number to generate n Integrity Key respectively.
According to another aspect of the present invention, provide a kind of key to generate and transmission method, may further comprise the steps:
Step S102, user's subscribed services device and subscriber equipment are shared root key K in advance, first key transmits identifying algorithm f1, second key transmission identifying algorithm f2, encryption key generating algorithm f3, Integrity Key generating algorithm f4, Anonymity Key generating algorithm f5, user's subscribed services device has anonymous cryptographic algorithm En, and subscriber equipment has Anonymity Key decipherment algorithm En
-1
Step S104, user's subscribed services device generates n random number R 1, R2..., Rn, uses HASH digest algorithm fh to calculate the summary of this n random number and generate a HASH value H;
Step S106, user's subscribed services device utilizes root key K, first key transmits identifying algorithm f1, HASH value H, some non-sensitive parameter P1, some sensitive parameter P2 generate the first authentication code MACMAC, utilize root key K, second key transmits identifying algorithm f2, HASH value H generates the first Expected Response XRES, utilize Anonymity Key generating algorithm f5, root key K, HASH value H generates Anonymity Key AK, and utilize Anonymity Key AK, sensitive parameter P2 and user's subscribed services device have Anonymity Key cryptographic algorithm generation user subscribed services device and have Anonymity Key cryptographic algorithm En (Anonymity Key AK, sensitive parameter P2);
Step S108, user's subscribed services device utilize encryption key generating algorithm f3, root key K, a n random number R 1, R2..., Rn generate respectively n encryption key CK1, CK2 ... CKn, utilize Integrity Key generating algorithm f4, root key K and n random number R 1, R2..., Rn generate respectively n Integrity Key IK1, IK2 ..., IKn;
Step S110, user's subscribed services device with n encryption key CK1, CK2 ..., CKn, n Integrity Key IK1, IK2 ..., IKn, a n random number R 1, R2..., Rn, root key K, HASH value H, the first Expected Response XRES, the first authentication code MAC, non-sensitive parameter P1, En (Anonymity Key AK, sensitive parameter P2) send to subscriber equipment by the network element M of subscriber equipment distributed key;
Step S112, subscriber equipment utilizes Anonymity Key generating algorithm f5, root key K, HASH value H to generate Anonymity Key AK and utilizes Anonymity Key AK and user to have Anonymity Key decipherment algorithm deciphering En (Anonymity Key AK, sensitive parameter P2) to obtain sensitive parameter P2;
Step S114, subscriber equipment utilization institute first states key transmission identifying algorithm f1, root key K, HASH value H, non-sensitive parameter P1 and sensitive parameter P2 and generates the second authentication code XMAC, determine whether the first shared in advance authentication code MAC of the second authentication code XMAC and subscriber equipment is identical, execution in step S116 under identical situation does not operate under different situations;
Step S116, subscriber equipment utilizes encryption key generating algorithm f3, root key K, a n random number R 1, R2..., Rn to generate n encryption key, utilize Integrity Key IK1, IK2 ..., IKn generating algorithm f4, root key K, a n random number R 1, R2..., Rn generate n Integrity Key IK1, IK2 ..., IKn;
Step S118, subscriber equipment utilize the second shared key transmission identifying algorithm f2, root key K, HASH value H to generate the second Expected Response RES and the second Expected Response RES is fed back to network element M;
Step S120, whether network element M relatively more identical with the first Expected Response XRES from the second Expected Response RES of subscriber equipment, and if identical would use n encryption key CK1, CK2 receiving from user's subscribed services device ..., CKn and n Integrity Key IK1, IK2 ..., IKn.
In step S106, sensitive parameter P2 and non-sensitive parameter P1 are a parameter or a plurality of parameter, are a parameter or a plurality of parameter.
In above-mentioned key generation and transmission method, method is used for 3GPP LTE/SAE.
According to another aspect of the present invention, provide a kind of key generation and transmission system to comprise: first key generating device, be positioned at user's subscribed services device side, be used for by root key K, first key transmission identifying algorithm f1, second key transmission identifying algorithm f2, encryption key generating algorithm f3, Integrity Key generating algorithm f4, the Anonymity Key generating algorithm f5 shared in advance with subscriber equipment, user's subscribed services device has anonymous cryptographic algorithm En, and the user has Anonymity Key decipherment algorithm En
-1Generate n encryption key CK1, CK2, ..., CKn, n Integrity Key IK1, IK2, ..., IKn, n random number R 1, R2..., Rn, HASH value H, the first Expected Response XRES, the first authentication code MAC, non-sensitive parameter P1, En (Anonymity Key AK, sensitive parameter P2), and with n encryption key CK1, CK2, ..., CKn, n Integrity Key IK1, IK2, ..., IKn, n random number R 1, R2..., Rn, root key K, HASH value H, the first Expected Response XRES, the first authentication code MAC, non-sensitive parameter P1, En (Anonymity Key AK, sensitive parameter P2) sends to subscriber equipment by the network element M that gives the subscriber equipment distributed key; Network element, be used for and from the first Expected Response XRES of user's subscribed services device and will compare from the second Expected Response RES of user's equipment, under the first Expected Response XRES situation consistent with the second Expected Response RES, enable n encryption key CK1, CK2 ..., CKn and n Integrity Key IK1, IK2 ..., IKn; And second key generating device, be positioned at user equipment side, be used for according to the pre-root key K that shares, first key transmit identifying algorithm f1, second key transmit identifying algorithm f2, encryption key generating algorithm f3, Integrity Key generating algorithm f4, Anonymity Key and user have Anonymity Key decipherment algorithm generating algorithm f5 generate n encryption key CK1, CK2 ..., CKn, n Integrity Key IK1, IK2 ..., IKn, the second Expected Response RES, the second authentication code XMAC, and it is fed back to network element M.
In above-mentioned key generation and transmission system, first key generating device comprises: the random number generation module is used to generate n random number R 1, R2..., Rn; HASH value H generation module is used to the summary that uses the HASH digest algorithm to calculate n random number R 1, R2..., Rn and generates HASH value H.User's subscribed services device has anonymous encryption function generation module, be used to utilize root key K, first key transmits identifying algorithm f1, HASH value H, non-sensitive parameter P1, sensitive parameter P2 generates message authentication code MAC, utilize root key K, second key transmits identifying algorithm f2, HASH value H generates the first Expected Response XRES, utilize Anonymity Key AK generating algorithm f5, root key K, HASH value H generates Anonymity Key AK, and utilize Anonymity Key AK and sensitive parameter P2, have the Anonymity Key cryptographic algorithm with user's subscribed services device and generate En (Anonymity Key AK, sensitive parameter P2); The Integrity Key generation module, be used to utilize encryption key generating algorithm f3, root key K, a n random number R 1, R2..., Rn generate respectively n encryption key CK1, CK2 ..., CKn, utilize Integrity Key generating algorithm f4, root key K and n random number R 1, R2..., Rn generate respectively n Integrity Key IK1, IK2 ..., IKn; The key sending module, be used for n encryption key CK1, CK2 ..., CKn, n Integrity Key IK1, IK2 ..., IKn, a n random number R 1, R2..., Rn, root key K, HASH value H, the first Expected Response XRES, message authentication code MAC, non-sensitive parameter P1, En (Anonymity Key AK, sensitive parameter P2) send to subscriber equipment by the network element M of subscriber equipment distributed key.
Second key generating device comprises: the sensitive parameter acquisition module is used to utilize Anonymity Key generating algorithm f5, root key K, HASH value H to generate Anonymity Key AK and utilize Anonymity Key AK and user to have Anonymity Key decipherment algorithm En
-1Deciphering En (Anonymity Key AK, sensitive parameter P2) is to obtain sensitive parameter P2; Authentication module is used for utilizing institute first to state key transmission identifying algorithm f1, root key K, HASH value H, non-sensitive parameter P1 and sensitive parameter P2 and generates the second authentication code XMAC, determines whether the second authentication code XMAC is identical with the first authentication code MAC; Key production module, be used under the authentication code situation identical with message authentication code, utilize encryption key generating algorithm f3, root key K, a n random number R 1, R2..., Rn generate n encryption key CK1, CK2 ..., CKn, utilize Integrity Key generating algorithm f4, root key K, a n random number R 1, R2..., Rn generation n Integrity Key IK1, IK2 ..., IKn; And the second Expected Response generation module, utilize second to share that key transmits identifying algorithm f2, root key K, HASH value H generate the second Expected Response RES and the second Expected Response RES is fed back to network element M.
In above-mentioned key generation and transmission system, sensitive parameter P2 and non-sensitive parameter P1 are a parameter or a plurality of parameter, and this system is used for 3GPP LTE/SAE.
By the present invention, can allow AuC and USIM consult two pairs of session keys on the one hand, when AuC gives MME with the session key distribution, MME further is distributed to it after MME and the eNB, and this is for providing corresponding session key between USIM and the eNB and between USIM and the MME.On the other hand, the method also provides the mutual authentication method in the key transport process, has guaranteed that the session key that USIM generates is identical with the session key that AuC generates.
Other features and advantages of the present invention will be set forth in the following description, and, partly from specification, become apparent, perhaps understand by implementing the present invention.Purpose of the present invention and other advantages can realize and obtain by specifically noted structure in the specification of being write, claims and accompanying drawing.
Embodiment
Below with reference to accompanying drawing, describe the specific embodiment of the present invention in detail.
Fig. 1 generates and the transmission method flow chart according to key of the present invention.With reference to Fig. 1, the invention provides a kind of key and generate and transmission method, may further comprise the steps:
Step S102, user's subscribed services device and subscriber equipment are shared root key K in advance, first key transmits identifying algorithm f1, second key transmission identifying algorithm f2, encryption key generating algorithm f3, Integrity Key generating algorithm f4, Anonymity Key generating algorithm f5, user's subscribed services device has anonymous cryptographic algorithm En, and the user has Anonymity Key decipherment algorithm En
-1As shown in Figure 3.
Step S104, user's subscribed services device generates n random number R 1, R2..., Rn, uses HASH digest algorithm fh to calculate the summary of this n random number and generate a HASH value H, as shown in Figure 3.
Step S106, user's subscribed services device utilizes root key K, first key transmits identifying algorithm f1, HASH value H, some non-sensitive parameter P1, some sensitive parameter P2 generate the first authentication code MACMAC, utilize root key K, second key transmits identifying algorithm f2, HASH value H generates the first Expected Response XRES, utilize Anonymity Key generating algorithm f5, root key K, HASH value H generates Anonymity Key AK, and utilize Anonymity Key AK, sensitive parameter P2 and user's subscribed services device have the Anonymity Key cryptographic algorithm and generate En (Anonymity Key AK, sensitive parameter P2), as shown in Figure 3.
Step S108, user's subscribed services device utilize encryption key generating algorithm f3, root key K, a n random number R 1, R2..., Rn generate respectively n encryption key CK1, CK2 ... CKn, utilize Integrity Key generating algorithm f4, root key K and n random number R 1, R2..., Rn generate respectively n Integrity Key IK1, IK2 ..., IKn, as shown in Figure 3.
Step S110, user's subscribed services device with n encryption key CK1, CK2 ..., CKn, n Integrity Key IK1, IK2 ..., IKn, a n random number R 1, R2..., Rn, root key K, HASH value H, the first Expected Response XRES, the first authentication code MAC, non-sensitive parameter P1, En (Anonymity Key AK, sensitive parameter P2) the network element M by the subscriber equipment distributed key sends to subscriber equipment, as shown in Figure 4.
Step S112, subscriber equipment utilize Anonymity Key generating algorithm f5, root key K, HASH value H to generate Anonymity Key AK and utilize Anonymity Key AK and user to have Anonymity Key decipherment algorithm En
-1Deciphering En (Anonymity Key AK, sensitive parameter P2) is to obtain sensitive parameter P2, as shown in Figure 4.
Step S114, subscriber equipment utilization institute first states key transmission identifying algorithm f1, root key K, HASH value H, non-sensitive parameter P1 and sensitive parameter P2 and generates the second authentication code XMAC, determine whether the first shared in advance authentication code MAC of the second authentication code XMAC and subscriber equipment is identical, execution in step S116 under identical situation, under different situations, do not operate, as shown in Figure 4.
Step S116, subscriber equipment utilizes encryption key generating algorithm f3, root key K, a n random number R 1, R2..., Rn to generate n encryption key, utilize Integrity Key generating algorithm f4, root key K, a n random number R 1, R2..., Rn generate n Integrity Key IK1, IK2 ..., IKn, as shown in Figure 4.
Step S118, subscriber equipment utilize the second shared key transmission identifying algorithm f2, root key K, HASH value H to generate the second Expected Response RES and the second Expected Response RES is fed back to network element M.
Step S120, whether network element M relatively more identical with the first Expected Response XRES from the second Expected Response RES of subscriber equipment, and if identical would use n encryption key CK1, CK2 receiving from user's subscribed services device ..., CKn and n Integrity Key IK1, IK2 ..., IKn.
In step S106, sensitive parameter P2 and non-sensitive parameter P1 are a parameter or a plurality of parameter, are a parameter or a plurality of parameter.
This method can be used for 3GPP LTE/SAE.
Fig. 2 is the block diagram according to key generation of the present invention and transmission system.The invention provides with reference to Fig. 2 that a kind of key generates and transmission system 200 comprises: first key generating device 202, be positioned at user's subscribed services device side, be used for by the root key K shared in advance with subscriber equipment, first key transmits identifying algorithm f1, second key transmits identifying algorithm f2, encryption key generating algorithm f3, Integrity Key generating algorithm f4, Anonymity Key generating algorithm f5, user's subscribed services device has anonymous cryptographic algorithm En and generates n encryption key CK1, CK2, ..., CKn, n Integrity Key IK1, IK2, ..., IKn, n random number R 1, R2..., Rn, HASH value H, the first Expected Response XRES, the first authentication code MAC, non-sensitive parameter P1, En (Anonymity Key AK, sensitive parameter P2), and with n encryption key CK1, CK2, ..., CKn, n Integrity Key IK1, IK2, ..., IKn, n random number R 1, R2..., Rn, root key K, HASH value H, the first Expected Response XRES, the first authentication code MAC, non-sensitive parameter P1, En (Anonymity Key AK, sensitive parameter P2) sends to subscriber equipment by the network element M that gives the subscriber equipment distributed key; Network element 204, be used for and from the first Expected Response XRES of user's subscribed services device and will compare from the second Expected Response RES of user's equipment, under the first Expected Response XRES situation consistent with the second Expected Response RES, enable n encryption key CK1, CK2 ..., CKn and n Integrity Key IK1, IK2 ..., IKn; And second key generating device 206, be positioned at user equipment side, be used for according to the pre-root key K that shares, first key transmit identifying algorithm f1, second key transmits identifying algorithm f2, encryption key and user and has Anonymity Key decipherment algorithm En
-1Generating algorithm f3, Integrity Key generating algorithm f4, Anonymity Key generating algorithm f5 generate n encryption key CK1, CK2 ..., CKn, n Integrity Key IK1, IK2 ..., IKn, the second Expected Response XRES, the second authentication code XMAC, and it is fed back to network element M.
First key generating device 202 comprises: random number generation module 202-2 is used to generate n random number R 1, R2..., Rn; HASH value generation module 202-4 is used to the summary that uses the HASH digest algorithm to calculate n random number R 1, R2..., Rn and generates HASH value H; User's subscribed services device has Anonymity Key encryption function generation module 202-6, be used to utilize root key K, first key transmits identifying algorithm f1, HASH value H, non-sensitive parameter P1, sensitive parameter P2 generates message authentication code MAC, utilize root key K, second key transmits identifying algorithm f2, HASH value H generates the first Expected Response XRES, utilize Anonymity Key AK generating algorithm f5, root key K, HASH value H generates Anonymity Key AK, and utilize Anonymity Key AK, sensitive parameter P2 and user's subscribed services device have anonymous cryptographic algorithm and generate En (Anonymity Key AK, sensitive parameter P2); Integrity Key generation module 202-8, be used to utilize encryption key generating algorithm f3, root key K, a n random number R 1, R2..., Rn generate respectively n encryption key CK1, CK2 ..., CKn, utilize Integrity Key generating algorithm f4, root key K and n random number R 1, R2..., Rn generate respectively n Integrity Key IK1, IK2 ..., IKn; Key sending module 202-10, be used for n encryption key CK1, CK2 ..., CKn, n Integrity Key IK1, IK2 ..., IKn, a n random number R 1, R2..., Rn, root key K, HASH value H, the first Expected Response XRES, message authentication code MAC, non-sensitive parameter P1, En (Anonymity Key AK, sensitive parameter P2) send to subscriber equipment by the network element M that gives the subscriber equipment distributed key.
Second key generating device 206 comprises: sensitive parameter acquisition module 206-2 is used to utilize Anonymity Key generating algorithm f5, root key K, HASH value H to generate Anonymity Key AK and utilize Anonymity Key AK and user to have Anonymity Key decipherment algorithm En
-1Deciphering En (Anonymity Key AK, sensitive parameter P2) is to obtain sensitive parameter P2; Authentication module 206-4 is used for utilizing institute first to state key transmission identifying algorithm f1, root key K, HASH value H, non-sensitive parameter P1 and sensitive parameter P2 and generates the second authentication code XMAC, determines whether the second authentication code MAC is identical with the first authentication code MAC; Key production module 206-6, be used under the authentication code situation identical with message authentication code, utilize encryption key generating algorithm f3, root key K, a n random number R 1, R2..., Rn generate n encryption key CK1, CK2 ..., CKn, utilize Integrity Key generating algorithm f4, root key K, a n random number R 1, R2..., Rn generation n Integrity Key IK1, IK2 ..., IKn; And the second Expected Response generation module 206-8, utilize second to share that key transmits identifying algorithm f2, root key K, HASH value H generate the second Expected Response RES and the second Expected Response RES is fed back to network element M.
In above-mentioned key generation and transmission system, sensitive parameter P2 and non-sensitive parameter P1 are a parameter or a plurality of parameter, and this system can be used for 3GPP LTE/SAE.
Describe one embodiment of the present of invention in detail with reference to Fig. 5 to Fig. 7 and in conjunction with the key agreement of 3GPP LTE/SAE below.This embodiment may further comprise the steps:
Step S702:AuC and USIM share root key K in advance, wildcard transmits identifying algorithm f1, f2, the pre-encryption key generating algorithm f3 that shares, the pre-Integrity Key generating algorithm f4 that shares, the pre-Anonymity Key generating algorithm f5 that shares, user's subscribed services device has anonymous cryptographic algorithm En, and the user has Anonymity Key decipherment algorithm En
-1As shown in Figure 5.
Step S704:AuC generates 2 random number R 1, R2, and AuC utilizes HASH digest algorithm fh to calculate the summary of these 2 random numbers, generates a HASH value H, as shown in Figure 5.
Step S706:AuC utilizes f1, K, H, SQN, AMF to generate message authentication code MAC; AuC utilizes f2, K, H to generate Expected Response XRES; AuC utilizes f5, K, H to generate Anonymity Key AK, and utilizes AK XOR encryption parameter SQN, generates SQN+AK, as shown in Figure 5.
Step S708:AuC utilizes f3, K, R1 to generate encryption key CK1, utilizes f3, K, R2 to generate encryption key CK2; AuC utilizes f4, K, R1 to generate Integrity Key IK1, utilizes f4, K, R2 to generate Integrity Key IK2, as shown in Figure 5.
(AK P2) sends to MME to step S710:AuC, and MME sends R1, R2, H, MAC, AMF, SQN+AK to USIM with CK1, CK2, IK1, IK2, R1, R2, H, XRES, MAC, P1, En.
Step S712:USIM utilizes f5, K, H to generate Anonymity Key AK, and utilizes AK XOR deciphering SQN+AK (in the present invention, agreement '+' expression step-by-step XOR), obtains SQN, as shown in Figure 6.
Step S714:USIM utilizes f1, K, H, AMF, SQN to generate authentication code XMAC, and USIM judges whether XMAC and MAC equate to determine whether message is distorted, if XMAC equals MAC, then message is not distorted in the transport process, as shown in Figure 6 in transport process.
Step S716:USIM utilizes f3, K, R1 to generate encryption key CK1, utilizes f3, K, R2 to generate encryption key CK2, and USIM utilizes f4, K, R1 to generate Integrity Key IK1, utilizes f4, K, R2 to generate Integrity Key IK2, as shown in Figure 6.
Step S718:USIM utilizes f2, K, H to generate Expected Response RES, and gives MME with the RES loopback, as shown in Figure 6.
Step S720:MME is RES and XRES relatively, finds that RES is consistent with XRES, then begins encryption enabled ciphering key K1, CK2 and Integrity Key IK1, IK2.
Alternatively, in step S706, P1, P2 can be made of a parameter, also can be made of a plurality of parameters.
Alternatively, in step S714, when the user judges that XMAC is not equal to MAC, show that then message is distorted in transmittance process, this moment, the user need not proceed step S718 and step afterwards.
By this embodiment, AuC and USIM can consult two pairs of session keys, can satisfy MME and the eNB demand for session key thus.
By the present invention, can allow on the one hand AuC and USIM consult two pairs of session keys, when AuC gives MME with the session key distribution, MME further is distributed to after MME and the eNB, just for corresponding session key is provided between USIM and the eNB and between USIM and the MME.On the other hand, the method also provides the mutual authentication method in the key transport process, has guaranteed that the session key that USIM generates is identical with the session key that AuC generates.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.