https growth history

Term basis

  Let me talk about basic nouns, symmetric encryption, asymmetric encryption

  Symmetric encryption: encryption, using an encryption algorithm decryption keys of the same pair, such as the DES

  Asymmetric encryption: encryption, decryption using a different secret key, encrypted using the public key, the decryption private key shall be used; and vice versa. For example, RSA

symmetric encryption https

https using symmetric encryption, the flow

  1. The browser request to the server, the server returns the keys key
  2. The browser to get keys key
  3. Browser uses secret key encryption key html, transmitted to the server
  4. The server uses the secret key to decrypt key

Problems

  There will be leaked secret key question: If there are malicious people, between steps 1 and 2, intercepted a secret key key, that the contents of the entire session for him is a plaintext

Asymmetric encryption https

https asymmetric encryption, the flow

  1. The browser request to the server, the server returns the public key k1 (server public key k1, private k2)
  2. The browser to get keys k1
  3. Browser uses encryption keys k1 html, transmitted to the server
  4. The server uses the secret key to decrypt k2

It did not directly address the secret key leakage problem, but to solve the problem caused by leaking secret key. Even between steps 1 and 2 being intercepted, only his public key k1, html for ciphertext encrypted, decrypting can not ensure the security of data transmission.

Problems

Asymmetric encryption mode, raises a new problem - an asymmetric encryption is relatively low efficiency, especially in the large text encryption, asymmetric encryption lower efficiency. Obviously we can not tolerate browser requests sent out, a long time to respond

https asymmetric encryption symmetric +

+ https symmetric encryption asymmetric encryption, the flow

  1. The browser request to the server, the server returns the public key k1 (server public key k1, private k2)

  2. The browser to get keys k1

  3. Browser generates symmetric encryption keys k3

  4. Browser with encryption k1 k3, ciphertext x, the x transmitted to the server

  5. Parsing the server with k2 x, to give a symmetric encryption keys k3

  6. Browser uses encryption keys k3 html, transmitted to the server
  7. The server uses the secret decryption key k3

https symmetrical + asymmetrical secret key to solve the leak problem, the problem of low efficiency asymmetric encryption, this version is actually now a lot of sites with https is used.

Problems

Seemingly unassailable, however, is not perfect - would issue a public key has been tampered appear

If, between Step 1 and Step 2, the malicious people intercepted, he acquired secret key k1, saved, and generates a new pair of keys (public key k11, K22 private), the k11 back to the browser the browser receives the keys k11, k11 encrypted using html, ciphertext x, the x transmitted to the server, in the process of transmission, malicious person intercepts the request again, to give x, x is used because k11 encrypted, he has a corresponding private key k22, so he is able to resolve the plaintext plaintext again, he expressly with the secret encryption key k1, transmitted to the server server is properly resolved, the browser and the server is not perception ciphertext have been leaked

This is the man in the middle attacks, simply because the browser can not determine the received public key, whether it is being tampered with.

https digital certificate, debut

Digital certificates principle

How certificates are to prevent tampering? How to prove the authenticity of the certificate itself of it? Let me talk about the digital certificates constitute: CA message digest with the private key encryption mechanism, in which a message digest = hash verification (public key information k1 + website) digital certificates:

In step 2 on the basis https3.0, additional information and return to CA's public key certificate using the CA public key to decrypt, get a bunch of hash value, which is the hash (k1 + public website information) come reuse https3 step 2 .0 return of keys k1 and their website information, content hash compare hash obtained are consistent with the use of the decrypted content CA public key, if not the same, were tampered with.

Related questions

Middleman can tamper with certificates?

Unable to do so, because only CA CA private institutions have, no middleman CA private key, it is impossible to tamper with the contents of the sign

Middleman can Diaobao certificate?

Can not be done, if there are sites B, want to bring down the site A, site A intercepted a certificate, and the certificate returned to their B A, only A website is the use of a public key of B. This is not going to work because the certificate, the website contains information, such as domain name, a contrast to know whether the substitution of the

How to ensure the credibility of the CA public key?

Similarly, the CA public institutions, but also can use the routines of digital certificates to prove.

So ultimately, the bottom is how to ensure the trustworthiness of it?

Operating system, browser pre-installed their trusted root certificate. Starting from the root certificate, through layers of trust, form a chain of trust, CA trusted certificate chain of trust, it will be able to prove their identity.

发布了158 篇原创文章 · 获赞 193 · 访问量 148万+

Guess you like

Origin blog.csdn.net/zy_281870667/article/details/102057126