In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is the process of TLS negotiation". In daily operation, I believe many people have doubts about the process of TLS negotiation. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts of "what is the process of TLS negotiation?" Next, please follow the editor to study!
0. Pre-knowledge
Asymmetric encryption (such as RSA series) algorithm operation mechanism: RSA (PrivateKey,MSG) = ENCODE, only RSA (PublicKey,ENCODE) = MSG;RSA (PublicKey,MSG) = ENCODE, only RSA (PrivateKey,ENCODE) = MSG
The difficulty of cracking RSA is based on this mathematical fact:
For two large prime numbers p / Q = n, the number of coprimes with N is (pmur1) (QMUE 1). When p or Q is more than 1024, the probability of finding the two divisors of N is too low, and it is even more difficult to find the exact pair of two divisors (PublicKey,PrivateKey).
1. Process (message and explanation, take visiting https://www.baidu.com as an example) 1.1. ClientHello (C2S)
Field values explain the TLS version of Random0acc.... used by VersionTLS1.0 The combination list of encryption and decryption algorithms supported by the random value client_randomCipher SuitesTLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 client generated by the client is divided into three partial key exchange algorithms (ECDHE_RSA), batch encryption algorithm (AES_128_GCM), and message authentication code algorithm (SHA256).
TIP: Cipher Suite is divided into three parts:
Key exchange algorithm: determines how the client and server authenticate when shaking hands
Bulk encryption algorithm: encrypts message flow, HTTP message encryption algorithm used after TLS completion (symmetric encryption)
Message authentication code algorithm: create message digest, message digest algorithm, that is, the message check code is used for information integrity check
1.2. ServerHello (S2C)
Field values explain the TLS version of Random22c9c.... used by VersionTLS1.2 The random value server_randomCipher SuiteTLS_ECDHE_RSA_WITH_CHACHA20_POLY1205_SHA256 generated by the server selects a 1. 3. 3 from the algorithm group reported by the client. CertAndServerExchange (S2C)
Server certificate issued-> Certifacate:
Field values explain the TLS version of the Certificates....CA certificate chain used by VersionTLS1.2, from the root certificate to the server certificate
Certificate chain (you can see here that it is consistent with the certificate connection above):
TIP:
Trust logic of certificate chain:
To buy a CA certificate is to let a CA institution use its own privateKey to encrypt your Pubkey to generate a signature.
Based on such a logic: first of all, An is trustworthy, then A says B is trustworthy, then B is trustworthy, B is trustworthy, then C is trustworthy.
The verification of the certificate is generally:
The authority that reads the public key signature and certificate of the CA certificate file
Read the public key of the root certificate (trusted) according to the ROOTCA of the root certificate obtained by the authority
Use the public key of the root certificate to decrypt the actual public key of the CA using the signature, which is matched with the one read directly from the CA file.
If it matches, continue to read other configurations to determine whether it is out of date, and so on.
Basic certificate information (public key, signature, user, authority, etc.):
ServerKeyExchange:
The field value explains the security number generated by the TLS version of Pubkey22c9c....Diffie-Hellman used by VersionTLS1.2. After calculating the pubkey, it is sent to Client,pubkey using the function (pMagnegPowerKey = g ^ x mod p). The client needs to use the same algorithm and the public key of Certificate to decrypt the Signature*..... The signature algorithm and signature of this paragraph message 1.4 ServerHelloDone (S2C)
1.5 ClientKeyExchange,CiperSpecHandShakeMsg (C2S)
ClientKeyExchange:
The field value interprets the security number y generated by Pubkey...Diffie-Hellman, generates pubkey according to the function pubKey= g ^ y mod p and sends it to the server, and then sends it to the server after public key encryption using ECDHE_RSA algorithm.
ChangeCipherSpec: toggles the information encryption algorithm (symmetric encryption, in this case CHACHA20_POLY1205)
two。 Subsequent 2.1 generate symmetric encryption key
Various random numbers generated during negotiation are used to generate a session key (this algorithm is universal.)
2.2 use symmetric encryption to generate encrypted HTTP messages
All subsequent requests are based on symmetric encryption algorithms (in this case, CHACHA20_POLY1205) (less efficient asymmetric algorithms will not be used)
3. TLS negotiation process is simplified
The client sends a random number to the server (plaintext), the supported algorithm group
After receiving it, the server also sends a random number to the client (plaintext), the algorithm to be used, and the data signature.
Server sends certificate file (CA certificate chain)
The client verifies the validity of the certificate (verifies the signature, etc.)
After the verification is completed, the third random number is generated, and the third random number is encrypted with the public key of the certificate and sent to the server, which decrypts it with the private key to get the third random number (ciphertext).
The server and the client hold three random numbers and then each generate a session key for session encryption.
In the future, the confidential decryption of the data will be symmetrically encrypted and decrypted using the session key.
4. Grab bag file
TLS-wareshark
At this point, the study of "what is the process of TLS negotiation" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.