DS&C Week02
DS&C Week02
CRYPTOGRAPHY
WEEK 02
By: Dr. Danish Shehzad
SECURITY TRENDS
2
THE OSI SECURITY ARCHITECTURE
OSI Protocol
architecture
3
OSI MODEL
OSI SECURITY ARCHITECTURE
ITU-T X.800 “Security Architecture for OSI”
A systematic way of defining and providing security
5
requirements
Provides a useful, if abstract, overview of concepts we will
study
Security Attack
A security attack means any action that puts the
6
data or overall security of the system at risk.
An attack might be successful or unsuccessful.
Security Service
A service that enhances the security of data
processing systems and information transfers.
These security services can be implemented in
various layers of the OSI model.
Makes use of one or more security mechanisms.
Security Mechanism
A mechanism that is designed to detect, prevent, or
recover from a security attack.
SECURITY ATTACKS
Threat & attack
Often used equivalently
There are a wide range of attacks
Two generic types of attacks
7
Passive
Active
8
SECURITY SERVICES
X.800
A service provided by a protocol layer of communicating open
systems, which ensures adequate security of the systems or of
data transfers
9
Confidentiality (privacy)
Authentication (who created or sent the data)
Integrity (has not been altered)
Non-repudiation (prove the communication parties)
Access control (prevent misuse of resources)
Availability (permanence, non-erasure)
Denial of Service Attacks
Virus that deletes files
SECURITY MECHANISM
Features designed to detect, prevent, or recover
from a security attack
No single mechanism that will support all
10
services required
One particular element underlies many of the
security mechanisms in use:
Cryptographic techniques
Hence we will focus on this topic first
SECURITY MECHANISMS (X.800)
Specific security mechanisms:
11
Pervasive security mechanisms:
Trusted functionality, security labels, event detection,
security audit trails, security recovery
OSI SECURITY STRUCTURE – SECURITY
MECHANISM
MODEL FOR NETWORK SECURITY
13
MODEL FOR NETWORK ACCESS SECURITY
14
CRYPTOGRAPHY
Is
the practice and study of techniques for
secure communication in the presence of
third parties
15
Symmetric cipher: same key used for
encryption and decryption
Asymmetric cipher: different keys used for
encryption and decryption
CRYPTOGRAPHIC SYSTEMS CLASSIFICATION
1. The operation used in transferring plaintext to ciphertext: •
• Symmetric (private- key) : both the sender and receiver use the
same key
• Asymmetric (public-key) : sender and receiver use different key
18
Enciphering or encryption algorithm: the process
of converting plaintext into ciphertext
19
Secret key: same key used for encryption and
decryption
Also referred to as a symmetric key
20
Cipher or cryptographic system : a scheme for
encryption and decryption
22
X = plaintext
Y = ciphertext
K = secret key
E = encryption algorithm
D = decryption algorithm
Both E and D are known to public
CRYPTANALYSIS
Objective:to recover the plaintext of a
ciphertext or, more typically, to recover
23
the secret key.
Kerkhoff’sprinciple: the opponent
knows all details about a cryptosystem
except the secret key.
Two general approaches:
brute-force attack
non-brute-force attack (cryptanalytic
attack)
BRUTE-FORCE ATTACK
Try every key to decipher the ciphertext.
On average, need to try half of all possible
24
keys
Time needed proportional to size of key space
Key Size (bits) Number of Alternative Time required at 1 Time required at 106
Keys decryption/µs decryptions/µs
32 232 = 4.3 109 231 µs = 35.8 minutes 2.15 milliseconds
128 2128 = 3.4 1038 2127 µs = 5.4 1024 years 5.4 1018 years
168 2168 = 3.7 1050 2167 µs = 5.9 1036 years 5.9 1030 years
26 characters 26! = 4 1026 2 1026 µs = 6.4 1012 years 6.4 106 years
(permutation)
CRYPTANALYTIC ATTACKS
May be classified by how much information
needed by the attacker:
25
Cipher text-only attack
Known-plaintext attack
Chosen-plaintext attack
Chosen-ciphertext attack
CLASSICAL ENCRYPTION TECHNIQUES
1. Substitution Ciphers
2. Transposition Cipher
1. SUBSTITUTION CIPHERS
Monoalphabetic
Additive Cipher
Shift Cipher
Affine Cipher
Caesar Cipher
Polyalphabetic Cipher
Autokey Cipher
Playfair Cipher
Hill Cipher
Vigenere Cipher
Vernam Cipher
2. TRANSPOSITION CIPHERS
Rail Fence
Simple Columnar
Rotormachine
MONOALPHABETIC SUBSTITUTION CIPHER
Shuffle the letters and map each plaintext letter to a different random
ciphertext letter:
31
Plain letters: abcdefghijklmnopqrstuvwxyz
Cipher letters: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
POLYALPHABETIC CIPHERS
In a polyalphabetic cipher, multiple “alphabets”
are used to encipher.
If two letters are the same in the ciphertext it
does not mean they must decipher to the same
plaintext letter.
Playfair Cipher
Autokey Cipher
Hill Cipher
Vigenere Cipher
Vernam Cipher
HILL CIPHER
The algo takes n x n matrix.
The cipher C of P derived by multiplying P by K.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
A BCDEFGHI J K L M N O P Q R S T U V W X Y Z
HILL CIPHER
PAY = |15 0 24|, P = 15
C = (KP) mod 26 0
24
C = 17 17 5 15
21 18 21 X 0 mod 26
2 2 19 24
C= 255+0+120
315+0+504 mod 26
30+0+456
HILL CIPHER
C= 375
819 mod 26
486
C= 11 L
13 N
18 S
PAY = LNS