Skip to content

Instantly share code, notes, and snippets.

View Klexx's full-sized avatar
🏠
Working from home

Klexx

🏠
Working from home
View GitHub Profile
@tyler-smith
tyler-smith / README.md
Last active July 21, 2017 08:23
OB Contract Fund Transfer

OB Contract Fund Transfer

payout.py is a tool that allows an OpenBazaar buyer and one of (vendor|moderator) to move funds from an OpenBazaar contract.

Both parties agree to payout the funds in an OB contract to a given address. They need two pieces of data. Order id, and BTC address to send funds to.

In this example we'll use:

Order ID: 02b11c97fe709c8c732a5e37faea598ae27016cf

@chiiph
chiiph / chacha20.py
Created October 6, 2013 16:04
Python implementation of the stream cipher ChaCha20. The idea is to use numpy as the "numeric backend" to avoid side channel attacks. THIS IS JUST AN EXPERIMENT, DO NOT USE IN PRODUCTION.
# Based on http://cr.yp.to/streamciphers/timings/estreambench/submissions/salsa20/chacha8/ref/chacha.c
import binascii
import numpy as np
np.seterr(over='ignore')
def rotl32(v, c):
assert isinstance(v, np.uint32)
assert isinstance(c, np.uint32)
@gurdiga
gurdiga / aes-encryption-example.md
Last active May 9, 2023 13:50
JS AES encryption example.

JS AES encryption example

This is a quick example of how to get symmetric encryption in JS using [aes.js from the crypto-js project][1]:

// at this point http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js should be loaded

var data = 'a JSON blob or something',
    password = 'my long and very secretive passphrase';

var encrypted = CryptoJS.AES.encrypt(data, password).toString();

@djsutherland
djsutherland / latex-clean.sh
Last active December 27, 2023 23:19
A bash script to clean latex temp files
#!/bin/bash
# Note: you might prefer latexmk -c since latexmk is great. It doesn't clean all of these, but see
# https://tex.stackexchange.com/questions/83341/clean-bbl-files-with-latexmk-c/83386#83386
exts=".aux .lof .log .lot .fls .out .toc .dvi .bbl .bcf .blg -blx.aux -blx.bib -blx.bib .run.xml .fdb_latexmk .synctex.gz .syntex.gz(busy) .pdfsync .algorithms .alg .loa .thm .nav .snm .vrb .acn .acr .glg .glo .gls .brf .lol .idx .ilg .ind .ist .maf .mtc .mtc0 .pyg .nlo .tdo .xdy .keys"
for x in "${@:-.}"; do
arg=$(echo ${x:-.} | perl -pe 's/\.(tex|pdf)$//')