Você está na página 1de 11

Ministry of Education and Science of Ukraine

Odessa national academy of telecommunications


Named after A. S. Popov

Complex task
on protection of information

Done by student:
Nom.z.
m
Of the group:
TE 4.01
Variant 15

Checked by:
Kondratieva N. V.

Odessa 2014

Task 2.
2.1 General structure of RSA algorithm and signatures on the basis
of RSA algorithm:
Public key:

n - is multiplication of two prime numbers p and q (p


and q must be kept in secret);
e - is the key of encryption, a number is mutual simple with the function
of Euler (, (n)) = 1 and
e (n).

Secret key:

d e1 (mod (n)) is the key of decryption.

Encryption:

C M (mod n).

Decryption:

M Cd (mod n).

Signature:

S Md (mod n).

Decryption of
signature:

M Se (mod n).

2.2 Subscriber A generates the keys on the RSA algorithm.


of variant

15

11

13

18, 26, 47

Message =15
1. n = p*q = 11*13 = 143
2. (n) = (p 1)(q 1)=(11 1)(13 1)=10*12=120
2.3 Subscriber B encrypts and
subscriber A, subscriber A decrypts it.
1. C M (mod n)

passes

message

to

the

On this step it is necessary to choose the number e so that it was coprime


with (n):
C M (mod n) 4726(mod143)
26 = 16 + 8 + 2 =26
261(mod143) =26
262(mod143) = 104
264(mod143) = 1042(mod143) = 10816(mod143) = 91
268(mod143) = 912(mod143) = 8281(mod143) = 130
2616(mod143) = 1302(mod143) = 16900(mod143) = 26
C = 104*130*26(mod143) = 351520(mod143) = 26
2. M Cd (mod n)
On this step it is necessary to find the number d that satisfies the condition
d e1 (mod (n))
n

Y = Z mod
X

H = Z div
X

26

64

26

120

26

10

2x1+0=2

26

10

2x2+1=5

10

1x5+2=7

2x7+5=19

Pi=HiPi-1+Pi-2(mod
n)

d=(1)-5x19(mod120) = -19(mod120) > -19 + 64 = 45


M = Cd (mod n) = 2645(mod143)
45 = 32 + 8 + 4 + 1
261(mod143) = 26
262(mod143) = 104
264(mod143) = 108162(mod143) = 91
268(mod143) = (mod143) = 130

3x19+7=64

2616(mod143) = (mod143) = 26
2616(mod143) = (mod143) = 104
2632(mod143) = (mod143) = 91
M = 91*130*91*26(mod143) = 27989780(mod143) = 104
2.4 Subscriber A signs a message by secret RSA key. Subscriber B
checks up a signature.
S Md (mod n) 2545(mod85)
45 = 32 + 8 + 4 + 1
1041(mod143) = 104
1042(mod143) = 91
1044(mod143) = 130
1048(mod143) = 26
10416(mod143) = 104
10432(mod143) = 91
S = 26*91*26*91(mod85) = 5597956(mod143) = 78
Decryption of signature:
M Se (mod n) = 7827(mod85)
27 = 16 + 8 + 2 + 1
781(mod143) = 78
782(mod143) = 78
784(mod143) = 78
788(mod143) = 78
7816(mod143) = 78
M = 78*78*78*78(mod143) = 37015056(mod143) = 78

Task 3.

2.1 General description of El-Gamal algorithm work:


Key generation

A generates an efficient description of a cyclic group


order with generator . A chooses a random
from
.

A computes

Encryption

of

A publishes , along with the description of


, as
his public key. A retains as his private key which must be
kept secret.

B chooses a random
calculates
.

from

B calculates the shared secret

B converts his secret message

, then

.
into an element

of

B calculates

B sends the

ciphertext
Decryption

to A.

A calculates the shared secret

and then computes


back into the plaintext message
inverse of in the group .

The decryption algorithm produces the intended message,


since

which he then converts


, where
is the

3.2 Subscriber B generates the keys on the El-Gamal algorithm.


