architecture/docs/workshop/5-snake-oil-crypto/hands-on-support/SmallKey/answers/crackSmallKey.sage.py

14 lines
639 B
Python

# This file was *autogenerated* from the file crackSmallKey.sage
from sage.all_cmdline import * # import sage library
_sage_const_8464481006489090994506453371545747140045883416875197642486592854169 = Integer(8464481006489090994506453371545747140045883416875197642486592854169); _sage_const_0 = Integer(0)
n = _sage_const_8464481006489090994506453371545747140045883416875197642486592854169
print("Factorizing n = {}".format(n))
p, q = factor(n)
print("p = {}".format(p[_sage_const_0 ]))
print("q = {}".format(q[_sage_const_0 ]))
print("{} * {} = {}".format(p[_sage_const_0 ], q[_sage_const_0 ], p[_sage_const_0 ]*q[_sage_const_0 ]))