Secp256k1 | EdDSA | |
---|---|---|
message | m = hash(M) | M, given |
privkey | . | given |
private-key | x, given | x = low32(sha512(privkey)) |
signing-secret | k, given | k = sha512(high32(sha512(privkey)) // M) |
privkey-to-pubkey | Y = G * x | Y = G * x |
calc-R | R = G * k | R = G * k |
r-value | r = R.x | r = SHA512(R // Y // M) |
s-value | s = (m + x * r) / k | s = k + x * r |
""" | |
PT/CT pairs | |
Key expanded Plaintext Ciphertext | |
AAAAAAAA AAAAAAAA AAAAAAAAAA VTPL?DL?HV | |
AAAAAAAA AAAAAAAA ABCDEFGHIJKLMNOPQRSTUVWXY VMHTL?QFPCBKSZCJGRZM-EEEZ | |
AAAA AAAAAAAA BBBB OTBZ | |
AAAAAAAA AAAAAAAA BBBBBBBBBB OTBZNRZNVA | |
AAAAAAAA AAAAAAAA BBBBBBBBBBBBBBBB OTBZNRZNVAJRJFVR | |
AAA AAAAAAAA BBBBBBBBBBBBBBBBBBBBBBBBB OTBZNRZNVAJRJFVRVVOTVBBJB |
""" | |
Author: itsme@xs4all.nl | |
""" | |
import html.parser | |
import html | |
import urllib.request | |
import json | |
from datetime import datetime, timedelta | |
import re | |
import os |
Demonstrate how to calculate the messagehash for the two signatures in this transaction
See ecdsa_demo.py for code showing how to use this to crack the bitcoin secret key.
These are the values extracted from the example transaction below:
pk="04 db d0 c6 15 32 27 9c f7 29 81 c3 58 4f c3 22 16 e0 12 76 99 63 5c 27 89 f5 49 e0 73 0c 05 9b 81 ae 13 30 16 a6 9c 21 e2 3f 18 59 a9 5f 06 d5 2b 7b f1 49 a8 f2 fe 4e 85 35 c8 a8 29 b4 49 c5 ff"
r="d4 7c e4 c0 25 c3 5e c4 40 bc 81 d9 98 34 a6 24 87 51 61 a2 6b f5 6e f7 fd c0 f5 d5 2f 84 3a d1"
s1="44 e1 ff 2d fd 81 02 cf 7a 47 c2 1d 5c 9f d5 70 16 10 d0 49 53 c6 83 65 96 b4 fe 9d d2 f5 3e 3e"
from z3 import * | |
# https://www.youtube.com/watch?v=9ATC_uBF8ow | |
# Normal sudoku rules apply. | |
# - ALL horizontally and vertically neighbouring digits with the sum 10 are marked with X; | |
# - ALL horizontally and vertically neighbouring digits with the sum 5 are marked with V. | |
# these pairs sum to 10: | |
# (0,2) + (1,2), (0,4) + (1,4), (0,6) + (1,6) | |
# (1,1) + (2,1), (1,3) + (2,3), (1,5) + (2,5), (1,7) + (2,7) | |
# (2,2) + (3,2), (2,4) + (3,4), (2,6) + (3,6) |
Marching Band problem
In this document I describe a solution to the 'marchingband' problem as stated on think-maths:
What is the fewest number of performers you require for your marching band to
have 64 marching options? (Only whole positive numbers will be accepted)
Where a 'marchingband' can march only in a rectangular shape.
EMRO AF Afghanistan 647500 37171921 World;Asia;NonCKIR | |
EURO AL Albania 28748 2876591 World;Europe;NonEU | |
AFRO DZ Algeria 2381740 34178188 World;Africa;North Africa | |
WPRO AS American Samoa (United States) 199 55465 World;Oceania;Polynesia | |
EURO AD Andorra 468 77281 World;Europe;NonEU | |
AFRO AO Angola 1246700 12799293 World;Africa;Central Africa | |
AMRO AI Anguilla (United Kingdom) 91 14731 World;North America | |
AMRO AG Antigua and Barbuda 442 96286 World;North America | |
AMRO AR Argentina 2766890 44361150 World;South America | |
EURO AM Armenia 29743 2951745 World;Europe;NonEU |
This gist describes my solution to Matt Parker's puzzle #8:
My solution involves looking at the pattern of folds when viewing the folded stack from the sides. And then using some python code to generate all possible ways the folds can match up in a way that you will still end up with two rows of 4 sheets.
The list below shows all ways to fold a piece of paper, including ways where the top-left ends up on the inside of the folded stack.
#!/bin/bash | |
# | |
# Script which scans all your mounted timemachine volumes, and apfs snapshots for a specific file. | |
# | |
# Willem Hengeveld <itsme@xs4all.nl> | |
# | |
if [[ $(id -u) -ne 0 ]]; then | |
sudo $0 "$@" | |
exit $? |
#!/bin/bash | |
# query.sh from BreachCompilation - magnet:?xt=urn:btih:7ffbcd8cee06aba2ce6561688cf68ce2addca0a3 | |
# works with older bash versions. | |
# patch by Willem <itsme@xs4all.nl> | |
dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |
if [ "$1" != "" ]; then | |
word1=$(echo $1 | tr A-Z a-z) | |
letter1=$(echo $word1|cut -b1) | |
if [[ $letter1 == [a-zA-Z0-9] ]]; then |