0% found this document useful (0 votes)
16 views3 pages

How HTTPS and TLS Secure Web Communication

TLS establishes a secure communication channel through a handshake, server authentication, and key exchange, ensuring encrypted data transfer and integrity checks. HTTPS builds on this by encrypting data between a client and server, using a session key for fast symmetric encryption and HMAC for data integrity. The protocol also supports session resumption for quicker reconnections and ensures protection against eavesdropping and tampering.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

How HTTPS and TLS Secure Web Communication

TLS establishes a secure communication channel through a handshake, server authentication, and key exchange, ensuring encrypted data transfer and integrity checks. HTTPS builds on this by encrypting data between a client and server, using a session key for fast symmetric encryption and HMAC for data integrity. The protocol also supports session resumption for quicker reconnections and ensures protection against eavesdropping and tampering.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd

Summary of How TLS Works:

1. Handshake: The client and server agree on encryption algorithms and keys to secure
communication.
2. Authentication: The server proves its identity using a digital certificate.
3. Key Exchange: A shared secret is established to generate symmetric keys for encryption.
4. Encrypted Communication: All subsequent data transfer is encrypted using symmetric
encryption (e.g., AES) to ensure confidentiality.
5. Integrity Checks: Message integrity is guaranteed using HMAC or similar techniques to
detect tampering.
TLS is widely used to secure communications in many protocols, most notably HTTPS (HTTP
over TLS), to ensure secure browsing on the web.

how https protocol works


HTTPS (Hypertext Transfer Protocol Secure) is the secure version of HTTP, designed to encrypt
data exchanged between a client (e.g., a web browser) and a server. It combines HTTP with TLS
(Transport Layer Security) or its predecessor, SSL (Secure Sockets Layer), to provide encryption,
data integrity, and authentication. Here's how HTTPS works in a step-by-step breakdown:

1. Establishing a Connection
When you type a URL with "[Link] your browser attempts to connect to the server over HTTPS.
The process begins with a TLS handshake to establish a secure communication channel.

2. TLS Handshake
The TLS handshake ensures both the client and server agree on encryption methods and establishes
trust. The steps are as follows:

a. Client Hello
• The client (browser) sends a "Client Hello" message to the server, which includes:
• The TLS version supported by the client.
• A list of supported cipher suites (encryption algorithms).
• A random number to be used in key generation.
• Other optional data, like extensions (e.g., for supporting specific features).

b. Server Hello
• The server responds with a "Server Hello" message, which includes:
• The chosen TLS version and cipher suite (selected from the client's list).
• A random number from the server for key generation.
• The server's digital certificate, which includes the server's public key and is signed
by a trusted Certificate Authority (CA).

c. Server Authentication
• The client now validates the server’s certificate:
• It checks if the certificate is signed by a trusted CA (such as DigiCert, Let's Encrypt,
etc.).
• Verifies the certificate is valid (not expired) and the domain name matches.
• If the certificate is trusted, the process continues. If not, the client will display a
security warning.

d. Key Exchange
• The client and server use the public key from the server's certificate to securely exchange
the pre-master secret. Depending on the cipher suite:
• The client may generate a pre-master secret, encrypt it with the server’s public key,
and send it to the server.
• Alternatively, they may perform a Diffie-Hellman key exchange to mutually derive a
shared secret without transmitting it directly.

e. Session Key Generation


• Both the client and the server now generate the same session key using the pre-master
secret, combined with their respective random numbers.
• This session key will be used for symmetric encryption of the actual data transmitted
between the client and server.

f. Finished Messages
• The client sends a Finished message encrypted with the session key, confirming that it is
ready to begin encrypted communication.
• The server responds with its own Finished message, also encrypted with the session key.
At this point, the TLS handshake is complete, and a secure connection is established.

3. Data Encryption
Once the secure connection is established:
• All data sent between the client and the server is encrypted using symmetric encryption
(e.g., AES, ChaCha20), which is much faster than asymmetric encryption.
• The session key ensures that the encrypted data remains confidential, preventing
eavesdroppers from intercepting and understanding the data.

4. Data Integrity
To ensure that data is not tampered with during transmission, HTTPS uses message integrity
checks. The protocol appends a cryptographic hash (using HMAC) to each message, which the
recipient can verify to ensure the data has not been altered in transit.

5. Session Resumption
For future connections, the client and server can use session resumption to avoid a full handshake:
• Session ID: The server assigns a session ID to the session. On a new connection, the client
can present this ID to resume the previous session without a full handshake.
• Session Tickets: Alternatively, the server can send an encrypted session ticket to the client
to store and use for resuming the session later.

6. Closing the Connection


When the session ends, the client or server can send a close_notify message, indicating that the
connection will be closed securely. Both parties discard the session key to ensure that the session
cannot be resumed without a new handshake.

Key Concepts in HTTPS:


• TLS/SSL: TLS (or its older version, SSL) is the protocol that provides encryption and
security for HTTPS.
• Certificate Authority (CA): A trusted entity that issues digital certificates, verifying the
identity of the server.
• Public Key Encryption: Asymmetric encryption used during the handshake to securely
exchange the session key.
• Session Key: A symmetric key generated for each session, used to encrypt all subsequent
data.
• HMAC: Hash-based Message Authentication Code, used to ensure data integrity and detect
tampering.

Security Features of HTTPS:


• Encryption: Data is encrypted, ensuring that third parties cannot intercept or read the data
in transit.
• Authentication: The server is authenticated through its digital certificate, proving its
identity.
• Integrity: HTTPS ensures that data has not been modified during transit, protecting against
tampering.

Summary of How HTTPS Works:


1. Client initiates an HTTPS connection by sending a request to the server.
2. TLS handshake is performed, where both parties agree on encryption methods, and the
server's identity is verified via a certificate.
3. A secure session key is generated and used to encrypt the data.
4. All communication is encrypted and integrity-checked using the session key.
5. Session resumption allows for quicker reconnections in the future without a full handshake.
This process ensures that data transmitted over HTTPS is secure and protected from eavesdropping,
tampering, and man-in-the-middle attacks.

You might also like