of
variant

ka

Kb

15

43

13

16

18

Message =14
Y = qka(modp) = 1316(mod43)
16 = 16+2

131(mod43)=13
132(mod43)=40
134(mod43)= 402(mod43)=9
138(mod31)= 92(mod43)=38
Y = 38 * 9 * 40 (mod 43) = 14
Open key:

Secret key:

Y = 16

Ka = 16

q = 13

P = 43

p = 43

3.3 Subscriber A encrypts a message on the El-Gamal algorithm,


subscriber B decrypts accepted message.
1) R = YKb(modp) = 1418(mod31)
18 = 16 + 2
161(mod43)=16
162(mod43)= 256(mod43)=41
164(mod43)= 412(mod43)=4
168(mod43)= 42(mod43)=16
1616(mod43)= 162(mod43)=41
R = Y = 41 * 41 (mod 43) = 1681(mod43) = 4
2) Z = qKb(modp) = 1121(mod31)
21 = 16 + 4 + 1
111(mod43)=11
112(mod43)=35
114(mod43)=21
118(mod43)=11
1116(mod43)= 112(mod43)=35
Z = 35 * 35 (mod 43) = 1225 (mod 43) = 21

C = MR = 148 = 11101000=0110=6
Values C, Z are transmitted. Deciphering:
R = Zka(modp) = 2716(mod31)
16 = 8 + 8
211(mod43) = 23
212(mod43) = 13
214(mod43) = 169(mod43) = 40
218(mod43) = 1600(mod43) = 9
R = 2*8*16(mod31) = 8
M = CR = 88= 01101000 = 1110 = 21

Task 4.
4.1 Structure of Diffi-Khellman algorithm:
1. Both subscribers have same prime number P and common mantissa D<(P-1) before
communication session start.
2. Every subscriber (1-st and 2-nd) chooses any natural number with conditions 1<X1<(P-1) and
1<X2<(P-1)
3. Every subscriber using own number X calculates Y1 D X1 (mod P ) and Y2 D X 2 (mod P)
4. Subscribers change with Y1 Y2 values between themselves by open channel.
5. Every subscriber calculates session key for ciphering for symmetric algorithm by the next
formulas: K12

Y2 1 (mod P) Y1 2 (mod P)
Communication Channel

p, D, X1

Y1 D (mod p)

p, D, X2

X1

Subscriber

Subscriber

Y2 D (mod p)
X2

Y2X (mod p)

Y1X (mod p)

4.2 Subscribers A and B produce the general session key on the


Diffi-Khellman algorithm.
of variant

kb

15

50

15

16

Number p = 101
Ya = aka(modp) = 5015(mod101)
15 = 8 + 4 + 2 + 1
501(mod101) = 50
502(mod101) = 76
504(mod101) = 762(mod101) = 5776(mod101) = 19
508(mod101) = 192(mod101) = 361(mod101) = 58
Ya=58*19*76*50(mod101) = 4.187.600(mod101) = 39

Yb = akb(modp) = 5016(mod101)
501(mod101) = 50
502(mod101) = 76

504(mod101) = 19
508(mod101) = 58
5016(mod101) = 582(mod101) = 3364 (mod101) = 31

Calculation of symmetrical key:


Ks =

(modp) =

(modp)

For subscriber A:
Ks=3115(mod101)
15 = 8 + 4 + 2 + 1
311(mod101) = 31
312(mod101) = 961(mod101) = 52
314(mod101) = 522(mod101) = 2704(mod101) = 78
318(mod101) = 782(mod101) = 6084(mod101) = 24
Ks=24*78*52*31(mod101)=87
For subscriber B:
Ks=3916(mod101)
391(mod101) = 39
394(mod101) = 1521 (mod101) = 6
394(mod101) = 62(mod101) = 36
398(mod101) = 362(mod101) = 1296(mod101) = 84
3916(mod101) = 842(mod101) = 7056(mod101) = 87

Calculator rates
System
Express
Number events: 20

Você também pode gostar