Skip to content

Instantly share code, notes, and snippets.

View hellman's full-sized avatar
🍊

Aleksei Udovenko hellman

🍊
View GitHub Profile
@hellman
hellman / writeup.ipynb
Created May 3, 2020 20:53
De1CTF 2020 - Mini Pure Plus
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hellman
hellman / 0_solve.sage
Last active April 19, 2020 22:24
PlaidCTF 2020 - MPKC (Crypto 350)
from sage.all import *
import sys
q,n,a,s = (3,59,10,25)
m = n+1-a+s
FF = GF(q)
R = PolynomialRing(FF, ["x{}".format(i) for i in range(n)])
xs = R.gens()
pk, ct = open("output").readlines()
@hellman
hellman / 0_chall.py
Created February 14, 2020 18:13
Codegate 2020 Quals - Munch (Crypto 750)
#!/usr/bin/env python3
from Crypto.PublicKey import RSA
from Crypto.Util.number import getPrime, bytes_to_long as b2l
from itertools import cycle
from random import randint
class reveal:
def __init__(self, info, bitlen):
self.coeff = cycle(info)
@hellman
hellman / 1_solve.sage
Last active February 13, 2020 20:53
Codegate 2020 Quals - Polynomials (Crypto 810)
from os import urandom
from Crypto.Util.number import long_to_bytes as l2b
from Crypto.Util.number import bytes_to_long as b2l
from Crypto.Cipher import AES
from data import *
load("chall.sage")
keys = []
@hellman
hellman / ctfzone2019_ntru_active_attack.py
Last active December 1, 2019 21:26
CTFZone 2019 Quals - NTRU (Crypto - Hard)
#!/usr/bin/python3
"""
The decryption looks like this:
(f * ctpol) % q * inverse(f, mod 3) % 3
Note that;
- (f) is a "small" polynomial (61 values 1 and -1, others are zero).
- (% q) is done to [-63; 64]
If (f*ctpol) does not wrap over q
@hellman
hellman / crazy_repetition_of_code.ipynb
Last active October 20, 2019 13:47
SECCON 2019 CTF Quals - Crazy Repetition of Codes (crypto)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hellman
hellman / randomly_select_cat.ipynb
Created October 15, 2019 09:43
HITCON CTF 2019 Quals - Randomly Select a Cat
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hellman
hellman / very_simple_haskell.ipynb
Created October 14, 2019 14:55
HITCON CTF 2019 Quals - Very Simple Haskell (crypto)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hellman
hellman / not_so_hard_rsa.ipynb
Last active October 14, 2019 13:53
HITCON CTF 2019 Quals - Not So Hard RSA (crypto)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hellman
hellman / lost_key_again.ipynb
Last active October 14, 2019 13:52
HITCON CTF 2019 Quals - Lost Key Again (crypto)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.