[go: up one dir, main page]

0% found this document useful (0 votes)
19 views17 pages

CNS Assignment - 2

The Data Encryption Standard (DES) is a symmetric-key block cipher that uses a 64-bit block size and a key length of 56 bits, implemented through a Feistel structure with 16 rounds. It involves initial and final permutations, round key generation, and multiple rounds of processing using substitution and permutation functions. Although widely used, DES has been largely replaced by more secure algorithms like AES due to vulnerabilities associated with its shorter key length.
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)
19 views17 pages

CNS Assignment - 2

The Data Encryption Standard (DES) is a symmetric-key block cipher that uses a 64-bit block size and a key length of 56 bits, implemented through a Feistel structure with 16 rounds. It involves initial and final permutations, round key generation, and multiple rounds of processing using substitution and permutation functions. Although widely used, DES has been largely replaced by more secure algorithms like AES due to vulnerabilities associated with its shorter key length.
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/ 17

| Eaplain about Data Encntion standord (DES) with a

Sutade erampe
The Data Encryption standard (pe is a syomatric -koy block
Chen pablished by the National Instte of standasds and
Techndogy (NIsT)
DES S an
inplementation of a Feistal Cipher. ît uses l6 round
Feistal strulure. The block sige is 64-bit Thouh, key length is
Gy-bt, DES ha an
fftie kay length of 56 bi., Since 8of the
Gy bits of the key are nt used by the encrygtion alqorithy
(function as cheek bits ory
EncryptiG4-bit glaintt Decnyption.
Gy bet paintat
DES -5 Bit DES
key TNrse cophy

GybatGphoyteat ebit cagher teat


G4 bit plaintert General structure of DES
DES
nitia Pumutatiog Round-key
qenerator

Roundl Y9-bit

Round 2 -56-bit ciphy


43-bit
ky
Round 1o ks
48-bit

Fnal Pumtata

64-bit Ggherteat
DS symmlric koy Block
Size:y8 Bits
alqorithy pEs folaus feistal Round koyl
Cipher stlure. Sukkey.
plain Teat Block sige: 64 bits
Gigher Teat Sige:
GYbits
Master koy Siy 6y/56 Inverse Initial
Initial
Peumutation & Bits No of Rounds t6.
peemtatio
The intal poumatation definedby tables ,as shoun in Tables.
The tables are to be intupreted as follous The
. input to a
tasle Consits of 6y bits numbered from Ito Gy. The 64
enties io the pemtation table Contain a perrmutat ion of the
humbers frorn l'to G4.
Fach enty oin the peutnutalian table ndicates the position of a
hurobeed input bit in the output, Which also Consists of oy bits.
The initial and fod pemdations are straight peamtation
boxes (p-boxes) that are dnverse of each otYon.
Noter Initiaf posngutalion bInverse Initia Pomutations hawe no
Cygtography Sigtficance in DES
Input Table
4 5

J0 I| 12- 13 14 15 lG
|7 18 19 2o 2| 22 23 24
24 28 29 30 3) 32
25
35 36 34 38 39
33 34
y2 y3 49 45 Y6 47 Y8
6G
50 51 52 53
53 54 55
64.
51 63
(a) Initia femalat ion (I)
68 42 34 26 |0 2

52 44 86 28 20 |2 4
62 54 38 30 222 14 6
56 40 32 24 l6
5 25 I7 4
59 43 35 24 19
27 I| 3
53 45 aq a 3 5
55 23

Ih otpat
At jst place 53
At 2nd place 50
At sd place y.
25 68

|2 52 64

(6) Ihverse Initial femtatior (IP-).


Yo 43 32

41 15 55

38 6230

34 45 13 53 29
|2 52 60 2

35 3 = 5) I9 59 24
34 2 42 50 53.26
25
49
In otput
At jplace yo

Atsae| 2 25 58

A5 58 G4

Rounds
THe left and ight halves of each G4-bit intomediale Nalue ane
treted as seperate 3a -bit quantien, labled L(eft) and Rfrght)
As in any elaic Feictal cipher, the oleral Procuing at each aun
Can be summar id in the following formulas!
Li= Ri-!
R:-li-t f(Ri-t,ki)
48 bi. The R input is bits. TR R
The gound key k; is
by wsing a table that defines
y8
input is fist eapanded to bits
anpnsion that invdes duplication of lo oftR
a poumtation pls an are noRed weth ki, This 43-bit selt
R bitThe enltin 4s bt
a subdttutian functiog tfat produca a 32-bit
outat, uhithis permuted as definod by Tade
oe of the s-bor in the fnction Fis ilaatrated in
TRe nde
TR sttation tonsidta of a st of aght s-boze, ah of
gt 66 bits
whih acapt bits asas input and poduces 4 bit as autput.
e)Eaposion ermtation(e)
5

