0% found this document useful (0 votes)
5 views

Lecture4-Confidentiality

The lecture covers the concept of confidentiality in information security, focusing on cryptographic solutions such as symmetric and asymmetric encryption. It discusses classical cryptosystems like the Shift Cipher and Substitution Cipher, highlighting the importance of key management and the principles of encryption and decryption. Additionally, it addresses the vulnerabilities of these systems and the methods of cryptanalysis, including brute force attacks and frequency analysis techniques.

Uploaded by

Jaideep Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Lecture4-Confidentiality

The lecture covers the concept of confidentiality in information security, focusing on cryptographic solutions such as symmetric and asymmetric encryption. It discusses classical cryptosystems like the Shift Cipher and Substitution Cipher, highlighting the importance of key management and the principles of encryption and decryption. Additionally, it addresses the vulnerabilities of these systems and the methods of cryptanalysis, including brute force attacks and frequency analysis techniques.

Uploaded by

Jaideep Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 110

Foundations of Information

Security
Lecture-4: Confidentiality
Today’s Content…

• Confidentiality
• Cryptographic Solution
• Symmetric Approach
• Asymmetric Approach
• Classical Cryptosystem
• Shift Cipher
• Substitution Cipher
Basic Setup:
• Communication over an insecure channel
• Types of insecure channel
• Internet (unprotected network of computers)
• Wifi (not password protected)
• Air Waves (GSM connection) etc.
Confidentiality can be achieved using
encryption/decryption

Encryption Decryption
Secure Network

E ^d@#*^

D
&!h^*hi ^d@#*^
&!h^*hi

Message
(I love you) Message
(I love you)

E: Encryption- Charlie cannot see what is being sent over the channel
D: Decryption- Bob can successfully decrypt the message
Basic Definitions:
• Plaintext (P) – The original message
• Ciphertext (C) – The scrambled message
• E() – Encryption Function
• D() – Decryption Function
Why secrecy of algorithms is not a good idea ?
1. Maintaining secrecy of algorithms is very cumbersome
• Industrial espionage
• Insider Threat
• Reverse Engineering of the code

2. Public design enables establishment of standards


• Designs which withstand years of public scrutiny – likely to gain more
confidence on its robustness
• Better that flaws are revealed by ethical hackers than malicious attackers
But …
• We can’t make everything public
• Eve can easily decrypt then

• Incorporate a second parameter


• The “KEY”
• Short secret data shared by both communicating parties

Kerckhoff’s Principle [1883]:

A cryptosystem should be secure even if the attacker knows all the details of
the system, with the exception of the secret key.
Depending upon the key, cryptosystems can be
divided into:

• Symmetric Cryptosystems
• Asymmetric Cryptosystems
Symmetric Encryption
• Both the parties use the same key to encrypt and decrypt

Hi, Meet you at xydA@tyhskykb Hi, Meet you at


Starbucks on mc88888*!$6jgj Starbucks on
Friday at 3:00 gb768$gh^kkdv Friday at 3:00
PM. Encryption mmmvmvbb Decryption PM.

Plaintext Ciphertext Plaintext

9
Asymmetric Encryption
• Communicating parties use two keys – public key (known to all) and private key
(known only to owner) to encrypt and decrypt
Asymmetric Encryption
• Communicating parties use two keys – public key (known to all) and private key
(known only to owner) to encrypt and decrypt

1. Bob gives Alice his


public key
Asymmetric Encryption
• Communicating parties use two keys – public key (known to all) and private key
(known only to owner) to encrypt and decrypt

Hi, Meet you at xydA@tyhskykb


Starbucks on mc88888*!$6jgj
Friday at 3:00 gb768$gh^kkdv
PM. Encryption mmmvmvbb

Plaintext Ciphertext

1. Bob gives Alice his 2. Alice uses the public key of Bob
public key to encrypt her message
Asymmetric Encryption
• Communicating parties use two keys – public key (known to all) and private
key (known only to owner) to encrypt and decrypt

3. Bob receives Alice’s


encrypted message
Asymmetric Encryption
• Communicating parties use two keys – public key (known to all) and private
key (known only to owner) to encrypt and decrypt

xydA@tyhskykb Hi, Meet you at


mc88888*!$6jgj Starbucks on
gb768$gh^kkdv Friday at 3:00
mmmvmvbb Decryption PM.

Ciphertext Plaintext

3. Bob receives Alice’s 4. Bob uses his private key to


encrypted message decrypt her message
Asymmetric Encryption

• Can the reverse be used, i.e., private key is used for encryption and
public key is used for decryption ?
• Why or why not ?
How do we keep this key (symmetric) secret ?
• Either Alice and Bob meet in private
• Exchange the keys used for later communications

• Use special cryptographic key exchange protocol


• Diffie Hellman Key Exchange
Symmetric Cryptosystems
• Formal definition
Example:
• Let us design a small cryptosystem as follows:
• Let 𝒫 = 𝒞 = 𝒦 = {0, 1, 2}
• i.e., 𝒫 = 𝒞 = 𝒦 =3
• 𝐶 = 𝐸𝑘 𝑃 = 𝑃 + 𝑘 𝑚𝑜𝑑 3 𝑓𝑜𝑟 𝑘 ∈ {0,1,2}
• P = 𝐷𝑘 𝐶 = 𝐶 − 𝑘 𝑚𝑜𝑑 3 𝑓𝑜𝑟 𝑘 ∈ {0,1,2}

K=0 K=1 K=2

0 0 0 0 0 0
1 1 1 1 1 1
2 2 2 2 2 2
Facts about 𝑬𝑲 ()
• It is injective (one-to-one)
• i.e. EK(x1) = EK(x2) iff x1 = x2
Facts about 𝑬𝑲 ()
• It is injective (one-to-one)
• i.e. EK(x1) = EK(x2) iff x1 = x2
• Why?
• If not, then Bob does not know if the ciphertext came from x1 or x2
Some Traditional
Cryptosystems
Threat Model
Assumptions:
• Attacker has full knowledge of the encryption/decryption algorithm
• Attacker doesn’t know the secret key
Threat Model
Assumptions:
• Attacker has full knowledge of the encryption/decryption algorithm
• Attacker doesn’t know the secret key

