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
#!/bin/bash | |
# bxor.bash: bitwise exclusive OR (XOR) of two numbers represented in hexadecimal numerals. Result is padded with leading zeros if the number is smaller than 2**256. | |
# The script could be used to encrypt or decrypt (Vernam cipher). | |
# Examples: | |
# $ bash bxor.bash "000ffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364139" "fedc09" | |
# $ for i in {1..8}; do printf "%08X" "$SRANDOM" >> b256random.key; done && bash ./bxor.bash 012345b $( < b256random.key ) | |
# $ head -c 32 /dev/random >> b256random.key && bash ./bxor.bash $( head -c 32 plaindata.bin | basenc --base16 -w 0 ) $( basenc --base16 -w 0 < b256random.key ) | |
# $ zsh bxor.bash "ffff" "011" | |
# $ sh bxor.bash "ffff" "011" |
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
#!/bin/bash | |
# private_key_into_bitcoin_wif.sh: convert secp256k1 private key in hexadicimal number (HEX) to Bitcoin Wallet Import Format (WIF) | |
# Examples: | |
# $ bash private_key_into_bitcoin_wif.sh "000ffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364139" > private_key_bitcoin.wif | |
# $ bash private_key_into_bitcoin_wif.sh $(< input_file.txt) > private_key_bitcoin.wif | |
# $ cat priv_key.txt | xargs bash private_key_into_bitcoin_wif.sh > private_key_bitcoin.wif | |
# $ bash private_key_into_bitcoin_wif.sh fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364139 | echo "$(cat) importedkeylabel false" | xargs bitcoin-cli importprivkey && bitcoin-cli getaddressesbylabel importedkeylabel | |
# $ openssl rand -hex 32 | xargs bash private_key_into_bitcoin_wif.sh | |
# $ xxd -l 32 -p -c 32 /dev/random | xargs bash private_key_into_bitcoin_wif.sh |
NewerOlder