HTTPS protocol handshake Process:
1, the client plaintext request, the non-symmetric encryption algorithm that you support (used to use the CA certificate public key encryption to generate the negotiation key random number Per_master), symmetric encryption algorithm (for later use of the negotiated key to encrypt the transmission of content), verify the integrity of the data hash algorithm, random number Random_ C is sent to the server.
2, the server sends back the client's clear text information, contains chooses a set of encryption algorithm, the hash algorithm, the CA certificate, the random number random_s. The CA certificate contains the server address, the public key, the certification authority information, and the signature.
3, the client does five things:
A) Verify the legality of the certificate, the address contained in the certificate and the address being accessed is consistent, etc.
b) generate a string of random number cipher pre_master, and use the asymmetric encryption algorithm selected by the server and the public key in the CA certificate to encrypt pre_master, get enc_pre_master;
c) Calculate the negotiated key Enc_key=func (Random_c,random_s,pre_master);
D) using the agreed-upon hash verification algorithm to calculate the handshake information, the handshake message is encrypted with the negotiated key Enc_key and a well-agreed encryption algorithm.
e) The client sends Enc_pre_master, agrees to use the agreed algorithm and negotiates key communication, and encrypts the handshake information to the server.
4, the server receives data to do five things:
A) use their own private key to decrypt Enc_pre_master, get pre_master;
b) Calculate the negotiated key Enc_key=func (Random_c,random_s,pre_master);
c) Use the negotiation key Enc_key and the agreed decryption algorithm to decrypt the handshake information and verify that the hash is consistent with the client;
d) Generate a handshake message, and use the negotiated key Enc_key with the agreed-upon cryptographic algorithm to encrypt the handshake message to the client.
5, the client uses the negotiation key decryption handshake message, calculates the hash, if the hash and the server sends the consistent, the handshake ends.
Thereafter, all communication data will be encrypted and decrypted with symmetric key enc_key and a well-agreed symmetric encryption algorithm.
Here the client and server mutually encrypt the handshake message and verify, is to ensure that both sides have obtained a consistent key enc_key, and can encrypt and decrypt the data properly, for the transmission of real data to do a test.
From the above process can be seen,Enc_key is the ultimate communication key, get the browser generated pre_master, get enc_key, can decrypt HTTPS message.
Fiddler intercepts the HTTPS protocol process:
1,f intercepts the browser's HTTPS request to the server, masquerading as a browser to send a request to the server to handshake.
2, the server sends back the response, obtains the CA certificate, decrypts the root certificate public key, verifies the server signature, and obtains the public key to the server CA certificate. Then F forges itself the CA certificate, impersonating the server certificate to the client browser.
3, the browser verifies the returned data, generates the Pre_master, generates enc_pre_master with the certificate public key of the forged F, and generates the Enc_key.
4, when the browser returns important data to the server, it is intercepted by F. F will intercept the ciphertext with its own forged certificate of the private key, get enc_pre_master, calculate the symmetric key Enc_key. F Encrypt the Enc_pre_master with the server certificate public key to the server.
5, the server unlocks the data with the private key, establishes the trust, and sends the encrypted handshake message to the client.
6,f intercept the ciphertext sent from the server, use the server public key to untie, and then use their own forged certificate private key encryption to the browser.
7, the browser gets encrypted information, with a forged certificate of the public key to unlock, verify the hash, the handshake formally completed.
Thereafter, the message between the browser and the server is encrypted and decrypted with the symmetric key enc_key, F knows the Enc_key, so the entire HTTPS message is transparent to F.
In this process, the browser recognizes that the F-Forged CA certificate is critical, so the root certificate that is signed for the forged CA certificate is critical. So the system is going to install this F forged root certificate.
Fiddler Crawl HTTPS protocol