Docsity

Symmetric Ciphers-Network Security-Lecture Slides, Slides of Cryptography and System Security

Partial preview of the text

Download Symmetric Ciphers-Network Security-Lecture Slides and more Slides Cryptography and System Security in PDF only on Docsity!

Network^ Security^ (Lec^ 4) Symmetric^ Ciphers

Symmetric^ Cipher

Model docsity.com

Continues… It is impractical to^ decrypt^ a^ message

on^ the

bases^ of^ cipher^ test^

+^ knowledge^ of^ the^ algo.

Algo^ do^ not^ need^ to

be^ secret,^ need^ to^ keep

only

key^ secret. Wide^ use^ of^ symmetric

ciphers^ ….

Model^ of^ Conventional^ Cryptosystem Source^ produces^ message^

in^ plaintext

X=[X1,X2,X3…..XM]. Key^ K=[K1,K2,K3…..KJ]. If^ the^ key^ generated

at^ the^ source^ ,^ must

also

be^ provided^ to^ the^ destination. Alternatively^ ,^ a^ third

party^ can^ provide.

Y=E(K,Y)

Cryptosystem^ three

independent Dimensions

Type^ of^ operations^ used

for^ transforming^ plaintext

to

ciphertext.^ Substitution^ Transposition^ Product^ system Fundamental^ requirement

(no^ information^ is^ lost,^

all

operations^ should^ be^ reversible) The^ number^ of^ keys^ used. The^ way^ in^ which^ plaintext

is^ processed.

Block^ ciphers Stream^ ciphers

Cryptanalysis Attacking ciphers Two approaches^ for^ attacking Cryptanalysis Try to exploit^ the^ characteristics^ of^ the^ algo Brute‐force attack Try all options

Substitution^ techniques A substitution^ technique^ is^

one^ in^ which^ the

letters^ of^ plaintext^ are

replaced^ by^ other^ letters

or^ by^ numbers^ or^ symbols.

ROT‐^13 cipher • The ROT‐ 13 cipher was commonly^ used^ to^ hide^ the^ meaning^ of

messages^ on^ the Internet^ (particularly^ on^ Usenet^ and^ E

‐mail).

-^ Each^ letter^ in^ the^ plaintext^ is^ substituted

with^ the^ ciphertext^ letter^ according^ to

the following^ mapping:^ p^ :^ ABCDEFGHIJKLMNOPQRSTUVWXYZ^ F ( p )^ :^ NOPQRSTUVWXYZABCDEFGHIJKLM • Example:^ –^ Plaintext:^ THIS IS A SECRET^ –^ Ciphertext:^ GUVF VF N FRPERG • The^ ROT‐^13 cipher^ is^ an^ involution^ (i.e.,

self‐inverse)^ so^ that^ encoding^ twice^ will

result^ in the^ original^ message. • This^ means^ that^ a^ separate^ decoding^ function

-^1 F is^ not^ needed.

Caesar^ cipher • The cipher used by Julius^ Caesar^ can^ be^ generalized^ to

a^ function^ defined by^ a^ parameter^ k^ representing^ the

number^ of^ letters^ that^ we^ “shift”

each plaintext^ letter:^ c^ =^ F ( p ) =^ p + k^ (mod 26) k • Where^ Julius^ Caesar^ used^ k =3,^ and

ROT‐^13 uses^ k =13.

-^ This^ cipher^ is^ called^ the^ Caesar

cipher.

-^ The^ parameter^ k^ is^ called^ the

key.

-^ Example:^ YVCCF^ Z^ YFGV^

PFL^ WZEU^ KYZJ^ ZEKVIVJKZEX

Cracking^ the^ Caesar

cipher

-^ Caesar^ cipher^ is^ defined^ by:^ c^ =^ F ( p ) =^ p + k^ (mod 26) k •^ There^ are^ only^26 possible^ values

of^ k^ (the^ key)

-^ Out^ of^ these^ 26,^ only^25 values

of^ k^ are^ valid^ keys^ (since^ k =0^ has

no

effect^ on^ the^ plaintext) • We^ can^ break^ a^ Caesar^ cipher^ by

trying^ all^25 possible^ valid^ keys

-^ This^ is^ called^ an^ exhaustive

key^ search.

-^ The^ language^ of^ the^ plaintext

is^ known^ and^ easily^ recognizable.

Simple^ substitution

cipher

-^ A^ generalization^ of^ the^ Caesar

cipher,^ called^ a^ simple^ substitution cipher or monoalphabetic substitution^ cipher ,^ maps^ plaintext

letters

to^ ciphertext^ letters^ according^

to^ a^ fixed^ mapping^ (the^ key).

-^ A^ single^ cipher^ alphabet^ (mapping

from^ plain^ alphabet^ to^ cipher

alphabet^ )^ is^ used^ per^ message. • Example:^ –^ p^ :^ ABCDEFGHIJKLMNOPQRSTUVWXYZ^ –^ F ( p )^ :^ QWERTYUIOPASDFGHJKLZXCVBNM k • Both^ the^ sender^ and^ receiver^ secretly

share^ the^ key,^ representing^ the

plaintext‐ciphertext^ letter^ mapping,

which^ is^ also^ called^ the

substitution^ alphabet.

Cracking^ the^ simple

substitution^ cipher (^26) • There are 26! = ~4 x 10 possible keys

-^ Exhaustive^ key^ search^ is^ not^ practical •^ Simple^ substitution^ ciphers^ were

considered^ strong^ for^ many^ centuries

-^ In^850 CE,^ Arab/Iraqi^ scientist^ Abu

Yusuf^ Yaqub^ ibn^ Ishaq^ al‐Kindi^ published

his book^ “Risalah^ fi^ Istikhraj^ al‐Mu’amma”

( A^ Manuscript^ on^ Deciphering Cryptographic^ Messages ),^ which^ contains

the^ first^ ever^ published^ description

of how^ to^ crack^ simple^ substitution^ ciphers • The^ method^ he^ described^ is^ now^ known

as^ frequency^ analysis.

-^ Exploiting^ the^ regularities^ of^ the

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.

1.6^ 3.4^ 7.4^ 0.2^ 0.3^ 3.6^ 2. 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.

9.2^ 2.6^ 1.5^ 1.6^ 0.5^ 1.9^ 0.

Example:^ Frequency

analysis

-^ 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

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

19 11 19 37 3 9 6 6