Skip to content

Instantly share code, notes, and snippets.

@Ryanauger95
Created October 11, 2019 21:31
Show Gist options
  • Save Ryanauger95/05d4f352bf29759b7f0418f861c49b72 to your computer and use it in GitHub Desktop.
Save Ryanauger95/05d4f352bf29759b7f0418f861c49b72 to your computer and use it in GitHub Desktop.
Generate an ethereum private/public key pair
#!/usr/bin/env bash
openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > Key
# Generate pub key
cat Key | grep pub -A 5 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//' > pub
# Generate priv key
cat Key | grep priv -A 3 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//' > priv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment