fix: add flag
This commit is contained in:
parent
81f6dae484
commit
c08b46c9de
3
crypto/easy_rsa/cipher.txt
Normal file
3
crypto/easy_rsa/cipher.txt
Normal file
@ -0,0 +1,3 @@
|
||||
n = 412185872968401257793868364974500949106246851673
|
||||
e = 65537
|
||||
cipher = 238402953668524899208063558207075404357269541120
|
@ -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)
|
||||
@ -15,4 +13,8 @@ cipher = pow(flag, e, n)
|
||||
print(cipher)
|
||||
flag = pow(cipher, d, n)
|
||||
flag = long_to_bytes(flag)
|
||||
print(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
1
crypto/easy_rsa/flag.py
Normal file
@ -0,0 +1 @@
|
||||
flag = b"0xFA{F4ct0r_Pr1me}"
|
Loading…
x
Reference in New Issue
Block a user