IS Unit-1
IS Unit-1
IS Unit-1
(AUTONOMOUS)
Accredited by NAAC & NBA (Under Tier - I) ISO 9001:2015 Certified Institution
Approved by AICTE, New Delhi. and Affiliated to JNTUK, Kakinada
L.B. REDDY NAGAR, MYLAVARAM, KRISHNA DIST., A.P.-521 230.
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
INTRODUCTION
By
Mr. Ch.Srinivasa Rao
Assistant Professor
Dept.of CSE, LBRCE
1.Background
The requirements of information security within an
organization have undergone two major changes in the last
several decades.
Can be intentional
1
or unintentional Is intentional
Is malicious
2
May or may not be
malicious
1.2 OSI Security Architecture
Security Architecture for OSI defines a systematic approach useful to
managers as a way to evaluate and choose various security products
and policies.
The managers are responsible for computer and network security
needs.
The OSI security architecture focuses on security attacks, mechanisms,
and services.
Information security is about protecting the information
from unauthorized access, misuse, disclosure, destruction,
modification, or disruption by using processes and methodologies
which are designed and implemented for protecting information.
These three concepts form what is often referred to as the CIA triad.
Security mechanism:
A process (or a device incorporating such a process) that is
designed to detect, prevent, or recover from a security attack.
Security service:
A processing or communication service that enhances the
security of the data processing systems and the information transfers
of an organization. The services are intended to counter security
attacks, and they make use of one or more security mechanisms to
provide the service.
1.3 Security Attacks
Attacks on the information can be classified into two categories
i. Passive attacks
ii. Active attacks
Passive Attacks
Passive attacks mainly focus on getting information by doing tapping or
eavesdropping or monitoring etc..,
There are two types of passive attacks
a. Revealing formation
b. Traffic analysis
Passive attacks are difficult to identify.
Passive attacks are prevented rather than detecting.
Active attacks
RFC 2828:
“a processing or communication service provided by a
system to give a specific kind of protection to
system resources”
Security Services (X.800)
Authentication
Assurance that the communicating entity is the
one claimed
Access Control
Prevention of the unauthorized use of a
resource
Data Confidentiality
Protection of data from unauthorized disclosure
Data Integrity
Assurance that data received is as sent by an
authorized entity
Non-Repudiation
Protection against denial by one of the parties
in a communication
1. 5 Security Mechanisms
Detect, prevent, or recover from a security attack
no single mechanism that will support all
services required
However one element underlies many of the
security mechanisms in use:
cryptographic techniques
Hence our focus on this topic
Security Mechanisms (X.800)
specific security mechanisms:
Plain text
Encryption Algorithm
Cipher text
Secret Key
Decryption Algorithm
Cryptanalysis
objective to recover key not just message
general approaches:
cryptanalytic attack
brute-force attack
2.2 Cryptanalytic Attacks
ciphertext only
only know algorithm & ciphertext, is statistical, know or
can identify plaintext
known plaintext
know/suspect plaintext & ciphertext
chosen plaintext
select plaintext and obtain ciphertext
chosen ciphertext
select ciphertext and obtain plaintext
chosen text
select plaintext or ciphertext to en/decrypt
Brute Force Search
always possible to simply try every key
most basic attack, proportional to key size
assume either know / recognise plaintext
2.3 Classical Substitution Ciphers
where letters of plaintext are replaced by other letters
or by numbers or symbols
or if plaintext is viewed as a sequence of bits, then
substitution involves replacing plaintext bit patterns
with ciphertext bit patterns
2.3.1Caesar Cipher
earliest known substitution cipher by Julius Caesar
first attested use in military affairs
replaces each letter by 3rd letter on
example:
meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB
Caesar Cipher
can define transformation as:
abcdefghijklmnopqrstuvwxyz
DEFGHIJKLMNOPQRSTUVWXYZABC
mathematically give each letter a number
abcdefghij k l m n o p q r s t u v w x y z
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
Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaint: ifwewishtoreplaceletters
Cipher : WIRFRWAJUHYFTSDVFSFUUFYA
2.3.3 Playfair Cipher
not even the large number of keys in a monoalphabetic
cipher provides security
one approach to improving security was to encrypt multiple letters
the Playfair Cipher is an example
invented by Charles Wheatstone in 1854, but named after his
friend Baron Playfair
Li Ri
Substitution Boxes [S-Box]
have eight S-boxes which map 6 to 4 bits
each S-box is actually 4 little 4 bit boxes
outer bits 1 & 6 (row bits) select one row of 4
inner bits 2-5 (col bits) are substituted
result is 8 lots of 4 bits, or 32 bits
row selection depends on both data & key
feature known as autoclaving (autokeying)
designed to be:
resistant against known attacks
speed and code compactness on many CPUs
design simplicity
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:
byte substitution (1 S-box used on every byte)
shift rows (permute bytes between groups/columns)
mix columns (subs using matrix multipy of groups)
add round key (XOR state with key material)
view as alternating XOR key & scramble data bytes
initial XOR key material & incomplete last round
with fast XOR & table lookup implementation
AES
Block size=128 bit(4words/16 bytes)
No.of rounds=10
Key size=128(4words/16 bytes)
No.of subkeys=44
Each subkey size=32bit/1word/16bytes
Each round=use 4 subkeys(128bit/4words/16/bytes)
Before starting
pre round calculation-4subkeys used
Ciphertext=128 bit(4words/16 bytes)
Byte Substitution
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}
S-box constructed using defined
transformation of values in GF(28)
designed to be resistant to all known attacks
Shift Rows
a circular byte shift in each 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
since state is processed by columns, this step permutes bytes
between the columns
Mix Columns
each column is processed separately
each byte is replaced by a value dependent on
all 4 bytes in the column
effectively a matrix multiplication in GF(28)
using prime poly m(x) =x8+x4+x3+x+1
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
but can define an equivalent inverse cipher with steps
as for encryption
but using inverses of each step
with a different key schedule
works since result is unchanged when
swap byte substitution & shift rows
swap mix columns & add (tweaked) round key
AES Decryption
3.3 Multiple Encryption & DES
clearly a replacement for DES was needed
theoretical attacks that can break it
demonstrated exhaustive key search attacks
AES is a new cipher alternative
prior to this alternative was to use multiple encryption
with DES implementations
Triple-DES is the chosen form
Double-DES?
could use Double DES for encryption
C = EK2(EK1(P))
issue of reduction to single stage
and have “meet-in-the-middle” attack
works whenever use a cipher twice
since X = EK1(P) = DK2(C)
attack by encrypting P with all keys and store
then decrypt C with keys and match X value
can show takes O(256) steps
3.3.1 Triple-DES
Due to the drawback of Double DES 3
encryptions are used
would seem to need 3 distinct keys
But can use 2 keys with E-D-E sequence
C = E (D (E (P)))
K1 K2 K1
encrypt & decrypt equivalent in security
if K1=K2 then can work with single DES
standardized in ANSI X9.17 & ISO8732
no current known practical attacks
Triple-DES with Three-Keys
although are no practical attacks on two-key
Triple-DES have some indications
can use Triple-DES with Three-Keys to avoid
even these
C = EK3(DK2(EK1(P)))
has been adopted by some Internet applications,
eg PGP, S/MIME
4. Modes of Operation
Block ciphers encrypt fixed size blocks
eg. DES encrypts 64-bit blocks with 56-bit key
need some way to encrypt/decrypt arbitrary amounts of
data in practise
ANSI X3.106-1983 Modes of Use (now FIPS 81) defines
different modes
4.1 Cipher Block Chaining (CBC)
for i = 0 to 255 do
S[i] = i
T[i] = K[i mod keylen])
j = 0
for i = 0 to 255 do
j = (j + S[i] + T[i]) (mod 256)
swap (S[i], S[j])
RC4 Encryption
encryption continues shuffling array values
sum of shuffled pair selects "stream key"
value from permutation
XOR S[t] with next byte of message to
en/decrypt
i = j = 0
for each message byte Mi
i = (i + 1) (mod 256)
j = (j + S[i]) (mod 256)
swap(S[i], S[j])
t = (S[i] + S[j]) (mod 256)
Ci = Mi XOR S[t]
RC4 Overview
RC4 Security
claimed secure against known attacks
have some analyses, none practical
result is very non-linear
since RC4 is a stream cipher, must never reuse a key
have a concern with WEP, but due to key handling
rather than RC4 itself
7. Placement of Encryption