Background technology
By the end of the second quarter in 2015, China mobile netizen userbase reached 6.57 hundred million people, and Chinese smart phone user has reached 6.01 hundred million people, and mobile payment increases by 445% on a year-on-year basis, and Chinese Consumer's has entered the mobile payment epoch.But lawless person makes the Malwares such as personation Net silver upgrading assistant, pirate mobile phone Net silver client, fishing Alipay, and mobile payment security has been arrived in serious threat.
Domestic first part Mobile banking APP safety message shows, major part Mobile banking APP is also dangerous, especially the Android client of minority Mobile banking exists that encryption mechanism is imperfect, the not potential safety hazard such as validate service device identity, likely by computer hacker or trojan horse utilize.Log in the first step using Mobile banking's client as user, because will input the sensitive information such as Bank Account Number and password, fail safe is particularly important.But safety message shows, and it is obvious that two classes log in potential safety hazard: a class is that encryption mechanism is imperfect or too simple, is easy to victim and kidnaps or crack; Another kind of is do not verify service end identity in communication process, thus causes landfall process to be easy to meet with " man-in-the-middle attack ".Wherein, part mobile phone Net silver APP uses " HTTP(HTML (Hypertext Markup Language))+simple encryption " mode transfer, be very easily held as a hostage or crack.
It is reported, rogue program that is counterfeit, fishing class adopts so a kind of gimmick possibly: in the operation of background monitoring foreground window, if foreground is the log-in interface of a Bank application, rogue program just starts the counterfeit interface of oneself immediately, and this action can near user without any perception.And user when without discover once input user name password in counterfeit log-in interface, will cause account and password stolen.More frighteningly, a rogue program even can detect simultaneously, counterfeit and kidnap the log-in interface of multiple bank client, and a lot of bank APP can not effectively solve this kind of problem.
The safety problem of APP application is paid close attention to by user gradually, if utilize server stores customer data, that should consider to use SSL to encrypt client with the communication between server, and SSL can ensure sensitive information (as: bank's card number, social security card number, logs in voucher etc.) transmission security.
360 mobile phone safe centers statistics find have the mobile phone A PP of 50% using https-secure host-host protocol, use the APP of https agreement, comprise mobile phone advertisement plug-in unit class, APP that multiple types such as class are shared in mobile-phone payment class, social activity.Brainstrust from Hanover and Marburg university has carried out the research of SSL and TLS leak to 1.3 ten thousand most popular freewares in PlayStore, they find, 1074 APP program packages are containing SSL particular code, these codes or accept all certifications, accept all authenticating host names, become potential MITM(man-in-the-middle thus) leak attacked.Scientists has also carried out manual audit to 100 APP application programs, found that, due to the existence of SSL leak, it is open that 41 programs are attacked MITM.Brainstrust represents, leak APP application program may be utilized, and assailant is stolen extremely sensitive user profile, comprises them at Facebook, Google, Yahoo, even the username and password of Web bank.Although use https agreement, these APP server port information still may be stolen by hacker, jeopardize mobile phone and log in the personal secrets such as account number cipher used.
Summary of the invention
The APP that the present invention is directed to above-mentioned client terminal communicate with server end exist counterfeit, go fishing, the problem such as man-in-the-middle attack, innovation proposes safety moving communication architecture and its implementation of a kind of dynamic bidirectional certification, to solving the problem of secure communication.
Above-mentioned first object of the present invention, its technical solution be achieved is: a kind of safety moving communication architecture of dynamic bidirectional certification, it is characterized in that: described safety moving communication architecture based on SSL certificate between client terminal and server end and unsymmetrical key to realization, wherein said SSL certificate is to be signed and issued by server end and in the APP that develops in client terminal of hard coded, described client terminal verifies matching to from the SSL certificate of server end and the SSL certificate of hard coded in APP business procedure, described unsymmetrical key is with the user registered at server end uniquely corresponding to a pair PKI for resulting from client terminal and private key, wherein said PKI is sent by SSL escape way and only receives and keeps to server end, described encrypted private key is preserved and to be solidified in client terminal and to have non-network transporting, described server end passes through the validity of SSL escape way and public key verifications private key signature.
Further, described SSL certificate be server end lock based on certificate certainly sign and issue SSL certificate.
Further, described SSL certificate is the SSL certificate signed and issued of the third-party institution that server end adopts.
Above-mentioned second object of the present invention, its technical solution be achieved realizes based on previous security mobile communication framework, it is characterized in that comprising step:
S01, server end sign and issue SSL certificate and in the APP that develops in client terminal of hard coded, client terminal produces the unsymmetrical key pair that is specific to user and the machine automatically when user registers simultaneously, PKI right for unsymmetrical key sent by SSL escape way and receives and keeps in server end, and deleting the PKI in the machine; The right private key of unsymmetrical key is by PIN/passcode encrypting storing the machine at client terminal;
S02, client terminal send certification verification request to server end;
SSL certificate is sent to client terminal by S03, server end;
Whether S04, client terminal contrast the SSL certificate being hard-coded in the machine consistent with the SSL certificate received, and complete the certification of client terminal to server end;
S05, server end carry out completeness check to the APP of client terminal, and set up SSL safe lane;
S06, user input ID and PIN on client terminal, and the private key that the machine stores is deciphered;
S07, server end send a random challenge code to client terminal by SSL safe lane;
The private key that S08, client terminal the machine store is signed to described random challenge code, and signature value is postbacked and deliver to server end;
The corresponding PKI that S09, server end store carries out sign test to the signature value that client terminal sends, and completes the certification of server end to client terminal;
S10, client terminal and server end carry out safe APP business.
Further, described safety moving communication implementation method is for having defence hacker fishing, the Mobile banking of man-in-the-middle attack demand, mobile payment or the communication of social sharing platform respectively and separately between background server.
Apply safety moving communication architecture and its implementation of dynamic bidirectional certification of the present invention, compare to existing mobile communication framework and there is significant progressive: client terminal and server end two-way authentication, SSL security protocol is adopted to carry out communication, ensure that the fail safe of communication data, eliminate exist in common mobile communication mechanism counterfeit, fishing, man-in-the-middle attack threaten.Server end adopts from grant a certificate, without the need to third-party institution's application certificate, eliminates loaded down with trivial details certificate request, maintenance process, and provides cost savings to a certain extent; Client terminal certification, without the need to device certificate, provides identity access rights to manage (IAM) by unsymmetrical key to PKI technology, can defend hacker's beach assault, phishing attack, malware attacks completely.
Embodiment
The present invention is directed to exist in existing mobile communication mechanism counterfeit, fishing, man-in-the-middle attack problem, propose a kind of safety moving communication architecture of dynamic bidirectional certification, and give its implementation.In order to be illustrated more clearly in mobile communication framework in the present invention and implementation method, below in conjunction with drawings and Examples, the present invention is specifically described, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
First need introduce be dynamic bidirectional certification of the present invention rely realize hardware structure, its based on SSL certificate between client terminal and server end and unsymmetrical key to realization, wherein this SSL certificate is to be signed and issued by server end and in the APP that develops in client terminal of hard coded, this client terminal verifies matching to from the SSL certificate of server end and the SSL certificate of hard coded in APP business procedure, this unsymmetrical key is with the user registered at server end uniquely corresponding to a pair PKI for resulting from client terminal and private key, wherein said PKI is sent by SSL escape way and only receives and keeps to server end, this encrypted private key is preserved and to be solidified in client terminal and to have non-network transporting, this server end passes through the validity of SSL escape way and public key verifications private key signature.
It should be noted that, a usual APP is fixedly attached to a station server, so above-mentioned SSL certificate can be server end lock based on certificate certainly sign and issue SSL certificate, applicability is stronger.In certain practical application, the SSL certificate that server end also can adopt the third-party institution to sign and issue, the certification of client terminal to server end needs authentication certificate chain, to confirm whether this certificate is that trust authority is issued, if gone wrong in credentials verification process, client terminal can warn user that this certificate is insincere, but certain customers still can select to trust problematic certificate, thus brings chance to hacker's fishing and man-in-the-middle attack.
The implementation method of safety communication of the present invention is then described in detail in detail: before employing dynamic bidirectional certification mobile communication framework of the present invention carries out communication, client terminal user need register at server end, as shown in Figure 1, for client terminal user in the present invention is in the flow process of server end registration ID, it at least comprises following steps:
A, client terminal send certification verification request to server end;
SSL certificate is sent to client terminal by B, server end;
Whether the contrast of C, client terminal is hard-coded in local SSL certificate consistent with the SSL certificate received;
D, server end carry out completeness check to client terminal APP;
E, client terminal and server end set up SSL secure communication channel;
F, user arrange user name, and simultaneously client terminal is at mobile device for user produces a unsymmetrical key pair, and is encrypted through SSL by PKI and sends to server end, and deletes local PKI, and public key encryption is preserved by server end;
User name is sent to server end by G, client terminal user together with user name signature;
H, server end check whether user name can be used, and the validity of certifying signature;
I, client terminal require that user arranges PIN/passcode/ fingerprint, are used for the right private key of encryption key.
Further, server end SSL certificate described in step B is from grant a certificate, and namely refer to the certification authority not by being trusted, issued the certificate of self by signature entity, publisher is identical with certificate main body.Different with computer browsing page, what mobile phone application was generally fixed is connected to a station server end, be applicable to adopting from grant a certificate, the benefit of self-signed certificate is used to be do not need extra application, other certificates are installed, eliminate loaded down with trivial details certificate request, maintenance process, self-signed certificate is free simultaneously, provides cost savings to a certain extent.
Further, for from grant a certificate, adopt certificate lock-in techniques here, directly server side certificate is hard-coded in client terminal, then the trust store using the trust store oneself defined to replace cell phone system to carry in the application, goes to connect the server end of specifying.Adopt in this way, application no longer relies on the trust store that system carries, and makes to crack this application and becomes complicated.
Further, in step e, client terminal and server end are set up in SSL safe lane and are at least comprised following steps:
(1) client terminal produces random number Client.Random, sends to server end;
(2) server end produces random number Server.Random, issues client terminal;
(3) client terminal produces the pre-master key Pre-master-key of use communication later at random, and encrypts pre-master ciphering key=E (SPubKey, Pre-master-key) with server end PKI SPubKey and send to server end;
(4) server end is deciphered it with certificate private key after receiving C, obtains pre-master key, then generates master key master-key according to Client.Random, Server.Random and pre-master key Pre-master-key;
(5) client terminal uses the same method according to Client.Random, Server.Random and pre-master key Pre-master-key and generates master key master-key;
(6) client terminal and server end derive Traffic encryption key(TEK) according to the identical method of master key master-key, Client.Random, Server.Random respectively, for the MAC key of completeness check, and for the initial vector IV value of cryptographic calculation;
(7) whether client terminal and server end to verify the key of negotiation respectively consistent.
Client terminal is completed by step C and step e the certification of server end, if server end exists counterfeit, so in step e, client terminal can not negotiate consistent Traffic encryption key(TEK) with server end end, will be used for the MAC key of completeness check and will be used for the initial vector IV value of cryptographic calculation, thus correctly can not set up SSL connection, so the problem that presence server end is not counterfeit here.
Unsymmetrical key pair described in step F, if be RSA, suggestion adopts that position is long is not less than 2048.
User name described in step G is signed, and right private key is signed to user name to refer to client terminal unsymmetrical key, and signature verification described in step H refers to that whether the signature in server end client terminal public key verifications step G is effective.
If in step H, server end checks that the user name of user exists, or user name signature is invalid, then can require that user resets user name, again for user produces unsymmetrical key pair.
Client terminal described in step I requires that user inputs PIN/passcode/ fingerprint, by the knowledge known to user or the biological information that has, being system proves that user has the legal of private key.With the private key of PIN/passcode/ encrypting fingerprint unsymmetrical key, refer to the symmetric key encryption private key derived from PIN/passcode or fingerprint, safe storage on the mobile apparatus.PIN/Passcode and private key all can not transmit in a network, thus can not victim interception.Further, deriving from the algorithm of symmetric key by PIN/passcode/ fingerprint can oneself definition or PBKDF and the PBKDF2 algorithm of selection standard.
User is after server end completes ID registration, and this two-way authentication safety moving communication architecture just can be used to carry out safety communication, and as shown in Figure 2, it at least comprises following steps:
S01, with aforementioned user's registration step, be summarized as server end and sign and issue SSL certificate and in the APP that develops in client terminal of hard coded, client terminal produces the unsymmetrical key pair that is specific to user and the machine automatically when user registers simultaneously, PKI right for unsymmetrical key sent by SSL escape way and receives and keeps in server end, and deleting the PKI in the machine; The right private key of unsymmetrical key is by PIN/passcode encrypting storing the machine at client terminal;
S02, client terminal send certification verification request to server end;
SSL certificate is sent to client terminal by S03, server end;
Whether S04, client terminal contrast the SSL certificate being hard-coded in the machine consistent with the SSL certificate received, and complete the certification of client terminal to server end;
S05, server end carry out completeness check to the APP of client terminal, and set up SSL safe lane;
S06, user input ID and PIN on client terminal, and the private key that the machine stores is deciphered;
S07, server end send a random challenge code to client terminal by SSL safe lane;
The private key that S08, client terminal the machine store is signed to described random challenge code, and signature value is postbacked and deliver to server end;
The corresponding PKI that S09, server end store carries out sign test to the signature value that client terminal sends, and completes the certification of server end to client terminal;
S10, client terminal and server end carry out safe APP business.
Further, unsymmetrical key provides identity access rights to manage (IAM) to PKI technology, defends hacker's beach assault, phishing attack, malware attacks completely.
In S06, even if assailant can have access to the key of encryption, obtain correct key by traveling through several PIN code.Because PKI only stores on server end, do not store in client terminal APP.Whether be properly decrypt to verify private key, assailant also must to server end request authentication.And server end will lock this key after assailant's n continuous authentification failure, this is also arrange the reason that simple several PIN code just enough protect private key.
S07, S08 are processes of a client terminal and server end challenge response.Client terminal user often inputs a PIN code, server end all can send random challenge code to client terminal, client terminal private key carries out signature to random challenge code and sends to server end, this signature of public key verifications that server end is corresponding, if effectively, the number of times of continuous authentification failure is rearranged into 0 to signature by server end.Invalid if signed, the number of times of continuous authentification failure is added 1.If this counter reaches maximum (server end provides a default value, and suggestion is not more than 10, and client terminal also can be modified this value according to safe coefficient voluntarily), so account ID will be lockable, and device private lost efficacy simultaneously.User must prove oneself identity by other safe channels, regenerate a new device private, and announcement server end upgrades corresponding PKI at client terminal.
The safety moving communication architecture of dynamic bidirectional certification of the present invention can prevent the poor search PIN code of hacker from attacking device private, even if because assailant can guess PIN code decrypted private key, assailant still can not judge whether the data after deciphering are exactly correct key.Only have and after challenge response program, just can learn result with server end.And server end, will several times continuously unsuccessful log in trial after lock account ID.For searching for attack thoroughly, assailant must need the password attempt of more than 10 times, and this has exceeded the upper limit that server end is arranged, so poor search attack is doomed can failure.
Through these steps of S01 to S10, can realize client terminal and server end two-way authentication, the SSL traffic agreement of carrying out afterwards is two-way SSL authentication protocol.
The present invention can be applied to several scenes, and mobile-phone payment class, social activity share the APP of multiple type such as class and the communication of server end, all can adopt safety moving communication architecture and its implementation of dynamic bidirectional certification of the present invention.As the communication etc. of the communication of Mobile banking and background server end, mobile payment platform and the communication of background server end, social sharing platform and background server end, every communication security is had higher requirements and counterfeit, hacker's fishing need be defendd, the Mobile solution of man-in-the-middle attack all can adopt described mobile communication framework.