Unit 4
Unit 4
▪ Application Level:
▪ Security services are embedded within an application.
▪ Security service can be tailored for specific needs of an
application.
▪ Example: Secure Electronic Transaction (SET).
IPSec
▪ general IP Security mechanisms
▪ provides
▪ Authentication(signatures and Certificates)
▪ Confidentiality (Encryption)
▪ key management
▪ does not provide a key exchange mechanism.
▪ applicable to use over LANs, across public &
private WANs, & for the Internet
▪ Key points of IPSec:
▪ Two modes of propagation (transport and tunnel)
▪ Security associations (SAs)
▪ Two types of header (ESP and AH)
IPSec
▪ IPSec features are implemented in the form of
additional IP headers called as extension headers.
▪ 2 extension headers – one for authentication and one
for confidentiality
IPSec
▪ IPsec: Building a Connection
▪ Internet Key Exchange
▪ Used for key management
▪ Used to negotiate the cryptographic algorithms to be later used in
actual operation.
▪ IPSec
▪ Security associations are negotiated on behalf of IPsec services.
IPSec
▪ IPSec Security Association
▪ Security Association(SA) :a one-way relationship between
sender & receiver that affords security for traffic flow
▪ Before communication starts , 2 parties should establish
Security Association with each other
▪ SA is the output of IKE phase.
▪ If two parties communicate using both protocols in IPSec,
each party requires 2 sets of SA (one per protocol)
▪ SA is simplex i.e. unidirectional , hence one SA for
incoming & one for outgoing transmission is needed.
▪ Security Association Database(SAD) : storage area for
storing the SA information at each party.
IPSec
▪ Transport and Tunnel Modes
▪ Transport mode:
▪ used to encrypt & optionally authenticate IP data
▪ data is encrypted but header left in clear i.e. does not
hide the actual source & destination address.
▪ can do traffic analysis but is efficient
▪ good for ESP host to host traffic
▪ Tunnel mode:
▪ encrypts entire IP packet
▪ A logical encrypted tunnel is established between 2
hosts.
▪ add new header for next hop
▪ good for VPNs, gateway to gateway security
External IP
header(not Internal IP data
encrypted) header
Transport and Tunnel Modes
Transport Mode
Router Router
Tunnel Mode
Encrypted Tunnel
Gateway 1 Gateway 2
Encrypted
A B
Tunnel
IP header IPSec header IP header TCP header data
mode
IPSec Protocols
ESP AH
IKE
After Applying AH
AH Transport Mode
New IP OriginalIP
AH TCP header Data
header Header
AH Tunnel Mode
Dealing with Replay Attack
Marked if a Unmarked if a
valid packet is valid packet is not
N-W received N
yet received
Field Description
Security Parameter Index(SPI) 32 bit field used in combination with source address,
destination address & IPSec protocol(AH/ESP) to
uniquely identify the SA for the traffic to which a
datagram belongs.
Sequence Number 32bit field used to prevent replay attacks.
Payload Data Variable length field that contains transport layer
segment (transport mode) or IP packet (tunnel mode),
which is protected by encryption.
Padding Padding bits
Padding length 8 bits field that specifies number of padding bytes in the
immediately preceding field.
Next Header 8 bit field which identifies the type of encapsulated data
in the payload.
Authentication Data Variable length field containing authentication data called
as Integrity Check Value(ICV). ICV is calculated
over the length of ESP packet minus Authentication Data
Field.
ESP Transport & Tunnel Mode
Before Applying ESP
Original ESP
TCP header Data ESP trailer ESP auth
IP Header header
Original TCP
New IP ESP ESP trailer ESP auth
IP header Data
header header
header
ESP Tunnel Mode
IPSec Advantages
• Transparent to the end user so no user training , key
issuance/revocation needed.
• Works at network layer hence no changes to upper
layer are needed.
• Allows interconnectivity between offices in a very
inexpensive manner.
• Allows traveling staff to access corporate network
securely.
• When it is implemented in a firewall, all outgoing &
incoming traffic gets protected but internal traffic
does not have to use IPSec. Hence it does not add
overhead for the internal traffic.
Secure Socket Layer (SSL)
2. Server Hello :
▪ Version – lower of the version suggested by the client and
the highest supported by the server.
▪ Random – same as random field of the client but random
value is independent of client’s random value.
▪ Session id – If session id sent by client is nonzero, server
uses the same value. Otherwise server creates a new session
id & puts in this field.
▪ Cipher suite – contains a single cipher suite, which is
selected by the server from the list sent by the client.
▪ Compression method - contains a single compression
algorithm, which is selected by the server from the list sent
by the client.
Phase 2 - Server authentication & key exchange
▪ Server initiates this phase & is the sole sender of all the
messages.
Steps :
1. Certificate – Server sends its digital certificate &
entire chain leading up to root CA to the client.
2. Server Key Exchange (optional) – Server sends its
public key to the client. It is used only if the server
does not send its digital certificate to the client in
step1.
3. Certificate Request (optional) – Server can request
for the client’s digital certificate.
4. Server hello done – indicates to the client that its
portion of the hello message is complete.
Phase 3 – Client authentication & key exchange
▪ Client initiates this phase & is the sole sender of all the
messages.
Steps :
1. Certificate(Optional) – This step is performed only if
server had requested for client’s digital certificate.
2. Client Key Exchange (optional) – Client sends
symmetric key that both parties will use in this session to
the server. It also creates a 48 byte pre master secret ,
encrypts it with server’s public key & send to it to the
server.
3. Certificate Verify (optional)– performed only if server
had demanded client authentication. Client combines the
pre master secret with random number exchanged by the
client & server after hashing them together and signs the
result with its private key.
Phase 4 – Finish
▪ Client initiates this phase which the server ends .
▪ Both client & server create a master secret based on the
pre master secret.
▪ Both client & server generate shared secret key known
only to them.
Steps :
1. Change cipher specs – It is a confirmation from the
client that all is well.
2. Finished
3. Change cipher specs – It is a confirmation from the
server that all is well.
4. Finished
Phase 4 – Master Secret & Symmetric Key Generation
▪ Master secret generation :
Pre-master secret Client random Server random
Master secret
Symmetric Key
SSL Record Protocol
E
n
cr
y Plain text (optionally compressed)
pt
e
d
MAC ( 0, 16 or 20 bytes)
SSL Alert Protocol
certificate unknown
close notify
Transport Layer Security (TLS)
▪ TLS Handshake
Transport Layer Security (TLS)
▪ TLS Handshake
▪ With a TLS enabled service, a sender sends a ClientHello. This includes
information about Client.
▪ Then server responds with ServerHello message (selecting highest
version of TLS supported by Client) and then chooses a cipher suite
from list in ClientHello message. The server also transmits its Digital
certificate and a final ServerHelloDone message.
▪ Client validates certificate. Client then sends ClientKeyExchange
message. Here client chooses a key exchange mechanism to securely
establish a shared secret with server. Client also needs to send
ChangeCipherSpec indicating that it is switching to secure
communication now, which is finally followed by Finished message for
indicating a successful handshake.
▪ Server replies with ChangeCipherSpec and an encrypted Finished
message once shared secret is received.
▪ Session key is Shared Symmetric Encryption Key used in TLS sessions
to encrypt data being sent back and forth.
Transport Layer Security (TLS)
▪ Difference between SSL and TLS
SSL TLS
SSL stands for Secure Socket Layer. TLS stands for Transport Layer Security.
SSL supports the Fortezza algorithm. TLS does not support the Fortezza algorithm.
In SSL, the Message Authentication Code protocol is used. In TLS, Hashed Message Authentication Code protocol is used.
SSL is less reliable and slower. TLS is highly reliable and upgraded. It provides less latency.
The commercial version satisfies users who want a product that comes
with vendor support
Content-Type
• Describes the data contained in the body with sufficient detail that the receiving user agent can
pick an appropriate agent or mechanism to represent the data to the user or otherwise deal with
the data in an appropriate manner
Content-Transfer-Encoding
• Indicates the type of transformation that has been used to represent the body of the message in
a way that is acceptable for mail transport
Content-ID
Content-Description
• A text description of the object with the body; this is useful when the object is not readable
MIME Content Types
MIME Transfer Encodings
Native and Canonical Form
S/MIME Functionality
S/MIME
For each recipient, encrypt the session key with the recipient’s
public RSA key
The user of some related A user’s public key must be A user requires access to a
administrative utility must be registered with a certification local list of certificates in
capable of generating separate authority in order to receive an order to verify incoming
Diffie-Hellman and DSS key pairs X.509 public-key certificate signatures and to encrypt
and should be capable of outgoing messages
generating RSA key pairs