Skip to content

Instantly share code, notes, and snippets.

@wizardofozzie
wizardofozzie / penrose.py
Created April 6, 2015 04:44
penrose.py
_ =\
"""if!
1:"e,V=100
0,(0j-1)**-.2;
v,S=.5/ V.real,
[(0,0,4 *e,4*e*
V)];w=1 -v"def!
E(T,A, B,C):P
,Q,R=B*w+ A*v,B*w+C
*v,A*w+B*v;retur n[(1,Q,C,A),(1,P
# Copyright 2014 Chris Cohen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@wizardofozzie
wizardofozzie / pbkdf_two.py
Created April 21, 2015 05:04
pbkdf_two.py
import hmac
import hashlib
import struct
is_python2 = True
def pbkdf_two(passwd, salt, iters=2048, keylen=64, digestmod=hashlib.sha512):
import hmac
import struct
import hashlib
from binascii import hexlify, unhexlify
import hmac, struct, hashlib, sys
is_python2 = True if sys.version_info.major == 2 else False
def pbkdf_two(passwd, salt, iters=2048, keylen=64, digestmod=hashlib.sha512):
"""
>>> hexlify(pbkdf_two(b'All n-entities must communicate with other n-entities via n-1 entiteeheehees', unhexlify('1234567878563412'), 500, 16, hashlib.sha1))
'6a8970bf68c92caea84a8df285108586'
"""
@wizardofozzie
wizardofozzie / pbkdf_two
Created April 22, 2015 00:07
Pbkdf_two
import hmac
import struct
def pbkdf2(password, salt, iters, keylen, digestmod):
"""Run the PBKDF2 (Password-Based Key Derivation Function 2) algorithm
and return the derived key. The arguments are:
password (bytes or bytearray) -- the input password
salt (bytes or bytearray) -- a cryptographic salt
iters (int) -- number of iterations
@wizardofozzie
wizardofozzie / bip39
Last active October 16, 2021 10:47
BIP39 codes & words
#!/usr/bin/python
import binascii, re, json, copy, sys
from binascii import hexlify, unhexlify
from bitcoin.main import *
# SEE https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
ELECTRUM_ENG_V1_WORDLIST = [
'like','just','love','know','never','want','time','out',
'there','make','look','eye','down','only','think','heart',
@wizardofozzie
wizardofozzie / bip39code
Last active August 29, 2015 14:19
BIP39 code
#!/usr/bin/python
import binascii, re, json, copy, sys
from binascii import hexlify, unhexlify
from bitcoin.main import *
# SEE https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
# https://gist.github.com/simcity4242/0b85c1c64bbd430e11ef/edit
def bip39_seed_to_mnemonic(hexseed):
@wizardofozzie
wizardofozzie / file1.py
Last active August 29, 2015 14:20 — forked from anonymous/file1.py
/wallet/Cryptsy.com = Cryptsy.com
@wizardofozzie
wizardofozzie / electrum1_wordlist
Created May 4, 2015 04:49
Electrum1_wordlist
words = [
"like",
"just",
"love",
"know",
"never",
"want",
"time",
"out",
"there",
FORMULA FOR CREATING NEW TV ANCHORMAN NAMES:
The first name has to be one syllable and a type of construction material and the last name has to be a breed of horse.
Construction material + breed of horse = Anchorman Name.
Examples: Brick Shetland, Chip Clydesdale, Stone Winchester, Wood Lippizaner.
***