# Patent

## Title
Two-way access authentication method

## Abstract

A two-way access authentication method comprises: According to the system parameters pre-established by the third entity, the first entity sends the access authentication request packet to the second entity, then the second entity validates whether the signature of first entity is correct, and if yes, the share master key of second entity is calculated; the second entity generates the access authentication response packet and sends it to the first entity, then the first entity validates whether the signature of access authentication response packet and the message integrity check code are correct; if yes, the share master key of first entity is calculated; the first entity sends the access authentication acknowledge packet to the second entity, then the second entity validates the integrity of the access authentication acknowledge packet, if passing the validation, the share master key of first entity is consistent with that of the second entity, and the access authentication is achieved. For improving the security, after received the access authentication request packet sent by the first entity, the second entity may perform the identity validity validation and generates the access authentication response packet after passing the validation.

## Background
This application claims the priority to Chinese Patent Application No. 200710019024.1, filed with the Chinese Patent Office on Nov. 8, 2007 and titled “a two-way access authentication method”, which is hereby incorporated by reference in its entirety.
FIELD OF THE INVENTION
The present invention relates to the field of wireless communications and in particular to a two-way access authentication method.
BACKGROUND OF THE INVENTION
In the technology of Radio-Frequency Identification (RFID), secure authentication between the reader/writer and the electronic tag has to be fully addressed prior to secure communication. In wireless networks, the communication between mobile terminals and access points or base stations faces the same challenge, e.g., secure authentication between mobile terminals and access points in a wireless local area network (WLAN), and secure authentication between mobile terminals and base stations in a wireless metropolitan area network (WMAN).
A series of standards such as 802.11 and 802.16 have been established by the IEEE to enhance security of WLANs and WMANs, providing secure access by mobile terminals to base stations or access points. Subsequently, the standards of 802.11i and 802.16e are developed as an amendment to address security vulnerabilities in 802.11 and 802.16, respectively.
However, the inventors found in their studies that, existing two-way authentication methods are based on authentication servers, and can not realize direct two-way authentication between base stations or access points and mobile terminals. That is, to perform two-way authentication between a base station or access point and a mobile terminal, a secure channel has to be pre-established using some other security protocol between the access point or base station and an authentication server, then, the authentication server helps perform two-way authentication between the base station or access point and the mobile terminal. Any problem of the security of the secure channel may degrade the reliability of two-way authentication. Moreover, if a new base station or access point is to be added to the network system, a secure channel has to be set up manually between the base station or access point and the authentication server, which results in difficulty in extending the network system.
SUMMARY OF THE INVENTION
Embodiments of the invention provide a two-way access authentication method, to ensure reliability of two-way access authentication.
An embodiment of the invention provides a two-way access authentication method, including: sending by a first entity an access authentication request message to a second entity according to system parameters predefined by a third entity, and verifying by the second entity a signature signed by the first entity and if the signature is correct, calculating by the second entity a shared master key of the second entity, wherein the system parameters comprise a product N of two large prime numbers, an integer e satisfying gcd(e, φ(N))=2, an integer d satisfying ed≡1(mod φ(N)) and a strong one-way hash function h, with φ( ) being the Euler's totient function;
generating by the second entity an access authentication response message, sending by the second entity the access authentication response message to the first entity, and verifying by the first entity a signature and a message integrity check code of the access authentication response message, and if the signature and the message integrity check code of the access authentication response message are both correct, calculating by the first entity a shared master key of the first entity; and
sending by the first entity an access authentication acknowledgement message to the second entity, verifying by the second entity integrity of the access authentication acknowledgement message, and if the verification is passed, the shared master keys of the first and second entities are consistent, thereby accomplishing access authentication.
Preferably, the verifying by the first entity the signature and the message integrity check code of the access authentication response message includes: determining whether a random number used by the second entity in the access authentication response message is a random number generated by the first entity; if so, determining whether the equation se≡ID2·t)h(t∥M)(mod N) is true; and if the equation is true, determining whether a message integrity check code of a field Sig2 and all previous fields of the field Sig2 in the access authentication response message is valid.
Preferably, verifying by the second entity integrity of the access authentication acknowledgement message includes: verifying whether a random number used by the first entity in the access authentication acknowledgement message is a random number generated by the second entity; and if so, determining whether a message integrity check code of a field N2 and all previous fields of the field N2 in the access authentication acknowledgement message is valid.
An embodiment of the invention further discloses a two-way access authentication method including: sending by a first entity an access authentication request message to a second entity according to system parameters predefined by a third entity, and verifying by the second entity a signature signed by the first entity, and if the signature is correct, calculating by the second entity a shared master key of the second entity, wherein the system parameters comprise a product N of two large prime numbers, an integer e satisfying gcd(e, φ(N))=1, an integer d satisfying ed E≡1(mod φ(N)) and a strong one-way hash function h, with φ( ) being the Euler's totient function; sending by the second entity an identity verification request message to a third entity, verifying by the third entity validity of identities of the first and second entities and sending an identity verification response message to the second entity, and verifying by the second entity the identity of the first entity according to the identity verification response message; if the identity of the first entity is correct, generating by the second entity an access authentication response message, and sending by the second entity the access authentication response message to the first entity, and verifying by the first entity a signature and a message integrity check code of the access authentication response message, and if the signature and the message integrity check code of the access authentication response message are both correct, calculating by the first entity a shared master key of the first entity; and
sending by the first entity an access authentication acknowledgement message to the second entity, verifying by the second entity integrity of the access authentication acknowledgement message, and if the verification is passed, the shared master keys of the first and second entities are consistent, thereby accomplishing access authentication.
Preferably, the verifying by the first entity the signature and the message integrity check code of the access authentication response message includes: determining whether a random number used by the second entity in the access authentication response message is a random number generated by the first entity; if so, determining whether the equation se≡ID2·th(t∥M)(mod N) is true; and if the equation is true, determining whether the message integrity check code of a field Sig2 and all previous fields of the field Sig2 in the access authentication response message is valid.
Preferably, the verifying by the second entity integrity of the access authentication acknowledgement message includes: verifying whether a random number used by the first entity in the access authentication acknowledgement message is a random number generated by the second entity; and if so, determining whether a message integrity check code of a field N2 and all previous fields of the field N2 in the access authentication acknowledgement message is valid.
As can be seen from the foregoing embodiments of the invention, the authentication between the first entity and the second entity does not require an authentication server, it is not necessary to set up a secure channel between the third entity and the first and second entities either, and the first and second entities can directly perform two-way authentication. Moreover, identity-based public key mechanism and WAPI background identity validity verification mechanism are combined, providing the following advantages: 1. reduced maintenance workload: unlike traditional digital certificate based public key mechanism, the identity-based public key mechanism of the present invention does not require maintenance of a Public Key Infrastructure (PKI); 2. reduced communication overhead: digital certificates are not needed to be transmitted during authentication, thereby reducing communication overhead; 3. the disadvantage of identity-based public key mechanism that the validity of identities are hard to be verified can be avoided with the combination of WAPI identity verification mechanism; 4. unlike WAPI, TTP signature during identity verification can be done with traditional public key algorithms, or with identity-based public key algorithms. 5. wide application: authentication can be performed according to the invention in all sorts of wired an wireless networks involving two-way authentication.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 illustrates a flow chart of a two-way access authentication method according to an embodiment of the invention.



DETAILED DESCRIPTION OF THE INVENTION
A method according to the invention is implemented with a Trusted Third Party (TTP), which may be an authentication server or any other authentication enabling devices. The TTP is responsible for physical identification of the identity of a user entity, generating system parameters and setting up user parameters.
Reference is made to FIG. 1 illustrating a flow chart of two-way access authentication method according to an embodiment of the invention. A specific implementation is described as follows:
Step 1: firstly, a TTP sets up system parameters, which include:
N: the product of two large prime numbers;
e: an integer satisfying gcd(e,φ(N))=1, with φ( ) being the Euler's totient function;
d: an integer satisfying ed 1(mod φ(N)); and
a strong one-way hash function h:{0,1}*→zφ(N).
And d is the system's private key, i.e. a master key, and (N,e,h) are parameters that may be published.
The TTP is responsible for keeping the system private key d secret.
Each user entity may calculate its own private key via the TIP. Particularly, assume that IDi represents an identity that can uniquely identify a user entity i. Therefore, after physical identification of the identity of the user entity I, the TTP generates for the user entity a private key as gi←IDid(mod N), where i=1, 2.
The foregoing step is performed in first use, and when the system parameters are set, it is not necessary to perform this step repeatedly in subsequent processes.
Step 2) A first entity sends an access request message to a second entity, the second entity verifies a signature of the first entity, and if the signature is right, a shared master key of the second entity is calculated.
In the foregoing step, the access request message includes the fields of:



















ID1
ID2
N1
TPK1
Sig1










where:
Field ID1: identity information of the first entity;
Field ID2: identity information of the second entity;
Field N1: a random number generated by the first entity;
Field TPK1: a temporary public key Y1 for D-H key exchange that is chosen by the first entity, and have a corresponding private key X1; and
Field Sig1: a signature signed by the first entity of the field TPK1 and all previous fields of the field TPK1, in the form of: (s, t). It is calculated as follows: suppose M is the field TPK1 and all previous fields of the field TPK1 of the message, then we have t=re(mod N) and s=g1·rh(t∥M)(mod N).
Step 3) the second entity generates an access authentication response message and sends the access authentication response message to the first entity, the first entity verifies a signature and a message integrity check code of the access authentication response message sent by the second entity, and if they are right, a shared master key of the first entity, MK, is calculated.
In the foregoing step, the access authentication response message includes the fields of:





















ID1
ID2
N1′
N2
TPK2
Sig2
MIC1










where:
Field ID1: the identity information of the first entity;
Field ID2: the identity information of the second entity;
Field N1′: a random number used by the second entity;
Field N2: a random number generated by the second entity;
Field TPK2: a temporary public key Y2 for D-H key exchange that is chosen by the second entity, and have a corresponding private key X2;
Field Sig2: a signature signed by the second entity of the field TPK2 and all previous fields of the field TPK2, in the form of (s, t). It is calculated as follows: suppose M is the field TPK2 and all previous fields of the field TPK2 of the message, then we have t=re(mod N) and s=g2·rh(t∥M)(mod N); and
Field MIC1: a message integrity check code of the field Sig2 and all previous fields of the field Sig2, with an integrity check key derived from the master key MK.
The first entity verifying the signature and the message integrity check code of the access authentication response message sent by the second entity includes: the first entity determines whether the random number N1′ used by the second entity in the access authentication response message is the random number generated by the first entity itself, and if not, the message is discarded; if so, the first entity determines whether the equation Se≡ID2·th(t∥M)(mod N) is true, and if not, the message is discarded; if it is true, the first entity calculates a shared master key MK from (X1, Y2), and determines whether MIC1 is valid, and if not, the message is discarded; if it is valid, authentication of the second entity succeeds, and the shared master key MK is used as a negotiated master key, which may be used for further deriving an encryption key and an integrity check key.
Step 4) the first entity sends an access authentication acknowledgement message to the second entity, the second entity verifies the integrity of the access authentication acknowledgement message, and if the verification is passed, then the shared master keys of the first and second entities are consistent, and access authentication is accomplished.
In the foregoing step, the access authentication acknowledgement message includes the fields of:



















ID1
ID2
N1
N2′
MIC2










where:
Field ID1: the identity information of the first entity;
Field ID2: the identity information of the second entity;
Field N1: the random number used by the first entity;
Field N2′: a random number used by the first entity; and
Field MIC2: a message integrity check code of the field N2 and all previous fields of the field N2, with an integrity check key derived from the master key MK.
Upon reception of the access authentication acknowledgement message sent by the first entity, the second entity determines whether the random number N2′ used by the first entity is the random number generated by the second entity itself, and if not, the message is discarded; if so, the second entity determines from the integrity check key derived from the master key MK whether MIC2 is valid, and if not, the message is discarded; if it is valid, authentication succeeds and MK is a negotiated master key.
By the foregoing process, the first and second entities set up a shared master key MK and accomplish two-way authentication.
For further security improvements, upon reception of the access authentication request message sent by the first entity, the second entity may further verify the validity of the identity of the first entity, and if the verification of the identity of the first entity is passed, the second entity may send the access authentication response message to the first entity. Therefore, the following steps may be included between the steps 2) and 3):
Step 11) the second entity sends an identity verification request message to the TTP, and the TTP verifies the validity of the identities of the first and second entities, the identity verification request message including the fields of:



















ID1
ID2
TTP
N1
N2










where:
Field ID1: the identity information of the first entity;
Field ID2: the identity information of the second entity;
Field TTP: the TTP responsible for verifying the validity of the identity of the device;
Field N1: the random number used by the first entity; and
Field N2: the random number used by the second entity.
Step 21) the TTP generates according to a verification result an identity verification response message, and sends the identity verification response message to the second entity, the second entity verifies the identity of the first entity according to the identity verification response message, and if it is correct, step 3) is performed. The identity verification response message includes the fields of:



















