Biz 8 ta qadamda natichaga (ochiq matn) erishdik!!!




Download 201,5 Kb.
Pdf ko'rish
bet4/4
Sana27.07.2024
Hajmi201,5 Kb.
#268786
1   2   3   4
Biz 8 ta qadamda natichaga (ochiq matn) erishdik!!!


ILOVA
 
Dastur kodi:
Ps: Biz bu kodlarni python dasturlash tilida yozdik.
import math
def f(x, n):
return (x * x + 1) % n def 
loyiha_ish(n):
x = 2 y = 
2
boluvchi = 1
i = 0
while boluvchi == 1:
x = f(x, n) y = 
f(f(y, n), n)
print(f"x({i}) = {x}")
print(f"y({i}) = {y}")
i += 1
boluvchi = math.gcd(abs(x - y), n)
print(f"EKUB(|x-y|,n)={boluvchi}") if 
boluvchi == n: return None
else:
return [boluvchi, n // boluvchi]
n =
int("3521965691682498349894156297871351510003392837134480208222044"


"4753957752560806765915557404471872854222134926440656261548716"
"5251895509139075621688493447805478090729096096693340629223579" 
"5059531555148850225316762953811321830535065868925602454064437" 
"6849173366230815779694365269990430445181132796913932904941185"
"478344783047790284034086549612594449881")
numbers = loyiha_ish(n) 
p = numbers[0] q = 
numbers[1] print(f"p = 
{p}") print(f"q = {q}") 
# Keyingi qadam:
c =
int("1946990934266279413917993964398835970466043305162067149027416"
"2053008128349816033069247844970800863920955661712219866590366"
"9590908102703307250646216395967327417349581565673419272952219"
"8445430968778476727718084419319887006224079130320273805411547"
"7138201099392091672934450078062438509784548210810385639731494"
"7527381565904894782921374911825451607")
q =
int("309891667546360778046499718781557673007508350025387550972839350 
9"
"98744943685393982481905598554268594569131526106931754414514765007 
609"
"61938733812295783151626364715549900758671969538864637994361280253 
879"
"98564380005561829893471856363325810237480997216190372833199473422 
687"


"39196994844525401961864948661966311285816762875897185527881147887 
1")
p
= 11365151311
q
= int(q)
e = 65537
c = int(c)
Ф = (p - 1) * (q - 1) 
d = pow(e, -1, Ф) 
print(f"Ф(n)= {Ф}") 
print(f"d = {d}") m 
= pow(c, d, n)
print(f"OCHIQ MATIN : M = {m}")

Download 201,5 Kb.
1   2   3   4




Download 201,5 Kb.
Pdf ko'rish

Bosh sahifa
Aloqalar

    Bosh sahifa



Biz 8 ta qadamda natichaga (ochiq matn) erishdik!!!

Download 201,5 Kb.
Pdf ko'rish