repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/KITCTFCTF/2022/pwn/date/server.py | ctfs/KITCTFCTF/2022/pwn/date/server.py | import tempfile
import signal
import base64
import binascii
from pwn import *
import sys
def handler(signum, frame):
raise OSError("Wakeup")
def main():
signal.signal(signal.SIGALRM, handler)
signal.alarm(60)
try:
b64 = input("Base64 encoded file: ").strip()
except EOFError:
ret... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/KITCTFCTF/2022/pwn/sys_jail/deploy/pow.py | ctfs/KITCTFCTF/2022/pwn/sys_jail/deploy/pow.py | import os
import subprocess
import sys
DIFFICULTY = 26
def check(r, token):
return subprocess.call(["hashcash", f"-cyqb{DIFFICULTY}", "-r", r, token]) == 0
def main():
if len(sys.argv) != 2:
print("No command provided", flush=True)
exit()
r = os.urandom(8).hex()
print(f"Send the result of: hashcash -mb{D... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/KITCTFCTF/2022/pwn/movsh/deploy/server.py | ctfs/KITCTFCTF/2022/pwn/movsh/deploy/server.py | from capstone import *
import subprocess
import tempfile
import signal
MAX_SHELLCODE_LEN = 250
md = Cs(CS_ARCH_X86, CS_MODE_64)
def handler(signum, frame):
raise OSError("Wakeup")
def verify_shellcode(shellcode):
# bypassing this filter is not intended
# however if you come up with a bypass feel free... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/KITCTFCTF/2022/crypto/PrimeGuesser1/PrimeGuesser1.py | ctfs/KITCTFCTF/2022/crypto/PrimeGuesser1/PrimeGuesser1.py | #!/usr/bin/env python3
import numpy as np
from numpy.polynomial import polynomial as poly
import random
def polymul(x, y, modulus, poly_mod):
return np.int64(
np.round(poly.polydiv(poly.polymul(x, y) % modulus, poly_mod)[1] % modulus)
)
def polyadd(x, y, modulus, poly_mod):
return np.int64(
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/KITCTFCTF/2022/crypto/PrimeGuesser2/PrimeGuesser2.py | ctfs/KITCTFCTF/2022/crypto/PrimeGuesser2/PrimeGuesser2.py | #!/usr/bin/env python3
import numpy as np
from numpy.polynomial import polynomial as poly
import random
def polymul(x, y, modulus, poly_mod):
return np.int64(
np.round(poly.polydiv(poly.polymul(x, y) % modulus, poly_mod)[1] % modulus)
)
def polyadd(x, y, modulus, poly_mod):
return np.int64(
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/KITCTFCTF/2022/crypto/CrookedRoulette/Crooked_Roulette.py | ctfs/KITCTFCTF/2022/crypto/CrookedRoulette/Crooked_Roulette.py | #!/usr/bin/env python3
from math import gcd
from Crypto.Util.number import getPrime,getRandomInteger
flag = "KITCTF{fake_flag}"
p = getPrime(512)
q = getPrime(512)
n = p*q
phi = (p-1)*(q-1)
e = getPrime(256)
while gcd(e, phi) != 1:
e = getPrime(256)
d = pow(e, -1, phi)
def sign(m):
return pow(m, d, n)
def ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/SUSCTF/2022/pwn/mujs/genucd.py | ctfs/SUSCTF/2022/pwn/mujs/genucd.py | # Create utfdata.h from UnicodeData.txt
tolower = []
toupper = []
isalpha = []
for line in open("UnicodeData.txt").readlines():
line = line.split(";")
code = int(line[0],16)
# if code > 65535: continue # skip non-BMP codepoints
if line[2][0] == 'L':
isalpha.append(code)
if line[12]:
toupper.append((code,int(... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/SUSCTF/2022/crypto/large_case/problem.py | ctfs/SUSCTF/2022/crypto/large_case/problem.py | from Crypto.Util.number import *
from secret import e,message
def pad(s):
if len(s)<3*L:
s+=bytes(3*L-len(s))
return s
L=128
p=1278467535736030841400325023673116875775172861928938308882105054008637479604584100916249284853982372217486394655693603570836103439011952737406531002598735126680153246202397203... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/SUSCTF/2022/crypto/Ez_Pager_Tiper/problem/magic_box.py | ctfs/SUSCTF/2022/crypto/Ez_Pager_Tiper/problem/magic_box.py | class lfsr():
def __init__(self, seed, mask, length):
self.length_mask = 2 ** length - 1
self.mask = mask & self.length_mask
self.state = seed & self.length_mask
def next(self):
next_state = (self.state << 1) & self.length_mask
i = self.state & self.mask & self.length_ma... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/SUSCTF/2022/crypto/Ez_Pager_Tiper/problem/problem.py | ctfs/SUSCTF/2022/crypto/Ez_Pager_Tiper/problem/problem.py | from Crypto.Util.number import *
from magic_box import *
from secret import mask1, mask2, seed1, seed2, seed3
n1, n2 = 64, 12
flag = 'SUSCTF{***}'
def encrypt(cipher, ipath, opath):
ifile=open(ipath,'rb')
ofile=open(opath,'wb')
plaintext=ifile.read()
for ch in plaintext:
c=ch^cipher.getrandbit... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/SUSCTF/2022/crypto/InverseProblem/problem.py | ctfs/SUSCTF/2022/crypto/InverseProblem/problem.py | import numpy as np
from secret import flag
def gravity(n,d=0.25):
A=np.zeros([n,n])
for i in range(n):
for j in range(n):
A[i,j]=d/n*(d**2+((i-j)/n)**2)**(-1.5)
return A
n=len(flag)
A=gravity(n)
x=np.array(list(flag))
b=A@x
np.savetxt('b.txt',b) | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/SUSCTF/2022/crypto/SpecialCurve3/problem.py | ctfs/SUSCTF/2022/crypto/SpecialCurve3/problem.py | from Crypto.Util.number import *
from secret import flag,getMyPrime
import hashlib
import random
class SpecialCurve:
def __init__(self,p,a,b):
self.p=p
self.a=a
self.b=b
def __str__(self):
return f'SpecialCurve({self.p},{self.a},{self.b})'
def add(self,P1,P2):
x1,y... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/H7CTFInternational/2024/crypto/I_Lost_My_Bottoms/enc.py | ctfs/H7CTFInternational/2024/crypto/I_Lost_My_Bottoms/enc.py | from Crypto.Util.number import *
p = getPrime(1024)
bits = 128
m = bytes_to_long(b"REDACTED")
hints = [pow(m , -1 , p) , pow(m+1 , -2 , p)]
hints_leak = [(i>>bits)<<bits for i in hints]
print(f'p = {p}')
print(f'hints_leak = {hints_leak}')
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/H7CTFInternational/2025/pwn/0x0f05/chal.py | ctfs/H7CTFInternational/2025/pwn/0x0f05/chal.py | import sys
import mmap
import ctypes
from capstone import Cs, CS_ARCH_X86, CS_MODE_64
from prettytable import PrettyTable
def disassemble(shellcode):
md = Cs(CS_ARCH_X86, CS_MODE_64)
table = PrettyTable()
table.field_names = ["Address", "Bytes", "Instruction"]
table.align["Address"] = "l"
tabl... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/H7CTFInternational/2025/crypto/OAEPsy/chall.py | ctfs/H7CTFInternational/2025/crypto/OAEPsy/chall.py | #!/usr/bin/env python3
import os, base64, math, hashlib
from flask import Flask, request, jsonify, abort
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
import secret
app = Flask(__name__)
RSA_BITS = int(os.environ.get("RSA_BITS", "2048"))
MAX_ORACLE_QUERIES = int(os.environ.get("MAX_ORACLE_QUER... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/H7CTFInternational/2025/crypto/Kakashi_s_Secret_Jutsu/source.py | ctfs/H7CTFInternational/2025/crypto/Kakashi_s_Secret_Jutsu/source.py | #!/usr/bin/env python3
import socketserver
import signal
import string, random
from hashlib import sha256
from Crypto.Cipher import AES
from secret import get_key, get_IV, get_secret, get_flag, perform_encryption
KAKASHI_BANNER = br"""
/$$ /$$ /$$$$$$$$ /$$$$$$ /$$$$$$$$ /$$$$$$$$
| $$ | $$|_____ $$//$$__ $$|__... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/snakeCTF/2023/misc/stressful_reader/jail.py | ctfs/snakeCTF/2023/misc/stressful_reader/jail.py | #!/usr/bin/env python3
import os
banner = r"""
_____ _ __ _ _
/ ___| | / _| | | | |
\ `--.| |_ _ __ ___ ___ ___| |_ _ _| | _ __ ___ __ _ __| | ___ _ __
`--. \ __| '__/ _ \/ __/ __| _| | | | | | '__/ _ \/ _` |/ _` |/... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/snakeCTF/2023/crypto/strongest_cipher/utilities.py | ctfs/snakeCTF/2023/crypto/strongest_cipher/utilities.py | def binary_encode_message(message: int, N_bits: int):
bit_list = []
for i in range(N_bits):
bit_list.append((message>>i) & 0x1)
return bit_list
def decode_message(encoded_message: list, p: int):
m = 0
threshold = 2 if(p == 2) else ((p+1)>>1)
for i,c in enumerate(encoded_message):
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/snakeCTF/2023/crypto/thefork/service.py | ctfs/snakeCTF/2023/crypto/thefork/service.py | import forkaes
import os
import signal
TIMEOUT = 600
assert("KEY" in os.environ)
KEY = os.environ["KEY"]
KEY = [ x for x in bytes.fromhex(KEY)]
assert len(KEY) == forkaes.BLOCK_SIZE
def main():
print("TheFORK oracle is here!")
tweak = [ int.from_bytes(os.urandom(1), byteorder='big') for _ in range(forkaes.... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/snakeCTF/2023/crypto/thefork/forkaes.py | ctfs/snakeCTF/2023/crypto/thefork/forkaes.py | from config import *
from AES.aes_utilities import *
from AES.utilities import *
# returns ciphertext_0 and ciphertext_1
def encrypt(plaintext, key, tweak):
keys = key_expansion(key, TOTAL_ROUNDS+1)
current_state = plaintext
for i in range(HEADER_ROUNDS):
t = add(current_state, keys[i])
t... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/snakeCTF/2023/crypto/thefork/config.py | ctfs/snakeCTF/2023/crypto/thefork/config.py | HEADER_ROUNDS = 5
LEFT_ROUNDS = 2
RIGHT_ROUNDS = 2
BLOCK_SIZE = 16
TOTAL_ROUNDS = HEADER_ROUNDS + LEFT_ROUNDS + RIGHT_ROUNDS
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/snakeCTF/2023/crypto/thefork/AES/aes_utilities.py | ctfs/snakeCTF/2023/crypto/thefork/AES/aes_utilities.py | from AES.utilities import *
def forward_round(state):
current_state = state
current_state = sub_bytes(current_state)
current_state = shift_rows(current_state)
current_state = mix_columns(current_state)
return current_state
def inverse_round(state):
current_state = state
current_state = in... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/snakeCTF/2023/crypto/thefork/AES/utilities.py | ctfs/snakeCTF/2023/crypto/thefork/AES/utilities.py | from AES.data import *
def shift_rows(current_state):
output = [0 for _ in range(16)]
for i in range(0,4):
for j in range(4):
output[j+4*i] = (current_state[j+((j+i)*4)%16])
return output
def inverse_shift_row(current_state):
output = [0 for _ in range(16)]
for i in rang... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/snakeCTF/2023/crypto/thefork/AES/data.py | ctfs/snakeCTF/2023/crypto/thefork/AES/data.py | mul2 = [
0x00,0x02,0x04,0x06,0x08,0x0a,0x0c,0x0e,0x10,0x12,0x14,0x16,0x18,0x1a,0x1c,0x1e,
0x20,0x22,0x24,0x26,0x28,0x2a,0x2c,0x2e,0x30,0x32,0x34,0x36,0x38,0x3a,0x3c,0x3e,
0x40,0x42,0x44,0x46,0x48,0x4a,0x4c,0x4e,0x50,0x52,0x54,0x56,0x58,0x5a,0x5c,0x5e,
0x60,0x62,0x64,0x66,0x68,0x6a,0x6c,0x6e,0x70,0x72,0x... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/snakeCTF/2023/crypto/bloom_bloom/challenge.py | ctfs/snakeCTF/2023/crypto/bloom_bloom/challenge.py | from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
import os
import random
import signal
import mmh3
TIMEOUT = 300
assert("FLAG" in os.environ)
FLAG = os.environ["FLAG"]
assert(FLAG.startswith("CTF{"))
assert(FLAG.endswith("}"))
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Rush/2023/crypto/BreakMe/chall.py | ctfs/Rush/2023/crypto/BreakMe/chall.py | from Crypto.Util.number import *
from Crypto.PublicKey import RSA
FLAG = ""
with open("flag.txt", "rb") as f:
FLAG = f.read()
p = getPrime(2048)
p_factor = p
p *= p
q = pow(p_factor, 6)
e = 0x10001
N = p*q
"""
-
-
-
VANISHED CODE
(known information: the cipher is just a textbook rsa)
-
-
-
"""
d = inverse(e, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/EnigmaXplore/2024/crypto/Fool_Me_Not/chall.py | ctfs/EnigmaXplore/2024/crypto/Fool_Me_Not/chall.py | import os
from Crypto.Cipher import AES
from Crypto.Protocol.KDF import PBKDF2
def multiply_bytes(a, b):
return bytes([x ^ y for x, y in zip(a, b)])
def aes_permutation(data, key):
cipher = AES.new(key, AES.MODE_ECB)
return cipher.encrypt(data)
def encrypt_keys(password, text, length=16):
return P... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/IRON/2024/misc/Capital_Of_Italy/main.py | ctfs/IRON/2024/misc/Capital_Of_Italy/main.py | #!/usr/bin/env python3
REDACTED = "ironCTF{test}"
blacklist = 'REDACTEDREDACTED'
print("WELCOME :)")
breakpoint = "breakpoint"
data = input()
if len(data) > 12:
print("Too long...")
exit()
for chars in blacklist:
if chars in data:
print("Blocked Character: ", chars)
exit()
try:
eval(da... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/IRON/2024/rev/Super_Secure_Login_Shell/interface.py | ctfs/IRON/2024/rev/Super_Secure_Login_Shell/interface.py | #!/usr/bin/python3
import ctypes
import requests
from getpass import getpass
from hashlib import sha256
from base64 import b64encode
from sys import exit
def generateToken(username :str, password_hash :bytes, access :int) -> bytes:
_tokengen :CDLL = ctypes.CDLL('./tokengen.so')
_tokengen.generateToken.argtype... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/IRON/2024/crypto/Rivest_Shamir_Adleman_1/chal.py | ctfs/IRON/2024/crypto/Rivest_Shamir_Adleman_1/chal.py | from Crypto.Util.number import *
m = open("flag.txt",'rb').read()
m = bytes_to_long(m)
p = getPrime(1024)
q = getPrime(1024)
N = p*q
e = getRandomNBitInteger(16)
c = pow(m,e,N)
p_ = p >> (200)
print(f"{(p_,N,e,c)=}")
# (p_,N,e,c)=(78251056776113743922781362749830646373211175353656790171039496888342171662458492506... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/IRON/2024/crypto/Backdoor/chal.py | ctfs/IRON/2024/crypto/Backdoor/chal.py | from curve_operations import Point,Curve # Custom module
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
from Crypto.Util.number import long_to_bytes
class Dual_EC:
def __init__(self):
p = 229054522729978652250851640754582529779
a = -75
b = -250
self.curve = Cu... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/IRON/2024/crypto/Minecraft_cipher/image.py | ctfs/IRON/2024/crypto/Minecraft_cipher/image.py | import random
def xor(a,b):
return bytes([x^y for x,y in zip(a,b)])
class CustomRandom:
def __init__(self, m, a=None, b=None, x=None) -> None:
if a is None:
self.a = random.getrandbits(64)
self.b = random.getrandbits(64)
self.x = random.getrandbits(64)
else:
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DCTF/2021/crypto/A_Simple_SP_Box/sp_box.py | ctfs/DCTF/2021/crypto/A_Simple_SP_Box/sp_box.py | from string import ascii_letters, digits
from random import SystemRandom
from math import ceil, log
from signal import signal, alarm, SIGALRM
from secret import flag
random = SystemRandom()
ALPHABET = ascii_letters + digits + "_!@#$%.'\"+:;<=}{"
shuffled = list(ALPHABET)
random.shuffle(shuffled)
S_box = {k : v for k... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DCTF/2021/crypto/Just_Take_Your_Time/just-take-your-time.py | ctfs/DCTF/2021/crypto/Just_Take_Your_Time/just-take-your-time.py | #!/usr/bin python3
from flag import flag
from Crypto.Cipher import DES3
from time import time
from random import randint
from secrets import token_hex
from pytimedinput import timedInput
guess = 3
TIMEOUT = 1
a = randint(1000000000000000, 9999999999999999)
b = randint(1000000000000000, 9999999999999999)
print("Show... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DCTF/2021/crypto/Lockpicking/lockpicking.py | ctfs/DCTF/2021/crypto/Lockpicking/lockpicking.py | from random import randint
from secret import flag, solvable
from signal import signal, alarm, SIGALRM
class lsfr:
def __init__(self):
self.state = [randint(0, 5039) for _ in range(10)]
while True:
self.coefs = [randint(0, 5039) for _ in range(10)]
if solvable(self): break
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CursedCTF/2024/Quals/misc/folderjail/app.py | ctfs/CursedCTF/2024/Quals/misc/folderjail/app.py | #!/usr/local/bin/python
import os
import shutil
import tarfile
from folders.folders import FolderAnalyzer, FolderTranspiler
TMP_DIR = '/tmp/program'
def unzip_tar_gz(hex_input):
tar_gz_data = bytes.fromhex(hex_input)
if os.path.exists(TMP_DIR):
shutil.rmtree(TMP_DIR)
os.makedirs(TMP_DIR, exist_ok... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CursedCTF/2024/Quals/crypto/hashbash/challenge.py | ctfs/CursedCTF/2024/Quals/crypto/hashbash/challenge.py | import ctypes, zlib
from collections import Counter
from secret import FLAG, FLAG2, FLAG3
# See hash_impl.c for implementations of other hash algorithms
c_hash_impl = ctypes.CDLL("./hash_impl.so")
c_hash_wrapper = lambda alg_name: lambda s: ctypes.c_uint( getattr(c_hash_impl, alg_name)(s) ).value
HASH_ALGS = {
"... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CursedCTF/2024/Quals/crypto/fuck_joseph/challenge.py | ctfs/CursedCTF/2024/Quals/crypto/fuck_joseph/challenge.py | from Crypto.Util.number import *
from flag import flag
n = getPrime(256) * getPrime(256)
e = 0x10001
print(n)
print(pow(bytes_to_long(flag), e, n))
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CursedCTF/2024/Quals/crypto/too_many_cooks/too_many_cooks.py | ctfs/CursedCTF/2024/Quals/crypto/too_many_cooks/too_many_cooks.py | BANNER = """\
I was alarmed to learn that cryptographers have broken 31 out of 64 rounds of SHA256.
To defend against cryptographers, I made my own hash function.
I hear rolling your own crypto is bad, so I merely composed existing hash functions.
~ retr0id
"""
import asyncio
import hashlib
from fastcrc.crc64 import ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CursedCTF/2024/Quals/crypto/viewing/source.py | ctfs/CursedCTF/2024/Quals/crypto/viewing/source.py | #!/usr/bin/env python3
from os import urandom
from secret import FLAG
PERM_1 = {0: 120, 1: 224, 2: 249, 3: 98, 4: 88, 5: 4, 6: 210, 7: 54, 8: 83, 9: 63, 10: 153, 11: 245, 12: 203, 13: 139, 14: 137, 15: 39, 16: 217, 17: 1, 18: 90, 19: 107, 20: 72, 21: 96, 22: 191, 23: 112, 24: 199, 25: 113, 26: 16, 27: 160, 28: 58, 29... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CPCTF/2025/crypto/Prime_Tester/chal.py | ctfs/CPCTF/2025/crypto/Prime_Tester/chal.py | from math import gcd
def is_prime(n):
if n == 2:
return True
if n == 1 or n & 1 == 0:
return False
d = n - 1
while d & 1 == 0:
d >>= 1
for a in range(500):
if gcd(a, n) != 1:
continue
t = d
y = pow(a, t, n)
while t != n - 1 and y... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/.github/scripts/get_release_props.py | .github/scripts/get_release_props.py | # /// script
# requires-python = ">=3.12"
# dependencies = [
# "pyyaml",
# "click",
# ]
# ///
"""Extract the properties of a configured EEST release from a YAML file."""
import sys
import click
import yaml
RELEASE_PROPS_FILE = "./.github/configs/feature.yaml"
@click.command()
@click.argument("release", req... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/.github/scripts/generate_eip_report.py | .github/scripts/generate_eip_report.py | """
Generate a markdown report of outdated EIP references from the EIP version
checker output.
"""
import os
import re
import sys
import textwrap
from string import Template
from typing import List, Tuple
# Report template using textwrap.dedent for clean multiline strings
REPORT_TEMPLATE = Template(
textwrap.dede... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/scripts/convert_addresses.py | scripts/convert_addresses.py | #!/usr/bin/env python3
"""
Simple address converter for static test fillers.
Two-pass approach:
1. Collect all addresses and create mappings
2. Replace all occurrences with tags.
"""
import argparse
import re
from enum import Enum, auto
from pathlib import Path
from typing import Dict, List, Optional, Set
from ethere... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | true |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/conftest.py | src/conftest.py | """Local pytest configuration used on multiple framework tests."""
import os
from typing import Dict, Generator
import pytest
from ethereum_clis import BesuTransitionTool, ExecutionSpecsTransitionTool, TransitionTool
DEFAULT_TRANSITION_TOOL_FOR_UNIT_TESTS = ExecutionSpecsTransitionTool
INSTALLED_TRANSITION_TOOLS =... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_checklists/eip_checklist.py | src/ethereum_test_checklists/eip_checklist.py | """
EIP Testing Checklist Enum definitions.
Note: This module includes a companion .pyi stub file that provides mypy type
hints for making EIPChecklist classes callable. The stub file is auto-generated
using: uv run generate_checklist_stubs
If you modify the EIPChecklist class structure, regenerate the stub file to
m... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | true |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_checklists/__init__.py | src/ethereum_test_checklists/__init__.py | """Ethereum test checklists module for EIP testing coverage tracking."""
from .eip_checklist import EIPChecklist
__all__ = ["EIPChecklist"]
| python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_checklists/tests/test_checklist_template_consistency.py | src/ethereum_test_checklists/tests/test_checklist_template_consistency.py | """Test consistency between checklist template and EIPChecklist class."""
import re
from pathlib import Path
from typing import Any, Set
import pytest
from ethereum_test_checklists.eip_checklist import EIPChecklist
TEMPLATE_PATH = (
Path(__file__).parent.parent.parent.parent
/ "docs"
/ "writing_tests"
... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_checklists/tests/__init__.py | src/ethereum_test_checklists/tests/__init__.py | """Tests for ethereum_test_checklists."""
| python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/block_types.py | src/ethereum_test_types/block_types.py | """Block-related types for Ethereum tests."""
import hashlib
from dataclasses import dataclass
from functools import cached_property
from typing import Any, Dict, Generic, List, Sequence
import ethereum_rlp as eth_rlp
from ethereum_types.numeric import Uint
from pydantic import Field, computed_field
from trie import ... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/account_types.py | src/ethereum_test_types/account_types.py | """Account-related types for Ethereum tests."""
import json
from dataclasses import dataclass, field
from enum import Enum, auto
from typing import Any, Dict, ItemsView, Iterator, List, Literal, Optional, Self, Tuple
from coincurve.keys import PrivateKey
from ethereum_types.bytes import Bytes20
from ethereum_types.nu... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/chain_config_types.py | src/ethereum_test_types/chain_config_types.py | """Chain Configuration related types for Ethereum tests."""
from pydantic import Field
from ethereum_test_base_types import CamelModel
class ChainConfigDefaults:
"""
Default values for the chain configuration.
Can be modified by modules that import this module and want to override the
default value... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/transaction_types.py | src/ethereum_test_types/transaction_types.py | """Transaction-related types for Ethereum tests."""
from dataclasses import dataclass
from enum import IntEnum
from functools import cached_property
from typing import Any, ClassVar, Dict, Generic, List, Literal, Sequence
import ethereum_rlp as eth_rlp
from coincurve.keys import PrivateKey, PublicKey
from ethereum_ty... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/request_types.py | src/ethereum_test_types/request_types.py | """Request types for Ethereum tests."""
from abc import abstractmethod
from collections import defaultdict
from typing import ClassVar, Dict, List, SupportsBytes
from ethereum_test_base_types import (
Address,
BLSPublicKey,
BLSSignature,
Bytes,
CamelModel,
Hash,
HexNumber,
)
class Reques... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/helpers.py | src/ethereum_test_types/helpers.py | """Helper functions/classes used to generate Ethereum tests."""
from typing import List, SupportsBytes
import ethereum_rlp as eth_rlp
from pydantic import BaseModel, ConfigDict
from ethereum_test_base_types.base_types import Address, Bytes, Hash
from ethereum_test_base_types.conversions import BytesConvertible, Fixe... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/utils.py | src/ethereum_test_types/utils.py | """Utility functions and sentinel classes for Ethereum test types."""
from typing import Any
from ethereum_test_base_types import Bytes, Hash
def keccak256(data: bytes) -> Hash:
"""Calculate keccak256 hash of the given data."""
return Bytes(data).keccak256()
def int_to_bytes(value: int) -> bytes:
"""C... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/blob_types.py | src/ethereum_test_types/blob_types.py | """Blob-related types for Ethereum tests."""
import random
from enum import Enum
from hashlib import sha256
from os.path import realpath
from pathlib import Path
from typing import Any, ClassVar, List, Literal, cast
import ckzg # type: ignore
import platformdirs
from filelock import FileLock
from ethereum_test_base... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/__init__.py | src/ethereum_test_types/__init__.py | """Common definitions and types."""
from .account_types import EOA, Alloc
from .blob_types import Blob
from .block_access_list import (
BalAccountChange,
BalBalanceChange,
BalCodeChange,
BalNonceChange,
BalStorageChange,
BalStorageSlot,
BlockAccessList,
BlockAccessListExpectation,
)
fro... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/trie.py | src/ethereum_test_types/trie.py | """
The state trie is the structure responsible for storing.
"""
import copy
from dataclasses import dataclass, field
from typing import (
Callable,
Dict,
Generic,
List,
Mapping,
MutableMapping,
Optional,
Sequence,
Tuple,
TypeVar,
cast,
)
from Crypto.Hash import keccak
from... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/phase_manager.py | src/ethereum_test_types/phase_manager.py | """Test phase management for Ethereum tests."""
from contextlib import contextmanager
from enum import Enum
from typing import ClassVar, Iterator, Optional
class TestPhase(Enum):
"""Test phase for state and blockchain tests."""
SETUP = "setup"
EXECUTION = "execution"
class TestPhaseManager:
"""
... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/receipt_types.py | src/ethereum_test_types/receipt_types.py | """Transaction receipt and log types for Ethereum tests."""
from typing import List
from pydantic import Field
from ethereum_test_base_types import (
Address,
Bloom,
Bytes,
CamelModel,
Hash,
HexNumber,
)
class TransactionLog(CamelModel):
"""Transaction log."""
address: Address
... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/block_access_list/expectations.py | src/ethereum_test_types/block_access_list/expectations.py | """
Block Access List expectation classes for test validation.
This module contains classes for defining and validating expected
BAL values in tests.
"""
from typing import Any, Callable, ClassVar, Dict, List, Optional
from pydantic import Field, PrivateAttr
from ethereum_test_base_types import Address, CamelModel,... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/block_access_list/account_changes.py | src/ethereum_test_types/block_access_list/account_changes.py | """
Account change classes for Block Access List.
This module contains the core data structures representing changes to accounts
in a block access list as defined in EIP-7928.
"""
from typing import ClassVar, List, Union
from pydantic import Field
from ethereum_test_base_types import (
Address,
Bytes,
C... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/block_access_list/exceptions.py | src/ethereum_test_types/block_access_list/exceptions.py | """Exceptions related to block access list validation."""
class BlockAccessListValidationError(Exception):
"""Custom exception for Block Access List validation errors."""
pass
| python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/block_access_list/account_absent_values.py | src/ethereum_test_types/block_access_list/account_absent_values.py | """
BalAccountAbsentValues class for BAL testing.
This module provides a unified class for specifying explicit absent values
in Block Access Lists. This class uses the same change classes as
BalAccountChanges to specify specific values that should NOT exist in the BAL.
For checking complete absence, use BalAccountExpe... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/block_access_list/modifiers.py | src/ethereum_test_types/block_access_list/modifiers.py | """
BAL modifier functions for invalid test cases.
This module provides modifier functions that can be used to modify Block Access
Lists in various ways for testing invalid block scenarios. They are composable
and can be combined to create complex modifications.
"""
from typing import Any, Callable, List, Optional
f... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/block_access_list/t8n.py | src/ethereum_test_types/block_access_list/t8n.py | """Block Access List (BAL) for t8n tool communication and fixtures."""
from functools import cached_property
from typing import Any, List
import ethereum_rlp as eth_rlp
from pydantic import Field
from ethereum_test_base_types import Bytes, EthereumTestRootModel
from ethereum_test_base_types.serialization import to_s... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/block_access_list/__init__.py | src/ethereum_test_types/block_access_list/__init__.py | """
Block Access List (BAL) models for EIP-7928.
Following the established pattern in the codebase (AccessList,
AuthorizationTuple), these are simple data classes that can be composed
together.
"""
from .account_absent_values import BalAccountAbsentValues
from .account_changes import (
BalAccountChange,
BalBa... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/tests/test_transactions.py | src/ethereum_test_types/tests/test_transactions.py | """Test suite for transaction signing and serialization."""
from typing import Tuple
import pytest
from ethereum_test_base_types import AccessList, Hash
from ..transaction_types import Transaction
@pytest.mark.parametrize(
[
"tx",
"expected_signature",
"expected_sender",
"expec... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/tests/test_post_alloc.py | src/ethereum_test_types/tests/test_post_alloc.py | """Test suite for test spec submodules of the `ethereum_test` module."""
from typing import Type
import pytest
from ethereum_test_base_types import Account
from ethereum_test_types import Alloc
@pytest.fixture()
def post(request: pytest.FixtureRequest) -> Alloc:
"""
Post state: Set from the test's indirect... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/tests/test_blob_types.py | src/ethereum_test_types/tests/test_blob_types.py | """Test suite for blobs."""
import copy
import time
from typing import Any
import pytest
from filelock import FileLock
from ethereum_test_forks import (
Cancun,
Osaka,
Prague,
)
from ethereum_test_forks.forks.transition import (
CancunToPragueAtTime15k,
PragueToOsakaAtTime15k,
ShanghaiToCancu... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/tests/test_types.py | src/ethereum_test_types/tests/test_types.py | """Test suite for `ethereum_test` module."""
from typing import Any, Dict, List
import pytest
from ethereum_test_base_types import (
AccessList,
Account,
Address,
Bytes,
Storage,
TestPrivateKey,
ZeroPaddedHexNumber,
to_json,
)
from ethereum_test_base_types.pydantic import CopyValidate... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/tests/test_phase_manager.py | src/ethereum_test_types/tests/test_phase_manager.py | """Test suite for TestPhaseManager functionality."""
import pytest
from ethereum_test_base_types import Address
from ethereum_test_tools import Transaction
from ..phase_manager import TestPhase, TestPhaseManager
@pytest.fixture(autouse=True)
def reset_phase_manager() -> None:
"""Reset TestPhaseManager singleto... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/tests/test_eof_v1.py | src/ethereum_test_types/tests/test_eof_v1.py | """Test suite for `code.eof.v1` module."""
from typing import List, Tuple
import pytest
from ethereum_test_base_types import to_json
from ethereum_test_base_types.pydantic import CopyValidateModel
from ethereum_test_vm import Opcodes as Op
from ..eof.v1 import AutoSection, Container, Section, SectionKind
test_case... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/tests/__init__.py | src/ethereum_test_types/tests/__init__.py | """Tests for the ethereum_test_types package."""
| python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/tests/test_block_access_lists.py | src/ethereum_test_types/tests/test_block_access_lists.py | """Unit tests for BlockAccessListExpectation validation."""
from typing import Any
import pytest
from ethereum_test_base_types import Address, StorageKey
from ethereum_test_types.block_access_list import (
BalAccountAbsentValues,
BalAccountChange,
BalAccountExpectation,
BalBalanceChange,
BalCodeC... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | true |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/tests/test_helpers.py | src/ethereum_test_types/tests/test_helpers.py | """Test suite for `ethereum_test.helpers` module."""
import pytest
from ethereum_test_base_types import Address
from ..helpers import compute_create2_address, compute_create_address
def test_address() -> None:
"""Test `ethereum_test.base_types.Address`."""
assert (
Address("0x0000000000000000000000... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/eof/constants.py | src/ethereum_test_types/eof/constants.py | """EVM Object Format generic constants. Applicable to all EOF versions."""
EOF_MAGIC = b"\xef\x00"
"""
The second byte found on every EOF formatted contract, which was chosen to
avoid clashes with three contracts which were deployed on Mainnet.
"""
EOF_HEADER_TERMINATOR = b"\x00"
"""Byte that terminates the header of ... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/eof/__init__.py | src/ethereum_test_types/eof/__init__.py | """EVM Object Format Library to generate bytecode for testing purposes."""
from .constants import LATEST_EOF_VERSION
__all__ = ("LATEST_EOF_VERSION",)
| python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/eof/v1/constants.py | src/ethereum_test_types/eof/v1/constants.py | """
EVM Object Format generic constants.
Applicable to EOF version 1.
"""
from ..constants import VERSION_BYTE_LENGTH
VERSION_NUMBER = 0x01
VERSION_NUMBER_BYTES = VERSION_NUMBER.to_bytes(VERSION_BYTE_LENGTH, "big")
MAX_CODE_SECTIONS = 1024
MAX_RETURN_STACK_HEIGHT = 1024
MAX_STACK_INCREASE_LIMIT = 0x3FF
"""
Maximu... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_types/eof/v1/__init__.py | src/ethereum_test_types/eof/v1/__init__.py | """
EVM Object Format Version 1 Library to generate bytecode for testing purposes.
"""
from dataclasses import dataclass
from enum import Enum, IntEnum, auto
from functools import cached_property
from typing import Any, Dict, List, Optional, Tuple
from pydantic import Field, GetCoreSchemaHandler
from pydantic_core.co... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_rpc/rpc.py | src/ethereum_test_rpc/rpc.py | """
JSON-RPC methods and helper functions for EEST consume based hive simulators.
"""
import logging
import os
import time
from itertools import count
from pprint import pprint
from typing import Any, ClassVar, Dict, List, Literal
import requests
from jwt import encode
from pydantic import ValidationError
from tenaci... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_rpc/__init__.py | src/ethereum_test_rpc/__init__.py | """
JSON-RPC methods and helper functions for EEST consume based hive simulators.
"""
from .rpc import (
AdminRPC,
BlockNumberType,
DebugRPC,
EngineRPC,
EthRPC,
NetRPC,
SendTransactionExceptionError,
)
from .rpc_types import (
BlobAndProofV1,
BlobAndProofV2,
EthConfigResponse,
... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_rpc/rpc_types.py | src/ethereum_test_rpc/rpc_types.py | """Types used in the RPC module for `eth` and `engine` namespaces' requests."""
import json
from binascii import crc32
from enum import Enum
from hashlib import sha256
from typing import Annotated, Any, Dict, List, Self
from pydantic import AliasChoices, Field, model_validator
from ethereum_test_base_types import (
... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_rpc/tests/test_types.py | src/ethereum_test_rpc/tests/test_types.py | """Test the types in the `ethereum_test_rpc` package."""
from typing import Any, Dict
import pytest
from ethereum_test_rpc import EthConfigResponse
eth_config_dict: Dict[str, Any] = {
"current": {
"activationTime": 0,
"blobSchedule": {"baseFeeUpdateFraction": 3338477, "max": 6, "target": 3},
... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_test_rpc/tests/__init__.py | src/ethereum_test_rpc/tests/__init__.py | """Unit tests for the `ethereum_test_rpc` package."""
| python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/file_utils.py | src/ethereum_clis/file_utils.py | """Methods to work with the filesystem and json."""
import os
import stat
from json import dump
from typing import Any, Dict
from pydantic import BaseModel, RootModel
def write_json_file(data: Dict[str, Any], file_path: str) -> None:
"""Write a JSON file to the given path."""
with open(file_path, "w") as f:... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/cli_types.py | src/ethereum_clis/cli_types.py | """Types used in the transition tool interactions."""
import json
from pathlib import Path
from typing import Annotated, Any, Dict, List, Self
from pydantic import Field, PlainSerializer, PlainValidator
from ethereum_test_base_types import (
Bloom,
Bytes,
CamelModel,
EthereumTestRootModel,
Hash,
... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/transition_tool.py | src/ethereum_clis/transition_tool.py | """Transition tool abstract class."""
import json
import os
import shutil
import subprocess
import tempfile
import textwrap
import time
from abc import abstractmethod
from dataclasses import dataclass
from pathlib import Path
from typing import Any, ClassVar, Dict, List, LiteralString, Mapping, Optional, Type
from url... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/__init__.py | src/ethereum_clis/__init__.py | """
Library of Python wrappers for the different implementations of transition
tools.
"""
from .cli_types import (
BlockExceptionWithMessage,
Result,
Traces,
TransactionExceptionWithMessage,
TransitionToolOutput,
)
from .clis.besu import BesuTransitionTool
from .clis.ethereumjs import EthereumJSTra... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/ethereum_cli.py | src/ethereum_clis/ethereum_cli.py | """Abstract base class to help create Python interfaces to Ethereum CLIs."""
import os
import shutil
import subprocess
from itertools import groupby
from pathlib import Path
from re import Pattern
from typing import Any, List, Optional, Type
from pytest_plugins.custom_logging import get_logger
logger = get_logger(__... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/fixture_consumer_tool.py | src/ethereum_clis/fixture_consumer_tool.py | """Fixture consumer tool abstract class."""
from typing import List, Type
from ethereum_test_fixtures import FixtureConsumer, FixtureFormat
from .ethereum_cli import EthereumCLI
class FixtureConsumerTool(FixtureConsumer, EthereumCLI):
"""
Fixture consumer tool abstract base class which should be inherited ... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/tests/test_execution_specs.py | src/ethereum_clis/tests/test_execution_specs.py | """Additional tests for the EELS t8n tool."""
import json
import os
import sysconfig
from pathlib import Path
from shutil import which
from typing import Dict, List, Type
import pytest
from pydantic import TypeAdapter
from ethereum_clis import ExecutionSpecsTransitionTool, TransitionTool
from ethereum_test_base_type... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/tests/test_transition_tools_support.py | src/ethereum_clis/tests/test_transition_tools_support.py | """Check T8N filling support."""
from typing import Dict
import pytest
from ethereum_clis import ExecutionSpecsTransitionTool, TransitionTool
from ethereum_test_base_types import Account, Address, TestAddress, TestPrivateKey
from ethereum_test_forks import (
ArrowGlacier,
Berlin,
Byzantium,
Cancun,
... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/tests/test_transition_tool.py | src/ethereum_clis/tests/test_transition_tool.py | """Test the transition tool and subclasses."""
import shutil
import subprocess
from pathlib import Path
from typing import Type
import pytest
from ethereum_clis import (
CLINotFoundInPathError,
EvmOneTransitionTool,
ExecutionSpecsTransitionTool,
GethTransitionTool,
NimbusTransitionTool,
Trans... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/clis/nimbus.py | src/ethereum_clis/clis/nimbus.py | """Nimbus Transition tool interface."""
import re
import subprocess
from pathlib import Path
from typing import ClassVar, Dict, Optional
from ethereum_test_exceptions import (
BlockException,
ExceptionBase,
ExceptionMapper,
TransactionException,
)
from ethereum_test_forks import Fork
from ..transitio... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/clis/nethermind.py | src/ethereum_clis/clis/nethermind.py | """Interfaces for Nethermind CLIs."""
import json
import re
import shlex
import subprocess
import textwrap
from functools import cache
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import pytest
from ethereum_test_exceptions import BlockException, ExceptionMapper, TransactionException
... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/clis/reth.py | src/ethereum_clis/clis/reth.py | """Reth execution client transition tool."""
from ethereum_test_exceptions import BlockException, ExceptionMapper, TransactionException
class RethExceptionMapper(ExceptionMapper):
"""Reth exception mapper."""
mapping_substring = {
TransactionException.SENDER_NOT_EOA: (
"reject transactio... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/clis/ethrex.py | src/ethereum_clis/clis/ethrex.py | """Ethrex execution client transition tool."""
from ethereum_test_exceptions import BlockException, ExceptionMapper, TransactionException
class EthrexExceptionMapper(ExceptionMapper):
"""Ethrex exception mapper."""
mapping_substring = {
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED:... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
ethereum/execution-spec-tests | https://github.com/ethereum/execution-spec-tests/blob/88e9fb8f10ed89805aa3110d0a2cd5dcadc19689/src/ethereum_clis/clis/ethereumjs.py | src/ethereum_clis/clis/ethereumjs.py | """EthereumJS Transition tool interface."""
import re
from pathlib import Path
from typing import ClassVar, Dict, Optional
from ethereum_test_exceptions import (
BlockException,
ExceptionBase,
ExceptionMapper,
TransactionException,
)
from ethereum_test_forks import Fork
from ..transition_tool import ... | python | MIT | 88e9fb8f10ed89805aa3110d0a2cd5dcadc19689 | 2026-01-05T06:50:32.790998Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.