A proof-of-concept, command-line tool for BLS signature operations, providing functionalities for key generation, public key derivation, message signing, and signature verification.
bls-sig-cli is a versatile command-line interface designed to facilitate various operations related to BLS (Boneh-Lynn-Shacham) signatures. It leverages robust cryptographic libraries to provide a secure and easy-to-use tool for generating keys, signing messages, and verifying signatures.
- Key Generation: Generate BLS secret keys from Input Key Material (IKM) or randomly.
- Public Key Derivation: Derive the corresponding public key from a given secret key file.
- Message Signing: Sign messages using a BLS secret key.
- Signature Verification: Verify BLS signatures against a public key and a message.
- Flexible Output: Output keys and signatures to standard output or specified files.
To install bls-sig-cli directly from Crates.io, ensure you have Rust and Cargo installed, then run:
cargo install bls-sig-cliIf you prefer to build from source, follow these steps:
git clone https://github.com/sidx04/bls-sig-cli.git
cd bls-sig-cli
cargo build --releaseThe executable will be located at target/release/bls-sig-cli. You can then move it to a directory in your PATH:
cp target/release/bls-sig-cli ~/.local/bin/ # or any other specified directoryThe bls-sig-cli CLI provides several subcommands, each corresponding to a specific BLS signature operation.
BLS Signatures CLI
Usage: bls-sig-cli <COMMAND>
Generate a new BLS secret key.
Usage: bls-sig-cli keygen [OPTIONS]
Options:
-i,--ikm <IKM>: Optional. Input Key Material used to derive the BLS private key.-o,--out <OUT>: Optional. Path to store the generated secret key.-h,--help: Print help.
Derive and print the public key from a secret key file.
Usage: bls-sig-cli pubkey [OPTIONS]
Options:
-p,--path <PATH>: Optional. Path to the secret key file.-h,--help: Print help.
Sign a message using a BLS secret key. A message can be any file or any arbitrary string of characters.
Usage: bls-sig-cli sign [OPTIONS] --msg <MSG>
Options:
-p,--path <PATH>: Optional. Path to the secret key file.-m,--msg <MSG>: Mandatory. Message to be signed.-h,--help: Print help.
Verify a BLS signature.
Usage: bls-sig-cli verify --pk <PK> --msg <MSG> --sig <SIG>
Options:
-p,--pk <PK>: Mandatory. Public key (hex).-m,--msg <MSG>: Mandatory. Message used during signing.-s,--sig <SIG>: Mandatory. Signature (hex).-h,--help: Print help.
Generate a random secret key and save to a file:
bls-sig-cli keygen --out my_secret.keyGenerate a secret key from IKM:
bls-sig-cli keygen --ikm "MY_SUPER_SECRET_STRING"Derive a public key:
bls-sig-cli pubkey --path my_secret.keySign a message:
bls-sig-cli sign --path my_secret.key --msg "Hello, world!"Verify a signature:
bls-sig-cli verify --pk PK_HEX --msg "MSG_STRING" --sig SIG_HEXReplace
PK_HEX,MSG_STRING, andSIG_HEXwith actual values.
Contributions are welcome! Feel free to open an issue or submit a pull request on the GitHub repository.
This project is licensed under:
- sidx04 – siddpal04@gmail.com