CSN11111 - Cryptography SSL - 2024-5
CSN11111 - Cryptography SSL - 2024-5
Network Security
Cryptography & SSL
Dr. Sana Ullah Jan
Lecture outline
Cryptography
Symmetric Key Encryption
Asymmetric Key Encryption
Digital Signature, Digital Envelop, Certificate Authority, Digital Certificate
Securing TCP
Secure Socket Layer (SSL) & Transport Layer Security (TLS)
Almost SSL
Real SSL/TLS
TLS 1.3
Attacks on SSL/TLS
Connection Replay Attack
Truncation Attack
Browser Exploit Against SSL/TLS Attack (BEAST)
Introduction to Cryptography
Cryptography elements
Algorithm – DES/3DES & RSA
Keys for encryption and decryption
Two types of encryption schemes:
Symmetric key encryption:
Encryption and decryption keys are the same
Stream ciphers
Block ciphers
Asymmetric key encryption:
Encryption and decryption keys are not the same
Stream ciphers vs. Block ciphers
1. Calculates the hash of 2. Encrypts the hash with the Private Key
the message
3. Signs the message with private key 4. Sends the signed message
Receiver:
5. Re -calculates the 6. Decrypts the received signature with Public Key
hash of the message
101101…
Subject name
Subject Public Key Info
Public Key Algorithm
Subject Public Key
DS vs DE vs DC?
Certificate Authority (CA)
The Certificate Authority (CA) is the device which issues and verifies
digital certificates.
GoDaddy
Symantec
Comodo
Entrust
Let's Encrypt
Unsecured TCP Connections
This encrypted package is then passed to TCP for transport over the Internet
Compare the actual MAC and new MAC, if they are same, there was no
alteration
Hash f(x)
This encrypted package is then passed to TCP for transport over the Internet
2 3
Same procedure for Record , Record , Record 4
Data Transfer, Alice receives - Almost SSL
Credit card Order Postal address Billing
information information address
Compare the actual MAC and new MAC, if they are same, there was no alteration
2 3
Same procedure for Record , Record , Record 4
A More Complete Picture
Real SSL
The previous slides covered the almost-SSL protocol, what about the actual
SSL??
☺
SSL/TLS Handshake – Real SSL/TLS
Bob verifies the certificate, extracts the server’s public key, generates a Pre
Master Key (PMS), encrypts the PMS with the server’s public key, and sends
the encrypted PMS to the server
SSL/TLS Handshake - Real SSL/TLS
• Truncation attack
Mallory once again gets in the middle of an ongoing SSL
session and ends the session early with a TCP FIN
Alice would think she received all of Bob’s data when
actuality she only received a portion of it
But what would be a solution?
Connection Closure Cont.
• In CBC mode, to make each message unique, an Initialization Vector (IV) is used
in the first block
• An IV is a random string that is XORed with the plaintext message prior to
encryption
How Is the Attack Accomplished?
The attacker has to modify the traffic to see if the results match; as a
result, multiple requests have to be sent in this process
This is a vulnerability in block ciphers that use the CBC mode of operation. It
was identified in TLS 1.0. However it was addressed in TLS 1.1 and TLS 1.2 by
the use of “explicit IVs” for each block.
Hence, TLS 1.1 and TLS 1.2 are not exposed to this attack.
Solution Cont.
Apple’s Safari, even though it has released a mitigation, has chosen to keep it
disabled by default
Ease of implementation
For network application developers
As easy as implementing unsecured Sockets