Try   HackMD

How Does HTTPS(HyperText Markup Language Secure) Works

Advantages of HTTPS(Secure) over HTTP

  • Data is encrypted before sending in HTTPs (Prevents Man In The Middle Attacks i.e Reading sniffed packtes).
  • HTTPS does not have any separate protocol. It operates using HTTP but uses encrypted TLS/SSL connection and HTTP is build on top of TCP protocol.

    TCP works on Application Layer but in addition to this, in HTTPS SSL/TLS works on the Transport Layer. More about OSI model is here

  • HTTPs requires SSL certificate and it should be signed by trusted Certificate Authority(CA) (Prevents Phishing,MITM Attacks).

HTTPS connection(SSL/TLS Handshake)

  1. Client sends a request to access resource from the server(eg youtube.com).
  2. Server sends back its certificate signed by a trusted Certificate Authority containing its public key.
  3. Client has trusted certificate authority in his list so it verifies the certificate and accepts it.

    More about this in the below section.

  4. Client then encrypts a new secret using servers public key.
  5. Server has its private key so it then decrypts the message sent by the client making only these two resources on the internet who know this secret key.
  6. All the communication between these two resources are now encrypted with this shared key.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →


  • Symmetric key encryptions are faster than Asymmetric encryptions and thus making them suitable to use for Web Traffic encryption( because large amount of data duh? ). But it depends on shared secret key and you can't just send it as is( many bad guys on the internet might wanna sniff it using Man-In-The-Middle-Attacks ) so thats when asymmetric encryption comes into play. We use asymmetric encrytion to share the sercret key over the internet and then use that key to encrypt our communication.
  • SSH(Simple Shell Scripting) also uses this technique to share data securily in its communication channel.

So what encrytion type https and ssh uses?

  • The best answer to this question is both asymmetric and symmetric key encryption is used in the process.

Certificate Authority