This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Crypto.Util import number | |
from secret import flag | |
nbit = 2048 | |
e = 65537 | |
p, q = number.getPrime(nbit//2), number.getPrime(nbit//2) | |
N = p * q | |
# N = 14871564779966647807710849781121809500530440168369963349377308901197803285619192987578333699960518148494391309500400834350235413916348349010881665475977014169857261456941575247369669695635975745695575650462258077595438693774208161879743121708431280489461785510815948783248837512615935739967100669884173960286905400419242769064214933385513190550471038684908409622471877199803893311107924150701348854249849421334035898230235882198863268374514022152610016824606857371732440610675267450448242632453712201631459133353269072394064023713666664658865870871502133929488104208880638866505781463327231845911539701761429945199541 | |
l1, l2 = 100, 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Crypto.Util.number import getPrime, bytes_to_long | |
import gmpy2 | |
from secret import hint,flag | |
assert len(hint)==28 | |
p, q = getPrime(1024), getPrime(1024) | |
N = p * q | |
# N = 17919584345306773018250341151907940471878342032767554777059134719728873514659570826793690035196966315710856522947232389386826868369798633208885707032628062730092268104330867495145614701247319287455290884236957679463764604587945278851853171744530901001743245364827898957560335262535932237980799249518493637308410256722396896178338217607523137033516145483686593860177910621944747227504080004840902792379769687077482677422789017549391579034871045742902124870675679997317704847436703294366189863130813107068622648834595237769403500006149462802467063207534750369850057260017680098485695416243056569110099636954503508734293L | |
lam = gmpy2.lcm(p-1, q-1) |