Ryukzak algoritmi


Download 172.44 Kb.
bet4/7
Sana09.06.2023
Hajmi172.44 Kb.
#1467333
1   2   3   4   5   6   7
Bog'liq
Ryukzak algoritmi

Shifrlash:

  1. BESH so’zini ASCII jadvali yordamida bit ko’rinishga o’tkazamiz:

01000010 01000101 01010011 01001000.

  1. Bitlardan iborat matnni 8 bitdan bloklarga ajratamiz va har bir blokni o’nlik sanoq sistemasiga o’tkazamiz: M1=66, M2=69, M3=83, M4=72.

  2. Ci= mod n. formula yordamida shifrlanadi:

C1= mod n = 6611 mod 1517 = (66*(665nod1517)2) mod 1517 = =(66*5322mod1517) mod 1517 = (66*862)mod1517=763,
C2= mod n = 6911 mod 1517 =1441,
C3= mod n = 8311 mod 1517 =821,
C4= mod n = 7211 mod 1517 =1097.
Hosil bo’lgan shifrtekst quyidagicha:C={763,1441,821,1097}
Shifrni ochish: Modul son n=p*q=1517, (p-1)*(q-1) ko’paytma bilan o’zaro tub bo’lgan e=11 ochiq kalit, matn uzunligi L=8 bit va C={763,1441,821,1097} bizga ma‘lum.

    1. e sonining (p-1)*(q-1)modul bo’yicha teskarisini topamiz:
      d=e-1mod((p-1)*(q-1))=11-1mod1440=11383mod1440=131

    2. Mi= mod n. formula yordamida shifrni ochamiz:

M1= mod n=763131mod1517=66, M2= mod n=1441131mod1517=69,
M3= mod n=821131mod1517=83, M4= mod n=1097131mod1517=72.

    1. Mi larni o’nlikdan ikkilikka o’tkazib, ASCII jadval yordamida harflarga o’tamiz va natijada M=BESH so’zi paydo bo’ladi.

Mustaqil ish uchun misollar.

  1. n=1517, e=11, C={ 413, 665, 620, 30 }, L=8 bit, M=?

  2. n=1517, e=11, C={ 593, 27, 763, 30 } L=8 bit, M=?

  3. n=1517, e=11, C={ 763, 30, 593, 27 }, L=8 bit, M=?

  4. n=1517, e=11, C={ 1270, 1408, 902, 665 }, L=8 bit, M=?

  5. n=1517, e=11, C={ 902, 1408, 620, 30 }, L=8 bit, M=?

  6. n=1517, e=11, C={ 13, 665, 1408, 1390 }, L=8 bit, M=?

  7. n=1517, e=11, C={ 1437, 1408, 902, 285 }, L=8 bit, M=?

  8. n=1147, e=11, C={162,881,767,753,162,516,881,753,139,881,894, 162,1109,894,229,881,162,894,890,162,1109}, L=8 bit, M=?

  9. n=1147, e=11, C={778,890,753,890,946,778,881,946,1109,139,881, 231,881,778,516,162,881,778}, L=8 bit, M=?

  10. n=1189, e=11,C={1071,416,529,50,368,1096,801,55,368,368,1096, 148,55,575,646,628,1096,495,50,529,352}, L=8 bit, M=?

  11. n=1189, e=11,C={220,1096,451,416,529,352,416,801,449,86,1096, 575,416,628,575,50,801,220,1096,451,368,50}, L=8 bit, M=? 12. n=341, e=13, L=6 bit, C={ 335, 161, 130, 276} M=?

  1. n=407, e=13, L=6 bit, C={ 280, 334, 235, 315} M=?

  2. n=341, e=13, L=6 bit, C={ 335, 232, 282, 226} M=?

  3. n=407, e=13, L=6 bit, C={ 280, 165, 261, 348} M=?

  4. n=341, e=13, L=6 bit, C={ 246, 112, 1, 293} M=?

  5. n=407, e=13, L=6 bit, C={ 280, 23, 185, 94} M=?

  6. n=341, e=13, L=6 bit, C={ 246, 198, 1, 226} M=?

  7. n=407, e=13, L=6 bit, C={ 288, 334, 235, 310} M=?

  8. n=341, e=13, L=6 bit, C={ 246, 161, 168, 130} M=?

  9. n=407, e=13, L=6 bit, C={ 280, 165, 312, 310} M=?

  10. n=341, e=13, L=6 bit, C={ 178, 161, 191, 151 } M=?

  11. n=407, e=13, L=6 bit, C={ 174, 23, 258, 382 } M=?

  12. n=341, e=13, L=6 bit, C={ 208, 208, 80, 132 } M=?

  13. n=187, e=13, L=6 bit, C={ 21, 21, 25, 33 } M=?

  14. n=209, e=13, L=6 bit, C={ 98, 98, 25, 154 } M=?

  15. n=209, e=7, L=6 bit, C={ 36, 19, 4, 2 } M=?

  16. n=209, e=13, L=6 bit, C={ 81, 98, 25, 204 } M=?

  17. n=187, e=13, L=6 bit, C={ 169, 21, 25, 6 } M=?

  18. n=341, e=7, L=6 bit, C={ 181, 145, 192, 271 } M=?

  19. n=187, e=7, L=6 bit, C={ 104, 47, 181, 7 } M=?

III. Rabin algoritmi
Bu shifrlash usuli 1979 yilda Maykl Rabin tomonidan chop etilgan. Algoritmning xavfsizligi katta tub sonlarga va ko’paytuvchilarga ajratish muammosiga asoslangan. Bunda ikkita katta tub son tanlanadi va ularning har birini to’rt soniga bo’lganda uch qoldiq chiqishi kerak. Bu sonlar yopiq kalit hisoblanadi. Ularning ko’paytmasi ochiq kalit hisoblanadi. p, q tub sonlar tanlanadi. Yuqoridagi shartga ko’ra ular quyidagilarni qanoatlantirishi kerak:
p mod4=3, q mod4=3.
Ochiq kalit n=p·q. M ochiq xabar va MShifrlash: C=M2 modn;

Download 172.44 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling