Skip to content

theaaronn/keycrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KeyCrypt

keycrypt 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 keycrypt executable. By default, it will output a 32-byte hexadecimal key.

keycrypt

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:

keycrypt -16

Integrate with your system's clipboard for immediate use:

  • Windows:
    keycrypt -16 | clip
  • macOS:
    keycrypt | pbcopy
  • Linux (requires xclip):
    keycrypt | xclip -selection clipboard

Installation

From Source

  1. Clone the repository (or download the main.go file):

    git clone https://github.com/theaaronn/keycrypt.git
    cd keycrypt
  2. Build the executable:

    go build -o keycrypt main.go
  3. Optional: Move to PATH: For system-wide access, move the keycrypt 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 keycrypt /usr/local/bin/

Via go install

go install github.com/theaaronn/keycrypt/v3@latest

License

This project is open source and available under the MIT License.

About

8, 16 and 32 secure random string generation in Go

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages