Revision Class
Revision Class
J. Immanuel Johnraja
Faculty in Computer Science and Engineering, KITS
HTTPS://WWW.THEHINDU.COM/BUSINESS/INDIA-SEES-375-CYBERATTACKS-EVERYDAY/ARTICLE33110725.ECE
DENIAL OF SERVICE
MASQUERADE
MAN-IN-MIDDLE ATTACK
SNOOPING
TRAFFIC ANALYSIS
REPUDIATION
PHISHING
COMPUTER SECURITY
CONCEPTS
18cs2005
COMPUTER SECURITY
The protection afforded to an automated information system in order to attain the applicable
objectives of preserving the
integrity,
availability, and
confidentiality
of information system resources.
INTEGRITY
Data integrity
Assures that information and programs are
changed only in a specified and authorized manner.
System integrity
Assures that a system performs its intended
function in an unimpaired manner.
AVAILABILITY
Encrypted CD-ROM/DVD
Hardware Equipment is stolen/disabled
is stolen
Messages are destroyed. Messages are read. Messages are modified, delayed,
Communication &
Communication lines are Traffic pattern of messages reordered or duplicated.
Network
disturbed observed False messages are fabricated
SECURITY SERVICES
J. Immanuel Johnraja
Faculty in Computer Science and Engineering, KITS
SECURITY SERVICES
• Authentication
• Access Control
• Data Confidentiality
• Data Integrity
• Non-repudiation
SECURITY MECHANISMS
J. Immanuel Johnraja
Faculty in Computer Science and Engineering, KITS
SECURITY MECHANISMS
Encipherment
• The use of mathematical algorithms to transform data into a form that is not readily intelligible.
Digital Signature
• Data appended to, or a cryptographic transformation of, a data unit that allows a recipient of the data unit
to prove the source and integrity of the data unit and protect against forgery.
Access Control Protocols
• A variety of mechanisms that enforce access rights to resources.
SYMMETRIC CIPHER
MODEL
J. Immanuel Johnraja
Faculty in Computer Science and Engineering, KITS
FEW TERMS
Secret key: Value independent of the plaintext and of the algorithm. The exact substitutions
and transformations performed by the algorithm depend on the key.
Caesar Cipher
C = E(k, p) = (p + k) mod 26
p = D(k, C) = (C - k) mod 26
Ciphertext?
TRANSPOSITION CIPHER
A stream cipher is one that encrypts a digital data A block cipher is one in which a block of plaintext
stream one bit or one byte at a time. is treated as a whole and used to produce a
ciphertext block of equal length.
GENERAL N-BIT-N-BIT BLOCK SUBSTITUTION
FEISTEL CIPHER
• In Diffusion, the statistical structure of the plaintext is dissipated into long-range statistics of
the ciphertext. This is achieved by having each plaintext digit affect the value of many
ciphertext digits.
• Confusion attempts to make the relationship between the statistics of the ciphertext and the
value of the encryption key as complex as possible.
FEISTEL CIPHER
FEISTEL CIPHER - CHOICE OF PARAMETER
• Block size
• Key size
• Number of rounds
• Subkey generation algorithm
• Round function F
DATA ENCRYPTION STANDARD
J. Immanuel Johnraja
Faculty in Computer Science and Engineering, KITS
DES
Inverse Initial Permutation
Initial Permutation (IP)
(IP–1)
SINGLE ROUND
OF DES
Expansion Permutation Permutation Function
(E) (P)
SINGLE ROUND
OF DES
F(R,K)
DES S-BOX
DES S-BOX
SINGLE ROUND
OF DES
Input Key Permuted Choice-1
Permuted Choice-2
Timing attacks
• Information about the key or the plaintext is obtained by observing how long it takes a given
implementation to perform decryptions on various ciphertexts.
• It exploits the fact that an encryption or decryption algorithm often takes slightly different
amounts of time on different inputs.
• DES appears to be fairly resistant to a successful timing attack.
Advanced Encryption Standard
J. Immanuel Johnraja
The AES Cipher - Rijndael
It has 128/192/256 bit keys, 128 bit data
An iterative rather than Feistel cipher
processes data as block of 4 columns of 4 bytes
operates on entire data block in every round
AES
Encryption
Process
AES Structure
Data block of 4 columns of 4 bytes is state
Key is expanded to array of words
Has 9/11/13 rounds in which state undergoes:
1. byte substitution (1 S-box used on every byte)
2. shift rows (permute bytes between groups/columns)
3. mix columns (subs using matrix multiply of groups)
4. add round key (XOR state with key material)
AES
Structure
Some Comments on AES
1. key expanded into array of 32-bit words
• four words form round key in each round
2. 4 different stages are used as shown
3. only AddRoundKey uses key
4. each stage is easily reversible
5. decryption uses keys in reverse order
6. final round has only 3 stages
AES
Structure
Substitute Bytes
A simple substitution of each byte
uses one table of 16x16 bytes containing a permutation of all 256 8-
bit values
each byte of state is replaced by byte indexed by row (left 4-bits) &
column (right 4-bits)
eg. byte {95} is replaced by byte in row 9 column 5
which has value {2A}
designed to be resistant to all known attacks
Substitute Bytes
Substitute Bytes Example
AES
Structure
Shift Rows
A circular byte shift in each
1st row is unchanged
2nd row does 1 byte circular shift to left
3rd row does 2 byte circular shift to left
4th row does 3 byte circular shift to left
Decrypt inverts using shifts to right
Shift Rows
AES
Structure
Mix Columns
Each column is processed separately
Each byte is replaced by a value dependent on all 4 bytes in the
column
Mix Columns
Add Round Key
XOR state with 128-bits of the round key
Processed by column
Designed to be as simple as possible
requires other stages for complexity / security
Add Round Key
AES
Round
AES Key Expansion
Takes 128-bit (16-byte) key and expands into
array of 44/52/60 32-bit words.
Start by copying key into first 4 words.
Then loop creating words that depend on
values in previous & 4 places back
in 3 of 4 cases just XOR these together
1st word in 4 has rotate + S-box + XOR round
constant on previous, before XOR 4th back
AES Decryption
AES decryption is not identical to encryption since steps done
in reverse
AES
Decryption
PUBLIC KEY
CRYPTOGRAPHY
J. Immanuel Johnraja
PRIVATE-KEY CRYPTOGRAPHY
• Encryption/decryption: The sender encrypts a message with the recipient’s public key, and the recipient
decrypts the message with the recipient’s private key.
• Digital signature: The sender “signs” a message with its private key.
• Key exchange: Two sides cooperate to exchange a secret key for symmetric encryption.
PUBLIC-KEY REQUIREMENTS
1. It is computationally easy for a party B to generate a key pair (public key PUb, private
key PRb).
2. It is computationally easy for a sender A, knowing the public key and the message to be
encrypted, M, to generate the corresponding ciphertext:
C = E(PUb , M)
3. It is computationally easy for the receiver B to decrypt the resulting ciphertext using the
private key to recover the original message:
M = D(PRb , C) = D[PRb , E(PUb , M)]
4. It is computationally infeasible for an adversary, knowing the public key, PUb, to
determine the private key, PRb.
PUBLIC-KEY REQUIREMENTS
• The RSA public key encryption algorithm was the first practical
implementation of public key encryption discovered.
• It remains the most used public key encryption algorithm today.
• It is named after the three researchers Ron Rivest, Adi Shamir and Len
Adleman who first published it.
RSA STEPS
1. Key Generation
2. Encryption
3. Decryption
RSA - KEY GENERATION
p = 17 and q = 11
• Step 2. Calculate n = p * q
Calculate n = pq = 17 × 11 = 187.
Plaintext: M < n
Ciphertext: C = Me mod n
Message M = 88
887 mod 187 = [(884 mod 187) × (882 mod 187) × (881 mod 187)] mod 187
881 mod 187 = 88
882 mod 187 = 7744 mod 187 = 77
884 mod 187 = 59,969,536 mod 187 = 132
887 mod 187 = (88 × 77 × 132) mod 187 = 894,432 mod 187
Ciphertext C = 11
DECRYPTION USING PRIVATE KEY
Ciphertext: C = 11
Plaintext: M = Cd mod n
1123 mod 187 = [(111 mod 187) × (112 mod 187) × (114 mod 187) × (118 mod 187) × (118 mod
187)] mod 187
111 mod 187 = 11
112 mod 187 = 121
114 mod 187 = 14,641 mod 187 = 55
118 mod 187 = 214,358,881 mod 187 = 33
1123 mod 187 = (11 × 121 × 55 × 33 × 33) mod 187 = 79,720,245 mod 187
Plaintext C = 11
RSA REQUIREMENTS
1. It is possible to find values of e, d, and n such that Med mod n = M for all M < n.
2. It is relatively easy to calculate Me mod n and Cd mod n for all values of M < n.
3. It is infeasible to determine d given e and n.
RSA SUMMARY
Private
SECURITY OF RSA
• to enable two users to securely exchange a key that can then be used for subsequent symmetric encryption of
messages.
• depends for its effectiveness on the difficulty of computing discrete logarithms.
DISCRETE LOGARITHM
• Primitive root of a prime number p is one whose powers modulo p generate all the integers from 1 to p - 1.
i.e., if a is a primitive root of the prime number p, then the numbers a mod p, a2 mod p, ..., ap-1 mod p are distinct
and consist of the integers from 1 through p - 1 in some permutation.
ALGORITH
M
Prime number q = 353 and a primitive root of 353 is α = 3.