Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

简单的 babyRSA,附件是一个python脚本。如下:
#!/usr/bin/env python

-- coding: utf-8 --

import random
from gmpy2 import *
from Crypto.Util.number import *
from secret import FLAG

m = bytes_to_long(FLAG)
p = getPrime(540)
q = getPrime(540)
N = p * q

E = next_prime(e ^ ((1 << 200) - 1))
enc = pow(m, e, N)
thread = q ** 5 - p ** 4

print("N =", N)
print("E =", E)
print("enc =", enc)
print("thread =", thread)

'''
N = 9045960754926809696017918039291390324132430713098706666392528816327129289392484230578196176508493930746244851877823027965772343088755379993741290093829669708751153587083558069268153545410584381336330743362650626929437704404423064316100958903688167806133136204579167284209479255638040729358858288017045459050018700015330692719
E = 509701035510029094316633323115635044514216918396202158789989
enc = 2499997609430354666167073116212706559336386151120922193205744842944616449845915292140062489397711377859105425038319425861430377821316082670226837870317571679221880584591554767004850274894506109175380211492260564538359426832397543383627970671575901040082556384854821453473037706220953554837201487126688150622168102315298325424
thread = 418731459008601767622607891590920314481289144904309220682216056977607771623210799878682897888886432951918495269814054382715997660539559524873675197692911183820735094577358669991410133736801613747858506659153995636907969881722344977241027894628387923290533982368315345730145885348899916392346994378654019504806851979361704672200869016342076816375198535664082691481406715821193140166308997262381552792352901867821796463353496594495536860518039628307796690348185669336660803091191489548772911490991670722042373428149222515866530400466989492280686872912263678793228705913211874643563331242944275642779279924349389381443696005556009072612336870483467999667612937140900164314494932471360799681929033856535538277719430004510126002692815254525499599745492238746900175907329293961236880657618597389851774142212780495061032
'''
babyRSA的附件.zip

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.