Web Security
Web Security
Web Security refers to the protective measures and protocols used to safeguard websites,
web applications, and online services from cyber threats such as:
Hacking attempts
Data theft
Malware
Unauthorized access
Phishing and spoofing
1. Handshake Protocol.
3. Alert Protocol.
SSL Record Protocol:
This protocol provides two services for SSL connections:
• These blocks are then optionally compressed which must be lossless and may not
increase the content length by more than 1024 bytes.
• A message authentication code is then computed over the compressed data using a
shared secret key. This is then appended to the compressed (or plaintext) block.
• The compressed message plus MAC are then encrypted using symmetric en-cryption.
Encryption may not increase the content length by more than 1024 bytes, so that the
total length may not exceed 214 + 2048. A number of different encryption algorithms
are permitted.
– Content type (8 bits) - The higher layer protocol used to process the en-closed
fragment.
– Major Version (8 bits) - Indicates major version of SSL in use. For SSLv3, the
value is 3.
– Minor Version (8 bits) - Indicates minor version in use. For SSLv3, the value is
0.
– Compressed Length (16 bits) - The length in bytes of the compressed (or
plaintext) fragment.
The “content type” above is one of four types; the three higher level protocols given above
that make use of the SSL record, and a fourth known as “application data”. The first three
are described next as they are SSL specific protocols.
Handshake Protocol:
Handshake Protocol is used to establish sessions. This protocol allows the client and server
to authenticate each other by sending a series of messages to each other. Handshake protocol
uses four phases to complete its cycle.
Phase -1: In Phase-1 both Client and Server send hello-packets to each other. In this IP
session, cipher suite and protocol version are exchanged for security purposes.
Phase -2: Server sends it certificate and Server-key-exchange. The server end phase-2 by
sending the Server-hello-end packet.
Phase -3: In this phase, Client replies to the server by sending it certificate and Client-
exchange-key.
Phase -4: In Phase-4 Change Cipher Spec occurs and after this the Handshake Protocol ends.
Change-Cipher Protocol:
This protocol uses the SSL record protocol. Unless Handshake Protocol is completed, the
SSL record Output will be in a pending state. After the handshake protocol, the Pending state
is converted into the current state.
Change-cipher protocol consists of a single message which is 1 byte in length and can have
only one value. This protocol’s purpose is to cause the pending state to be copied into the
current state.
Alert Protocol:
This protocol is used to convey SSL-related alerts to the peer entity. It consists of two bytes
the first of which takes the values 1 (warning) or 2 (fatal). If the level is fatal SSL
immediately terminates the connection. The second byte contains a code that indicates the
specific alert.
It is the successor to SSL (Secure Socket Layer) and is considered much more secure and
efficient.
Main Goals of TLS:
1. Confidentiality – Prevent eavesdropping.
2. Integrity – Prevent data tampering.
3. Authentication – Verify the identity of the communicating parties.
TLS Versions:
Version Year Status Key Features
TLS 1.0 1999 Deprecated Based on SSL 3.0
TLS 1.1 2006 Deprecated Minor improvements
TLS 1.2 2008 Active Strong encryption, widely adopted
TLS 1.3 2018 Current Faster, simpler handshake, no obsolete algorithms
TLS vs SSL: