cryptkey
cryptkey is a minimalist command-line utility written in Go for generating
cryptographically secure random keys. It offers options for generating
8-byte, 16-byte, or 32-byte hexadecimal keys, making it suitable for quick
key generation for various applications.
Features
- Secure Key Generation: Utilizes
crypto/rand for robust,
cryptographically secure random key generation.
- Flexible Key Lengths: Supports 8, 16, and 32-byte key outputs.
- Clipboard Integration: Designed to be easily piped with OS-specific
clipboard utilities for instant use.
Usage
To generate a key, simply run the cryptkey executable. By default, it will
output a 32-byte hexadecimal key.
cryptkey
Options
-8: Generate an 8-byte key.
-16: Generate a 16-byte key.
-32: Generate a 32-byte key (default).
If multiple length flags are provided, the first one encountered will take
precedence.
Examples
Generate a 16-byte key:
cryptkey -16
Integrate with your system's clipboard for immediate use:
Installation
From Source
-
Clone the repository (or download the main.go file):
git clone https://github.com/your-username/cryptkey.git # Replace with your repo
cd cryptkey
-
Build the executable:
go build -o cryptkey main.go
-
Optional: Move to PATH: For system-wide access, move the cryptkey
executable to a directory included in your system's PATH (e.g.,
/usr/local/bin on Linux/macOS, or a directory added to Path
environment variable on Windows).
# On Linux/macOS
sudo mv cryptkey /usr/local/bin/
Via go install
go install github.com/theaaronn/keycrypt
License
This project is open source and available under the MIT License.