HTTP is a standard protocol for transferring data over the web, e.g the images you share on Instagram from your phone are seen by your friend's phone or the text messages or any other sort of data transfer is mostly done on this HTTP, while HTTPS is a secure version of HTTP that encrypts the data to protect its confidentiality and integrity. HTTPS provides an additional layer of security, making it the preferred choice for transmitting sensitive information online, it does so by encryption technology based on cryptography.
Both HTTP (Hypertext Transfer Protocol) and HTTPS (Hypertext Transfer Protocol Secure) are protocols used for transmitting data over the internet. They define how information is formatted and exchanged between a client (such as a web browser) and a server.
HTTP
It operates over TCP/IP (Transmission Control Protocol/Internet Protocol) and uses a request-response model.
HTTP request methods can be GET, POST, PUT, PATCH, DELETE, etc.
HTTP response status codes can be 200(OK), 301(move permanently), 404(not found), etc list goes like: 1xx: informational, 2xx: success, 3xx: redirection, 4xx: client error, 5xx: Server Error.
HTTP is a stateless protocol, meaning it doesn't maintain any information about past requests or sessions.
This lack of state makes HTTP lightweight and efficient but poses security risks when transmitting sensitive information.
PORT NUMBERS
Port numbers allow multiple applications or services to coexist on a single server, each identified by its unique port number. The server uses these port numbers to route incoming network traffic to the appropriate application or service based on the requested port.
They are like a virtual little hub managed by the Operating System. With ports one can network with different software all at the same time using different ports. In total O.S allows a total of 65k ports.
In summary, port numbers specify the specific applications or services running on a server that should handle incoming HTTP or HTTPS requests. Port 80 is typically used for HTTP, while port 443 is used for HTTPS.
HTTPS
HTTPS is a secure version of HTTP that adds an extra layer of security by using encryption. It uses SSL (Secure Sockets Layer) or TLS (Transport Layer Security) protocols to encrypt the data transmitted between the client and the server.
When you access a website using HTTPS, your web browser establishes a secure connection with the server by performing a "handshake." During this process, the client and server exchange digital certificates to verify their identities.
Let's understand HTTPS encryption in detail:-
Whenever the Client does a request on a server there are several privacy breaches in-between like your wifi provider, ISP, Cloud, etc. So to ensure a secure connection we need to encrypt our data on the client side before it leaves and decrypt the data on the server side.
This is achieved using a technique called Public key Cryptography.
Public key cryptography, also known as asymmetric cryptography, is a cryptographic system that uses a pair of mathematically related keys for secure communication. It involves the use of a public key and a private key, which are distinct from each other and have different purposes.
Here's a simplified explanation of how public key cryptography works:
Encryption: If Party A wants to send an encrypted message to Party B, Party B first generates a key pair consisting of a public key and a private key. Party B shares the public key with Party A.
Party A uses Party B's public key to encrypt the message. The encryption process converts the message into a format that can only be decrypted with the corresponding private key.
Party B receives the encrypted message and uses its private key to decrypt it and retrieve the original message. Since the private key is kept secret, only Party B can decrypt the message.
#DAY2