ID1
ID2
TTP
N1
N2
RES1
RES2
SigTTP









where:
Field ID1: the identity information of the first entity;
Field ID2: the identity information of the second entity;
Field TTP: the TTP responsible for verifying the validity of the identity of the device;
Field N1: the random number generated by the first entity;
Field N2: the random number generated by the second entity;
Field RES1: a result from the verification by the Trp to the validity of the identity of the first entity;
Field RES2: a result from the verification by the TTP to the validity of the identity of the second entity; and
Field SigTTP: a signature signed by the TTP of the field RES2 and all previous fields of the field RES2, which may be a traditional PKI-based signature or an identity-based signature.
Upon reception of the identity verification request message sent by the second entity, the TTP verifies the identities of the first and second entities, and encapsulates verification results in the identity verification response message and sends it to the second entity. The identity verification response message is paired with the identity verification request message. The second entity may determine the validity of the identity of the first entity according to the field RES1 and the field SigTTP in the identity verification response message.
Then, the access authentication response message sent by the second entity to the first entity in step 3) includes the fields of:





















ID1
ID2
N1′
N2
TPK2
Sig2
MIC1
RES1
RES2
SigTTP









Where:
Field ID1: the identity information of the first entity;
Field ID2: the identity information of the second entity;
Field N1′: the random number used by the second entity;
Field N2: the random number generated by the second entity;
Field TPK2: the temporary public key Y2 for D-H key exchange chosen by the second entity and having a corresponding private key X2;
Field Sig2: the signature signed by the second entity of the field TPK2 and all previous fields of the field TPK2, in the form of (s, t). It is calculated as follows: suppose M is the field TPK2 and all previous fields of the field TPK2 of the message, then we have t=re(mod N) and s=g2·rh(t∥M)(mod N);
Field MIC1: the message integrity check code of the field Sig2 and all previous fields of the field Sig2, with the integrity check key derived from the master key MK;
Field RES1: the result from the verification by the TTP to the validity of the identity of the first entity;
Field. RES2: the result from the verification by the TTP to the validity of the identity of the second entity; and
Field SigTTP: the signature signed by the TTP of the field RES2 and all previous fields of the field RES2.
Upon reception of the access authentication response message sent by the second entity, the first entity determines whether the random number N1′ used by the second entity is the random number generated by the first entity itself, and if not, the message is discarded; if so, the first entity determines whether the equitation se≡ID2·th(t∥M)(mod N) is true, and if not, the message is discarded; if it is true, the first entity calculates a shared master key MK from (X1, Y2), and determines whether MIC1 is valid, and if not, the message is discarded; if it is valid, authentication of the second entity succeeds, and the shared master key MK is used as a negotiated master key, which may be used for further deriving an encryption key and an integrity check key.
The first entity may determine the validity of the identity of the second entity according to the field RES2 and the field SigTTP in the access authentication response message.
Then, the access authentication acknowledgement message sent by the first entity to the second entity in step 4) includes steps of:



















ID1
ID2
N1
N2′
MIC2










where:
Field ID1: the identity information of the first entity;
Field ID2: the identity information of the second entity;
Field N1: the random number generated by the first entity;
Field N2′: a random number used by the first entity; and
Field MIC2: a message integrity check code of the field N2 and all previous fields of the field N2, with an integrity check key derived from the master key MK.
Upon reception of the access authentication acknowledgement message sent by the first entity, the second entity determines whether the random number N2′ used by the first entity is the random number generated by the second entity itself, and if not, the message is discarded; if so, the second entity determines from the integrity check key derived from the master key MK whether MIC2 is valid, and if not, the message is discarded; if it is valid, authentication succeeds and MK is a negotiated master key.
By the foregoing process, the first and second entities set up a shared master key MK and accomplish two-way authentication.
As can be seen from the foregoing embodiments of the invention, the authentication between the first entity and the second entity does not require an authentication server, it is not necessary to set up a secure channel between the third entity and the first and second entities either, and the first and second entities can directly perform two-way authentication. Moreover, identity-based public key mechanism and WAPI background identity validity verification mechanism are combined, providing the following advantages: 1. reduced maintenance workload: unlike traditional digital certificate based public key mechanism, the identity-based public key mechanism of the present invention does not require maintenance of a Public Key Infrastructure (PKI); 2. reduced communication overhead: digital certificates are not needed to be transmitted during authentication, thereby reducing communication overhead; 3. the disadvantage of identity-based public key mechanism that the validity of identities are hard to be verified can be avoided with the combination of WAPI identity verification mechanism; 4. unlike WAPI, TTP signature during identity verification can be done with traditional public key algorithms, or with identity-based public key algorithms. 5. wide application: authentication can be performed according to the invention in all sorts of wired an wireless networks involving two-way authentication.

