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

Difie - Hellman & SHA-1 - Algorithm

Difie Hellman and SHA 1 Algorithm notes

Uploaded by

soulayush28
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 views11 pages

Difie - Hellman & SHA-1 - Algorithm

Difie Hellman and SHA 1 Algorithm notes

Uploaded by

soulayush28
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/ 11

* Mon in +he middle attack (MTTN)

MITM attack is when a bocker secvetty intercepts


4 monipuldes the conve scat ion bet ween the 2
Panties wlthout khouwing them.
Jt Wov ks in following way'
A hacker 4ries to posit ion himselves between 2
mmunicating parties .foy eg ( Alice 4 Bob)
Duing thier comr)unicedion the messages which
Alice's ane going theyuill not re ach to bob,
Ater they first pass 4hough the hacker iH wil!
go to BoB.

Dursng +his Process


pr hacker gyetends as Bob when
+alking to i ce,vice vevsa pre tends to be allce when
talking b bob.
Ta algoithms like DrCie -Hellmen key erchange
the hocker can replace puwblic keys shored by aice R
1 bob eith +heir own keys
This eads to shomng keys wth hacker, not
with each othex
1
As a resut A)ice 4 Bob both think they
Communicad ing seL urely, but hackty Can see 4
Contrel ovevgthing
Diffie Hell mon key Exchange Aly

-3+ comes ider under asymmetric key cryptog mphic


clgonthn
J+ is not on encypdlon /,devyption algoithm
Tt wil just ma ke key exchonge bet 2 pavtios

* 0efo This aqo


dgorrid hrn is cvyptogrophie adgovithm
a shored
cohich alows 2 ponles to securely exchange
SecYet over an iosecue cormmucat lon pvotocol,

A lrocedune'
J consider a prime number. 4
Let =
I selet d sued 4hd < d is imitee yotofe
Primve root It is said to be it ìmit ive root

if o mog ohosld ive you dist inct values


upto (4-1)
SO, we Con sidered 4=+
-1=6, so,for it must lve distirct
vdues like ( ,2) 3, ,5) 6
d we selet d=3,
w'e hwe to toke value ataom trom 4he
Prime fuc tors of q-1=6
f=7, 4-1 =6
23,?
) Pri me fa ctors for 6is formua to
i Test for o= 2
chec k

-mod moá9f 1)
tt fails to condiAion since it can!t be
tyu to
1J Teyt fords3
(6/t)
mod y== 3 mod
-mod
72F.m od 4

(62)
mod #1 passes thefirst tes+

2^d
test mod 3
mod

2
the first
1

3
(6/3) mod t1 it passes both
io second teyt

Ror prine facdor 2,3?


Yoot r
Hence3 is a prinit iv
So let's che ck accoTding Primtie mot synfax
d=3
(44) =3 mod 4= 3
mod
2
3mod =2
2

3mod '7= 4
3

3 mod t= L from
Hence We qot dl distint velues
g-1 CL2, 3, 4, 5,c) 3 s
1 to
rimitive voot
So we have fo und =# 4 d=3
ste
de have to osiume XA (Priak keyofA) 4kas?
Heve
XPivate key
Y=Publie key
Sing his ossomed Vauue of XA we hace
to calew de ya using
XA
7A= mod 9
ey 9=1 4 d=3 (xA 3-> Assurne)
Here XA<ut
XA=-feb rivede key

Here we caleeated t he public kty or A form


Poivete& key of A
Now Ue have to culelat Ye,Ye
I+i) simi la?
As sume x (ivade key of e) xB<

8(3)nodg
F(3 mod

YA= (3, 6)
Jn hi fifh sBeo wehawe to calelate
Sicyed key k K -for exchangirg
k’er 500

Ajler dladinyif K,=ke then sucte))


K= (4) Mod = a(xA,Y)=6,6)

ko= 1 - -)

fron
kË kg Hence Succe)
key erchanged S.scc ess fuly
Success
SHA 1 algorid bon (Steune Mosh Ayonthm d)
The outpt of +his ayoithmwill be a Hash value
which is of e size l60 brts
The input will be ony voiable
lenghmesage.
but his mes elge is hot direcdly g1ven
given we -deulde
this mèssage in chun bs.
he SHA-L dgovithm pvocesses messayein 512%rts.
Un case 1f the inpd me Ssage is not a mutiple
f 512 bits, +hen we add padding
How to add faddin9
¥Tn shah agorithm cond4ion
The input me Ssaqe muyt be of size t4 bits
Such Hhat iH can Complett eiteria or5l2 bi
t 64 5|2 bity

Iaput Liefawt value


messog e which will be
added to complte eite a
OSrpose the mesage we hcve tss only of 50 bit
4 hen add
we ad padding in f, Ilowing wcuy.
5o bi lo0o ooooooD

1n fisst ste p we add single 1 bit to 4he msg ,


iACter this a'e odd enough ''s so that lengdb
f padded euiva ent to 44 bit eutero

