fix: add flag

This commit is contained in:
sangge 2023-11-01 15:26:25 +08:00
parent 81f6dae484
commit c08b46c9de
3 changed files with 13 additions and 7 deletions

View File

@ -0,0 +1,3 @@
n = 412185872968401257793868364974500949106246851673
e = 65537
cipher = 238402953668524899208063558207075404357269541120

View File

@ -1,11 +1,9 @@
from Crypto.Util.number import *
import os
from flag import flag
flag = os.getenv("FLAG")
flag = b"flag{wow}"
flag = str2long(flag)
p = getPrime(64)
q = getPrime(64)
flag = bytes_to_long(flag)
p = getPrime(80)
q = getPrime(80)
n = p * q
e = 65537
print(n)
@ -16,3 +14,7 @@ print(cipher)
flag = pow(cipher, d, n)
flag = long_to_bytes(flag)
print(flag)
with open("cipher.txt", "w") as f:
f.write(f"n = {n}\n")
f.write(f"e = {e}\n")
f.write(f"cipher = {cipher}\n")

1
crypto/easy_rsa/flag.py Normal file
View File

@ -0,0 +1 @@
flag = b"0xFA{F4ct0r_Pr1me}"