Skip to content

Instantly share code, notes, and snippets.

Avatar
🍊

Aleksei Udovenko hellman

🍊
View GitHub Profile
@hellman
hellman / dice_rejected.py
Last active May 15, 2022
DiceCTF 2021 - rejected
View dice_rejected.py
from sage.all import *
from rejected import LFSR, taps
from binteger import Bin
from sock import Sock
n = 64
N = 2**30 + 2**29
f = Sock("mc.ax 31669")
f.send_line(str(N))
@hellman
hellman / dice_psych.py
Last active Feb 6, 2022
DiceCTF 2022 - psych (crypto 500)
View dice_psych.py
from sage.all import ZZ, GF, EllipticCurve, proof
from hashlib import scrypt
from sock import Sock
from psych import sidh, xor, G, H
proof.all(False)
def ser(*args):
@hellman
hellman / 0raccoon.ipynb
Last active Jul 3, 2021
CTFZone 2021 - Raccoon
View 0raccoon.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hellman
hellman / write.ipynb
Last active Feb 28, 2021
AeroCTF 2021 - Horcrux (Crypto)
View write.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hellman
hellman / coll.py
Last active Jan 14, 2021
HXP CTF 2020 - Octothorpe (Crypto Hard)
View coll.py
'''
The idea is to reach a state consisting of 00 and FF bytes.
Because of the independence of shifts values, if the message block is the same 32-byte part repeated 2 times,
the state is preserved. We then can change the 32 byte part arbitrarily and keep the hash value unchanged.
To do this we first craft a 32x2 message block that lands on such state after 2nd round (1st round does nothing).
We have 32 bytes of freedom (-charset constraints), so this is reasonable and can be done with 1 byte guess and propagation.
One caveat is that the initial state is rather symmetric and and it's not always easy to land on a desired state,
so we prepend random block first to randomize the state.
@hellman
hellman / Makefile
Last active Dec 13, 2020
ASIS CTF 2020 Finals - Trio Color (3DES)
View Makefile
prepare:
mkfifo p1 p2
precomp:
./stage1_precomp
du -hs dump*
# 17G dump0
# 17G dump1
# 17G dump2
# 17G dump3
@hellman
hellman / multicrc_solve.py
Created Sep 6, 2020
ALLES! CTF 2020 - crccalc1,2 (Crypto)
View multicrc_solve.py
from sage.all import *
from crccheck.crc import *
def tobin(v, n):
assert 0 <= v < 2**n
return tuple(ZZ(v).digits(2, padto=n))[::-1]
def frombin(v):
return sum(int(c)*2**i for i, c in enumerate(v[::-1]))
@hellman
hellman / FibHash.ipynb
Last active Mar 25, 2021
CONFidence 2020 CTF Finals - FibHash (Crypto 421)
View FibHash.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hellman
hellman / gengol.ipynb
Created Aug 16, 2020
2nd Crypto CTF 2020 - GenGol
View gengol.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hellman
hellman / 0writeup.ipynb
Last active Oct 24, 2020
RCTF 2020 - infantECC
View 0writeup.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.