Skip to content

Instantly share code, notes, and snippets.

View grocid's full-sized avatar

Carl Löndahl grocid

View GitHub Profile
%% ROFdenoise
%
% Copyright (c) 2022, Carl Löndahl & Philippe Magiera
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are met:
%
% Redistributions of source code must retain the above copyright notice,
% this list of conditions and the following disclaimer.
% Redistributions in binary form must reproduce the above copyright notice,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from pwn import *
L, zz, m = 1024, 15, 3
def H(params, msg, u):
K, m = params
r, z = K.characteristic(), K.gens()[0]
h = 0
while msg > 0:
h *= z
h += msg % r
#; -*- mode: python;-*-
# This is an implementation of the Nguyen-Stern algorithm, and of our new multivariate attack
# To run the Nguyen-Stern algorithm, run the function NSattack().
# To run all the experiments with the Nguyen-Stern algorithm, run the function statNS().
# We provide the experimental results below.
# To run our algorithm, run the function multiAttack().
# To run all the experiments with our algorithm, run the function statMulti().
import os
import math
import random
import multiprocessing
THREADS = multiprocessing.cpu_count()
def close_factor_worker(n, delta, ub, ret):
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Secure enclave challenge @WPICTF

Looking at the decompiled secure_enclave.ko, we find

// read back to struct
iVar1 = enclave_read(auStack552,param_3,param_3,0);

...
@grocid
grocid / gf_mul.py
Last active October 28, 2019 23:19
Exponentiation in GF2[x]/P(x)
import math
poly = 0xa195150d15*2+1
degree = int(math.log(poly)/math.log(2))
f = (1 << degree)
def multiply(a, b, poly):
r = 0
for i in range(64):
if ((a & (1 << i)) != 0):
@grocid
grocid / appelgrens.py
Created September 20, 2019 14:45
SEC-T CTF appelgrens
from hashlib import sha256
from pwn import *
s = remote("appelgrens-01.pwn.beer", 31337)
user = "admin "
print [sha256(user).digest().decode("cp1252")]