Skip to content

Instantly share code, notes, and snippets.

@baotang2118
Last active November 6, 2019 08:35
Show Gist options
  • Save baotang2118/d998db1f08d140e48cc3863ab2d48dec to your computer and use it in GitHub Desktop.
Save baotang2118/d998db1f08d140e48cc3863ab2d48dec to your computer and use it in GitHub Desktop.
import gmpy2
n=374159235470172130988938196520880526947952521620932362050308663243595788308583992120881359365258949723819911758198013202644666489247987314025169670926273213367237020188587742716017314320191350666762541039238241984934473188656610615918474673963331992408750047451253205158436452814354564283003696666945950908549197175404580533132142111356931324330631843602412540295482841975783884766801266552337129105407869020730226041538750535628619717708838029286366761470986056335230171148734027536820544543251801093230809186222940806718221638845816521738601843083746103374974120575519418797642878012234163709518203946599836959811
e=3
cipher=2205316413931134031046440767620541984801091216351222789180582564557328762455422721368029531360076729972211412236072921577317264715424950823091382203435489460522094689149595951010342662368347987862878338851038892082799389023900415351164773
with gmpy2.local_context(gmpy2.context(), precision=300) as ctx:
root = gmpy2.cbrt(cipher)
print (root)
abc = (int(root))
print abc
#13016382529449106065839070830454998857466392684017754632233906857023684751222397
hex0 = str(hex(abc))
print hex0
#0x7069636f4354467b655f7734795f7430305f736d3431315f38316236353539667dL
ascii = str(hex0)[2:len(hex0)-1].decode('hex')
print ascii
#picoCTF{e_w4y_t00_sm411_81b6559f}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment