sra
This commit is contained in:
25
sra/chal.py
Executable file
25
sra/chal.py
Executable file
@@ -0,0 +1,25 @@
|
||||
from Crypto.Util.number import getPrime, inverse, bytes_to_long
|
||||
from string import ascii_letters, digits
|
||||
from random import choice
|
||||
|
||||
pride = "".join(choice(ascii_letters + digits) for _ in range(16))
|
||||
gluttony = getPrime(128)
|
||||
greed = getPrime(128)
|
||||
lust = gluttony * greed
|
||||
sloth = 65537
|
||||
envy = inverse(sloth, (gluttony - 1) * (greed - 1))
|
||||
|
||||
anger = pow(bytes_to_long(pride.encode()), sloth, lust)
|
||||
|
||||
print(f"{anger = }")
|
||||
print(f"{envy = }")
|
||||
|
||||
print("vainglory?")
|
||||
vainglory = input("> ").strip()
|
||||
|
||||
if vainglory == pride:
|
||||
print("Conquered!")
|
||||
with open("/challenge/flag.txt") as f:
|
||||
print(f.read())
|
||||
else:
|
||||
print("Hubris!")
|
||||
Reference in New Issue
Block a user