• Aim of the attacker:


• Recover the secret key, or,
• Given the ciphertext, recover the original plaintext
even if the key is unknown
Shift Cipher Also called Caesar's Cipher

• Let 𝒫 = 𝒞 = 𝒦 = {Set of English Alphabets}


• i.e., 𝒫 = 𝒞 = 𝒦 = 26
• Algorithm - Shift each letter in the plaintext by a position specified by
the key to form the ciphertext
Shift Cipher
• Let 𝒫 = 𝒞 = 𝒦 = {Set of English Alphabets}
• i.e., 𝒫 = 𝒞 = 𝒦 = 26
• Algorithm - Shift each letter in the plaintext by a position specified by
the key to form the ciphertext
• Let k = 5
• i.e., shift each letter in the plaintext by 5 letters to the right
• E.g., Plaintext = I AM BOND
Ciphertext = N FR GTSI
Shift Cipher Cryptanalysis
• Let us suppose
Plaintext – i am bond
Ciphertext - l dp erqg
Shift Cipher Cryptanalysis
• Let us suppose
Plaintext – i am bond
Ciphertext - l dp erqg

• Can you guess the key ?


Shift Cipher Cryptanalysis
• Let us suppose
Plaintext – i am bond
Ciphertext - l dp erqg

• Can you guess the key ?


• Key = 3
Shift Cipher Cryptanalysis
• Let us suppose
Plaintext – i am bond
Ciphertext - l dp erqg

• Can you guess the key ?


• Key = 3
• You just broke Julius Caesar’s cipher ☺
How did we Cryptanalyze ?
• Try “shift of 1” to check if a valid plaintext is produced
• Else, try shift of 2, 3 etc.
• Only 26 key choices to test and try, breaking is super easy !!
How did we Cryptanalyze ?
• Try “shift of 1” to check if a valid plaintext is produced
• Else, try shift of 2, 3 etc.
• Only 26 key choices to test and try, breaking is super easy !!
• What we did here was to exhaustively search the keyspace
• Attack is known as BRUTE FORCE ATTACK
How did we Cryptanalyze ?
• Try “shift of 1” to check if a valid plaintext is produced
• Else, try shift of 2, 3 etc.
• Only 26 key choices to test and try, breaking is super easy !!
• What we did here was to exhaustively search the keyspace
• Attack is known as BRUTE FORCE ATTACK

• BUT IS BRUTE FORCE ATTACK ALWAYS POSSIBLE ??


Substitution Cipher
• Algorithm
• Substitute each letter in the plaintext by another letter specified by the key
m A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
k G Q B T X U L C H S R W V Z D E Y O K A M N J I F P
Substitution Cipher
• Algorithm
• Substitute each letter in the plaintext by another letter specified by the key
m A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
C
k G Q B T X U L C H S R W V Z D E Y O K A M N J I F P

 Plaintext : elementary dear watson


Ciphertext : xwxvxzagof txgo jgakdz
Substitution Cipher
• Algorithm
• Substitute each letter in the plaintext by another letter specified by the key
m A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
k G Q B T X U L C H S R W V Z D E Y O K A M N J I F P

 Plaintext : elementary dear watson


Ciphertext : xwxvxzagof txgo jgakdz

• Here, one mapping is one key itself !!!


Substitution Cipher
• How many key choices possible ?
• 26 x 25 x 24 x 23 x ..... = 26!
Substitution Cipher
• How many key choices possible ?
• 26 x 25 x 24 x 23 x ..... = 26!
• 26! = 288 approx. 1026 computations
• Practically impossible to do BRUTE FORCE ATTACK !!!
Substitution Cipher
• How many key choices possible ?
• 26 x 25 x 24 x 23 x ..... = 26!
• 26! = 288 approx. 1026 computations
• Practically impossible to do BRUTE FORCE ATTACK !!!
• So what does it mean … substitution cipher is unbreakable ??
• Unfortunately NO …
Substitution Cipher
• Frequency Analysis Technique
• Cipher is a monoalphabetic cipher
• Each plaintext letter is always going
to be replaced by the same ciphertext
letter
Substitution Cipher
• Frequency Analysis Technique
• Cipher is a monoalphabetic cipher
• Each plaintext letter is always going
to be replaced by the same ciphertext
letter
• Frequency of letters in plaintext is
preserved in the ciphertext
Substitution Cipher
• Frequency Analysis Technique
• Cipher is a monoalphabetic cipher
• Each plaintext letter is always going
to be replaced by the same ciphertext
letter
• Frequency of letters in plaintext is
preserved in the ciphertext
Substitution Cipher
• Frequency Analysis Technique
• Cipher is a monoalphabetic cipher
• Each plaintext letter is always going
to be replaced by the same ciphertext
letter
• Frequency of letters in plaintext is
preserved in the ciphertext
• E.g., if E(plaintext) -> D (ciphertext), then
D will be the most frequently occurring
letter in the ciphertext
• Analyze these mappings to find potential
substitutions
Substitution Cipher
• Frequency Analysis Technique

Frequently occurring 2-letter words th, he, er, on, an, of, to, in, it, is, be, as, at,
so, we, he, by, or, do, if, me, my, up, an,
go, no, us, am
Frequently occurring 3-letter words the, and, for, are, but, not, you, all, any,
can, had, her, was, one, our, out, day, get,
has, him, his, how, man, new, now, old,
see, two, way, who, boy, did, its, let, put,
say, she, too, use

