gogen

command module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: MIT Imports: 3 Imported by: 0

README

gogen

Go Reference Go Report Card Build Status

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

Installation

curl -sSL https://raw.githubusercontent.com/idelchi/gogen/refs/heads/main/install.sh | sh -s -- -d ~/.local/bin

Usage

gogen [flags] command [flags]
Configuration
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.

Configuration
Flag Environment Variable Description Default Valid Range
-l, --length GOGEN_LENGTH Length of the key to generate 32 32-512 (multiple of 32)

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
password - Generate a password

Generate secure passwords of configurable length.

Configuration
Flag Environment Variable Description Default Valid Range
-l, --length GOGEN_LENGTH Length of the password to generate 16 -

Examples:

# Generate a 16-character password (default)
gogen password

# Generate a 20-character password
gogen password -l 20

# Using the shorter alias
gogen pw
hash - Hash a password

Hash passwords using bcrypt or argon2 with configurable cost and benchmarking capabilities.

Configuration
Flag Environment Variable Description Default Valid Range
-t, --type GOGEN_TYPE Hashing algorithm to use bcrypt bcrypt, argon2
-c, --cost GOGEN_COST Cost of the password hash.` 12 4-31
-b, --benchmark GOGEN_BENCHMARK Run a benchmark on the password hash. false -

The --cost and --benchmark flags are only valid for the bcrypt algorithm.

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

# Hash a password using argon2
gogen hash -t argon2 password

For detailed help on any command:

gogen --help
gogen <command> --help

Documentation

Overview

Command gogen provides cryptographic key generation, password generation and hashing functionality.

Usage:

# Generate a 32-byte key
gogen key

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

# Generate a password
gogen password

# 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
argon
Package argon provides functionality for secure password hashing using Argon2id.
Package argon provides functionality for secure password hashing using Argon2id.
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.
pw
Package pw provides secure password generation functionality using a diverse set of characters including lowercase, uppercase, numbers, and special characters.
Package pw provides secure password generation functionality using a diverse set of characters including lowercase, uppercase, numbers, and special characters.
stdin
Package stdin provides simple utilities for reading from stdin.
Package stdin provides simple utilities for reading from stdin.
uid
Package uid provides methods for generating unique identifiers.
Package uid provides methods for generating unique identifiers.
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