Skip to content

Instantly share code, notes, and snippets.

View HarryR's full-sized avatar
🏴‍☠️
My time travel machine is stuck at 60 seconds per minute

HaRold HarryR

🏴‍☠️
My time travel machine is stuck at 60 seconds per minute
View GitHub Profile
@HarryR
HarryR / FIZZ-Y-BUZZ.php
Last active December 27, 2015 05:08
/r/shittyprogramming fizz buzz competition entry
<?php
// CPOYRIGHT (C) 1989 ACCESODATA CORPORATION ES.
// AUTHOR: RDRGO.43
// DEPART: ENGINEERING
// PROJEC: INSURANCE DATA VERIFICACION
/* 0001 */ // DEFINE('
/* 0002 */ FOREACH( RANGE(1,100) AS $NUMERO )
/* 0003 */ {
/* 0004 */ // IS NUMERO FOR BUZZ?
/* 0005 */ $DIVTRES = (string)($NUMERO / 3);
@HarryR
HarryR / spider_DS_Store.py
Last active September 8, 2016 12:04
Spider .DS_Store files on a website
#!/usr/bin/env python
import requests
import sys
import requests
import os
from tempfile import mkstemp
from ds_store import DSStore
def main():
if len(sys.argv) < 2:
#!/usr/bin/env python
"""
Embed files into C arrays
Hacky solution because xxd didn't have enough features
"""
from __future__ import with_statement
from __future__ import print_function
#include <stdio.h>
#include <sodium.h>
int main(int argc, char **argv) {
int tries = 1;
sodium_init();
while (1) {
unsigned char zero_public_key[crypto_sign_PUBLICKEYBYTES] = {0};
@HelloZeroNet
HelloZeroNet / opensslVerify2.py
Last active June 19, 2017 23:36
Alternative openssl verify
#!/usr/bin/env python
##
## @file contrib/verifymessage/python/terracoin_verifymessage.py
## @brief terracoin signed message verification sample script.
## @author unknown author ; found on pastebin
##
import ctypes
import ctypes.util
import hashlib
@HarryR
HarryR / lisp.py
Last active August 17, 2017 21:43
Single-file 100 line version of https://github.com/kvalle/root-lisp
import re
import sys
def parse_any(symbols):
while len(symbols):
if symbols[0] == '(':
return parse_list(symbols[1:])
if symbols[0] == "'":
symbols, inner = parse_any(symbols[1:])
return symbols, ['quote', inner]
@HarryR
HarryR / proof-of-insecurity.txt
Last active December 24, 2017 16:35
Zero Knowledge Proof of a preimage, without revealing the preimage
# 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
@HarryR
HarryR / cryptochannel.py
Last active March 8, 2018 15:30
Negotiate an encrypted channel between two long-term NaCl key pairs, ensuring forward secrecy by creating an ephemeral session key. See: https://www.logicista.com/2017/humans-vs-crypto
"""
Cryptochannel provides a way of securely communicating with another
party where each party as a verifiable identity.
It provides both Client and Server components, where the Server has a known
long-term key but the Server doesn't need to know the client's long-term key
prior to it connecting.
The protocol enforces forward secrecy, where if either of the parties long-term
keys are leaked no intercepting party will be able to recover the contents of
@xnyhps
xnyhps / gist:33f7de50cf91a70acf93
Created July 4, 2014 14:29
mod_onions: Install instructions on Debian
# Add the Prosody repository, because we want the latest version
echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list
wget https://prosody.im/files/prosody-debian-packages.key -O- | sudo apt-key add -
sudo apt-get update
# Install tor and prosody, and lua-bitop, which is required for mod_onions
sudo apt-get install prosody tor lua-bitop
# Prepare the directories where Tor will store the hidden service's private key
#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);