-After thiu padding 5I2 b which i Consi dercd a)


one bloch/chun k of msg- hich will be given
to cha algeyith m
No w let' Conçder 1st
chunk e kfo win sha dye
woy
The sho fentfoyms 8 o-ite rations (1=0 to gg)
lkobit
443 it tG 4 bid 5\2 bi

In this itenain for eoch each


)deretion we aive one word Wowi
t 6obit cd ioidi iterad íonho
Af RO itevation o/of Ro is
iven to Ri hen o/f of f to
so Bo to B9
The 5l2 bits which is rotthirgbut
chunk of mes 09e it i give n to
MSA' message scheding lgolFmGDbit
the 6

- This MSA heles to divide you


512
16 wo ds which ane notbirg hd the wobirts inta
which are 32 bit each of size
WËW6
- Bt the oblem b we have diutn wovd
which aM given fo pto Rir, bud afer Ris
means Z r (we don '4 hawe wovd to povide
- Io thD caje we bove fomudo to find/ledate
or d) for teration abov e(R s
WtW-6 W-4 WE-gWt-3
toy es:we have to find word for Rc evat ion

wiGWe W Wo Ws)
Thiy means 4had Wii is depe ndent on

wo, W, WI,WI, z meons we hawe to deyive


Wis fam them by oppyig Some Com putdton
Since we aloreadq have valuey foY Wo,WWsy
we deive Wi Velue from them
So the second otput whih e qive sha terat ton
S l66 bit, this l6o bit -eeetf is foyther
diyi ded into 5 block of size 32 bit each
22 32 l60bi t
L32 t 32 t 32

A E bloc ky

kt
A
A c
diogom whih will help to unders tand
This i of I60 bit value
values will eocb bloek
whut
will ho H

So in 49t iteationRo we don kno d twhat oe


-

initlad values for A,8, c,0 E blocki


-This Value am giuen by defaul t only fo
ist ikeration Ro Ahey
A= Ho G4t5 2301 Thi +) 4he set
of value) whie h
C= He- 986ACDFE ane on'y siver For
D= Ha= lo 32 5446 4" (eo) ikration ony
beoz afkr Roite rad ioo
twe will get 1so bid value
4 accovdiny to thad value
we cun Aivde it 5 block
In
ln sha-l clgorithm w have oto 49 jleraliony
+his itet ions (ne foydber
fur,her divided irto 4stage)
whest each
as follo w
stage il hae 2o iteotons each

Kit= 5 A824 999 0s to 9


>202 to s39
K3t 3FLBBcpc >40 to s 59
Kyt CA G2 CA DG 69 Stox9.
So let' see whed actuully happen in ea
iteouti on
- Led's td ke 1 Ro iterad fon accor ding to
lko bit diag vo
In diag ram twe hawe F block is nothing
bud boeay fundion whih |l. to ke only'B''o'
block to vlues ta Pen form funtian
oferati on
his function Contains some ariH bemadi
tu hich dye differet foY 4 different stuges
sha clgovit hm, which ae os follow
of
Kil=B.cAB. D o y youpotony
k2tz’ A0 for stage’ 2o-to 39
c^B.o^c.for sto ge’ o to b9
Gt=.
kut’ c p f o r stageGoto 9

givento
he out put of 4hiy fundion )operattoy
which ts an add ition modlo
A 4his poinl iH oill perfom Some openation h he
E block value 4 thiy value op i given to next
6 perution
Ihis atpt pe fomy agaio ogex atiun wHh the
Value which i) coming from atheA block
Thiy value j) fisst e5 Left shfted by 5
44hen H will perfom opendtion
Dfer thesucces fw eKec on of Ahi opeadion
o tpt of t his passed to the z operat lun
But here we have anotker inu thatiWE
Wa means thet out first to 16 iteradior) ane
Co mplet 4
R wt wJll, help to clededt Wors for forthey
iteration)
Theo out put of 37d opes ations i given to the
Lth efinal opeation here
hevt clso owe haue
ne another in put ke'tis nothing bud
to nst a nt value the
tho Constont value i diffevtnt foy difcyent
Stogey as shown above
kit 5A82399
Con stt value

Ky t=CAG2C1DG

he focl out put of ul of these opemtion


i given to A Bloc k
-The fira value fy 8 bloe k i) sinple he
6ngirl value of A block is assigned to j+
- for C block itt gets value of B block but
the vue ib lef+ shfted by 30 230
-The block value is as Sane os oigina
V
alue of C block.
And the Last E block geds origiral velue of

The bCombinetion of th all A,B,C,o4 E


blo ck mekes fina t6o bid tput for firt
'Ro ittrations
-This owtput is given ay inp ud to R Rso on to

To last skp we have to add l6o bit valur


bit in pu
which we have ta ken as in IHia lGo mesSagr
which will g ive finu ouput for the first
chunk
- To get the final Hash value we ha to repeat
upto mijfsm2.rr mo blek
ll 4he Steps

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy