Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
In one embodiment, referring to fig. 1, a smart card based identity authentication method is disclosed, comprising a registration step, a login step and an authentication step, wherein,
the registration step includes the user registering with the background server SBRegistration, background Server SBTo the userIssuing smart cards C, each smart card C having two latest random keys k stored therein1,k2And a unique identifier ID of the smart cardC;
The login step comprises that the user inserts the smart card C into the card reader RCMiddle to login background server SB;
The authentication step comprises that after the login is successful, the smart card C and the background server S are authenticatedBWherein the two random keys k1,k2Digital signature is carried out by using an improved ECC signature method, and simultaneously a digital certificate and a random key K are subjected to AES (advanced encryption standard) encryption algorithm by using a shared key K1,k2And the signature is integrally encrypted, and the background server S is carried out on the smart card CBAfter the authentication is successful and the background server SBAfter the smart card C is successfully authenticated, the random key k is updated1,k2。
For this embodiment, most smart cards use the DES or 3DES algorithm to encrypt data. DES uses only a 56-bit key, one bit in each of the 8 octets for odd parity on each octet, a weakness that is easily exploited by attacks and other known methods, and DES thus becomes an insecure block cipher. The 3DES is a DES-based encryption algorithm, so that the realization speed is low due to the limitation of 64 bytes in the packet length, and in the AES encryption process, a permutation and replacement network is used in each round, so that the method is suitable for hardware and software realization. Therefore, the AES is introduced to replace DES and 3DES, so that the safety of information and original data in the method can be improved.
In the ECC signature process, the inversion operation takes a long time. In the process of signing data by using the improved ECC signature scheme, when a transmitting end signs, s is k-hrdAAnd r '═ sG + h' rQ is calculated during the verification of the certification endA=(k-hrdA)G+h′rdATherefore, the improved ECC signature scheme does not need modular inversion operation, and has the advantages of small calculation amount, high processing speed, small occupied storage space and high speed of the digital signature process.
As can be appreciated, the first and second,the embodiment uses the improved ECC signature method to carry out the authentication on the random key k1,k2Digital signature is carried out, the signature is verified through a public key at an authentication end, and a random secret key k is ensured1,k2The source legitimacy avoids the threat of being altered by an attacker during transmission. Before the authentication information is sent, the authentication information is encrypted by using an AES symmetric key algorithm, so that the security in the transmission process is greatly improved. The AES algorithm key is variable and may be independently designated 128bits, 192bits, 256 bits. Because of the use of long keys, the possibility of exhaustive attacks is relieved at the present stage, and the method has stable mathematical basis and is resistant to cryptanalysis.
In addition, each smart card has unique identification data, namely unique identifiers, so that the data privacy and the position privacy of the user are guaranteed.
In another embodiment, the registering step further comprises: the smart card C is a background server SBUsing a unique identifier IDCA shared secret key K, a user password P' and two random secret keys K1,k2The smart card C is sent to the user through a security channel after being personalized; wherein the user password P' is not stored in the background server SBBut in the smart card C, the smart card C and the background server SBHas stored therein both said two random keys k1,k2Unique identifier IDCAnd an AES encryption key K as a shared key.
The secure channel is to embed the original information to be transmitted into a data packet of another protocol after encryption and protocol encapsulation processing, and to transmit the data packet like a common data packet. Through such processing, only the source and destination users can interpret and process the nesting information in the channel, and the nesting information is meaningless information for other users.
For this embodiment, an illegal reader RCCan not be used as a smart card C and a background server SBIn between, because he only knows the shared secret K andsecret key k1,k2The intercepted information can only be decrypted at any time, and it is difficult for an attacker to find the parameters because the parameters are only located in the smart card C and the backend server SBAre shared between them. Therefore, the method can prevent illegal card reader RCMan-in-the-middle attacks.
If the backend server stores the user password P ', there is a risk of password theft while maintaining P'. The method does not need to store the user password P' in the background server SBThus eliminating the risk of password theft. Thus, the method is also secure against internal attacks.
In another embodiment, the step of logging further comprises: the user inputs a user password P, the smart card C compares whether the user password P is equal to the user password P' stored in the smart card C, if not, the smart card C rejects the login request and the smart card C and the card reader R are connectedCThere is no data exchange between them, otherwise the card reader RCTo a background server SBAnd sending a login request.
In another embodiment, a hardware function is added to the smart card C to update the random key.
With this embodiment, the validity of the key update is ensured. After the smart card sends the authentication message, the internally stored random key needs to be updated, so a function f () solidified on the smart card hardware is introduced to update the random key k1,k2The problem that the key updating fails when the intelligent card is internally failed is solved.
Referring to fig. 2, in another embodiment, the authenticating step further comprises:
step 1, background server S
BUsing self-private keys
Random key k by improved ECC signature method
1,k
2Signature derivation
Random key K by AES encryption algorithm using shared key K
1,k
2,
And a background server S
BCertificate of
Encrypting, sending the encrypted message to the reader R
CCard reader R
CSending the message to the smart card C;
step 2, after receiving the message, the smart card C decrypts the message by using the shared secret key K to obtain a random secret key K
1,k
2Signature, system and method
And a background server S
BCertificate of
First, the background server S is verified
BIf the certificate is legal, the background server S is taken out
BIn certificate of (2) S
BOf (2) a public key
Completing an improved ECC verification signature that is a random key k to be obtained after the successful ECC verification signature
1,k
2With a random key k stored internally of the smart card C
1,k
2Comparing, if they are identical, then making comparison with card reader R
CThe verification is successful, otherwise, the verification fails;
step 3, for the card reader R
CAfter the verification is finished, the smart card C uses the self private key SK
CRandom key k by improved ECC signature method
1,k
2And a unique identifier ID
CSignature derivation
Random key K by AES encryption algorithm using shared key K
1,k
2And a unique identifier ID
CSignature, system and method
And certificate Cert of the Smart card C
CEncrypting, sending the encrypted message to the reader R
CThe random key k is then updated with a shared function f () fixed on the smart card C
1,k
2;
Step 4, the card reader R
CDirectly transmitting the received ciphertext E
K((k
1||k
2||ID
C)||
Forward to background server S
B;
Step 5, background server S
BDecrypting the received message with the shared secret key K to obtain a random secret key K
1,k
2Unique identifier ID
CSign of
And certificate Cert of the Smart card C
C(ii) a Certificate Cert of prior-certificate smart card C
CIf the certificate is legal, the certificate Cert of the smart card C is taken out
CPublic key PK of smart card C in (1)
CImplementing an improved ECC verification signature that will be successful followed by a unique identifier ID
CAnd a background server S
BInternally stored unique identifier
Comparing, if they are identical, verifying random key k
1And k
2Is equal to the background server S
BInternally stored random key k
1And k
2If equal, the smart card C is successfully verified and then stored in the background server S
BThe shared function f () in (1) updates the random key k
1,k
2。
Wherein the f () function updates k as follows
1And k
2:
Where h () is a one-way cryptographic hash function, h (ID)
C) Is a unique identifier ID to a smart card
CAnd (6) taking the abstract.
In the method, the smart card C compares the messages
K in (1)
1、k
2With the random key k stored in the smart card C
1、k
2Authentication backend server S
BThe validity of (2). Likewise, a background server S
BBy comparing messages
ID of (1)
C、k
1、k
2With a background server S
BThe unique identifier ID stored therein
CAnd a random key k
1、k
2And verifying the validity of the smart card C. Therefore, the method comprises the smart card C and the background server S
BAuthentication in between.
With this embodiment, the attacker, after listening to the communication between the smart card and the background server, retransmits the data at the smart card C and the background server S in the validity time range windowBAnd a parallel session is started to imitate a legal user to log in a background server. The attacker cannot create a valid new login message because of the random key k for each new session1And k2Are all new. Thus, the method is secure against parallel session attacks.
If an attacker eavesdrops on the discovery
He cannot obtainUnique identifier ID
CBecause he does not know the shared key K and the random key K
1,k
2. Due to the background server S
BStoring a unique identifier ID
CBackground server S
BCan be identified by a unique identifier ID
CJudgment E
K((k
1||k
2||ID
C)||
And a smart card C to prevent counterfeiting and playback. Thus, the background server S
BForgery and replay attacks can be detected and prevented.
If an attacker eavesdrops on the output of the smart card
In the next authentication session he cannot pretend to be a legitimate reader because of the random key k
1And k
2Changes occur in each session. Encrypting the message using AES encryption algorithm, the smart card unique identification number ID even if the output was captured by an attacker
CAnd a random key k
1,k
2Is also protected. Therefore, the method is not easily eavesdropped.
In another embodiment, the identity authentication method further comprises a password updating step, and the password updating step further comprises that when the user needs to change the password, the user inserts the smart card C into the card reader RCInputting a user password P, comparing whether the user password P is equal to the user password P' stored in the smart card C by the smart card C, if not, refusing the request of changing the password, and the smart card C and the card reader RCThere is no data exchange between them; if equal, the user can input a new user password P'nThe smart card C uses the new user password P'nThe password change is completed instead of the user password P' stored in the smart card C.
In another embodiment, the improved ECC signature method specifically refers to:
step 1), a sending end A selects a random number k, wherein k belongs to [1, p-1 ];
step 2), calculating r ═ kG (x, y) ═ x1,y1) If r is 0, returning to step 1);
step 3), calculating the abstract of the message m, namely h ═ h (m);
step 4), calculating s ═ k-hrdAIf s is equal to 0, go to step 1);
step 5), attaching (r, s) as a signature to m and then sending the signature to a receiving end B;
wherein p is a prime number; g (x, y) is a base point on the elliptic curve; r is part of the signature on message m; h is the digest of message m; h () represents a hash function; dA is the private key of sender A; s is another part of the signature for message m; (r, s) is the signature of message m.
With this embodiment, with the improved ECC signature method, modulo inversion operation is not required, which can reduce the computational burden and improve efficiency. In addition, the message m is firstly abstracted, and then the abstract is signed and checked, so that the calculation speed is improved, the length of the abstract is smaller than that of the plaintext message m, the time is saved during calculation of s, the signature safety is improved, and the one-way hash function is irreversible, so that even if an attacker obtains the abstract of the message m, the attacker cannot solve the message m from the message m.
In another embodiment, the improved ECC verification signature specifically refers to:
1) the receiving end B firstly judges whether r and s are integers in the interval [1, p-1], if any one of the checks fails, the signature is rejected, otherwise, the signature continues;
2) calculating h ═ h (m);
3) calculate r '═ sG (x, y) + h' rQA;
4) Accepting the signature if and only if r' ═ r, else rejecting the signature;
wherein p is a prime number; g (x, y) is a base point on the elliptic curve; r' is a part of the signature for message m; h' is the digest of message m; s is another part of the signature for message m; (r, s) is the signature of message m; h () represents a hash function; qAIs the public key of the sender a.
With the embodiment, the improved ECC signature verification method is used, modular inversion operation is not needed, the operation burden can be reduced, and the efficiency can be improved.
In another embodiment, a comparison of the efficiency and security of the present method and other authentication schemes is presented.
Table 1 is a comparison of the efficiency of the present process with other protocols. In Table 1, Te、Th、TmAnd TaThe time required for exponentiation, hash, elliptic curve multiplication and addition and subtraction of elliptic curve points, TAESIs the time required by AES encryption and decryption operation in the method. In general, the temporal complexity of these operations can be roughly expressed as Te>Th>>Tm>Ta. As can be seen from table 1, the time complexity of the method is lower in each scheme.
Table 2 shows the security comparison between the present method and other schemes, and it can be seen from table 2 that the present method can resist all attacks listed in the table, and has higher security.
TABLE 1
TABLE 2
Although the embodiments of the present invention have been described above with reference to the accompanying drawings, the present invention is not limited to the above-described embodiments and application fields, and the above-described embodiments are illustrative, instructive, and not restrictive. Those skilled in the art, having the benefit of this disclosure, may effect numerous modifications thereto without departing from the scope of the invention as defined by the appended claims.