Skip to content

Instantly share code, notes, and snippets.

View sea0h7e's full-sized avatar
🍋
:P

sea0h7e sea0h7e

🍋
:P
View GitHub Profile
@sea0h7e
sea0h7e / 0_sol.sage
Created October 17, 2019 11:56
HITCON CTF 2019 Quals - not so hard RSA (Crypto, 371pts, 6 solves)
# https://pdfs.semanticscholar.org/2d85/9e8937fe652558a60e82ffd39cd4ab835e31.pdf, Section4.4
# As LLL is not precise for there are only 10 public keys, so I use Babai instead.
# Just randomly construct the target vector, if it is close enough to (dM, 1−k1Λ1, ..., 1−krΛr), we may recover d.
from Crypto.Util.number import *
import random
k = 10
f = open('output', 'rb')
f.readline()
@sea0h7e
sea0h7e / 0_sol.sage
Created October 9, 2019 03:52
PwnThyBytes CTF 2019 - LOTR (Crypto, 936pts, 5 solves)
import hashlib
from random import randint
f = open('gov_officials_PK.txt')
pk = []
while True:
try:
pk.append(int(f.readline()))
except:
break
@sea0h7e
sea0h7e / 0_sol.py
Created October 8, 2019 07:54
InCTF2019 - cookiegen (Crypto, 951 pts, 8 solves)
from pwn import *
from Crypto.Util.number import *
import hmac
from hashlib import md5
context.log_level = 'critical'
p = 337333846325195852023465984016735747017640658020735865443882234978293187151183899366894634062588357161
def register(name, base):
con = remote('18.216.251.207', 3197)