Skip to content

Instantly share code, notes, and snippets.

@wizardofozzie
wizardofozzie / bip39_to_entropy.py
Created June 11, 2015 13:05
bip39_to_entropy.py
In [109]: ML
Out[109]:
[u'wife',
u'olive',
u'club',
u'barely',
u'trap',
u'zero',
@wizardofozzie
wizardofozzie / ecmath.py
Created June 11, 2015 12:26
EC_math.py
# https://github.com/wobine/blackboard101
def EccMultiply(xs,ys,Scalar): # Double & add. EC Multiplication, Not true multiplication
if Scalar == 0 or Scalar >= N: raise Exception("Invalid Scalar/Private Key")
ScalarBin = str(bin(Scalar))[2:]
Qx,Qy=xs,ys
global itr
itr += 1
for i in range (1, len(ScalarBin)): # This is invented EC multiplication.
Qx,Qy=ECdouble(Qx,Qy); print "DUB", '%064x' % Qx; print
@wizardofozzie
wizardofozzie / btc_addr_obfs
Created June 3, 2015 21:18
BTC address generator (obfuscated)
_ =r"""A(W/2,*M(3*G
*G*V(2*J%P),G,J,G)+((M((J-T
)*V((G-S)%P),S,T,G)if(S@(G,J))if(
W%2@(S,T)))if(W@(S,T);H=2**256;import&h
ashlib&as&h,os,re,bi nascii&as&k;J$:int(
k.b2a_hex(W),16);C$:C (W/ 58)+[W%58]if(W@
[];X=h.new("rip em d160");Y$:h.sha25
6(W).digest();I$ d=32:I(W/256,d-1)+
chr(W%256)if(d>0@""; U$:J(k.a2b_base
64(W));f=J(os.urando m(64)) %(H-U("AUVRIxl
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.
***
@wizardofozzie
wizardofozzie / electrum1_wordlist
Created May 4, 2015 04:49
Electrum1_wordlist
words = [
"like",
"just",
"love",
"know",
"never",
"want",
"time",
"out",
"there",
@wizardofozzie
wizardofozzie / file1.py
Last active August 29, 2015 14:20 — forked from anonymous/file1.py
/wallet/Cryptsy.com = Cryptsy.com
@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 / 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 / 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
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'
"""