Two ways of encryption and the mechanism that HTTPS can run.


Two ways of encryption:

1. Symmetric encryption: Encrypted data and decrypted data have the same key, so it is unacceptable to maintain a key between two individuals with data exchange needs. (People won’t.)

2. Asymmetric encryption: Encrypted data (public key) is different from decrypted data (private key).

Data encrypted by public key can only be unlocked by private key. Data encrypted by private key can only be unlocked by public key, so asymmetric encryption is single-item security. But the public key, the public key, can be found by anyone, so asymmetric encryption is secure only when the public key is issued to the private key.

How HTTPS works (SSL Encryption Suite):
(1) Xiaoming visits Zhizhi (take Zhizhi as an example). When he logs in, he knows to give his public key to Xiaoming’s browser.
(2) The browser generates a symmetric key, which is encrypted with a public key and passed to the user.
(3) Know how to get the symmetric key by decrypting it with the private key.
(4) Browsers and data communications after that are encrypted with keys, which solves the problem that asymmetric encryption has only one item of security.

Recommended Today

Java atomicinteger class using

A counter For ordinary variables, when multithreading operations are involved, classic thread safety problems will be encountered. Consider the following code: private static final int TEST_THREAD_COUNT = 100; private static int counter = 0; public static void main(String[] args) { final CountDownLatch latch = new CountDownLatch(TEST_THREAD_COUNT); Thread[] threads = new Thread[TEST_THREAD_COUNT]; for (int i = […]