This script is designed to generate ECDSA and Bitcoin cryptographic keys using OpenSSL. It creates a pair of ECDSA keys (private and public) and derives Bitcoin-compatible key pairs from the ECDSA private key.
To run this script, you need to have OpenSSL installed on your system. OpenSSL is used for the generation of the keys and for certain manipulations required to derive the Bitcoin keys.
-
On Ubuntu/Debian-based systems:
sudo apt-get update sudo apt-get install openssl
-
On RedHat/Fedora-based systems:
sudo yum update sudo yum install openssl
-
On macOS (using Homebrew):
brew install openssl
-
Ensure you have OpenSSL installed and accessible from your command line.
-
Place the script
main.sh
in your desired directory. -
Open a terminal and navigate to the directory where
main.sh
is located. -
Make the script executable by running:
chmod +x main.sh
-
Execute the script:
./main.sh
The script performs the following operations:
- Generates an ECDSA private key using the
secp256k1
curve, which is commonly used in Bitcoin cryptography. - Extracts the public key from the generated ECDSA private key.
- Derives a Bitcoin-compatible private key from the ECDSA private key.
- Derives a Bitcoin-compatible public key from the ECDSA private key.
After running the script, you will find four files in the directory:
ECDSA.priv
- The ECDSA private key.ECDSA.pub
- The ECDSA public key.BITCOIN.priv
- The Bitcoin-compatible private key derived from the ECDSA private key.BITCOIN.pub
- The Bitcoin-compatible public key derived from the ECDSA private key.
Ensure that you securely store the generated private keys (ECDSA.priv
and BITCOIN.priv
). Exposure of these keys can compromise any cryptographic system or currency wallet that uses them.