Background
In order to prevent the user data from being stolen when the user data passes through an untrusted network area, the communication data of the user and a website (such as an online bank, a security website and the like) encrypted by using an SSL protocol are encrypted by the SSL protocol. But encryption only prevents data from being stolen during transmission, and the identity of the other end (visited website) in communication with the user is not verified. For example, the other end communicating with the user may be a malicious web site masquerading as an internet banking web site. Such entities that fraudulently obtain user confidential data (including user names, passwords, etc.) by masquerading as trusted websites are collectively referred to as phishing websites. Since the data is encrypted, the traditional firewall has no control over these phishing websites. Due to the trust of high-strength encryption of the SSL protocol and the lack of professional knowledge of the SSL protocol, an ordinary user often cannot judge whether an SSL certificate provided by an accessed website is legal or not, and an event that personal confidential data is cheated by a phishing website occurs occasionally. Therefore, there is a security defect that a phishing site disguised as a trusted site cannot be filtered.
Patent publication No. CN101436933B discloses an HTTPS encrypted access method, including the steps of: establishing a special encryption SSL channel between a client and HTTPS proxy equipment; establishing a universal encryption SSL channel between the client and the HTTPS agent equipment; performing loop-back processing on an HTTPS message sent to the HTTPS agent equipment by a browser through the universal encryption SSL channel; and sending the HTTPS message after the loop returning to the HTTPS agent device through the special encryption SSL channel. The patent can realize that a user calls a special cryptographic algorithm through the browser to perform security access, and meets the requirement of performing security access on the application browser in specific fields such as government affairs.
Patent publication No. CN102948131B discloses a system and method for split proxying Secure Socket Layer (SSL) communications across intermediaries deployed between a client and a server. The method includes establishing, by a server-side intermediary, an SSL session with a server, the client-side intermediary may establish a second SSL session with the client using SSL configuration information received from the server-side intermediary, the two intermediaries may communicate via a third SSL session, the server-side intermediary may decrypt data received from the server using a session key of the first SSL session, the server-side intermediary may transmit data encrypted using a session key of the third SSL session to the client-side intermediary via the third SSL session, the client-side intermediary may decrypt the encrypted data using the session key of the third SSL session, and the client-side intermediary may transmit data encrypted using the session key of the second SSL session to the client.
Patent publication No. CN102948131B discloses an SSL communication method based on hardware cryptographic algorithm, which includes: the client sends a request to the server, sends a communication protocol version list supported by the client and an encryption algorithm list supported by the client, and generates a first random number; the server side sends a response and a server side certificate after receiving the request, wherein the server side certificate is stored in the encryption chip, confirms the used communication protocol version and the encryption mode, and generates a second random number and sends the second random number to the client side; the client takes out the public key from the server certificate, sends a third random number encrypted by the public key, and sends a code change notification and a client handshake end notification, wherein the client handshake end notification is a hash value of all the previously sent contents and is used for verifying by the server; and the server side decrypts the sent encrypted data by using the private key, verifies the data and generates a working key. The patent greatly improves the safety and reliability of the communication system.
However, the above prior art still has the following problems:
1. the prior art can not filter phishing websites disguised as credible websites, so that personal confidential data is cheated by the phishing websites.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a system for establishing communication based on SSL, which is used for solving the problem that the prior art cannot filter phishing websites disguised as credible websites, so that personal confidential data is cheated by the phishing websites.
In order to solve the technical problems, the invention adopts the following technical scheme:
a system for establishing communication based on SSL comprises an information protection module, an SSL security server, a service terminal, a client and an encryption chip;
the encryption chip is arranged at the client, and when the encryption chip is called by the client, the encryption chip matches with the corresponding service terminal security certificate and gives the client;
after the client side obtains the security certificate, the client side encrypts the communication information once and stores the communication information to the information protection module;
the client security certificate stored by the information protection module is a public key certificate;
the SSL security server is used for verifying the client security certificate, and negotiates a communication private key with the client after the SSL security server passes the verification of the client security certificate;
the SSL security server transmits the communication private key to the information protection module, the information protection module performs matching verification on the communication private key, after the verification is passed, the information protection module transmits the communication information to the service terminal, and the service terminal performs decoding through the communication private key;
the SSL security server and the service terminal are in the same communication network.
Furthermore, the information protection module also comprises a security gateway, and the service terminal is in access connection with the client through the security gateway;
the security gateway captures SSL encrypted data, and can freely import a trusted X.509 certificate list;
the security gateway intercepts a handshake process of an SSL protocol and extracts an X.509 certificate chain transmitted in the handshake process;
and the security gateway verifies the legality of the certificate chain according to the PKI relevant standard and the trusted certificate list provided by the user, and filters and prevents illegal SSL connection of the certificate chain.
Further, the security gateway filters the SSL packets according to the following rules:
filterRule={dir=0,count=1,dstport=443}&&{dir=0,count=3,off_set=0,feature=0x16};
in the screening rule: { dir ═ 0, count ═ 1, dstport ═ 443} denotes that the destination port number of the 1 st packet from the client to the server is 443; { dir ═ 0, count ═ 3, off _ set ═ 0, feature ═ 0X16} indicates that the application layer payload offset of the 3 rd packet from the client to the server is 0, and the 3 rd packet is filled with fingerprint information 0X16 starting from the first byte.
Further, the security gateway can import or delete the trusted X.509 certificate list by itself.
Further, the security gateway can capture the normal information of the client accessing the service terminal through the information protection module and the information copy of the phishing information.
Further, when the security gateway passes the validity of the certificate chain according to the PKI relevant standard and the trusted certificate list provided by the user, the security gateway automatically cuts off the SSL connection with the service terminal.
Compared with the prior art, the invention has the following beneficial effects:
1. the security gateway or the bridge captures SSL encrypted data, captures a handshake process of an SSL protocol, extracts an X.509 certificate chain, verifies the legality of the X.509 certificate chain transmitted in the extracted handshake process according to a PKI relevant standard and a trusted certificate list provided by a user, allows the SSL connection with the legal certificate chain to pass through, and filters and prevents the SSL connection with the illegal certificate chain;
2. under the support of the information protection module, the safe storage of the certificate is realized, the device certificate is prevented from being illegally modified, the safety of the private key of the device is ensured, the SSL encryption communication is adopted, the data is prevented from being stolen by an illegal user, and the safe transmission of the information on the Internet is ensured; namely, use security, integrality and customer's data security in the perfect electronic payment process of SSL agreement, realize characteristics such as the simple, practical and attentive of electronic transaction, reach three easy, promptly: easy use, easy maintenance and easy development;
3. and when the legality of the certificate chain is not verified by the security gateway according to the PKI related standard and the trusted certificate list provided by the user, the security gateway automatically cuts off the SSL connection with the service terminal.
Detailed Description
In order that those skilled in the art can better understand the present invention, the following technical solutions are further described with reference to the accompanying drawings and examples.
Examples
As shown in fig. 1-3, a system for establishing communication based on SSL of the present invention includes an information protection module 1, an SSLsecure server 2, a service terminal 3, a client 4, and an encryption chip 6;
the encryption chip 6 is arranged on the client 4, and when the encryption chip 6 is called by the client 4, the encryption chip 6 matches with the corresponding security certificate of the service terminal 3 and gives the security certificate to the client 4;
after the client 4 acquires the security certificate, the communication information is encrypted for one time and then is stored in the information protection module 1;
the client 4 security certificate stored in the information protection module 1 is a public key certificate;
theSSL security server 2 is used for verifying the security certificate of the client 4, and theSSL security server 2 negotiates a communication private key with the client 4 after the security certificate of the client 4 passes verification;
theSSL security server 2 transmits the communication private key to the information protection module 1, the information protection module 1 performs matching verification on the communication private key, after the verification is passed, the information protection module 1 transmits the communication information to the service terminal 3, and the service terminal 3 performs decoding through the communication private key;
the information protection module 122 is disposed on the client 4, and is configured to match out a corresponding client certificate to the client 4 when being invoked by the client 4, that is, the information protection module 122 is responsible for securely providing the client certificate to the client 4.
The encryption chip 6 processes the information as follows:
s1, dividing the message into small segments, then compressing each segment, the compression algorithm needs to negotiate with the communication object;
s2, a message authentication code is added to each compressed segment, in order to ensure integrity and perform authentication of data, and tampering can be recognized by attaching the MAC value of the message. Meanwhile, in order to prevent replay attack, when the message authentication code is calculated, the number of the segment, the algorithm of the one-way hash function and the shared key used by the message authentication code are required to be negotiated and decided with a communication object;
the compressed segment plus the message authentication code are encrypted together by a symmetric cipher S3. The encryption uses a CBC mode, an initialization vector IV of the CBC is generated through a master secret, and an algorithm of a symmetric cipher and a shared key need to be negotiated;
and S4, adding the data type, version number and compressed length to the encrypted data to form a header, so as to obtain the final communication encrypted data.
The information protection module 1 is a physical certificate repository in which a plurality of private keys, corresponding public keys, and public key certificates corresponding to the public keys are stored. The private key, the public key and the public key certificate are stored in the HSM, so that external attack and tampering can be effectively prevented. Hsm (hardware security module) is a dedicated cryptographic processor designed specifically for protecting the cryptographic key lifecycle. The HSM securely manages, processes, and maintains encryption keys in a reliable and tamper-resistant device.
TheSSL security server 2 is used for verifying the certificate of the client 4, negotiating a communication private key with the client 4 after the verification is passed, then theSSL security server 2 and the client 4 adopt the communication private key for communication, transmitting the communication data of the client to the encryption chip 6 for processing, and feeding back the data processed by the encryption chip 6 to the client 4. Wherein the SSLsecure server 2 is in the same communication network as the cryptographic chip 6. The certificate verification is a link in the SSL protocol process, and the principle is that after theSSL security server 2 obtains the certificate of the client, the certificate is compared with the certificate in the trust certificate bank of the information protection module 1, and if the client certificate or the issuer of the client certificate exists in the trust certificate bank of the information protection module 1, the verification is passed.
SSL (Secure Sockets Layer) is a security protocol that provides security and data integrity for network communications, and encrypts network connections at the transport Layer. The SSL protocol is divided into two parts: handshake Protocol (Handshake Protocol) and Record Protocol (Record Protocol). The handset Protocol is used for negotiating a key, and most contents of the Protocol are how two communication parties use the handset Protocol to safely negotiate a key; record Protocol defines the format of the transmission. The SSL protocol establishes an encryption channel between two computers, establishes SSL connection to ensure that data is not stolen or tampered in the transmission process, and ensures the confidentiality, integrity and reliability of confidential information. The SSL protocol provides services mainly including: authenticating the user and the server to ensure that the data is sent to the correct client and server; encrypting data to prevent data from being stolen midway; maintaining the integrity of the data and ensuring that the data is not changed in the transmission process;
the SSLsecure server 2 is in the same communication network as the service terminal 3.
The information protection module 1 also comprises a security gateway 5, and the service terminal 3 is in access connection with the client 4 through the security gateway 5;
the security gateway 5 captures SSL encrypted data, and the security gateway 5 can freely import a trusted X.509 certificate list;
the security gateway 5 intercepts the handshake process of the SSL protocol and extracts the x.509 certificate chain transmitted in the handshake process;
the security gateway 5 verifies the legitimacy of the certificate chain according to the PKI-related standards and the list of trusted certificates provided by the user, filters and prevents illegal SSL connections of the certificate chain.
The screening rule of the security gateway 5 for the SSL packet is as follows:
filterRule={dir=0,count=1,dstport=443}&&{dir=0,count=3,off_set=0,feature=0x16};
in the screening rule: { dir ═ 0, count ═ 1, dstport ═ 443} denotes that the destination port number of the 1 st packet from the client to the server is 443; { dir ═ 0, count ═ 3, off _ set ═ 0, feature ═ 0X16} indicates that the application layer payload offset of the 3 rd packet from the client to the server is 0, and the 3 rd packet is filled with fingerprint information 0X16 starting from the first byte.
The security gateway 5 or the bridge captures the SSL encrypted data, captures the handshake process of the SSL protocol, and extracts the x.509 certificate chain. And verifying the legality of the X.509 certificate chain transmitted by the extracted handshake process according to related standards of PKI and a trusted certificate list provided by a user, wherein the security gateway 5 or the bridge allows SSL connections with legal certificate chains to pass through, and filters and prevents SSL connections with illegal certificate chains.
The security gateway 5 or the network bridge is arranged between the user internet terminal and the network link of the accessed website, and data of internal users accessing the external network accessing the normal website or the phishing website through the SSL encryption tunnel need to pass through the security gateway 5 or the network bridge. The security gateway 5 can capture SSL encrypted data, capture a handshake process of an SSL protocol, extract a certificate chain of the handshake process of the SSL protocol, verify the validity of the extracted certificate chain according to related standards of PKI and a trusted certificate list provided by a user, allow SSL connection with the legal certificate chain to pass through by the security gateway 5 or a bridge, filter and prevent SSL connection with the illegal certificate chain, thereby allowing network connection between an end user and a trusted website and cutting off the connection between the end user and the phishing website. In the method, an administrator can import or delete the trusted certificate list on the gateway or the bridge
Security gateway 5 may import or delete a trusted list of x.509 certificates on its own.
The security gateway 5 can capture the normal information of the client 4 accessing the service terminal 3 through the information protection module 1 and the information copy of the phishing information.
When the security gateway 5 does not verify the legality of the certificate chain according to the PKI related standard and the trusted certificate list provided by the user, the security gateway 5 automatically cuts off the SSL connection with the service terminal 3.
The master password is calculated depending on the following information:
preparing a main password;
a client random number;
a server random number;
when using RSA public key cryptography, the client sends the encrypted preliminary master cryptogram to the server together with the ClientKeyExchange message.
When using DH key exchange, the client sends the public value of DH to the server together when sending a ClientKeyExchange message. Based on this value, the client and server will each generate a preliminary master password.
When computing the primary password from the preliminary primary password, a pseudo-random number generator is used that is a combination of two one-way hash functions (MD5 and SHA-1). Two one-way hash functions are used to improve security.
For the RSA key exchange algorithm, the pre-master-key itself is a random number, and the three random numbers are added to the random number in the hello message, and finally a symmetric key is derived by a key derivation device.
The pre-master exists in that the SSL protocol does not trust that each host can generate completely random numbers, if the random numbers are not random, the pre-master secret can be guessed, and only the pre-master secret is not suitable for being used as a key, so a new random factor must be introduced, keys generated by the client and the server together with the three random numbers of the pre-master secret cannot be easily guessed, one pseudo-random can be completely non-random, but three pseudo-random are very close to random, and the increase of the randomness is larger when one degree of freedom is added.
Under the support of the information protection module 1, the secure storage of the certificate is realized, the device certificate is prevented from being illegally modified, and the security of the private key of the device is ensured. SSL encryption communication is adopted, so that data is prevented from being stolen by illegal users, and the information is ensured to be safely transmitted on the Internet; namely, use security, integrality and customer's data security in the perfect electronic payment process of SSL agreement, realize characteristics such as the simple, practical and attentive of electronic transaction, reach three easy, promptly: easy use, easy maintenance and easy development. Meanwhile, by integrating SSL and HSM, data security from the device to the transmission process is realized. The Security Provider who can also self-define accord with Java Security Provider standard realizes SSL safety communication protocol, accord with current standard, make the scheme easy to use, safety, the developer just can let ordinary non-SSL communication client APP realize the encryption communication based on information protection module 1 in simple several steps, accomplish the safe transmission of data fast, realize quick development, Security gateway 5 in the information protection module 1 can be according to PKI relevant standard and the credible certificate list that the user provided to the legality of certificate chain, filter and prevent the illegal SSL of certificate chain and connect, cut off the connection of end user and phishing website.
Finally, the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all of them should be covered in the claims of the present invention.