Skip to content

Instantly share code, notes, and snippets.

View pdyraga's full-sized avatar
🏔️

Piotr Dyraga pdyraga

🏔️
View GitHub Profile

0x0498b5a912b28763b70a7b6f64862538aea0fca366b56f569b9f006a809e82ac

@pdyraga
pdyraga / keys
Created October 3, 2019 09:32 — forked from miguelmota/ethereum_keys.sh
Generate Ethereum Private key, Public key, and Address using Bash and OpenSSL
# Generate the private and public keys
openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > key
# Extract the public key and remove the EC prefix 0x04
cat key | grep pub -A 5 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//' > pub
# Extract the private key and remove the leading zero byte
cat key | grep priv -A 3 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^00//' > priv
# Generate the hash and take the address part