16 lines
889 B
Python
16 lines
889 B
Python
from flag import flag
|
|
from Crypto.Util.number import *
|
|
from sympy import nextprime
|
|
|
|
p = getStrongPrime(512)
|
|
q = nextprime(p)
|
|
n = p * q
|
|
e = 65537
|
|
message = bytes_to_long(flag)
|
|
cipher = pow(message, e, n)
|
|
print('n = ', n)
|
|
print('cipher = ', cipher)
|
|
'''
|
|
n = 131218645413263355153882609539056016131417346313857164694985244482795553321017628052409848109502464613127315618163239570703997367565089679231386965428337884937201599530967017131631155141474278378404319209291510075037073905863337674016959942427881314862079017726040171724955667479955452318495669802898606424779
|
|
cipher = 26956916426221432592724280571104585450884434311786111534684952145936843234803020133270687335772238641092604523138936635434436452351638173961249648611694741353332785924630668149684381852459140144587038595053081706954959823271114216030131967673910349569926570370812503337360887328344577462535615172014761814718
|
|
''' |