Unit - I: Over View - Need For Security
Unit - I: Over View - Need For Security
A B
Security Goals (CIA) or Services-
A service that enhances the security of the data processing
systems and the information transfers of an organization
1.Confidentiality
2.Integrity
3.Authentication
4.Access Control
5.Non Repudation
6.Availability
Confidentiality-
Confidentiality is the fundamental security service provided by cryptography.
It is a security service that keeps the information from an unauthorized person.
Message send should be Known only to sender and receiver
It is sometimes referred to as privacy or secrecy.
2.Integrity- It is security service that deals with identifying any
alteration to the data.
• The data may get modified by an unauthorized entity intentionally or
accidently
• Ensures that Message send should be received as such without any
modification to the Revr.
3. Authentication -Authentication provides the identification of the
originator.
• It confirms to the receiver that the data received has been sent only
by the sender.
• Identifies the origin of the message
4.Access Control- Ability to limit and control access to host system
5. Non repudiation- Prevents that neither the sender nor the receiver from
denying the transmitted message.
There are four general categories of attack which are listed below.
1.Interruption
• An asset of the system is destroyed or becomes unavailable or
unusable.
• This is an attack on availability .
• E.g., destruction of piece of hardware, cutting of a communication
line or Disabling of file management system.
Sender Receiver
2.Interception
• An unauthorized party gains access to an asset.
• This is an attack on confidentiality. Unauthorized party could
be a person, a program or a computer.
• E.g., wire tapping to capture data in the network, illicit copying of files
Sender Receiver
Eaves dropper
3.Modification
• An unauthorized party not only gains access to but tampers with an
asset.
• This is an attack on integrity.
• E.g., changing values in data file, altering a program, modifying the
contents of messages being transmitted in a network.
Sender Receiver
Eaves dropper
4.Fabrication
• An unauthorized party inserts false or spurious message into the
system.
• This is an attack on authenticity.
• E.g., insertion of spurious message in a network or addition of records
to a file.
Sender Receiver
Eaves dropper
Security Attack
• Attack- An intelligent act that violates the security policy of the system.
• Security –1.Active Attack 2. Passive Attack
Active attack –Goal of opponent is to do alteration in the message that is
being transmitted across the network or creation of a false msg.
It is difficult to prevent but easy to detect
These attacks can be classified in to four categories:
1.Masquarade – When one entity pretends to be another
Message from intruder that appears to be from sender
A B
Internet
CC
2.Replay- Involves the capture of data and retransmit the message
without modification to produce unauthorized effect.
• 3.Modification- Some part of legitimate message is altered
or delayed
4.Denial Of Service(DoS)-
• Disruption of entire network by disabling the network.
• By overloading the network so as to degrade the performance
• Suppress all the message directed to the user
Passive Attack-
• Goal of opponent is to obtain the information that is being transmitted across
the network.
• Aim of attacker is just to listen or monitor the conversation that is being held
between sender and Receiver
• Involve no alteration of the message.
• Difficult to defect but easy to prevent by providing encryption
• These attacks can be classified in to Two categories
1. Release of Message Content-
A telephone conversation, an e-mail message and a transferred file may contain
sensitive or confidential information.
We would like to prevent the opponent from learning the contents of these
transmissions
2.Traffic Analysis:
Intruder monitor the traffic flow and watches the frequency and length of the
message and observes the pattern of the message
Difference Between Active and Passive
Attack
Active Attack Passive Attack
• Goal of the attacker to modify the • Goal of the attacker is just to
message. observe or Listen the conversation
• Can be easily detected that is being held between S and R.
• It cannot be prevented. • It cannot be detected
• Types- Masquarade • It can be prevented by encryption.
Replay • Types
Modification Traffic analysis
Dos Release of Message Content
• Security Mechanism –Mechanism or method designed to
detect,prevent or recover from security attack.
1. Encryption – Mathematical Algorithm used to transform data into
another form which is non intelligible.
2. Digital Signature- To provide authentication i.e To identify the
sender or the origin of message
Categories of CryptoSystems
• Based on Types of Operation
1.Substitution- Each Element in PT is substituted by another to get CT
2.Transposition- Position of PT is changed to produce CT
• Based on No.of Keys used
1.Symmetric- Sender and Receiver uses same key for both Encryption and
Decryption.
2.Asymmetric Encryption- Two different keys are used Encryption and
Decryption
• Based on Processing Technique
1.Stream Cipher – Bit by Bit Encryption
2.Block Cipher- Block by block Encryption
Types of Encryption -1.Symmetric Encryption
2.Asymmetric Encryption
1.Symmetric Key Encryption(Single Key ) or Conventional Encry
• Encryption- Process of Converting PT into CT using key and Algorithm
• In symmetric Encryption Same key is used for both encryption and
decryption.
• Same key is shared between sender and receiver i.e
keys are known both to sender and receiver
• Here the original message, referred to as plaintext, is converted into random nonsense, referred
to as cipher text.
• The encryption process consists of an algorithm and a key.
• The key is a value independent of the plaintext. Changing the key changes the output of the
algorithm.
• Once the cipher text is produced, it may be transmitted.
• Upon reception, the cipher text can be transformed back to the original plaintext by using a
decryption algorithm and the same key that was used for encryption.
Symmetric Model has 5 Ingredients
1.Plain Text(PT)- Original Message given as input to Encryption Alg
2.Encryption Alg- Performs various transformation on PT to convert n
to CT.
3.Secret Key- It is another input to Encryption Alg (E.Alg+Key == CT)
4.Cipher Text(CT)-Scrambled message produced as output.
5.Decryption Alg- Takes CT an Key as input and produces original PT
Notation Used
E[X or PT , Key] – CT or Ek [X]= Y
D[Y or CT,Key] - PT or Dk[Y]= X
Advantages and Disadvantages of Symmetric
Encryption
• Advantage
High rate of throughput
keys are relatively short
• Disadvantage
Key must be kept secret at both ends
Key sharing or distribution is major problem
Asymmetric Encryption
• Asymmetric or Public Key or Two Keys Encryption
• Two different keys called private key and Public keys are used -one for
Encryption and other for Decryption
• Public-key, which may be known by anybody, and can be used to
encrypt messages.
• Private-key, known only to the recipient, used to decrypt messages
CLASSICAL ENCRYPTION TECHNIQUES
• There are two basic building blocks of all encryption techniques: substitution and
transposition.
1.SUBSTITUTION TECHNIQUES
• A substitution technique is one in which the letters of plaintext are replaced by
other letters or by numbers or symbols.
• If the plaintext is viewed as a sequence of bits, then substitution involves
replacing plaintext bit patterns with cipher text bit patterns.
• Types
1.CAESAR CIPHER
2.MONOALPHABETIC CIPHER
3.PLAY FAIR CIPHER
4.HILL CIPHER
5.POLY ALPHABETIC OR VIGNERE CIPHER
6.ONE TIME PAD
Caesar cipher (or) shift cipher
• The earliest known use of a substitution cipher and the simplest was introduced by
Julius Caesar.
• The Caesar cipher involves replacing each letter of the alphabet with the letter
standing 3 places further down the alphabet.
• e.g., plain text : pay more money
• Cipher text: SDB PRUH PRQHB
• Note that the alphabet is wrapped around, so that letter following „z‟ is „a‟.
• For each plaintext letter p, substitute the cipher text letter c such that
• C = E(p+k) mod 26 = (p+3) mod 26
• A shift may be any amount, so that general Caesar algorithm is
• C = E (p) = (p+k) mod 26
• Where k takes on a value in the range 0 to 25. The decryption algorithm is simply
• P = D(C) = (C-k) mod 26
• Let us assign a numerical equivalent to each letter:
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
abcdefghijklmnopqrstuvwxyz
Then the algorithm can be expressed as follows.
For each plaintext letter p, substitute the ciphertext letter C:
We define a mod n to be the remainder when a is divided by n.
For example, 11 mod 7 = 4.
C = E(3, p) = (p + 3) mod 26
A shift may be of any amount,
so that the general Caesar algorithm is C = E(k, p) = (p + k) mod 26 where
k takes on a value in the range 1 to 25.
The decryption algorithm is simply p = D(k, C) = (C - k) mod 26 If it is
known that a given ciphertext is a Caesar cipher, then a brute-force
cryptanalysis is easily performed: Simply try all the 25 possible keys
• Encryp- C=(P+K) mod 26
• Ex- P.text -PAY & Key -3
• 15 0 24
• Encry- C=(15+3)mod 26=18 mod 26 =18---S
( 0+3) mod 26 =3 mod 26 = 3----D
(24+3)mod 26= 27 mod 26= 1----B
Plain Text PAY = Cipher Text C= SDB
Decrption = S D B
C= 18 3 1
Decryp- D=(C-K) mod 26
(18-3)mod 26---15----P
(3-3)mod 26 ----0-----A
(1-3) mod 26= -2 mod 26 ---24---Y
Dis advantage
1.If Encrp & Decrp Alg is Known then it is easily traceable
2.Brute force attack is possible that is attacker try with only 25 keys to find CT
try every possible keys until PT is found.
-
2. Mono Alphabetic Cipher
• Substitute one letter with another letter by having any permutation
and combination of 26 alphabets
• Substituting is not done in regular pattern.
• Any Letter can be substituted for any other letter
• Ex. A is replaced with any letter (B to Z)
Disadvantage-
Easy to break because by use of Frequency of Occurrence
3.Play Fair Cipher
• The best known multiple letter encryption cipher where PT is
Encrypted 2 letters at a time (i.e Pair of letters are taken from PT)
• Playfair algorithm is based on the use of 5x5 matrix of letters
constructed using a keyword.
• The matrix is constructed by filling in the letters of the keyword
(minus duplicates) from left to right.
• Remaining unfilled cells of the matrix are filled with the remaining
letters in alphabetical order. The letter „i‟ and „j‟ count as one letter.
• Duplicates are removed.
Rules for Encryption
• Encryption is done by taking 2 characters at a time.
• Rule 1: When selected pair in PT has got same alphabets it is separated by
filler letter ‘X’ .
• Example- B A L L O O N
• See the pair LL it is same letter so it is separated by Filler X
• Therefore B A L L O O N becomes B A L X L O X O N X
• Rule 2: When PT letters that fall in the same row of the matrix are each
replaced by the letter to the right, with the first element of the row
following the last.
• Rule 3: When PT letters fall in Same column it is replaced by letter
beneath.
• Rule 4: When PT letters are different then it is replaced by intersection
cell of its row and column.
• Let the keyword be “MONARCHY” • 5X5 matrix is constructed as below.
Example- B A L L O O N becomes
B A L X L O X O N X(Rule 1)
PT is paired as BA LX LO XO NX M O N A R
BA falls in same column so CT will be
C H Y B D
B A --- I/J B (Rule 3)
L X --- X U (Rule 4) E F G I/J K
L O --- P M (Rule 4)
X O --- V N (Rule 4) L P Q S T
N X --- A W (Rule 4) U V W X Z
Therefore CT will be
IB XU PM VN AW
Ex 2: PT -- N A (Rule 2)
CT – A R • Advantage – Matrix combination 26 X 26
Ex 3 PT --- B D (Rule 2) • Disadvantage- Easy to break
CT ---D C
4. Hill Cipher
• It is also Multi letter Cipher developed by mathematical scientist
Laser Hill 1929
• Algorithm takes M successive PT letter and substitute for M CT
• IT depends on Linear Equation
• Each letter is assigned a numeric value i.e
A=0,B=1,C=2 D=3,E=4 ,F=5,G=6,H=7,I=8,J=9,K=10,L=11,M=12,N=13
O=14,P=15,Q=16,R=17,S=18,T=19,U=20,V=21,W=22,X=23,Y=24,Z=25.
C = 17 *15 + 17* 0 + 5 * 24
21 * 15 + 18 * 0 + 2 * 24
2 * 15 + 2 * 0 + 19 * 24
C= 255 + 120
315 + 504
30 + 456
C=375 mod 26 C= 11 L C= L N S
819 mod 26 13 N
486 mod 26 18 S
• Advantage
1. Completely hides single letter frequency
• Dis advantage
1. It can be easily broken with known Plain Text attack
5.Polyalphabetic Cipher or Vignere Cipher
• Each occurrence of PT have different substitution
K
E
a b c d e f g h i j k … x y z
Y
a A B C D E F G H I J K … X Y Z
L
b B C D E F G H I J K L … Y Z A
E
T
c C D E F G H I J K L M … Z A B
T
E d D E F G H I J K L M N … A B C
R
S e E F G H I J K L M N O … B C D
f F G H I J K L M N O P … C D E
g G H I J K L M N O P Q … D E F
: :: :: :: :: :: :: :: :: :: :: :: … :: :: ::
:
x X Y Z A B C D E F G H … W
y Y Z A B C D E F G H I … X
z Z A B C D E F G H I J … Y
• Example PT = C O M P U T E R C E N T E R
key = D E C E P T I V E D E C E P
FS
• Example PT = B A D
K = D E C
CT = E E F
Dis Advantage :
• Slowness of Encryption
• Error Propagation
• Requires more code
Confussion- Making the relationship between key and CT as complex
as possible.
Block Cipher Modes of Operation
• Types
1. Electronic Code Book(ECB)
2. Cipher Block Chaining(CBC)
3. Cipher Feed Back Mode(CFB)
4. Output Feedback Mode(OFB)
5. Counter mode
Electronic Code BOOK(ECB)
• In this mode each CT block gets feedback into next encryption round.
• Data is encrypted in small units.
• Load the Initialization Vector IV into shift register.
• It is assumed that unit of transmission is S bits
• Take only ‘s’ number of most significant bits (left bits) of output of
encryption process and XOR them with ‘s’ bit plaintext message block
to generate ciphertext block.
• Feed ciphertext block into top register by shifting already present data
to the left and continue the operation till all plaintext blocks are
processed.
• Essentially, the previous ciphertext block is encrypted with the key,
and then the result is XORed to the current plaintext block.
Output Feedback Mode(OFB)
• Similar in structure to that of CFB
• Here output of encryption function is fed as input to shift register.
• Advantage- Bit errors in transmission do not propogate.
i.e if error occurs in CT1 then only PT1 is affected,subsequent PT are
not corrupted.
CFB V.S. OFB
Cipher Feedback
Output Feedback
5.Counter Mode
• It is version of CFB mode without feedback.
• Both Sender and Receiver need access to reliable counter.
• Load the Initial counter value in register and encrypt the contents of
counter with key.
• PT block of PT1 contents of counter to get CT1.
• Update the counter + for next round.
Adv- All advantages of CFB and no error propagation
DisAdv- Requires synchronization couter at Sender and Receiver.
Loss of Synchronization leads to incorrect recovery of PT
CTR Encryption and Decryption
Data Encryption Standard(DES)
• DES is a symmetric key block cipher most widely used.
• Published by National Institute of Standard & Tech(NIST)
• Encrypts block of size 64 bits
• Intially Key of size 64 bits reduced to 56 bits by discarding every 8th bit
of key.
• DES uses both transposition & substitution technique- referred to as
product cipher.
DES-General Structure of DES is depicted in the following illustration
• Next the initial permutation (IP) produces two halves of the permuted block- Left
Plain Text (LPT) and Right Plain Text (RPT) each of 32 bits.
K1 K2
K1 K2 K3