## Claims

1. A two-way access authentication method, comprising by a first entity an access authentication request message to a second entity according to system parameters predefined by an authentication server, and verifying by the second entity a signature signed by the first entity and if the signature is correct, calculating by the second entity a shared master key of the second entity, wherein the system parameters comprise a product N of two large prime numbers, an integer e satisfying gcd(e,φ(N))=1 an integer d satisfying ed≡1(mod φ(N)) and a strong one-way hash function h, with φ( ) being the Euler's totient function, wherein the integer d is the system's private key which is secretly maintained by the authentication server, the authentication server generates for the ith entity a private key as gi←IDid (mod N), where IDi represents an identity of the ith entity, and i=1, 2;
generating by the second entity an access authentication response message, sending by the second entity the access authentication response message to the first entity, and verifying by the first entity a signature and a message integrity check code of the access authentication response message, and if the signature and the message integrity check code of the access authentication response message are both correct, calculating by the first entity shared master key of the first entity; and
sending by the first entity an access authentication acknowledgement message to the second entity, verifying by the second entity integrity of the access authentication acknowledgement message, and if the verification is passed, the shared master keys of the first and second entities are consistent, thereby accomplishing access authentication.

2. The method according to claim 1, wherein the verifying by the first entity the signature and the message integrity check code of the access authentication response message comprises:
determining whether a random number used by the second entity in the access authentication response message is a random number generated by the first entity;
if so, determining whether the equation se≡ID2·th(t∥M)(mod N) is true;
and if the equation is true, determining whether a message integrity check code of a field Sig2 and all previous fields of the field Sig2 in the access authentication response message is valid.

3. The method according to claim 1, wherein verifying by the second entity integrity of the access authentication acknowledgement message comprises:
verifying whether a random number used by the first entity in the access authentication acknowledgement message is a random number generated by the second entity; and
if so, determining whether a message integrity check code of a field N2 and all previous fields of the field N2 in the access authentication acknowledgement message is valid.

4. A two-way access authentication method, comprising by a first entity an access authentication request message to a second entity according to system parameters predefined by an authentication server, and verifying by the second entity a signature signed by the first entity, and if the signature is correct, calculating by the second entity a shared master key of the second entity, wherein the system parameters comprise a product N of two large prime numbers, an integer e satisfying gcd(e,φ(N))=1 an integer d satisfying ed≡1(mod φ(N)) and a strong one-way hash function h, with φ( ) being the Euler's totient function, wherein the integer d is the system's private key which is secretly maintained by the authentication server, the authentication server generates for the ith entity a private key as gi←IDid (mod N), where IDi represents an identity of the ith entity, and i=1, 2;
sending by the second entity an identity verification request message to the authentication server, verifying by the authentication server validity of identities of the first and second entities and sending an identity verification response message to the second entity, and verifying by the second entity the identity of the first entity according to the identity verification response message;
if the identity of the first entity is correct, generating by the second entity an access authentication response message, and sending by the second entity the access authentication response message to the first entity, and verifying by the first entity a signature and a message integrity check code of the access authentication response message, and if the signature and the message integrity check code of the access authentication response message are both correct, calculating by the first entity a shared master key of the first entity; and
sending by the first entity an access authentication acknowledgement message to the second entity, verifying by the second entity integrity of the access authentication acknowledgement message, and if the verification is passed, the shared master keys of the first and second entities are consistent, thereby accomplishing access authentication.

5. The method according to claim 4, wherein the verifying by the first entity the signature and the message integrity check code of the access authentication response message comprises:
determining whether a random number used by the second entity in the access authentication response message is a random number generated by the first entity;
if so, determining whether the equation se≡ID2·th(t∥M)(mod N) is true; and
if the equation is true, determining whether the message integrity check code of a field Sig2 and all previous fields of the field Sig2 in the access authentication response message is valid.

6. The method according to claim 4, wherein the verifying by the second entity integrity of the access authentication acknowledgement message comprises:
verifying whether a random number used by the first entity in the access authentication acknowledgement message is a random number generated by the second entity; and
if so, determining whether a message integrity check code of a field N2 and all previous fields of the field N2 in the access authentication acknowledgement message is valid.