2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00
LaTeX-examples/documents/facharbeit-rsa/Factoring.ari
2013-05-07 22:36:03 +02:00

11 lines
424 B
Text

# Gegebener Öffentlicher Schlüssel N = p*q und e sowie Geheimtext y
N := 6593724735903381194175738064212775889771.
e := 47.
y := 6508724329196926526021005674657658127499.
p := ec_factorize(N). # 6890701303127411
q := N div p. # 956207997714884457630761
phi := (p-1)*(q-1). #6588943695914805815679579653627015131600
d := mod_inverse(e, phi).
cc := byte_string(y).
z := y**d mod N.
string(byte_string(z)).