0% found this document useful (0 votes)
36 views31 pages

Lecture 2a

## Information Security Slide 2: The Threatscape **Title:** The Ever-Present Threat **Content:** * This slide should focus on the ever-evolving landscape of information security threats. * You can use a powerful image on one side of the slide to visually represent a cyber threat, such as a hacker or a malware icon. * On the other side, list the different categories of threats to information security. Here are some examples: * **Cyberattacks:** Include subcategories like malware, phishi

Uploaded by

Fatima syeda
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
36 views31 pages

Lecture 2a

## Information Security Slide 2: The Threatscape **Title:** The Ever-Present Threat **Content:** * This slide should focus on the ever-evolving landscape of information security threats. * You can use a powerful image on one side of the slide to visually represent a cyber threat, such as a hacker or a malware icon. * On the other side, list the different categories of threats to information security. Here are some examples: * **Cyberattacks:** Include subcategories like malware, phishi

Uploaded by

Fatima syeda
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 31

Lecture 2

Introduction to Cryptography
And Monoalphabetic Ciphers

1
2
.. Prehistory
• Cryptography was used..
– For military purposes
• In ancient time
– For private business
• Religious affairs, secret trades, illegal activities
– To protect privacy of individuals
• Caesar
Kerckhoff’s Principle
• Given by Auguste Kerckhoffs in 19th Century
for military ciphers.
• “a crptosystem should be secure even if
everything about the system, except the key, is
public knowledge”
• Security should rely on the secrecy of the key
only and not on the security of the algorithm.
Secrecy Vs Privacy
• Confidentiality (secrecy)
– Insurance that a given information cannot be
accessed by unauthorized parties.

• Privacy ≠ secrecy
– Ability for a person to control how his personal
information spreads in a community
Classical
Cryptosystems
(Monoalphabetic)
Cryptosystem
A cryptosystem is a five-tuple (P, C, K, E, D), where following
conditions are satisfied :
1. P is a finite set of possible plaintexts
2. C is a finite set of possible ciphertexts
3. K, the keyspace, is a finite set of possible keys
4. For each K  K, there is an encryption algorithm EK  E and
a corresponding decryption algorithm DK  D. Each EK : P 
C and DK : C  P are functions such that DK(EK(X)) = X for
every plaintext X  P.
Simple Cryptosystems
Monoalphabetic Ciphers

• The ciphers for which, once a key is chosen, each


alphabetic character is mapped to a unique alphabetic
character

• Examples of monoalphabetic ciphers include Shift cipher,


Substitution Cipher and Affine cipher
1. Shift Cipher

Let plaintext (p) = wewillmeetatmidnight


We first convert the plaintext string into integers. The rule is:
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
w e w i l l m e e t a t m i d n i g h t

22 4 22 8 11 11 12 4 4 19 0 19 12 8 3 13 8 6 7 19
Let K=11, we add 11 to each value, reducing each sum modulo 26, we get ciphertext
7 15 7 19 22 22 23 15 15 4 11 4 23 19 14 24 19 17 18 4
H P T T W W X P P E L E X T O Y T R S E
1. Shift Cipher
For a particular Key k=3, the cryptosystem is often called the
Caesar Cipher (Roman Empire, 2000 years ago )

0123456...
Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC
3456789...

Plain: meet me after the toga party


Cipher: PHHW PH DIWHU WKH WRJD SDUWB
Cryptanalysis of Shift Cipher
• Shift cipher (modulo 26) is not
secure, since it can be
cryptanalyzed by brute force
attack
• There are only 25 keys to try, until
a meaningful plaintext string is
obtained
• On average, a plaintext will be
computed using 26/2=13
decryption rules

- Plain: meet me after the toga


party
– Cipher: PHHW PH DIWHU
WKH WRJD SDUWB
2. The Substitution Cipher

Example:

Plaintex: s u b s t i t u t i o n
Ciphertext:V U N V M Z M U M Z F S
2. Cryptanalysis of The
Substitution Cipher

