This file contains hidden or 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
"""Compare your devices dice seed creation with the ones generated by this script | |
and check how each word and checksum were calculated. | |
Ex: | |
python dice.py 565256126243114366655152522264552364231641333461455456111566561236253463223236163643465622462251536 | |
Entropy bytes: b'565256126243114366655152522264552364231641333461455456111566561236253463223236163643465622462251536' | |
Hashed bytes: 2e364baddcfa80dfc910fc92b634e962d2f844e9e9a210428d8e4d899a6883ae | |
Hashed bits: 0b10111000110110010010111010110111011100111110101000000011011111110010010001000011111100100100101011011000110100111010010110001011010010111110000100010011101001111010011010001000010000010000101000110110001110010011011000100110011010011010001000001110101110 |
This file contains hidden or 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
"""Uses Trezor python-mnemonic to convert hex keys to BIP39 seed words and vice-versa | |
Install Trezor python-mnemonic: | |
pip install mnemonic | |
Exemple: Convert hex key to words: | |
python nostr_seed_trezor.py a4431c0a96a4997ed5ec763fb58b7f532530b9cf916219f3d2e2118f47cb56bb | |
Seed words: picture body actor coil end satoshi fish mom distance proof thank play fantasy friend dinner clump boring ozone review cart virtual toss foot infant | |
BIP39 seed numbers: [1315, 200, 22, 363, 589, 1532, 702, 1143, 510, 1379, 1791, 1331, 665, 744, 499, 355, 208, 1269, 1477, 281, 1956, 1838, 728, 923] | |
Exemple: Convert words to hex key: |
This file contains hidden or 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
"""Uses Embit and qrcode modules to convert hex and bech32 keys to BIP39 seed words and vice-versa. | |
Also generates ascii compact seed QR codes and public keys. | |
Install Embit: | |
pip install embit | |
Exemple: Words as input: | |
python nostr_c_seed_qr.py picture body actor coil end satoshi fish mom distance proof thank play fantasy friend dinner clump boring ozone review cart virtual toss foot infant | |
Exemple: Hex key as input: |
This file contains hidden or 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
""" Python nostr client to for air-gapped shit posting | |
Requirements: | |
- python-nostr: On the same folder the air_nostr.py is, clone and rename it | |
git clone https://github.com/jeffthibault/python-nostr | |
mv python-nostr python_nostr | |
- opencv, embit, qrcode | |
pip install opencv-python embit qrcode |
This file contains hidden or 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
"""Uses Embit and qrcode modules generates ascii compact seed QR code. | |
Install Embit: | |
pip install embit | |
Exemple: Words as input: | |
python seed_qr.py picture body actor coil end satoshi fish mom distance proof thank play fantasy friend dinner clump boring ozone review cart virtual toss foot infant | |
""" | |
import sys | |
from io import StringIO |
This file contains hidden or 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
"""Uses Embit to convert BIP39 seed words to Tiny Seed format. | |
Install Embit: | |
pip install embit | |
Exemple: python tiny_seed.py rail price fiction dice orphan have allow spatial share country mixed gasp | |
""" | |
import sys | |
from embit.wordlists.bip39 import WORDLIST |
This file contains hidden or 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 io import StringIO | |
import hashlib | |
from Crypto.Cipher import AES | |
from Crypto.Random import get_random_bytes | |
import base64 | |
from qrcode import QRCode | |
from embit.wordlists.bip39 import WORDLIST | |
from embit import bip39 | |
MNEMONIC_ID = "test_ID" |
This file contains hidden or 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
""" | |
Create Krux colors from 8 bits RGB values | |
Type r g b arguments as 0-255 numbers | |
""" | |
import sys | |
def rgb888torgb565(color): | |
"""convert to gggbbbbbrrrrrggg to tuple""" | |
MASK5 = 0b11111 |
This file contains hidden or 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
""" | |
This python script is aimed to help and teach how Krux can be used to sign files and create PEM public keys so openssl can be used to verify | |
Requirements: | |
- opencv, qrcode | |
pip install opencv-python qrcode | |
- This script also calls a openssl bash command, so it is required to have verification functionality | |
""" | |
import argparse |
This file contains hidden or 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
# The MIT License (MIT) | |
# Copyright (c) 2021-2023 Krux contributors | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
OlderNewer