Categorygithub.com/etkecc/go-secgen
modulepackage
1.4.0
Repository: https://github.com/etkecc/go-secgen.git
Documentation: pkg.go.dev

# README

secgen

Secrets generator, supported types:

  • Passwords
  • Random bytes
  • ED25519 SSH keypairs

Simple go environment variables reader, for env-based configs

// password
securePassword := secgen.Password(64)
// base64-encode random bytes (openssl rand -base64 replacement)
randomBytes := secgen.Base64Bytes(64)

// ssh key
publicSSHkey, privateSSHkey, err := secgen.Keypair()

# Functions

Base64Bytes generates secure bytes with the given length and returns it as a base64 string.
DKIM generates DKIM signature and private key (TXT record, private key).
HexBytes generates secure bytes with the given length and returns it as a hex string.
Keypair generates ed25519 keypair for ssh (public key, private key).
Passphrase generates secure passphrase, based on shared secret and salt.
Password generates secure password.

# Constants

RSABits used for DKIM keypair.