Skip to content

Instantly share code, notes, and snippets.

View rot256's full-sized avatar

Mathias Hall-Andersen rot256

View GitHub Profile
[email protected] AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIN1gpUMh//f4gyrQ4JgLdrFsv8sc8oCJBcjB5lpclpQCAAAABHNzaDo= rot256@digit
@rot256
rot256 / public-key.asc
Created January 24, 2025 15:45
My PGP Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFdJtPsBEAD5nXy+MWGA5JjWMaT9Si8pgzSI8RTxHWxBTnun5pEqFMmNflhU
k3FDCSvW5zdm5zccYH+bqoHX7hHuDl9IhCGhzgbiTtVOctQMz0DN5SBMVrrwz/zi
aAxsYQT0pfWey4A7q6TSTZhToZOQH+mjR+b6p9w0t1HP73YqNjr7OEFBdaJS9RZG
sxD142PubPn1PV2Db7xP+nXxPal884Okbwy2gjrITG91x9IoDYa6Z+RtVwM8E10/
i8b6sGHXoN8Yk5adcj9NmXz2q2kVT7nGUr93mx0zzjDnYNEhFJg+gHyRB5W8ru5m
9IaKyrHWLJZoGYYw6ttWX5Q8AyyTYWSZ58eChfAT+BKSLnTYLpYfpeWVXdpd4tyY
nQqYGOn2gpBZtTzzRuyDX6ONnQVA/e6fFBCsOkSvUQ2mVALZq1VZ+DTmosTm6mbv
tAwMfABALXYi5oiyPoyFO/P24/LC2tbgwrcHDXfJRmyI0B+3F6tk7RbXQjZn8cuE
@rot256
rot256 / mem.sh
Created January 13, 2025 17:14
Script to track maximum memory of process and all childen using cgroups
#!/bin/bash
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
# Check if a command was provided
if [ $# -eq 0 ]; then
@rot256
rot256 / gen-ff.sage
Created November 4, 2022 20:55
Sage script to generate an ark_ff field implementation
import sys
LIMB = 64
mod = int(sys.argv[1]) if len(sys.argv) > 1 else 28948022309329048855892746252171976963363056481941560715954676764349967630337
name = sys.argv[2] if len(sys.argv) > 2 else 'Fp'
bits = int(mod).bit_length()
limbs = (bits + LIMB - 1) // LIMB
size = limbs * LIMB
processor : 15
vendor_id : GenuineIntel
cpu family : 6
model : 141
model name : 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
stepping : 1
microcode : 0x34
cpu MHz : 2300.000
cache size : 24576 KB
physical id : 0
@rot256
rot256 / deep-fri.sage
Created April 13, 2020 19:00
DEEP-FRI Algebraic Hash
e = 128
E.<X> = GF(2^e) # E = GF(2^e)
P.<Y> = PolynomialRing(E) # P = GF(2^e)[Y]
F = E.base_ring() # F = GF(2)
V = VectorSpace(F, e) # V = (GF(2))^e
# isomorphism \phi : E -> V
def to_vector(elem):
assert elem in E
coeff = map(F, '{:b}'.format(elem.integer_representation())[::-1])
@rot256
rot256 / victim.c
Created February 28, 2020 20:38
Glitching attack on Atmega328
#include <avr/io.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <util/delay.h>
#include "aes.h"
#define UART_BAUD 9600
@rot256
rot256 / doit.py
Created May 18, 2019 19:15
3DES-HMAC Exploit
#!/usr/bin/env python
import sys
from pwn import *
from base64 import urlsafe_b64decode, urlsafe_b64encode
from oracle import PaddingOracle
from hashpumpy import hashpump
import requests
@rot256
rot256 / oracle.py
Created May 14, 2019 15:20
Simple CBC Padding Oracle Library
import sys
ASCII = set(
map(chr, range(0x20, 0x7f)) +
['\t', '\n']
)
def xor(*args):
if len(args) > 2:
xs, ys = args[0], xor(*args[1:])
@rot256
rot256 / cons.py
Last active December 13, 2018 09:18
Construct Random Relations For Flag Check
import sys
import random
EQ_CNT = 24
RN_CNT = 10
passwd = sys.argv[1]
rnd = lambda n: [random.randrange(0x1, 0x100) for _ in range(n)]
assert len(passwd) > 4