View minilang.py
#!/usr/bin/env python
from __future__ import print_function
import traceback
import sys
import json
import re
LEX_RX = re.compile(r'("[^"]+"|[^a-zA-Z0-9\$\s]|\$?[a-zA-Z0-9]+)')
CMDS = dict(
View shellcode.c
#include <stdio.h>
#include <Windows.h>
#include <winternl.h>
#include <wchar.h>
#include <tlhelp32.h>
PPEB get_peb(void);
DWORD __stdcall unicode_ror13_hash(const WCHAR *unicode_string);
DWORD __stdcall ror13_hash(const char *string);
HMODULE __stdcall find_module_by_hash(DWORD hash);
View schnorr.py
from __future__ import print_function
from random import randint
from hashlib import sha256
from py_ecc.secp256k1.secp256k1 import add, multiply, inv, N, P, G
bytes_to_int = lambda x: reduce(lambda o, b: (o << 8) + ord(b), [0] + list(x))
rands = lambda: randint(1, N - 1)
sbmul = lambda s: multiply(G, s)
hashs = lambda *x: bytes_to_int(sha256('.'.join(['%X' for _ in range(0, len(x))]) % x).digest()) % N
hashp = lambda *x: hashs(*[item for sublist in x for item in sublist])
View borrito.py
from __future__ import print_function
from py_ecc import bn128
from random import randint
from hashlib import sha256
from py_ecc.bn128 import add, multiply, curve_order, G1
from py_ecc.bn128.bn128_field_elements import inv
bytes_to_int = lambda x: reduce(lambda o, b: (o << 8) + ord(b), [0] + list(x))
rands = lambda: randint(1, curve_order - 1)
sbmul = lambda s: multiply(G1, s)
View burrito-ringsig.py
from __future__ import print_function
from py_ecc import bn128
from random import randint
from hashlib import sha256
from py_ecc.bn128 import add, multiply, curve_order, G1
from py_ecc.bn128.bn128_field_elements import inv
def bytes_to_int(x):
o = 0
for b in x:
View aos-ringsig.py
from __future__ import print_function
from py_ecc import bn128
from random import randint
from hashlib import sha256
from py_ecc.bn128 import add, multiply, curve_order, G1
def bytes_to_int(x):
o = 0
for b in x:
View ringsig.py
from __future__ import print_function
from py_ecc import bn128
from random import randint
from hashlib import sha256
from py_ecc.bn128 import add, multiply, curve_order, G1
def bytes_to_int(x):
o = 0
for b in x:
View merkle.py
#!/usr/bin/env python
from hashlib import sha256
H = lambda *x: sha256(''.join([str(X) for X in x])).hexdigest()
def merkle_tree(items):
"""Given an array of items, build a merkle tree"""
tree = [[H(x) for x in items]]
while len(tree[-1]) != 1:
it = iter(tree[-1])
View proof-of-insecurity.txt
# Random element of S
ℝ ∈ S = λS -> {ω ∈ Ω | ℝ_ω ∈ S}
# A homomorphic function which transforms `x` from its additive
# group into its equivalent in the multiplicative group
G^x = {λx | x ∈ Z_(q-1)} -> X
# Maps `x` to `X` within `Z_q` while adhering to the random oracle model
H = λx -> X ∈ Z_q
View secd.py
import sys
import ast
import operator
from collections import namedtuple
State = namedtuple('State', ('s', 'e', 'c', 'd'))
APPLY = lambda S, N, F: F(*[x.pop() for x in [S.s] * N])
PEEK = lambda S, N, F: F(*S.s[-1:0-N])