Ghostkey CLI
A command-line interface for managing ghost keys and certificates in the Freenet ecosystem.
What are Ghost Keys?
Ghost keys are a cryptographic mechanism used in the Freenet ecosystem to provide anonymous, unlinkable donations. They allow donors to prove they have made a donation without revealing their identity or linking multiple donations together. Ghost keys are created through a multi-step process involving master keys, delegate certificates, and finally the ghost key itself.
Purpose of Ghost Keys
- Anonymity: Donors can prove they've made a donation without revealing their identity.
- Verifiability: The system can verify that a donation has been made without knowing who made it.
This CLI tool provides the necessary utilities to manage the entire lifecycle of ghost keys, from generating master keys to creating and verifying ghost key certificates.
Features
- Generate master keys
- Create and verify delegate certificates
- Generate and verify ghost key certificates
- Sign messages with ghost keys
- Verify signed messages
Installation
To install the Ghostkey CLI, you need to have Rust and Cargo installed on your system. Then, you can build and install the CLI using:
cargo install --path .
Usage
The Ghostkey CLI provides several subcommands:
generate-master-key: Generate a new master key pairgenerate-delegate: Create a new delegate certificateverify-delegate: Verify a delegate certificategenerate-ghost-key: Generate a new ghost key certificateverify-ghost-key: Verify a ghost key certificatesign-message: Sign a message using a ghost keyverify-signed-message: Verify a signed message
For detailed usage of each subcommand, use the --help flag:
ghostkey <subcommand> --help
Examples
-
Generate a master key:
ghostkey generate-master-key --output-dir ./master-keys -
Create a delegate certificate:
ghostkey generate-delegate --master-signing-key ./master-keys/master_signing_key.pem --info "Test Delegate" --output-dir ./delegate -
Generate a ghost key:
ghostkey generate-ghost-key --delegate-dir ./delegate --output-dir ./ghost-key -
Sign a message:
ghostkey sign-message --ghost-certificate ./ghost-key/ghost_key_certificate.pem --ghost-signing-key ./ghost-key/ghost_key_signing_key.pem --message ./message.txt --output ./signed_message.pem -
Verify a signed message:
ghostkey verify-signed-message --signed-message ./signed_message.pem --master-verifying-key ./master-keys/master_verifying_key.pem
Testing
To run the test suite for the Ghostkey CLI, use:
./test_ghostkey.sh
This script will run through various scenarios to ensure the CLI is functioning correctly.
License
This project is licensed under the GNU Lesser General Public License v3.0.