It is a secure communication protocol introduced by Netscape in 1995. SSL provides a secure connection between two computers and encrypts the whole session, thus ensuring secure transmission. SSL protocol is based on reliable TCP transmission control protocol and has nothing to do with the upper layer protocol. Various application layer protocols (such as HTTP, FTP, TELNET, etc. ) can be transmitted transparently through SSL protocol.
SSL protocol is divided into two layers: SSL handshake protocol and SSL recording protocol. The relationship between SSL protocol and TCP/IP protocol is shown in figure 1:
HTTPS FTPS remote login IMAPS, etc.
SSL handshake protocol
SSL recording protocol
TCP transmission control protocol
IP internet protocol
Figure the relationship between SSL protocol and TCP/IP protocol
The secure connection provided by SSL protocol has the following three basic characteristics:
(1) connections are confidential: each connection has a unique session key, and data is encrypted with symmetric passwords (such as DES and RC4);
(2) Reliable connection: Message transmission adopts MAC algorithm (such as MD5, SHA, etc.). ) integrity check;
(3) The authentication of the other entity adopts asymmetric cryptography (such as RSA, DSS, etc.). ).
1.2 SSL handshake protocol
SSL handshake protocol is used to establish a secure transmission channel between the two communication parties, and it specifically realizes the following functions: (1) In the client authentication server, SSL protocol uses public key for identity authentication; (2) Verify the customer on the server side (optional); (3) The client and the server negotiate the encryption algorithm and compression algorithm supported by both parties. The encryption algorithms that can be selected are: IDEA, RC4, DES, 3DES, RSA, DSS, Diffie_hellman, Fortezza, MD5, SHA, etc. (4) generating a session key of a symmetric encryption algorithm; (5) Establish an encrypted SSL connection. The general handshake process is shown in Figure 2:
Fig. 2 handshake process of SSL protocol
The handshake process is divided into four stages:
(1) Initializes the logical connection. The client sends the ClientHello message first, and the server should also return the ServerHello message. These two messages are used to negotiate the security capabilities of both parties, including protocol version, random parameters, session ID, key exchange algorithm, symmetric encryption algorithm, compression algorithm and so on.
(2) The server shall send the server certificate (including the public key of the server, etc.). ) and the session key, and if the server requires authentication of the client, it should send a CertificateRequest message. Finally, the server sends a message from ServerHelloDone, indicating that the hello phase has ended and the server is waiting for the response from the client.
(3) If the server requests to authenticate the client, the client first sends a certificate message, and then generates a session key, which is encrypted with the server's public key and encapsulated in the ClientKeyExchange message. If the client sends its own certificate, it will send a digitally signed certificate to verify the certificate.
(4) The client sends a ChangeCipherSpec message, informing the server that the messages sent in the future will be encrypted using the previously agreed security parameters, and finally sends an encryption completion message. After receiving the above two messages, the server will also send its own ChangeCipherSpec message and Finished message. At this point, the handshake is completed and both parties can start transmitting application data.
SSL handshake protocol establishes appropriate session state information elements in both parties, as shown in the following table:
Description of session state information elements
A session identifier selected by the session identifier server to identify active and resumed sessions.
Peer certificate X509 certificate of peer entity
Data compression algorithm used in compression method
Encryption describes the data encryption algorithm and MAC algorithm used.
Session key The session key shared by the client and the server.
You can restart to identify whether this conversation can be used to initialize a new flag.
1.3 SSL recording protocol
SSL recording protocol receives data from high layer, then segments, compresses and encrypts it, and finally sends it out by the transport layer. In the SSL protocol, all the transmitted data are encapsulated in the record, and the SSL recording protocol specifies the format of the record header and the recorded data.
Each SSL record contains the following information: (1) Content type: refers to the high-level protocol of SSL; (2) Protocol version number: refers to the version number of the SSL protocol used, which currently has two versions, 2.0 and 3.0; (3) Length: refers to the length of recorded data, and the maximum length of recorded data is 16383 bytes; (4) Data payload: the result obtained by processing data with the compression method and encryption method defined in SSL handshake stage; (5) MAC: Calculate MAC before valid data is encrypted and put into SSL record for data integrity check. If MD5 algorithm is used, the length of MAC data is 16 bytes. SSL recording protocol adopts the modified version of HMAC structure in RFC2 104, and puts a sequence number in the message before the hash function action to resist various retransmission attacks. The serial number is a 32-bit increment counter.
2 sets of agreements
2. Overview of1set protocol
Set (Secure Electronic Transaction) is a specification for secure electronic transactions jointly formulated by MasterCard and Visa in 1996. It provides authentication among consumers, merchants and banks, ensures the confidentiality, reliability and non-repudiation of transactions, and ensures the safety of online shopping with credit cards in an open network environment.
2.2 data encryption model adopted in set protocol
The data encryption model adopted by SET protocol is shown in Figure 3.
Figure 3 Data encryption model adopted by SET protocol
The model has the following characteristics:
(1) The authentication of transaction participants is completed by means of digital certificates, and the format of digital certificates generally adopts the international standard X.509
(2) The non-repudiation of the transaction is realized by digital signature. Because the digital signature is generated by the sender's private key, and the sender's private key is only known to him, it is convenient to send and cannot deny the transaction data it has sent;
(3) Using message digest algorithm to ensure data integrity;
(4) Because the operation speed of asymmetric encryption algorithm is slow, it should be combined with symmetric encryption algorithm, which encrypts data and exchanges symmetric keys with digital envelopes.
2.3 Set the protocol data exchange process
SET protocol shopping system consists of five parts: cardholder, merchant, payment gateway, acquiring bank and issuing bank. The data exchange process between these five parts is shown in Figure 4.
Fig. 4 data exchange process of set protocol
Comparison between SSL protocol and SET protocol
The difference between SSL protocol and SET protocol is mainly manifested in the following aspects:
(1) User interface: SSL protocol is built into the browser and WEB server, and no special software needs to be installed; In the SET protocol, the client needs to install special e-wallet software, and the corresponding software needs to be installed on the merchant server and the bank network.
(2) Processing speed: SET protocol is very complex and huge, and the processing speed is slow. A typical SET transaction process needs to verify the electronic certificate 9 times, verify the digital signature 6 times, transmit the certificate 7 times, sign 5 times, encrypt symmetrically 4 times and encrypt asymmetrically 4 times. The whole transaction process may take 1.5 to 2 minutes. SSL protocol is much simpler and faster than SET protocol.
(3) Authentication requirements: The early SSL protocol did not provide authentication mechanism. Although in SSL3.0, the authentication between browser and Web server can be realized by digital signature and digital certificate, it is still impossible to realize multi-party authentication. Moreover, SSL only needs the authentication of the merchant server, and the authentication of the client is optional. In contrast, the authentication requirements of SET protocol are higher, and all members participating in SET transactions must apply for digital certificates, which solves the multi-party authentication problems between customers and banks, customers and merchants, and merchants and banks.
(4) Security: Security is the most critical issue in online transactions. SET protocol can ensure the confidentiality, identifiability, integrity and non-repudiation of information due to the adoption of public key encryption, information digest and digital signature. SET protocol adopts double signatures to ensure that all participants' information is isolated from each other, so that merchants can only see the cardholder's subscription data, while banks can only obtain the cardholder's credit card information. Although SSL protocol also uses public key encryption, message digest and MAC detection, it can provide confidentiality, integrity and a certain degree of identity authentication, but it lacks a complete authentication system and cannot provide complete undeniable functions. So the security of SET is much higher than SSL.
(5) Protocol level and function: SSL belongs to the security technical specification of the transport layer and does not have the commercial, coordination and integration functions of e-commerce. SET protocol is located in the application layer, which not only standardizes the whole business process, but also sets strict encryption and authentication standards, and has the functions of commerce, coordination and integration.
Summary:
SSL protocol is widely used because of its low cost, high speed, simple use and no need to make major changes to the existing network system. However, with the expansion of e-commerce, the risk of online fraud is also increasing, and SET protocol will gradually occupy a dominant position in future e-commerce.