-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmore.py
More file actions
23 lines (17 loc) · 1.16 KB
/
more.py
File metadata and controls
23 lines (17 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from Crypto.Util.number import long_to_bytes, bytes_to_long, inverse
import base64
p = 28064707897434668850640509471577294090270496538072109622258544167653888581330848582140666982973481448008792075646342219560082338772652988896389532152684857
q = 20423438101489158688419303567277343858734758547418158024698288475832952556286241362315755217906372987360487170945062468605428809604025093949866146482515539
e = 68180928631284147212820507192605734632035524131139938618069575375591806315288775310503696874509130847529572462608728019290710149661300246138036579342079580434777344111245495187927881132138357958744974243365962204835089753987667395511682829391276714359582055290140617797814443530797154040685978229936907206605
n = p*q
phi = (p-1) * (q-1)
d = inverse(e,phi)
with open("flag.64","r") as file:
content = file.read()
# ===== chatgpt because im lazyyyy ===============================
# Decode the base64 string to bytes
binary_data = base64.b64decode(content)
# Convert the bytes to an integer (decimal)
decimal_value = int.from_bytes(binary_data, byteorder='big')
# ==============================================================
print(long_to_bytes(pow(decimal_value,d,n)))