Frequently occurring 4-Letter Words that, with, have, this, will, your, from,
they, know, want, been, good, much,
some, time
Substitution Cipher
• Frequency Analysis Technique
• Correlate most frequently observed letter in ciphertext with most
frequent letter in english language , then second most frequent and
so on …
LIVITCSWPIYVEWHEVSRIQMXLEYVEOIEWHRXEXIPFE
MVEWHKVSTYLXZIXLIKIIXPIJVSZEYPERRGERIMWQL
MGLMXQERIWGPSRIHMXQEREKIETXMJTPRGEVEKEITR
EWHEXXLEXXMZITWAWSQWXSWEXTVEPMRXRSJGSTVRI
EYVIEXCVMUIMWERGMIWXMJMGCSMWXSJOMIQXLIVIQ
IVIXQSVSTWHKPEGARCSXRWIEVSWIIBXVIZMXFSJXL
IKEGAEWHEPSWYSWIWIEVXLISXLIVXLIRGEPIRQIVI
IBGIIHMWYPFLEVHEWHYPSRRFQMXLEPPXLIECCIEVE
WGISJKTVWMRLIHYSPHXLIQIMYLXSJXLIMWRIGXQER
OIVFVIZEVAEKPIEWHXEAMWYEPPXLMWYRMWXSGSWRM
HIVEXMSWMGSTPHLEVHPFKPEZINTCMXIVJSVLMRSCM
WMSWVIRCIGXMWYMX
Substitution Cipher
• Frequency Analysis Technique
• Correlate most frequently observed letter in ciphertext with most
frequent letter in english language , then second most frequent and
so on …
LIVITCSWPIYVEWHEVSRIQMXLEYVEOIEWHRXEXIPFE Frequency Analysis of Ciphertext:
MVEWHKVSTYLXZIXLIKIIXPIJVSZEYPERRGERIMWQL
MGLMXQERIWGPSRIHMXQEREKIETXMJTPRGEVEKEITR I – Most common letter
EWHEXXLEXXMZITWAWSQWXSWEXTVEPMRXRSJGSTVRI XL – Most common bigram
EYVIEXCVMUIMWERGMIWXMJMGCSMWXSJOMIQXLIVIQ
IVIXQSVSTWHKPEGARCSXRWIEVSWIIBXVIZMXFSJXL XLI – Most common trigram
IKEGAEWHEPSWYSWIWIEVXLISXLIVXLIRGEPIRQIVI E – Third most common letter
IBGIIHMWYPFLEVHEWHYPSRRFQMXLEPPXLIECCIEVE
WGISJKTVWMRLIHYSPHXLIQIMYLXSJXLIMWRIGXQER
OIVFVIZEVAEKPIEWHXEAMWYEPPXLMWYRMWXSGSWRM
HIVEXMSWMGSTPHLEVHPFKPEZINTCMXIVJSVLMRSCM
WMSWVIRCIGXMWYMX
Substitution Cipher
• Frequency Analysis Technique
• Correlate most frequently observed letter in ciphertext with most
frequent letter in english language , then second most frequent and
so on …
LIVITCSWPIYVEWHEVSRIQMXLEYVEOIEWHRXEXIPFE Frequency Analysis of Ciphertext:
MVEWHKVSTYLXZIXLIKIIXPIJVSZEYPERRGERIMWQL
MGLMXQERIWGPSRIHMXQEREKIETXMJTPRGEVEKEITR I – Most common letter
EWHEXXLEXXMZITWAWSQWXSWEXTVEPMRXRSJGSTVRI XL – Most common bigram
EYVIEXCVMUIMWERGMIWXMJMGCSMWXSJOMIQXLIVIQ
IVIXQSVSTWHKPEGARCSXRWIEVSWIIBXVIZMXFSJXL XLI – Most common trigram
IKEGAEWHEPSWYSWIWIEVXLISXLIVXLIRGEPIRQIVI E – Third most common letter
IBGIIHMWYPFLEVHEWHYPSRRFQMXLEPPXLIECCIEVE
WGISJKTVWMRLIHYSPHXLIQIMYLXSJXLIMWRIGXQER
OIVFVIZEVAEKPIEWHXEAMWYEPPXLMWYRMWXSGSWRM By Frequency Mapping:
HIVEXMSWMGSTPHLEVHPFKPEZINTCMXIVJSVLMRSCM I→E
WMSWVIRCIGXMWYMX
XL → TH
XLI → THE
E→A
Substitution Cipher
• Frequency Analysis Technique
• Correlate most frequently observed letter in ciphertext with most
frequent letter in english language , then second most frequent and
so on …
heVeTCSWPeYVaWHaVSReQMthaYVaOeaWHRtatePF
aMVaWHKVSTYhtZetheKeetPeJVSZaYPaRRGaReM
WQhMGhMtQaReWGPSReHMtQaRaKeaTtMJTPRGaVaK
aeTRaWHatthattMZeTWAWSQWtSWatTVaPMRtRSJ
GSTVReaYVeatCVMUeMWaRGMeWtMJMGCSMWtSJOMe
QtheVeQeVetQSVSTWHKPaGARCStRWeaVSWeeBtV
eZMtFSJtheKaGAaWHaPSWYSWeWeaVtheStheVthe
RGaPeRQeVeeBGeeHMWYPFhaVHaWHYPSRRFQMtha
PPtheaCCeaVaWGeSJKTVWMRheHYSPHtheQeMYhtS
JtheMWReGtQaROeVFVeZaVAaKPeaWHtaAMWYaPP
thMWYRMWtSGSWRMHeVatMSWMGSTPHhaVHPFKPaZe
NTCMteVJSVhMRSCMWMSWVeRCeGtMWYMt
Substitution Cipher
• Frequency Analysis Technique
• Correlate most frequently observed letter in ciphertext with most
frequent letter in english language , then second most frequent and
so on …
heVeTCSWPeYVaWHaVSReQMthaYVaOeaWHRtatePF Other Possibilities:
aMVaWHKVSTYhtZetheKeetPeJVSZaYPaRRGaReM heVe → here
WQhMGhMtQaReWGPSReHMtQaRaKeaTtMJTPRGaVaK
aeTRaWHatthattMZeTWAWSQWtSWatTVaPMRtRSJ Rtate → State
GSTVReaYVeatCVMUeMWaRGMeWtMJMGCSMWtSJOMe atthattMZe → at that time
QtheVeQeVetQSVSTWHKPaGARCStRWeaVSWeeBtV
eZMtFSJtheKaGAaWHaPSWYSWeWeaVtheStheVthe
RGaPeRQeVeeBGeeHMWYPFhaVHaWHYPSRRFQMtha By Frequency Mapping:
PPtheaCCeaVaWGeSJKTVWMRheHYSPHtheQeMYhtS
JtheMWReGtQaROeVFVeZaVAaKPeaWHtaAMWYaPP I→E V -> R
thMWYRMWtSGSWRMHeVatMSWMGSTPHhaVHPFKPaZe XL → TH R -> S
NTCMteVJSVhMRSCMWMSWVeRCeGtMWYMt
XLI → THE M -> I
E→A Z -> M
Substitution Cipher
• Frequency Analysis Technique
• Only 1 ciphertext is enough to get the key
• But the ciphertext should be long enough (atleast 30 characters) to make
statistical correlation
Monoalphabetic Ciphers
• Shift and Substitution ciphers are mono-alphabetic ciphers
• One-to-one mapping between plaintext and ciphertext
• Preserve language properties !!

• Can polyalphabetic cipher work better ?


• One letter will map to different letter at different instants
• Vigenere cipher
Vigenere Cipher
• Encrypt alphabetic text by using a series of interwoven shift
ciphers based on the letters of a keyword
• The keyword is repeated again and again so that the total length of
the secret key is equal to that of the plaintext
• Uses a 26×26 table with A to Z as the row and column headings
• Called as the Vigenere Table
Plaintext Letters

Shift by 0
Shift by 1
Shift by 2

Shift by 25
Shift by 25
Shift by 1
Shift by 2
Shift by 0
For Example,

Keyword - hope

Plaintext - elementary dear watson


Key - hopehopeho peho pehope
Plaintext Letters

Ciphertext - lztqlbieym …….


Shift by 25
Shift by 1
Shift by 2
Shift by 0
For Example,

Keyword - hope

Plaintext - elementary dear watson


Key - hopehopeho peho pehope
Plaintext Letters

Ciphertext - lztqlbieym …….

Keyword - tree

Plaintext – Information Technology

Ciphertext- ??
Shift by 25
Shift by 1
Shift by 2
Shift by 0
For Example,

Keyword - hope

Plaintext - elementary dear watson


Key - hopehopeho peho pehope
Plaintext Letters

Ciphertext - lztqlbieym …….

Keyword - tree

Plaintext – information technology

Ciphertext- bejskdexbfr xxtlrhcskr


Vigenere Cipher
• Same plaintext letter maps to different ciphertext letters
• Language structure is not preserved
Vigenere Cipher
• Same plaintext letter maps to different ciphertext letters
• Language structure is not preserved
• Is there still some loophole ??
Vigenere Cipher
• Same plaintext letter maps to different ciphertext letters
• Language structure is not preserved
• Is there still some loophole ??

• Weakness – Keyword is repeated


• E.g., if Keyword = key
• Key = keykeykeykeykey ….
Vigenere Cipher
• Same plaintext letter maps to different ciphertext letters
• Language structure is not preserved
• Is there still some loophole ??

• Weakness – Keyword is repeated


• E.g., if Keyword = key
• Key = keykeykeykeykey ….
• Every third letter is encrypted using the same shift
• Essentially we have, 3 interwoven shift ciphers, which can each
individually be broken by frequency analysis
Vigenere Cipher
• Same plaintext letter maps to different ciphertext letters
• Language structure is not preserved
• Is there still some loophole ??

• Weakness – Keyword is repeated


• E.g., if Keyword = key
• Key = keykeykeykeykey ….
• Every third letter is encrypted using the same shift
• Essentially we have, 3 interwoven shift ciphers, which can each individually be
broken by frequency analysis

• So aim is to find the length of the keyword first ..


Vigenere Cipher
• 2 tests
• Kasiski Test
• Index of coincidence
• Using these tests, the length of the keyword can be uniquely
determined
• Once keyword length is determined, apply frequency analysis to find
the secret keyword
Kasiski Test
• If two identical sequences of plaintext letters occur at a distance that
is an integer multiple of the keyword, they will generate identical
ciphertext sequences
• As same key letters will appear under the same plaintext letters then
Kasiski Test
• If two identical sequences of plaintext letters occur at a distance that
is an integer multiple of the keyword, they will generate identical
ciphertext sequences
• As same key letters will appear under the same plaintext letters then
• Example,

• "math" is encrypted in the same way to "WERR“


• Distance between first occurrence of “math” and second occurrence of “math” is 15
• Length of the keyword must be a factor of this distance
Kasiski Test

• As repeating sequences are 15 letters apart,


