bls-sig-cli

Crates.iobls-sig-cli
lib.rsbls-sig-cli
version0.1.5
created_at2025-07-05 18:44:35.110527+00
updated_at2025-07-05 18:56:03.059804+00
descriptionA command-line tool for BLS signature operations (keygen, pubkey, sign, verify).
homepagehttps://github.com/sidx04/BLS-Signatures
repositoryhttps://github.com/sidx04/BLS-Signatures
max_upload_size
id1739379
size51,507
Sid (sidx04)

documentation

README

BLS Signatures CLI (bls-sig-cli)

A proof-of-concept, command-line tool for BLS signature operations, providing functionalities for key generation, public key derivation, message signing, and signature verification.


Table of Contents


Overview

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.


Features

  • 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.

Installation

From Crates.io (Recommended)

To install bls-sig-cli directly from Crates.io, ensure you have Rust and Cargo installed, then run:

cargo install bls-sig-cli

From Source

If 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 --release

The 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 directory

Usage

The bls-sig-cli CLI provides several subcommands, each corresponding to a specific BLS signature operation.

Global Options

BLS Signatures CLI

Usage: bls-sig-cli <COMMAND>

Commands

keygen

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.

pubkey

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

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

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.

Examples

Generate a random secret key and save to a file:

bls-sig-cli keygen --out my_secret.key

Generate 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.key

Sign 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_HEX

Replace PK_HEX, MSG_STRING, and SIG_HEX with actual values.


Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request on the GitHub repository.


License

This project is licensed under:


Authors

Commit count: 0

cargo fmt