Skip to content

Instantly share code, notes, and snippets.

Avatar
🍊
Something

Aleksei hellman

🍊
Something
View GitHub Profile
@hellman
hellman / writeup.ipynb
Created May 3, 2020
De1CTF 2020 - Mini Pure Plus
View writeup.ipynb
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 Apr 19, 2020
PlaidCTF 2020 - MPKC (Crypto 350)
View 0_solve.sage
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 Feb 14, 2020
Codegate 2020 Quals - Munch (Crypto 750)
View 0_chall.py
#!/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 Feb 13, 2020
Codegate 2020 Quals - Polynomials (Crypto 810)
View 1_solve.sage
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 Dec 1, 2019
CTFZone 2019 Quals - NTRU (Crypto - Hard)
View ctfzone2019_ntru_active_attack.py
#!/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 Oct 20, 2019
SECCON 2019 CTF Quals - Crazy Repetition of Codes (crypto)
View crazy_repetition_of_code.ipynb
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 Oct 15, 2019
HITCON CTF 2019 Quals - Randomly Select a Cat
View randomly_select_cat.ipynb
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 Oct 14, 2019
HITCON CTF 2019 Quals - Very Simple Haskell (crypto)
View very_simple_haskell.ipynb
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 Oct 14, 2019
HITCON CTF 2019 Quals - Not So Hard RSA (crypto)
View not_so_hard_rsa.ipynb
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 Oct 14, 2019
HITCON CTF 2019 Quals - Lost Key Again (crypto)
View lost_key_again.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.