• Length of the key must be a factor of 15
• That is, keyword must be one of the lengths 15, 5, 3 or 1
• Definitely, cannot be 1 – easy to analyse otherwise
Kasiski Test
• If a repeated substring in a plaintext is encrypted by the same substring in the
keyword, then the ciphertext contains a repeated substring and the distance of the
two occurrences is a multiple of the keyword length
Kasiski Test
• If a repeated substring in a plaintext is encrypted by the same substring in the
keyword, then the ciphertext contains a repeated substring and the distance of the
two occurrences is a multiple of the keyword length
• Not every repeated string in the ciphertext arises in this way but the probability of a
repetition by chance is noticeably smaller
• Long repeated substrings in a ciphertext are not likely to be by chance
• But, short repeated substrings may appear more often and some of them may be
purely by chance
• Better to analyse repeated substrings of length 3 or more
Kasiski Test
• If a repeated substring in a plaintext is encrypted by the same substring in the
keyword, then the ciphertext contains a repeated substring and the distance of the
two occurrences is a multiple of the keyword length
• Not every repeated string in the ciphertext arises in this way but the probability of a
repetition by chance is noticeably smaller
• Long repeated substrings in a ciphertext are not likely to be by chance
• But, short repeated substrings may appear more often and some of them may be
purely by chance
• Better to analyse repeated substrings of length 3 or more
• E.g., Plaintext: …. THE…………… THE.…………. NIJ…………
Keyword: …. ION…………… ION………….. ION…………
Ciphertext: …. BVR…………...BVR…………..BVR…………
Kasiski Test
• Search the ciphertext for pairs of identical segments of atleast length
three
• Record the distance between the starting positions of each of the
two segments, say ∆1 , ∆2 , ∆3 𝑒𝑡𝑐.
• Find the GCD of all the ∆𝒊 and output it as keyword length m
• Because GCD will divide all the distances
Kasiski Test
CVJTNAFENMCDMKBXFSTKLHGSOJWHOFUISFYFBEXEINFIMAYSSDY
YIJNPWTOKFRHWVWTZFXHLUYUMSGVDURBWBIVXFAFMYFYXPIGBH
WIFHHOJBEXAUNFIYLJWDKNHGAOVBHHGVINAULZFOFUQCVFBYNF
TYGMMSVGXCFZFO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
MFPXXEFZQXYHGFLACEBJBXQSTWIKNMORNXCJFAIBWWBKCMUKIV
QTMNBCCTHLJYIGIMSYCFVMURMAYOBJUFVAUZINMATCYPBANKBXL
WJJNXUJTWIKBATCIOYBPPZHLZJJZHLLVEYAIFPLLYIJIZMOUDPLLT
HVEVUMBXPIBBMSNSCMCGONBHCKIVLXMGCRMXNZBKQHODESYTV
GOUGTHAGRHRMHFREYIJIZGAUNFZIYZWOUYWQZPZMAYJFJIKOVFK
BTNOPLFWHGUSYTLGNRHBZSOPMIYSLWIKBANYUOYAPWZXHVFUQAI
ATYYKYKPMCEYLIRNPCDMEIMFGWVBBMUPLHMLQJWUGSKQVUDZGS
YCFBSWVCHZXFEXXXAQROLYXPIUKYHMPNAYFOFHXBSWVCHZXFEX
XXAIRPXXGOVHHGGSVNHWSFJUKNZBESHOKIRFEXGUFVKOLVJNAYI
• Common factors to all – 2, 3 and 6
VVMMCGOFZACKEVUMBATVHKIDMVXBHLIVWTJAUFFACKHCIKSFPKY • GCD – 6
QNWOLUMYVXYYKYAOYYPUKXFLMBQOFLACKPWZXHUFJYGZGSTYW
ZGSNBBWZIVMNZXFIYWXWBKBAYJFTIFYKIZMUIVZDINLFFUVRGSSBU
• Hence, likely keyword length = 6
GNGOPQAILIFOZBZFYUWHGIRHWCFIZMWYSUYMAUDMIYVYAWVNAY
TFEYYCLPWBBMVZZHZUHMRWXCFUYYVIENFHPYSMKBTMOIZWAIXZ
FOLBSMCHHNOJKBMBATZXXJSSKNAULBJCLFWXDSUYKUCIOYJGFL
MBWHFIWIXSFGXCZBMYMBWTRGXXSHXYKZGSDSLYDGNBXHAUJBTF
DQCYTMWNPWHOFUISMIFFVXFSVFRNA

Source: http://crypto.interactive-maths.com/kasiski-analysis-breaking-the-code.html
Index of Coincidence
• Appearance of repeated segments could be by chance
• To confirm the keyword size obtained by kasiski, we calculate index of
coincidence
• Is a statistical measure which helps distinguish text encrypted with a vigenere
cipher from a random text
Index of Coincidence
• A statistical measure which helps distinguish text encrypted with a vigenere
cipher from a random text
• Coincidence: Given an English text
• If we pick 2-letters from the text at random
• Both different (most of the time)
• Both same (in some cases)
Index of Coincidence
• A statistical measure which helps distinguish text encrypted with a vigenere
cipher from a random text
• Coincidence: Given an English text
• If we pick 2-letters from the text at random
• Both different (most of the time)
• Both same (in some cases)

• English language: 6.8% of the randomly chosen letters are identical


• When occurrence of all letters is equally likely, it’s 3.8%
Here this represents the probability
The probability with n-1 will also getting a letter in english, like a is
almost same as n, as n is large for quite probable hence has probability
english, thus we take n-1 as n of 8.2%, thus probability of getting
and simplify the calculation 2 A's would 8.2% squared, similarly
for other alphabets, thus quite
non uniform
Here probability of getting
2 random alphabets like
in vigenere is 1/26
Here we are checking the ioc of cipher text, if its closer to 0.038 its poly, else mono closer to 0.065
When we have checked that the text is polyalphabetic, we calculate its
number of letters, we do so by dividing the whole cipher text into groups, in
group 2 we will have 2 groups with 1 letter gap in each letter of the group, in
group 3 we will have 3 groups, with 3 letter gap similarly for other groups,
notice g1 starts with z and group starts with v, thus no letter is skipped
when i.c gets close to mono and then dips again, then that
group would be the exact size of key
The idea behind this is, if ioc get's close 0.65 then we have reached mono-
alphabetic, meaning something like shift cipher which can easily be broken by

Index of Coincidence frequency analysis, since it mimics the english language, but your vigenere
cipher text is completely random and has random % of alphabets in it, and it is
just a series of interwoven shift ciphers which can easily be broken by
frequency analysis

• The probability that two randomly selected letters from a given string of letters
will be identical
• E.g., What is the probability that two randomly drawn letters from the string X are A ?
• When the string X is Vigenere encryption of a proper English text ?
• When the string X is just a random string of English alphabets ?

X=
LACEBJBXQSTWIKNMORNXCJFAIBWWBKCMUKIVQTMNBCCTHLJYIGIMSYCFVMURMA
YOBJUFVAUZINMATCYPBANKBXLWJJNXUJTWIKBATCIOYBPPZHLZJJZHLLVEYAIFPL
LYIJIZMOUDPLL …..
Index of Coincidence of a Proper English Plaintext
• Suppose we have a long string X (length n) of English language
• The number of occurrence of each letter corresponds to the average frequency of
that letter in the English language, i.e., 8 A’s, 3 C’s, 13 E’s etc.
• Let the frequency of each letter A, B, C … Z in the given string be 𝑓0 , 𝑓1 , 𝑓2 … 𝑓25
Index of Coincidence of a Proper English Plaintext
• Suppose we have a long string X (length n) of English language
• The number of occurrence of each letter corresponds to the average frequency of that
letter in the English language, i.e., 8 A’s, 3 C’s, 13 E’s etc.
• Let the frequency of each letter A, B, C … Z in the given string be 𝑓0 , 𝑓1 , 𝑓2 … 𝑓25
n
• We can choose any two elements of string X in C2 ways
Index of Coincidence of a Proper English Plaintext
• Suppose we have a long string X (length n) of English language
• The number of occurrence of each letter corresponds to the average frequency of
that letter in the English language, i.e., 8 A’s, 3 C’s, 13 E’s etc.
• Let the frequency of each letter A, B, C … Z in the given string be 𝑓0 , 𝑓1 , 𝑓2 … 𝑓25
n
• We can choose any two elements of string X in C2 ways
f
• Number of ways of choosing two A’s from string X is: 0 C2
• Similarly, for each letter 𝑖 𝑤ℎ𝑒𝑟𝑒, 0 ≤ 𝑖 ≤ 25, no. of ways of choosing both elements
fi
to be i is: C2
Index of Coincidence of a Proper English Plaintext
• Suppose we have a long string X (length n) of English language
• The number of occurrence of each letter corresponds to the average frequency of that
letter in the English language, i.e., 8 A’s, 3 C’s, 13 E’s etc.
• Let the frequency of each letter A, B, C … Z in the given string be 𝑓0 , 𝑓1 , 𝑓2 … 𝑓25
n
• We can choose any two elements of string X in C2 ways
f
• Number of ways of choosing two A’s from string X is: 0 C2
• Similarly, for each letter 𝑖 𝑤ℎ𝑒𝑟𝑒, 0 ≤ 𝑖 ≤ 25, no. of ways of choosing both elements to
fi
be i is: C2

