SSL/TLS - CSU359 - Shoolini University

SSL/TLS

1. Introduction to SSL/TLS

SSL (Secure Sockets Layer) and TLS (Transport Layer Security) are cryptographic protocols that provide secure communication over a network, particularly the Internet. TLS is the successor to SSL, offering enhanced security and efficiency. These protocols ensure three fundamental security properties:

2. How SSL/TLS Works

SSL/TLS operates in a layered manner using the following steps:

2.1 Handshake Protocol

The handshake protocol establishes the foundation for secure communication. Key steps include:

  • Client Hello: The client initiates communication, specifying supported protocols, cipher suites, and random data.
  • Server Hello: The server responds with its chosen protocol version, cipher suite, and its random data.
  • Certificate Exchange: The server provides its digital certificate, proving its identity.
  • Key Exchange: A shared session key is established using asymmetric encryption (e.g., RSA or Diffie-Hellman).
  • Session Start: Both parties confirm they are ready to use the session key, switching to symmetric encryption for the remainder of the session.

2.2 Record Protocol

The record protocol secures the actual data transmission after the handshake:

  • Encrypts data using the session key.
  • Ensures data integrity using cryptographic hashes (e.g., HMAC).
  • Supports fragmentation and compression for efficiency.

3. SSL vs. TLS

Though often used interchangeably, SSL and TLS differ in terms of security and features:

4. Key Components

4.1 Certificates

Certificates are issued by Certificate Authorities (CAs) and ensure authenticity.

  • Structure: Contains public key, issuer, validity period, and signature.
  • Validation Types: Domain Validation (DV), Organization Validation (OV), Extended Validation (EV).

4.2 Cipher Suites

A cipher suite is a collection of algorithms that secure communication. It includes:

  • Key exchange algorithm (e.g., RSA, ECDHE).
  • Encryption algorithm (e.g., AES, ChaCha20).
  • Message authentication code (e.g., SHA256).

5. Advantages of SSL/TLS

6. Common Vulnerabilities and Mitigations

7. Real-World Applications

8. Implementation Example

8.1 Server Configuration (Nginx)

server {
    listen 443 ssl;
    server_name example.com;

    ssl_certificate /etc/nginx/ssl/cert.pem;
    ssl_certificate_key /etc/nginx/ssl/key.pem;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;

    location / {
        root /var/www/html;
        index index.html;
    }
}

8.2 Testing with OpenSSL

openssl s_client -connect example.com:443

This command verifies the server's certificate and supported protocols.