• A key in substitution cipher consist of a permutation of 26 alphabetic


characters
• There are 26! = ~4 x 1026 possible keys
• Exhaustive key search is infeasible
• Simple substitution ciphers were considered strong for many centuries
• The first ever published description of how to crack simple substitution
ciphers was given by Arab/Iraqi scientist Abu Yusuf Yaqub ibn Ishaq al-
Kindi in A Manuscript on Deciphering Cryptographic Messages written
around 850 CE
• The method he described is now known as Frequency Analysis
2. Frequency Analysis
• The statistical distribution of letter frequencies of a message
(text) written in any language tend towards a known letter
frequency distribution profile of the language

• This is particularly true for long messages (i.e., the longer the
text, the closer the letter frequency distributions match the
language’s letter frequency distributions)

• The simple substitution cipher preserves the letter frequency


distributions of the plaintext in the ciphertext (i.e., information
about the plaintext is leaked in the ciphertext)

• The attacker takes a frequency count of the ciphertext letters


and tries to match them to the letter frequency distribution
profile of the plaintext language
English language:
Relative letter frequencies

Letter A B C D E F G H I J K L M
Frequency 7.4 1.0 3.1 4.2 13.0 2.8 1.6 3.4 7.4 0.2 0.3 3.6 2.5
Letter N O P Q R S T U V W X Y Z
Frequency 7.9 8.0 2.7 0.3 8.0 6.1 9.2 2.6 1.5 1.6 0.5 1.9 0.1
English language:
Relative letter frequencies
• Ciphertext:
R jrk hbxiu lk vai vzihova ohlls lo rk rmrsvjikv
ywbhtbkn. Ixise jlskbkn ai vrgiu vai ihixrvls tlzk
vl vai hlyye rkt hirxiu vai ywbhtbkn. Bk vai
ixikbkn, ai nivu bkvl vai ihixrvls, rkt, bo vaisi
bu uljilki ihui bk vai ihixrvls -- ls bo bv zru
srbkbkn varv tre -- ai nliu yrpg vl abu ohlls
tbsipvhe. Alzixis, bo vaisi bu klylte ihui bk vai
ihixrvls rkt bv aruk'v srbkit, ai nliu vl vai vikva
ohlls rkt zrhgu wm vzl ohbnavu lo uvrbsu vl abu
sllj.
• Letter frequency count (total = 344 letters):

Letter A B C D E F G H I J K L M

Frequency 23 26 0 0 5 0 3 18 49 5 26 32 2

Letter N O P Q R S T U V W X Y Z

Frequency 9 10 2 0 24 19 11 19 37 3 9 6 6
Relative frequency distributions
(English & ciphertext)
Example: Frequency analysis
• From the frequency distributions, we assume that:
– The ciphertext letter I corresponds to the plaintext letter E (the most
frequent letter in the English language)
– The ciphertext letter V corresponds to the plaintext letter T (the second
most frequent letter in the English language)

• Partially decrypted ciphertext (red = plaintext):


R jrk hbxeu lk vae vzehova ohlls lo rk
rmrsvjekv ywbhtbkn. Exese jlskbkn ae vrgeu vae
ehexrvls tlzk vl vae hlyye rkt herxeu vae
ywbhtbkn. Bk vae exekbkn, ae nevu bkvl vae
ehexrvls, rkt, bo vaese bu uljelke ehue bk vae
ehexrvls -- ls bo bv zru srbkbkn varv tre -- ae
nleu yrpg vl abu ohlls tbsepvhe. Alzexes, bo
vaese bu klylte ehue bk vae ehexrvls rkt bv
aruk'v srbket, ae nleu vl vae vekva ohlls rkt
zrhgu wm vzl ohbnavu lo uvrbsu vl abu sllj.
Example: Frequency analysis
• From the frequency distributions, we assume that:
– The ciphertext letter I corresponds to the plaintext letter E (the most
frequent letter in the English language)
– The ciphertext letter V corresponds to the plaintext letter T (the second
most frequent letter in the English language)