σ25 fi C σ25 2
𝑖=0 𝑓𝑖 (𝑓𝑖 −1) 25 𝑓𝑖
• Thus, IC (X) = 𝑖=0
𝑛
2
= ≈ σ𝑖=0 = σ25
𝑖=0 𝑝𝑖
2
C2 𝑛(𝑛−1) 𝑛
• Here, 𝑝𝑖 denotes the probability of occurence of each letter in English language
Index of Coincidence of a Proper English Plaintext

• Table – 1.1 presents – prob. of


occurrence of the 26 letters in a
normal English plaintext string
• In a Vigenere encrypted
ciphertext string also, the same
probabilities will occur
• As it is a combination of
interwoven shift ciphers
• Only the first column of the table
will be permuted.

Ref: D.R. Stinson, Cryptography: Theory and Practice, Third Edition, CRC Press, 2006.
Index of Coincidence of English Letters

𝐼𝑐 (𝑥) ≈

Ref: D.R. Stinson, Cryptography: Theory and Practice, Third Edition, CRC Press, 2006.
Index of Coincidence of a Random String
• Suppose we have a long string Y (length n)
• The elements of Y do not follow English letters frequency distribution
• Infact, each letter has equal probability of occurrence
• The chance of pulling out an A is 1/26
Index of Coincidence of a Random String
• Suppose we have a long string Y (length n) of random English letters
• The elements of Y do not follow English letters frequency distribution
• Infact, each letter has equal probability of occurrence
• The chance of pulling out an A is 1/26
• The probability of pulling out two As simultaneously is (1/26)*(1/26)
• The chance of drawing any pair of identical letters is: 26*(1/26)*(1/26) = (1/26) = 0.0385
Index of Coincidence of a Random String
• Suppose we have a long string Y (length n) of random English letters
• The elements of Y do not follow English letters frequency distribution
• Infact, each letter has equal probability of occurrence
• The chance of pulling out an A is 1/26
• The probability of pulling out two As simultaneously is (1/26)*(1/26)
• The chance of drawing any pair of identical letters is: 26*(1/26)*(1/26) = (1/26) = 0.0385

• So the IC of an evenly distributed set of letters is 0.0385


Index of coincidence
• Let ciphertext string 𝑦 = 𝑦1 , 𝑦2 , 𝑦3 , … . ., 𝑦𝑛
• E.g., 𝑦 = xwxvxzagof txgo jgakdz
• Let us suppose, through Kasiski test , we obtained length of keyword m = 3
• Define m substrings of y as follows:
𝑦1 = xvafggd = 𝑦1 𝑦 𝑚+1 𝑦 2𝑚+1 … .
𝑦2 = wxgtoaz = 𝑦2 𝑦 𝑚+2 𝑦 2𝑚+2 … .
𝑦3 = xzoxjk = 𝑦3 𝑦 𝑚+3 𝑦 2𝑚+3 … .





