gogen

command module
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 3 Imported by: 0

README

gogen

Go Reference Go Report Card Build Status

gogen is a tool for generating cryptographic keys and password hashes.

Installation

From source
go install github.com/idelchi/gogen@latest
From installation script
curl -sSL https://raw.githubusercontent.com/idelchi/gogen/refs/heads/main/install.sh | sh -s -- -d ~/.local/bin

Usage

gogen [flags] command [flags]
Global Flags and Environment Variables
Flag Environment Variable Description Default
-s, --show GOGEN_SHOW Show the configuration and exit false
-h, --help - Help for gogen -
-v, --version - Version for gogen -
Commands
key - Generate a cryptographic key

Generate keys of configurable length.

Flags and Environment Variables:

Flag Environment Variable Description Default Valid Range
-l, --length GOGEN_LENGTH Length of the key to generate 32 32-512 (multiple of 32)
-h, --help - Help for key command - -

Examples:

# Generate a 32-byte key (default)
gogen key

# Generate a 64-byte key
gogen key -l 64

# Key length must be between 32-512 bytes and a multiple of 4
hash - Hash a password

Hash passwords using bcrypt with configurable cost and benchmarking capabilities.

Flags and Environment Variables:

Flag Environment Variable Description Default Valid Range
-c, --cost GOGEN_COST Cost of the password hash 12 4-31
-b, --benchmark GOGEN_BENCHMARK Run a benchmark on the password hash false -
-h, --help - Help for hash command - -

Examples:

# Hash a password with default cost (12)
gogen hash password

# Hash with custom cost (4-31)
gogen hash -c 14 password

# Run benchmark to measure hashing performance across costs
gogen hash -b password

For detailed help on any command:

gogen --help
gogen <command> --help

Documentation

Overview

Command gogen provides cryptographic key generation and password hashing functionality.

Usage:

# Generate a 32-byte key
gogen key

# Generate a 64-byte key
gogen key -l 64

# Hash a password with default cost (12)
gogen hash password

# Hash a password with custom cost
gogen hash -c 14 password

# Run password hashing benchmark
gogen hash -b password

Directories

Path Synopsis
internal
commands
Package commands provides the command-line interface for the gogen tool.
Package commands provides the command-line interface for the gogen tool.
config
Package config defines the configuration structure and validation rules for the gogen tool.
Package config defines the configuration structure and validation rules for the gogen tool.
parse
Package parse generates and executes the command-line interface for the application.
Package parse generates and executes the command-line interface for the application.
pkg
cobraext
Package cobraext provides extensions to the cobra package.
Package cobraext provides extensions to the cobra package.
hash
Package hash provides functionality for secure password hashing and benchmarking using the bcrypt algorithm.
Package hash provides functionality for secure password hashing and benchmarking using the bcrypt algorithm.
key
Package key provides functionality for creating and managing cryptographic keys.
Package key provides functionality for creating and managing cryptographic keys.
printer
Package printer provides a simple way to print messages to the standard output and standard error streams.
Package printer provides a simple way to print messages to the standard output and standard error streams.
stdin
Package stdin provides simple utilities for reading from stdin.
Package stdin provides simple utilities for reading from stdin.
validator
Package validator provides a wrapper around go-playground/validator with built-in translation support for validation error messages.
Package validator provides a wrapper around go-playground/validator with built-in translation support for validation error messages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL