Shalini Tewari
Shalini Tewari

@maybeshalinii

4 Tweets Jan 02, 2025
A friend of mine was asked this in an interview,
"What's the difference between HTTP and HTTPS?"
Here's how you can answer:
HTTP is the foundational protocol used for transferring hypertext on the web. It defines how messages are formatted and transmitted and how web servers and browsers should respond to various commands.
When you enter a URL in your browser, an HTTP command is sent to the web server directing it to fetch and transmit the requested web page.
HTTPS is HTTP with encryption. It uses SSL/TLS to encrypt the data transferred between the web server and browser, ensuring a secure connection.
HTTPS provides a secure channel over an insecure network, protecting the integrity and confidentiality of data between the user's computer and the site.
HTTP:
- Data is sent in plaintext, making it vulnerable to interception and attacks (e.g., man-in-the-middle attacks).
- Uses port 80 by default.
- URLs begin with http://.
- Data can be altered without detection during transit.
- Does not provide any authentication; users cannot be sure they are communicating with the intended server.
HTTPS:
-Data is encrypted using SSL/TLS, ensuring that even if intercepted, it cannot be read without the encryption key.
- Uses port 443 by default.
- URLs begin with https://
- Data integrity is ensured, as tampering with data during transit would cause decryption to fail.
- Uses digital certificates to authenticate the server, ensuring users are communicating with the legitimate server.
Use Cases and Adoption:
1. HTTP:
Suitable for non-sensitive information where security is not a primary concern.
Commonly used for static websites, blogs, or publicly accessible content.
2. HTTPS:
Essential for sensitive information, including login credentials, payment transactions, and personal data.
Increasingly adopted as a standard for all websites to ensure privacy and security.
In summary, the primary difference between HTTP and HTTPS lies in the security provided by HTTPS through SSL/TLS encryption. While HTTP is suitable for general, non-sensitive web traffic, HTTPS is crucial for any site handling sensitive data, ensuring secure, authenticated, and encrypted communication.
This post is for your understanding. Please keep it brief during the interview and focus on the key points that seem important.

Loading suggestions...