• Partially decrypted ciphertext (red = plaintext):


R jrk hbxeu lk tae tzehota ohlls lo rk
rmrstjekt ywbhtbkn. Exese jlskbkn ae trgeu tae
ehexrtls tlzk tl tae hlyye rkt herxeu tae
ywbhtbkn. Bk tae exekbkn, ae netu bktl tae
ehexrtls, rkt, bo taese bu uljelke ehue bk tae
ehexrtls -- ls bo bt zru srbkbkn tart tre -- ae
nleu yrpg tl abu ohlls tbsepthe. Alzexes, bo
taese bu klylte ehue bk tae ehexrtls rkt bt
aruk't srbket, ae nleu tl tae tekta ohlls rkt
zrhgu wm tzl ohbnatu lo utrbsu tl abu sllj.
Example: Frequency analysis
• From the frequency distributions, we assume that:
• We can assume that the ciphertext letter A corresponds to the
plaintext letter H because:
– The digram ‘TH’ is the most common in the English language
– The word “THE” is the only frequently used 3-letter English word
starting with T and ending with E

• Partially decrypted ciphertext (red = plaintext):


R jrk hbxeu lk the tzehoth ohlls lo rk
rmrstjekt ywbhtbkn. Exese jlskbkn he trgeu the
ehexrtls tlzk tl the hlyye rkt herxeu the
ywbhtbkn. Bk the exekbkn, he netu bktl the
ehexrtls, rkt, bo these bu uljelke ehue bk the
ehexrtls -- ls bo bt zru srbkbkn thrt tre -- he
nleu yrpg tl hbu ohlls tbsepthe. hlzexes, bo
these bu klylte ehue bk the ehexrtls rkt bt
hruk't srbket, he nleu tl the tekth ohlls rkt
zrhgu wm tzl ohbnhtu lo utrbsu tl hbu sllj.
Example: Frequency analysis
• We can assume that the ciphertext letter R corresponds to the
plaintext letter A because:
– The word “THAT” is the only frequently used 4-letter English word
starting with ‘TH’ and ending with T
– The relative frequency of R in the ciphertext closely approximates
the relative frequency of A in English
• Partially decrypted ciphertext (red = plaintext):
A jak hbxeu lk the tzehoth ohlls lo ak
amastjekt ywbhtbkn. Exese jlskbkn he tageu the
ehexatls tlzk tl the hlyye akt heaxeu the
ywbhtbkn. Bk the exekbkn, he netu bktl the
ehexatls, akt, bo these bu uljelke ehue bk the
ehexatls -- ls bo bt zau sabkbkn that tae -- he
nleu yapg tl hbu ohlls tbsepthe. hlzexes, bo
these bu klylte ehue bk the ehexatls akt bt
hauk't sabket, he nleu tl the tekth ohlls akt
zahgu wm tzl ohbnhtu lo utabsu tl hbu sllj.
Example: Frequency analysis
• We can assume that the ciphertext letter K corresponds to the
plaintext letter N because:
– The words “AN” and “AT” are the only frequently used 2-letter
English words starting with A
– The relative frequency of K in the ciphertext closely approximates
the relative frequency of N in English
• Partially decrypted ciphertext (red = plaintext):
A jan hbxeu ln the tzehoth ohlls lo an
amastjent ywbhtbnn. Exese jlsnbnn he tageu the
ehexatls tlzn tl the hlyye ant heaxeu the
ywbhtbnn. Bn the exenbnn, he netu bntl the
ehexatls, ant, bo these bu uljelne ehue bn the
ehexatls -- ls bo bt zau sabnbnn that tae -- he
nleu yapg tl hbu ohlls tbsepthe. hlzexes, bo
these bu nlylte ehue bn the ehexatls ant bt
haun't sabnet, he nleu tl the tenth ohlls ant
zahgu wm tzl ohbnhtu lo utabsu tl hbu sllj.
Example: Frequency analysis
• We assume that:
– The ciphertext letter T corresponds to the plaintext letter D (from
the word ‘ant’)
– The ciphertext letter B corresponds to the plaintext letter I (from
the words ‘bt’ and ‘bn’)
• Partially decrypted ciphertext (red = plaintext):
A jan hbxeu ln the tzehoth ohlls lo an
amastjent ywbhtbnn. Exese jlsnbnn he tageu the
ehexatls tlzn tl the hlyye ant heaxeu the
ywbhtbnn. Bn the exenbnn, he netu bntl the
ehexatls, ant, bo these bu uljelne ehue bn the
ehexatls -- ls bo bt zau sabnbnn that tae -- he
nleu yapg tl hbu ohlls tbsepthe. hlzexes, bo
these bu nlylte ehue bn the ehexatls ant bt
haun't sabnet, he nleu tl the tenth ohlls ant
zahgu wm tzl ohbnhtu lo utabsu tl hbu sllj.
Example: Frequency analysis
• We assume that:
– The ciphertext letter T corresponds to the plaintext letter D (from
the word ‘ant’)
– The ciphertext letter B corresponds to the plaintext letter I (from
the words ‘bt’ and ‘bn’)
• Partially decrypted ciphertext (red = plaintext):
A jan hixeu ln the tzehoth ohlls lo an
amastjent ywihtinn. Exese jlsninn he tageu the
ehexatls tlzn tl the hlyye ant heaxeu the
ywihtinn. in the exeninn, he netu intl the
ehexatls, ant, io these iu uljelne ehue in the
ehexatls -- ls io it zau saininn that tae -- he
nleu yapg tl hiu ohlls tisepthe. hlzexes, io
these iu nlylte ehue in the ehexatls ant it
haun't sainet, he nleu tl the tenth ohlls ant
zahgu wm tzl ohinhtu lo utaisu tl hiu sllj.
Example: Frequency analysis
• If you continue like this, completing words (using your
knowledge of the English language) and matching
ciphertext letters with probable plaintext letters (using the
relative frequencies), you will eventually obtain a complete
decryption of the message and will also have recovered the
key (the substitution alphabet)

