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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Author: itsme@xs4all.nl | |
""" | |
import html.parser | |
import html | |
import urllib.request | |
import json | |
from datetime import datetime, timedelta | |
import re | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bsddb.db import * | |
import sys | |
import struct | |
# by Willem Hengeveld <itsme@xs4all.nl> | |
# usage: python dumpwallet path_to_your/wallet.dat | |
# note: you need to have the bsddb package installed | |
def getcompact(k, i): | |
b= ord(k[i]) ; i+=1 |
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Linux kernel kallsyms unpacker | |
# Version 0.2 | |
# Copyright (c) 2010-2013 Igor Skochinsky | |
# | |
# This software is provided 'as-is', without any express or implied | |
# warranty. In no event will the authors be held liable for any damages | |
# arising from the use of this software. | |
# | |
# Permission is granted to anyone to use this software for any purpose, | |
# including commercial applications, and to alter it and redistribute it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 $? |