import libnum from Crypto.Util import number from functools import reduce from secret import flag
n = 5 size = 64 whileTrue: ps = [number.getPrime(size) for _ inrange(n)] iflen(set(ps)) == n: break
e = 65537 n = reduce(lambda x, y: x*y, ps) m = libnum.s2n(flag) c = pow(m, e, n)
print('n = %d' % n) print('c = %d' % c)
1 2
n = 175797137276517400024170861198192089021253920489351812147043687817076482376379806063372376015921 c = 144009221781172353636339988896910912047726260759108847257566019412382083853598735817869933202168
0x02 解题
从题目中的:
1 2 3 4 5 6
n = 5 size = 64 whileTrue: ps = [number.getPrime(size) for _ inrange(n)] iflen(set(ps)) == n: break