• The substitution alphabet for this example is:


– p: ABCDEFGHIJKLMNOPQRSTUVWXYZ
– Fk(p) : RYPTIONABFGHJKLMQSUVWXZDEC
Other English language
features
• Digram frequencies
– Common digraphs: EN, RE, ER, NT, TH

• Trigram frequencies
– Common trigrams: THE, ING, THA, ENT

• Vowels other than E are rarely followed by another vowel

• The letter Q is followed only by U


3. The Affine Cipher

Suppose K=(7,3), We can calculate 7-1 mod 26=15, the encryption formula becomes:
eK (x)=7*x + 3 mod 26
And the corresponding decryption function id
dk(y)= 15 (y-3) = 15 y - 19
Example: Encrypt “ hot”  7, 14, 19
(7 x 7 + 3) mod 26 = 52 mod 26 = 0
7x14 + 3) mod 26 =101 mod 26=23
(7x19 + 3) mod 26 -= 136 mod 26=6 0,23,6  AXG
Home work 
• Groups, Rings and Fields
• Modular Arithmetic
• Finite Fields (2n)
• Multiplicative Inverse

• Then we will discuss the cyptanalysis of affine


cipher

• Thats all Folks!!


Cipher Vs Code
• Code
– A system of symbols which represent information
• Cipher
– Mostly used for ‘secret key cryptographic systems’
– Encryption or Decryption algorithms
• Cryptosystem
– Mostly used for ‘public key cryptographic systems’
Inputs and Outputs
• Cleartext
– Information encoded by using a public code
• Plaintext ≠ cleartext!
– Input of an encryption algorithm
• Ciphertext (Cryptogram)
– Information encoded by a cryptographic system
• Encryption (Encipherment), Decryption
(Decipherment)
– Action to transform a plaintext into a ciphertext or the
opposite

You might also like