0% found this document useful (0 votes)
58 views24 pages

Css Assignment

The document discusses solving problems using the extended Euclidean algorithm and Fermat's little theorem. It provides examples of finding the greatest common divisor and multiplicative inverse in modulo arithmetic. The key ideas are applying the extended Euclidean algorithm and Fermat's little theorem modulo a prime number.

Uploaded by

Hisbaan Sayed
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)
58 views24 pages

Css Assignment

The document discusses solving problems using the extended Euclidean algorithm and Fermat's little theorem. It provides examples of finding the greatest common divisor and multiplicative inverse in modulo arithmetic. The key ideas are applying the extended Euclidean algorithm and Fermat's little theorem modulo a prime number.

Uploaded by

Hisbaan Sayed
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/ 24

IR (ONCEIC O RODRIGUES

COLLIGE Ot INGINIURING

CSS AsSIQnment
Name-AyuKshi Sanjay Rane 285
TE Comps

SLn Euclidean algo ri thm find the qicatcst ommo


_divisor of_12345 and 43215
given
a : 12345 b43215
Formula-
a: ub + O<hb
Or2

O r2

Tn-2 n 'n- t m

d gcd (a,b) '

Solutio0
* 4 221 5 t 29130
T2345
43215 X 2913o + 4085
2130 2 x 1408S+ 2-8+T6 960

4035 3 x9 Co t G45
60 - I x 645 315

645 2x 315+ 15

315 21 * 5 +

d gcd (12345 43215)I5.


gcd 12245 3 2 5) is 15
IRONLIAO KODRIGAULSOLG LMGAALK

i 22X 23 nad 22

(ab) mod
o mo dn) bmodn)Jmodn
22 mod 22) 23 mod 22) mod 22
mod 2
mod 22

I
221x 23) mod 22

Eulidean_algorn th m,
find the qd
ttnd
4sing the
pairs Also f i n d z a n d
follOuLn
246 and 46

b:4G1
o24 6
rmug

a t by c d a,b

-2 n n
fn- Ln
n n -2
f o

b
o

mod b
SOuO.

a b +
56
24 61 5 xq 6 +

b +2
6 2 x1S6 + 199

56 3 Ls42 I6

65

u 21x1t2

3r 2 +| s 3

2 +D

gcd ( 246I, 461)


=

18 -10S1

d ai +by
ve
1oS1)
246Ix 98)+ 461X-
481 218 4 3 121 1

o51
Ans 9cd (2461, 461) :I 198 Y

245 an d 215

ven
a: 245 b 21S
A
RODRIGL
CONECAO
iR

Formulg'-

az+by : d: qcd(a,b)
ntn-2 n n -
4n- 2 0904
o -2 - fo- Ln
ro

r:r--o

ob

a mod b

Sotut on'
215 tI10 2-I e
245 SX
- - -55

21S XI 1o +45

70 3*5+35

45 IX 35+ 10
4 2 a 2

X1O t 5
35 3
s 3 - Ls 4 -1o
ged 124S 5

en y acd a x+ by

124 Sx 1 ) + (2S x -te

23C S 5 2 SO

Ans cd 1 2 5 , 21s) S , |9 -

SFind the mul pliae


i 1 3 2 in Zigo using extnd ed Eu de
38 n ZI30

a 180, b33
For mula:
az+by 9cd a
n
n-2 n. n -
n n-2 n n -
also Fn rn-2 o «
n

ob

r -i-o
amodb
Souo
38 + 23

38 I*>3+
S
IR
CONCTIC O
RODRIGUUSTOLLIGL O
LNuN
28 2X10+

X33
3-

4419

qcd 180, 38) 2


qcd CT80 33)
2 4
Zso
here1S MulHplL catie nYerce of 38 in

a 20 b

Formua:
azfby d gcd (a, b)
n n-2- 2nn-
n Yn-2 n .4n
n -2 n -1 Ln
also
h ro .
r- a

o b

i amod b
a

cd t s ) )1

hee as 9cd *O, 1)

mulh plicatiV erse s p o . s e

M u l p l e tive nverse o
6Fimd the re Sult
theorem esut of
he
the falloulg
i5Ss follo
mod 13 ng SIOq ermal's

p 1S
Formula
a
-

a mod P
p dots
prime
aot and a saninteger
Such hat
P13
divide
a 5.
s'3
-

mod 13
S mod 133
mod 3
5,5° mo d 3
s mod 13 ) smo
di3) mo d 13
X8)mod 3
8 mod 13

mo d 3 8
mod
AAd 1o

Fornmulai a
P-1

p is a_ prim Imod p
and ais
ais ana ntger
p do es_nat inger Such
such th at
divi d a
plo
o- aly5
45
00
tmod 1O |
I45
mod o
mod 1o (195
S mod
mod tO1) 19smod 1O1)J
mod Iol
#, X11) mod 101
mo d 10
02
4 5 2
had 0111

1The h mum p0siHVe intt gerP suh 1hat


(3nod 1) is
using Ferrnat's theoresn
mod
uwhere, pS prime and a1 nger and a!so
P do ts not d de

p 11, a3

P T

P-1 1-1
1G

4e hinmum po siMe nte gey 6


ON IA ODRIGULS OLLLL OL
NIIING

snd he valuc o for he following scL of congru


cnce Usimg ChincscKemainder Thcorem
1 3mod 5

mod 1
mod &&
Solution
Dr myl C a mod m,
a,mo d M2

mod Mk

m2

Step M mX M 2X Omg
M

Step 23O 56 S 6
C

2.3 O
M

M M 2 80
35 t3 35
m
5 6Y nod 5
403) no d 7 3

353) mod 2

, " ) + (a,M, m,')+ l4,M,1') J mod 21


(3y 567) 1 403)+ 6x
35x 3) mod 220
C2 +20 629 J rnod 270
1 n od 220

2)

a9 yptogroph 1 un uin
dd+ve ophy I 1 2
p+0 C P+K)mod 26 K 20
4
9
211 24 15 1 4 I1
15 1 218 12
22 425
5 20 123
21 2% 21 20 s21 4
22 32 25 40 33
rnod 26

22 112 3 2 2D 12 2 12 25 14 1
in o
b scm z ohh
si d nas1aqe u) Jsj a. Lubs Cm zoh
r 1,9 - r) mod 26 K20

mzoh
1 2 2 12 25 4T
7 --21-1122 o- 19-212-3 -13

fn od 26
(OLLEGE OF ENGINIER
RCOEIORODRIGLUS

Decryphon O C-K)mad 2
oh
Sj au bs m
C 25 33
35 39 34 26 31 2o 35
2144 28 33 40
2231 44 20 13
11 IS 7 24 38|S
2 11 24 19 19 6 o

mod 2
3 20 1 3

0I5 7 24 8 1
2
11 24 S19 14 610 le u/n
phylis
cr P t lolg rlal
ryptography 1sfun.
MeSsagei
decrupkd

Cpherwth Key E 1S
MultHpli cative
l
Crypo qranhy Ls un
t
Key 1S 26
IS X7 mod
Kuy 7

Key 1

26
C (Pxk mod
Enuyphon
30 mod 26 4
C ( 2 xI ` m o d
26
21 V
mod 26 25S mod 26
r 17XIS) 360 m od
26 22
24x IS) mod 26
17
mod 26 25 mod 2
2
p CISK IS) 25 z
26
1 9 xIS)
mod 26 23S Mod
t mod 26 2 C
210
o t x IS) mod 26 2612 :

mod 10 mod 26
6 x 1S)
26 2 Y
17xIS) mod 2 6 2 S S mod
r:
o a
26 mod 26
a (oxIS) mod

S X I 5 ) mod 26 2.2S mod 26 17r


7XIS) mod 26 los mo d 24 b
h
u(24Y1)mod 2 36p mod 26 22 w
9I) mad 14 mo d 26 16 :
20
S:2'S)mod 24 210 mad 26 10 -K
5is) mod 2: 15 mod 26 3 :
u20xI5)mod 24 *S0o mod 26 : y O
3 I mod 2 19S mod 26 13
enpd tevwr
2 cmyarb0qki on
Decpon P (Cr) mod 24
e 4 ) mod 26 28 mod 26 2 C
V (2 1)mod 26 |41 mod 26
L 2 21 mod I7 h
24: 5
71) mod 2 mod 14 2
25 9 mod 26 15 P
) mod
C
B 21) mod 2 115 mod 2 19 E
m 26 4 mod 2 1 4 O
2K) mo d 26 =
v 9 mod 26 6
a
21x 1) mod 24 9
ox 1) mod 2 : 141
d
1mod 24 I7

Ct1x1) mod 24 I1mod 24 0 d


6 1X 1) mod 2 mod 26 15 P
mod 2 1 h
221) mad 26 I54 mod 24
: 24
t61)
mod 24 2
mod
K
OX7) mad 2S 10 mod 24
23x1) mod 26 6 I mod26 8 S
23>
O 1yx1) mod 26 26 S 4
18mod 26: 20 u
C131 mod 2 91 mod 26 13 n
decrypHed xt Crypt+o graphy Stun
i aftne uphr usinq the
Key is,20)
C [PXi) +K2 ) mod 26
C:LC2X 'S)+2o] mod 245o mod 26 29:9
L01X15)15) +20] mod 2 : 21S mod 26: IS P
24 24*i5) t 20] mod 24 : 390mod 26 1C:
LISK Is) t207 mad g 245 mad 24
LCU*15) +20] mod ? 30S mod 26
O 19x 15)
t
t 2o]mod :230 mod 26 21 o

LG*IS)+2n1
IS) +2o] mod 2s lo mod 24: 6* 7
d 24
rL1X 15) +20]mad 2 21Smod
26 IS *f
R CONCT RORIO

a[loXIS)+ 20Jmod 2 20 mad 6 20 u


nLI5XI5)+20mod 2: 24S mod 26 1
hL7x15+2oJmod 24 :2mod 26 21 Y
L 2 x15) t20 mod 24: 39o mod 18 16
3 XIS+2oJ mod 2C : 190 mod 26 1o =K

SLC8XIS 2o mod 20 26
29o mod¬

C 5X15)+ 2) mod 24: 95 mod 26


17-

320 mo d 26 S
C 2 0 X I5) +2o) mo d 2
21S mod 2 : 1 h
n T 3 x ISt20] mod 24 =
ke F!h
enCryptd x X + p l t
wqp ulvq

LCC-ka) * Ki mod 26
Decryption: P

K 5 X1 mo d 24

1) 2
* C
2 mod 26
20 ]X
-
1]mod 26
Lt2 =r
mod 26: -3S mod 26 11
20) x 7J
P: [IS
26 28mod 26 2 4 y
q.L16 20) X1/ mod
L - 2 0 ) x 7 m o d
2 -63 mad 26 15:p
7 mod 16 1 1 t
t L14-20) *7Jmod 6 19 o
mod 20
wL22
2o)x1mo d 24:
26 C 9
9L6-10)*1mod 26 9 8 m od
35 ma d 20 1:r
mod 26
-

p LS-20)*
26: omod 26 0 :q
u L 2 0 -20) *1mod
®15
I I - 20)X1]
mod 20: 63 mod 26 p

7mod 2 :1 hh
26
V l 2 - 2 0 )x1mod
23 mod 24: 24
1 L 6 -20)*1 Mod 26
mod 26
o -20)1) SS
K 26
mod 2
mod 26 -112
- 112 ma
-9e)* 1
-21mod 2¢ s f
mod
L12o)x7
mod 26 2o :u
-8
Lt2o) X1 mod 2 13r
2 6 : 13
n

m
m od
od 26
mod 2
h 1 -20) *1] SFun
decryptd ert Cryptography

DEncypt the messa9e This hou se iS vcry old si


Vg ener p h e r wth
Ke antHC

CiCPi modm)mod 26

C
3 19 8 2

P t S s e
i s Y
ery 0 d
1 1 9 2 08 82 24 r4 3
197 8
2 0t3
K 3 19
2 3 8 2 13 9
1433 3112to |is 34 23 25 2
I4 2
2o 21 26
mod 26

19 20 o 14 1
s623 2So4 2y 22
23

aj zn or
encrypttd xt s ' tuba'johimKsi2nor o

USin9 pldyfar cpher to en upher the mess a gc ThS


Cphr is Yery n ereshog" using he ey CIPHER''.

Dery pt tne aphertexb

Key CIPHER

P This Cipher S rcry in FereSHg


TRCONCIICAORODRICGS COLLLG O INGINIRING

H E
A

K M N
S

S PH ER s E RY IN TE
D P P HE CF 2C DY ER UH

IN

LV

nrup itd +xt YDSPIPHECF QP 2C DY EK UH FCTOEK LVV

YD P P HE ZC DV EK U
S PH ER S E RRY TE

FC Tu LY
E ST N

d r y pttd tt THISIPHERISV ERY IN TERESTIN

wNe
H Gpher tD encrypthe m e s s a g e
12Vsig ounmy":Uscthe followng.
l y e in apcaccful
ASO de crypt mod 2 6
= PK
C E CKP) nE
Ic ou
fu
Ce 2
e a
2 4 20 13 1
VC S 20
e 24
21 4
22 4

24
Enod1 9 2 mod
6
C22 4
t u C2 [ = 20]

mod 26
L 13 7
o
=Va

Lee Ce a i 4 [ 7 33 10) mod 2

PS

L3B
d

mod 24
Lca a 7 : Lo is J|3 2 1 15 Io 5
23
xb

mod 26
z [ 40] 8
a 2

C2 8 J
TR (ONC
O RODRIGUFS COLLIGE OE ENGINEERIN

mi
LCi3 Ciy 2 473 2 220 32]
32] mod
mod 26
6
L5 1
Lo GG3
9

LCiS Ce J LS 20] |3 I Ss ISomod 24

L20

C7 9] L I2J 3 2 43 3) mod 24

L1 1o]

CC9 CoJ:[14 2oJ32 |t42 IC3]mod 16

L12 12

134J51med 26
rca L2 L3 11J 3 2 | L
Ls 1

e
Cas C |11 24] 47:Ln 20 2 mod 24
:Is 20
P
enuryp hed text: i u v a f s d b m i a Lg FKmmed pu

Decryph on P CK mod 2
nverse o m ahX

det )

adjoint .s -2

multplicatiyNe inv erse of 1 1s 11.

A
19*[ 3] mod 2

38 mod 24
1s

PI P21 [ s 20) mod 24

L22 4
e

CP 4: tai
o med 2s
H.COCEJC AO KODPIG.ES(
ALLi,FINML:2N

LPs P 5 8 J| mod 26

214
Ne

LPP: [ 3]3 4 mod 24<


S

L 13

CPo1:23 1 3 n o d 24
5J

Lr PL L12 3 14 mod 24

ea

mod
L S

C24
Ce
3 1 mad 2
LPiS Pie C 20

[ s 20]
fu

mod
2

LP1 Ps L7 1o J

C
29 7mod26
CP4 Pae L2

20

O
mo d 24

L13 14
nt

124
Ps Pa LIS 20 J 3 1mad

1 7 24

dcery ptr Hxt. we live in a pegceful couny

key I e s

13 De Ci pher the followin 9 pherkext usi0J

trans ÞOSIHO pher


taso''
e s t di hrtn psto C pcay o cpe
N nRIGES ((0LO EGINE FRING

li A d iphe transposihon uphr

transpasi

wth he ty 3 , 2,6,L
on KeY
upEr t of fhe
tnt ahon
ps

E 3 , " , 6 ,1,5.1)

decpon Key AT)

0 O

0
Phe «t eh ce
e
n
n

m tn z
mbt
Deedn

e h
3 Z z

4, 2,',6,5,3

V e

Decry pt d yt
behind *me tem ple n he eyen

You might also like