Difie - Hellman & SHA-1 - Algorithm
Difie - Hellman & SHA-1 - Algorithm
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
-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
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
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
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
wiGWe W Wo Ws)
Thiy means 4had Wii is depe ndent on
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
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