Index of coincidence
• If m is the right option, then
𝐼𝐶 𝑦 ≈ 0.065
since, each 𝑦𝑖 is just a shifted version of the proper English plaintext
substrings
• If not, value of m obtained is not right
• For a totally random ciphertext string
1 2
𝐼𝐶 𝑦 = 26 = 0.038
26
EXAMPLE
CVJTNAFENMCDMKBXFSTKLHGSOJWHOFUISFYFBEXEINFIMAYSSDYYI
cvjtna fiyljw uycluk tvuzua
JNPWTOKFRHWVWTZFXHLUYUMSGVDURBWBIVXFAFMYFYXPIGBHWIF fenmcd dknhga tvgufq ojnvuw
HHOJBEXAUNFIYLJWDKNHGAOVBHHGVINAULZFOFUQCVFBYNFTYGM
MSVGXCFZFOKQATUIFUFERQTEWZFOKMWOJYLNZBKSHOEBPNAYTFK
mkbxfs ovbhhg beswys trlmba
NXLBVUAXCXUYYKYTFRHRCFUYCLUKTVGUFQBESWYSSWLBYFEFZVU tklhgs vinaul swlbyf tzmfss
WTRLLNGIZGBMSZKBTNTSLNNMDPMYMIUBVMTLOBJHHFWTJNAUFIZ
MBZLIVHMBSUWLBYFEUYFUFENBRVJVKOLLGTVUZUAOJNVUWTRLMB
ojwhof zfofuq efzvuw ojqxlf
ATZMFSSOJQXLFPKNAULJCIOYVDRYLUJMVMLVMUKBTNAMFPXXJPD uisfyf cvfbyn trllng pknaul
YFIJFYUWSGVIUMBWSTUXMSSNYKYDJMCGASOUXBYSMCMEUNFJNAU
FUYUMWSFJUKQWSVXXUVUFFBPWBCFYLWFDYGUKDRYLUJMFPXXEFZ
bexein ftygmm izgbms jcioyv
QXYHGFLACEBJBXQSTWIKNMORNXCJFAIBWWBKCMUKIVQTMNBCCT fimays svgxcf zkbtnt dryluj
HLJYIGIMSYCFVMURMAYOBJUFVAUZINMATCYPBANKBXLWJJNXUJT
WIKBATCIOYBPPZHLZJJZHLLVEYAIFPLLYIJIZMOUDPLLTHVEVUMBXP
sdyyij zfokqa slnnmd mvmlv
IBBMSNSCMCGONBHCKIVLXMGCRMXNZBKQHODESYTVGOUGTHAGRH npwtok tuifuf pmymiu m
RMHFREYIJIZGAUNFZIYZWOUYWQZPZMAYJFJIKOVFKBTNOPLFWHGU
SYTLGNRHBZSOPMIYSLWIKBANYUOYAPWZXHVFUQAIATYYKYKPMCE
frhwvw erqtew bvmtlo ukbtna
YLIRNPCDMEIMFGWVBBMUPLHMLQJWUGSKQVUDZGSYCFBSWVCHZX tzfxhl zfokmw bjhhfw mfpxxj
FEXXXAQROLYXPIUKYHMPNAYFOFHXBSWVCHZXFEXXXAIRPXXGOVH
HGGSVNHWSFJUKNZBESHOKIRFEXGUFVKOLVJNAYIVVMMCGOFZACKE
uyumsg ojylnz tjnauf pdyfij
VUMBATVHKIDMVXBHLIVWTJAUFFACKHCIKSFPKYQNWOLUMYVXYYK vdurbw bkshoe izmbzl fyuwsg
YAOYYPUKXFLMBQOFLACKPWZXHUFJYGZGSTYWZGSNBBWZIVMNZX
FIYWXWBKBAYJFTIFYKIZMUIVZDINLFFUVRGSSBUGNGOPQAILIFOZBZF
bivxfa bpnayt ivhmbs viumbw
YUWHGIRHWCFIZMWYSUYMAUDMIYVYAWVNAYTFEYYCLPWBBMVZZH fmyfyx fknxlb uwlbyf stuxms
ZUHMRWXCFUYYVIENFHPYSMKBTMOIZWAIXZFOLBSMCHHNOJKBMB
ATZXXJSSKNAULBJCLFWXDSUYKUCIOYJGFLMBWHFIWIXSFGXCZBMY
pigbhw vuaxcx euyfuf snykyd
MBWTRGXXSHXYKZGSDSLYDGNBXHAUJBTFDQCYTMWNPWHOFUISMI ifhhoj uyykyt enbrvj jmcgas
FFVXFSVFRNA
bexaun frhrcf vkollg ouxbys
mcmeu
EXAMPLE
• cfmtoubfsnftuvbfpibfdovzcfsztezobbfvufutbsetizspbbtiiueevtottopjdmumpfvssjomfufsubfdmfgbtof
bibjsubutnjttpjvpipepnoicbeogfifopffpunolnpftpimwpjqswfqpmowfiosfbiuvvoetmiuhpoxoxopfssifb
fizfsoifiiumwfpzmunmizmjtsbxughsbthsguqnuff
• vekkjieidprzydimifeikvifvtvfurfjkpkuyryvewfrzklmvjjzvwunkvjrzjkcrvkfdyitnmucjyjvfcdrfzfjwrakvcyy
rjzckjwcpjelzlvisnvrksurrzzuzjklsrpwywuymrevlwvyveripfvervvjerfjvfvvvvfcklyyffwjtnviktzdubpfyrzy
ivewzryfkzfckzkjdcfffmrxdnjcpivr
• jnblwsxmywhfuuvyghxynbnofygoiqoysnnayhcgslzlgbnymhnmhlybounlmqniymbpyuuuycxmnuuxffy
ypqlbinicqcicmuiybniizzylmlubcblmqyghegiymibfyhmiuzqycnibhuuccxounhcxphnusfvnmzuhxwfiyu
yyllzyybmybimivuqouhmmynybhwyhbwohbxncsiligygysbbywsxn
• tmxhhfeaytwxmrxfbhalhhafbgxkftklhaxxkrluwbvlbtnmthabmbfrlzvmfxaolltxfwmxkgbeamkxbyglxxa
xkxbmttgfafnpxxkohhayotmbmhxxhttryaywaktwtbikoxakepmbmgdfhxlkaxhxxhhkhekamamkbtakq
mkpmaxgwbnwafunrgazwwwavaybzxvptalhmxaluomwxmxklxtthmfa
• ncfgoyiyiovhsbfyhoujghuuymcquemnoylcycufyyunmnmilfuzbyuvluubsluyuvnxisbmyayuuwqupluux
ycqncwumhivyvmblubylliiuhbmccmnovhmiuzqyonhlzybyhiyycfmlszbzxyyybzxxgwnoxoyccbihjcsnyy
ubchzzwzxyyilgnibhcyuyycmuciymibnbjufyybicbxzyhfmois
• adssffnsjkwlgwaxwjnwaglqnmfafwwzetbxtfkqsfwgstduowflsffjgawasflvjmajjgwsdssnfswvwwkjehes
mjwknlmmoaaawjabzlfjdvxsgkgzdgahjnwzjvoggssaavakldguqkgsxaxhfsxaggszkgligkadlakfwvakqkug
gzxwjkvfsglzgfsdatlvhfesoxsoaslwkjwxzwsgdadwffv
EXAMPLE
• cfmtoubfsnftuvbfpibfdovzcfsztezobbfvufutbsetizspbbtiiueevtottopjdm
umpfvssjomfufsubfdmfgbtofbibjsubutnjttpjvpipepnoicbeogfifopffpun
olnpftpimwpjqswfqpmowfiosfbiuvvoetmiuhpoxoxopfssifbfizfsoifiium
wfpzmunmizmjtsbxughsbthsguqnuff
• IC(Str1) = .065
• vekkjieidprzydimifeikvifvtvfurfjkpkuyryvewfrzklmvjjzvwunkvjrzjkcrvkfdyitn
mucjyjvfcdrfzfjwrakvcyyrjzckjwcpjelzlvisnvrksurrzzuzjklsrpwywuymrevlwvy
veripfvervvjerfjvfvvvvfcklyyffwjtnviktzdubpfyrzyivewzryfkzfckzkjdcfffmrxdnj
cpivr
• IC(Str2) = .063
EXAMPLE
• IC(str 3) : 0.065
• IC(str 4) : 0.068
• IC(str 5) : 0.068
• IC(str 6) : 0.065
EXAMPLE
• IC(str 3) : 0.065
• IC(str 4) : 0.068
• IC(str 5) : 0.068
• IC(str 6) : 0.065

• As all the substrings have IC values close to 0.065, this shows our
keyword length guess = 6 is correct
• Frequency analysis of each of the 6 substrings lead us to the keyword
EXAMPLE
• IC(str 3) : 0.065
• IC(str 4) : 0.068
• IC(str 5) : 0.068
• IC(str 6) : 0.065

• As all the substrings have IC values close to 0.065, this shows our keyword
length guess = 6 is correct
• Frequency analysis of each of the 6 substrings lead us to the keyword –
“BRUTUS”
MAPPING UNDER THE KEYWORD – “BRUTUS”
CVJTNAFENMCDMKBXFSTKLHGSOJWHOFUISFYFBEXEINFIMAYSSDYY Be patient till the last. Romans, countrymen, and lovers! hear me for my cause,
IJNPWTOKFRHWVWTZFXHLUYUMSGVDURBWBIVXFAFMYFYXPIGBHWI and be silent, that you may hear: believe me for mine honour, and have respect
FHHOJBEXAUNFIYLJWDKNHGAOVBHHGVINAULZFOFUQCVFBYNFTYG to mine honour, that you may believe: censure me in your wisdom, and awake
MMSVGXCFZFOKQATUIFUFERQTEWZFOKMWOJYLNZBKSHOEBPNAYT your senses, that you may the better judge. If there be any in this assembly, any
FKNXLBVUAXCXUYYKYTFRHRCFUYCLUKTVGUFQBESWYSSWLBYFEFZV dear friend of Caesar's, to him I say, that Brutus' love to Caesar was no less
UWTRLLNGIZGBMSZKBTNTSLNNMDPMYMIUBVMTLOBJHHFWTJNAUF than his. If then that friend demand why Brutus rose against Caesar, this is my
IZMBZLIVHMBSUWLBYFEUYFUFENBRVJVKOLLGTVUZUAOJNVUWTRLM answer: —Not that I loved Caesar less, but that I loved Rome more. Had you
BATZMFSSOJQXLFPKNAULJCIOYVDRYLUJMVMLVMUKBTNAMFPXXJP rather Caesar were living and die all slaves, than that Caesar were dead, to live
DYFIJFYUWSGVIUMBWSTUXMSSNYKYDJMCGASOUXBYSMCMEUNFJN all free men? As Caesar loved me, I weep for him; as he was fortunate, I rejoice
AUFUYUMWSFJUKQWSVXXUVUFFBPWBCFYLWFDYGUKDRYLUJMFPXX at it; as he was valiant, I honour him: but, as he was ambitious, I slew him.
EFZQXYHGFLACEBJBXQSTWIKNMORNXCJFAIBWWBKCMUKIVQTMNB There is tears for his love; joy for his fortune; honour for his valour; and death
CCTHLJYIGIMSYCFVMURMAYOBJUFVAUZINMATCYPBANKBXLWJJNX for his ambition. Who is here so base that would be a bondman? If any, speak;
UJTWIKBATCIOYBPPZHLZJJZHLLVEYAIFPLLYIJIZMOUDPLLTHVEVUM for him have I offended. Who is here so rude that would not be a Roman? If
BXPIBBMSNSCMCGONBHCKIVLXMGCRMXNZBKQHODESYTVGOUGTHA any, speak; for him have I offended. Who is here so vile that will not love his
GRHRMHFREYIJIZGAUNFZIYZWOUYWQZPZMAYJFJIKOVFKBTNOPLF country? If any, speak; for him have I offended. I pause for a reply. Then none
WHGUSYTLGNRHBZSOPMIYSLWIKBANYUOYAPWZXHVFUQAIATYYKYK have I offended. I have done no more to Caesar than you shall do to Brutus.
PMCEYLIRNPCDMEIMFGWVBBMUPLHMLQJWUGSKQVUDZGSYCFBSWV The question of his death is enrolled in the Capitol; his glory not extenuated,
CHZXFEXXXAQROLYXPIUKYHMPNAYFOFHXBSWVCHZXFEXXXAIRPXX wherein he was worthy, nor his offences enforced, for which he suffered death.
GOVHHGGSVNHWSFJUKNZBESHOKIRFEXGUFVKOLVJNAYIVVMMCGOF Here comes his body, mourned by Mark Antony: who, though he had no hand in
ZACKEVUMBATVHKIDMVXBHLIVWTJAUFFACKHCIKSFPKYQNWOLUMY his death, shall receive the benefit of his dying, a place in the commonwealth;
VXYYKYAOYYPUKXFLMBQOFLACKPWZXHUFJYGZGSTYWZGSNBBWZI as which of you shall not? With this I depart,—that, as I slew my best lover for
VMNZXFIYWXWBKBAYJFTIFYKIZMUIVZDINLFFUVRGSSBUGNGOPQAILI the good of Rome, I have the same dagger for myself, when it shall please my
FOZBZFYUWHGIRHWCFIZMWYSUYMAUDMIYVYAWVNAYTFEYYCLPWB country to need my death.
BMVZZHZUHMRWXCFUYYVIENFHPYSMKBTMOIZWAIXZFOLBSMCHHN
OJKBMBATZXXJSSKNAULBJCLFWXDSUYKUCIOYJGFLMBWHFIWIXSFG
XCZBMYMBWTRGXXSHXYKZGSDSLYDGNBXHAUJBTFDQCYTMWNPW
HOFUISMIFFVXFSVFRNA
Takeaway ….
• Large key size is a necessary condition but not a sufficient condition to
provide security.
• As long as statistical relationship between plaintext and ciphertext or
plaintext and key remains, cipher is not secure.
Conclusions

• All secure cipher needs sufficient key-space


• Complexity of design does not mean security
• Designing secure ciphers is hard
• Classical ciphers are broken
Modern Cryptography

Symmetric Cipher

Block Cipher Stream Cipher

You might also like