5
4
/0
8
|5 lb
2
20

A5
20 22 23 24
24 25 26 21 2%

28 30 3) 32

(d)Prmtation function(P)
18 3|

2
25
30 2)
its 29 bith
abts Di
Ri-l

Lept shpte) Leftshft


Erpansio /Pesumutatoo
(E table)

XDR
enmtato, lartrot/
(emitated

Substitutioo |choice
(s-bo) 7:
fomtatan
LP)

XOR

Ri Di

Fig: Sine Round of Des Algotm


Round Funtien
The heat of this apher is the DES funtion,bits f Theto bES
rigbtmost 32
tuntion aglies a y3-bit key to the
functoo
Produce aa 22-bit output
32 bits

bapansion P-bon
49 bits

xOR -k4sbit:)
S-boes

32blts

straight Pbon
32 bits

DES Analypis:
Tuo desired Paopotes of a bock Cpher are the Aualanche eft
and he Completeness . Avalanche effect is used.
Aualanche effedt: Asmall chanqe in plaintzat relt in the vesy
qreat chane in the cpheteut
E To check the avalanche effect in DES. Let uu enrypt
plaintent blocks with the samne key )that differ ony in one bitand
obsewe the difference in the numbes Of bits in each mound
plainteat : 000000000000o0 Rey: 22234572487A BB23
Gphertet: 4134FD 416E82A5F
plainteat: 00000oooo0O00oD Rey: 222s45129379B23.
Ciphetet: OA4ED5c15A63 PEA

omglelenu effect muans that each bit of aphertent neda to depndy


on many bit en the ploigteat The d-ffuion and Confuinprodud
by p-Bores
p-Bow and S-bow in DES, show a vey strong
Gompletenun ettt
a Delop and ovenvied of te genal stdture of adasnce
encnyption standand (AEs)
The moTe Popular and widely adopted Symmatie
ercnyption
likely to be encountered nowadays is the fdaegced
alqorithy atleaat six time faster
Encytion standand (AEs).ît is found
than trile DES.
peeded as its key siye we too small
A eglacenent for DEs Wa

it it we Considerd anenable againt


witf inereanina Computing puier,
DES
Trple denigned to
to overcome
eahauve key Sean atack'
ths drawback but t Ja found sou.
The fatines of AES
Aes are as follous
* yormtic key Ssymmdtne Bock Cpher
* la8 -bt daa, las 192 256 -bit keys
* Stronqer and faster than Triplee-bEs
* rowide full spcification and daign detait
* softsae imglenentade in c and Tava.
Operation of AES
AES is an tertve ther than feistal aphert is baed on
sub stution - peumtalog netork.t omprises of a Sodes of inke
opuations, Some of whik invdre selaing inputs by speasfe afpt
(Sabdihtiens ) and otRers invdwe shating bits around (Pemtations)
Interedingy, PEs pafoms al its Conptations or bytes gatfRer tfan
bits. Hence, AEs treats the las bits of a plaintet Bock as le bytes.
plaintet Bock
Tese lo bites are anranqud in fou Cdumns and fou aus for
as a mti
procaning
UnLke DEs, the nunbet of ounds in hes is eriade and depnd
Re lentG of the key. AES Wse 10 -ounds for as-bit kas,
en the
ound for I2-bit kys and19 gound for A56 - bit keys . Each
of theeounda wes a different sa3-bit nound key, whi is
Caladated frem the ongina AEs kay.
The schematie of AES stucture is giuwen in the follawing
ilutraten |2$-bit laislet

(21 bita key


ension Cghorteat
(ias, 112,or 256bta)
Pre-ound
tronsfomatan
Roundl
R keusine
Round 2
192
Round N I4
(sliahtty dffeest
Relatnchip betweer
urnber bf ounda (^)
k-kt cghutet and agho key sige
Encryption prncess
Here,we oetrnct to deeiptloo of a typeal andof AES
encyptior. Eact rand Corise of fou Sub-procne: The frt
TDund procs is depicked bela plaintet
Gqhikuy
ko(ias bt) fddRaund key

Sub Bytes Raund


l
shift Rous
MiComns
AddRound key
Bute subsittioo (subBytea)
The l6 inpt byles ae Substituted by lookg y a fud tablesto
qer in duigo Seult is in a nmatria of fouy tre) s
and foun Colemns:
shftrous is shif ted to the agt.
ous of the mati
Eadh of the four inerted on te ght sideof
tny entries that fall off are Te
shftis Carried aut as
* Fst ow is not nat chifted
is shifted one (byte) postblorn to the left.
* Third ro is shifted two; postbions to the legt
is shitted tree posibiens to the apt
* The rest is a Dew matix Conscatinq of the Same lo bytes
but shifted uth sepect to each otfet.
- Miacounns

focd cnn of fouy bytes is tranfomed wing a spuiaf


now
matfematica fantiog. Thu finatiag take
take es
input the fout byte of
ene Column and atpuls fout Complatey new
the ongina oon: e e l t is anotey new natri
f to ns bytes- ît shad be noted that tRis stp isCoruisting
not
Penformed in the lat ound.
Addound kay
The l6 byte of the
the oti are now Censidered as las bt and
Qre xoRed to the (38 bit of te round ky. Lt ts is the lat
und then tRe atput is the acheteat: otfonwte, the vting 23 128
bit ae iteputed as lo bytes and we beqig anothey
Tound sinuday
Tecrgtion Process
The process of denggtion of on AES Gphertent is siniar to the
encryption process in tfe evese ord Each ound Consist of fo
froaser onducted o the eNeASe Osole

* Add ound key

shift mo
* Byte substitution.
in eacl Tound are io seerse mapnt,
Sioce Sub-Procese deenyption
ulake for a Feste aghox, the encnypton and
they are
dgoitfins nesds to be sepenately ingleunted, lfhough
Veny clocaly oelated.
AES Aralyis widay adopted and supptey
h preunt day oryptogroty , AEs is
TU date, noftica yptanalgis
in botß hadare ad softuare. discovered Additionally, AEs har
aleck againit AEs han beas
-io fubility of key engs, kih altas a dgre of
built e
enhautive
oo fing' againt Proqen in the ability to paform
key seankhe.

ditfonnce btuaen
between a fista and Non- fistal black
3 ldetfy
Gghet
Fastel Black Gaghot
Struret
’ Based en the Feistel netuork strcture.
’ Dwides the plaintat into to halues i Left (and ight (R)
’ Ody one half ypicaly R) is proceaud thrugh a round
functio, wkade the othen half C) is XORed wtk the oulput of
the furti
’The halyes are cuagped at eoch -round
Encggtin/Ducngpton:
The ercnyption and deygbin preanes are -neary identeal,
difing only in the ordy of the ound kay.
Simplitier imglemenatioo becoue the same strucere Can be
wmd for botf

’ Requises fesey Conptations and Can we the Same algothi


fos degpiorn ith nainina chang
’ DES (Dala Encrygte standara)
Blaufuh
’ CAsT-I28

key Adeantag
’ Sgmnty of encryptiorn and decnyglior ensues
ond Coniaeng
Non-fistel Bock Cigho
struture:
’Does not follas the feiatal stmutre.

’ Typreally Procesen the entise block of paitat whing
Subettutiao,frmatia Ond kay uining
re

’irryption and deuytien procanes Ore not identico. A


epuate algositir or tansformnuatiog is eqised for decptia
’ Con adiese strong diffuion and Seauaty io fewey
-glunds conupared to Feistef stnuctures.

’ AES (Aduancud Encngtien stondand)


’ IDEA/nternatin Tata Encnggtiorn Agonti)
Often Poovides betey sanity due to ctrongey diffuio
and Gonfuioy mechanisns.
CSE-A

|Explain abut Symmetrte key he model?


Ars:- SYMMETRIC KEY CIPHER MODEL -
Serdet and teceive
Ihe
Common Rey
Eroupt and deGyt messges

Alice Bob

Plintat Plaintat

Enetyptton Secure |Decryption


adgsihm Keiy-chamel
Ezhage olgorihm
shted Sharcd
Sactet Key |Scexet Key
JCphertext cigher text

ngecure chorrel

3! P ts he plaêext, c ts he cipher text , and K is Jhe keu.

Encryptton : C= Ey(e) Decrytton : P= Dy (e)


We 8SUne that Bob Creates P
pove drat P =P:
Alce: C= Ek(P)
Bob : P D, Cc)= Dy (E, (P)) = P
Sgute kocktrg and unlock+irg uth he Sarne

rcypt ton Decyplion


agoritfhm alçorithn

Substtkton phas ond Expla~n ang & methods.


5 Explain
Ans: SuBSTITUTTON CIPHERS

Substtutlon aphers aphces cne Synbol uth aroher.


Substrudon cphers Can be ote qoriged as her
nonalphabetie cithets or polyalphobetie cihers.
Note: A substttalon cipher. repaces ne Symtel oith anotter.

Monoglphabetie sphers: beuoeen


monoalçhabelie gubsttion, the lationshp
plaintet to ymbo n She r
Synol n the
one - to -one
Cipherlext s
Exanple:1
The tollooig hous plantott and s orappnding boh
prababy manoalphabette becouse
Cpherteb. The cpher tsas o's.
i's (els)ate encyptcd Cipherterb: KHOOR
Pesntext hello
he odive
shift dpher and
monoalphabete cipher
atHNe her better
The sinplest ts Sornetines itel texE
TKiS pher he en and apher
Cpher. caesar cpher, but plointext
Sornees a natere. igure
reveals ts
mathematal

P
Naintet C
P
phert GHT J KL MNOP
SAB
value

plointet stu
phertet RSTUV -
N
22 23 24 25
value
diqure Additve cipher
Plointet
ple&ntet Bob
Alice
P

mod 26

Decrgplton
EncgpkBon
cipher text
, and
aite, the plainteat., cpher text
Note:
Ahen he cpher s
integerg n Z26
Key are
Enamçle:he adste cphex th. key 5 to Enoy pt he message
Use
hello".
Sdutlon: ooritim do,he plasntet , chavacter
e appy dhe Enerygtton
by char acter.
ciphertext: 226
Plaintext;h0 Encryptonilot Hmad 26 Gphertent: (99 T
Plointexti e-o Encryplion : (Dut) mod 26 ciphertent: OoA
Cu 6) nod26
encgptoni (uts) mods c¥phertext: ooA
iphertext o390
EnergBoni Ceetts) nodz6
Relerence

A MNOPo
G
22 23l 24/25

volue

>|shtlt pher and caasar Gpher : Gphevs. Juus caesoy


Hlsially» additive cpherg ate alles sht
ns olers. 1 Jis
usod an atitie cpher to Cornuniote ulh
dpher ove 'soneineg steleoed to as t the aelar
reason,adie
used a Key o s or hig omniatiors.
Cpher caegat
Note:
Sometmes reeed to as shit apherg Qnd

Addlye Cpher ave


Coegar cpher.
Multelite ciphers plontet
plantet Bob
P

&rcnypton beciyption
Note:
cherext
Sn a multipltatte cpher, the plaÃn text ae -ntgers in 2 2c
Sampie:ts the ey doraan or any mutpliotive cpher
Lohat membeS!
oluton:
to be in 2b% set hos ony 12
The key needs 21, 23, 26.
3,5, 4,4,1,S, I4, (9,

’ARline ciphevg: multtliative ciphes


Corn bine additve and

Platntent plintet
Bob
Key Key

Pl(PKKDmal26

T--k mod 26

cphertent
P=Clc-k)x k)mod 26
c-(PxKit k)mod 26 Ki k is te additive
ohee k s he muttipiatie inverge
oich the Pst key
in docun
EXampe:
The aine cipher
uges pair & keys
The ste d She ke
ard she secend is rom 226
is om ,
1S 26 xI2= 3l2.

haver Srall be4


phey:and
alprolbelle ubstttuttonctve ne eck.
Mono multipli brutefoce
Because adtte, vutnerable to ach plaintent
are eg tlo
dormaans, Srey
oton o reate mapgcharacker. Aice Bob an
A betler corregpordig pherteat Ret Bach chooadev,
he Shousig he rappig
chavoter and talble
aqree n a
Sxornple:
use he ey in gre t êncyt he. messoge
thts nESS sy to noypt butt hard to lid he tey

The ciphnertenk ts
CFVQRvVNEFVRNVST YRG«AHS L0TI CN HTT YBFG TîCRXRS
Releence
aealeg kanopistluvoy
Enkesle<eelooja|*|alajelzs
>yahobee rerS: a character ay
ocurene
polpipabetc sbsttton ,&och
Sn bo a chader -tn dhe dainent
drent lelttle The elatorghip
have a the prerst ta one-t- Many
to a chorate a
Stornple:
K (KP, &..).
Dervyption : P;e (ci-K) mod zs|
Sxarmple: ogreed to we an
autot cper th
Ahot Ace & Bob
ke 12. Nouo ce uoants gends b re mesge Ata
i t l Key value
s Soley". Encipherig t cone
chaate y chancter.

Plointext 8a t
2 9 3 24
Vs value 9
03
ketgy sbearn:
03 24
Cs values: (2 12
A H R
Ciprer texb: M M TC M

You might also like