A tiny secure-random password generator

go-psw

Version Build Status Go Report Card Coverage Status PkgGoDev

A tiny golang tool for generating a crypto-random password in a terminal.

Golang logo

Installation

go install github.com/hedhyw/go-psw/cmd/psw@latest

Usage

psw [LENGTH] [CHARS_PATTERN]

# Just generate a secure-random password:
psw

# Generate a password of length 10:
psw 10

# Generate only with given pattern (next example will print [a-zA-Z]):
psw 10 aA

# Special case (next example will print only [ёàは]):
psw 10 ёàは

Using as a library

package main

import (
	"fmt"
	"log"

	"github.com/hedhyw/go-psw/pkg/v1/consts"
	"github.com/hedhyw/go-psw/pkg/v1/generator"
)

func main() {
	g := generator.NewCryptoRandGenerator()

	chars, err := g.GeneratePassword(
		consts.Digits+consts.LowerLetters, // Chars to use.
		10,                                // Password length.
	)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(chars)
}

License

See License.

Owner
Similar Resources

eval the strength of a password

mpasswordeval eval the strength of a password 校验密码的安全性 包含以下几点校验 常规规则校验 密码长度 (必须指定) 是否包含数字 是否包含大写字母 是否包含小写字母 是否包含特殊符号 是否通过zxcvbn 是否通过pwned 是否在常用弱密码 使用示

Nov 22, 2022

Generate a cryptographically strong random string :lock:

Crypto Random String You can use this library to generate a cryptographically strong random string for creating an identifier, slug, salt, PIN code, f

Oct 7, 2021

Culture - A package that gets a random name from the Culture series' ships Minds.

culture A package that gets a random name from the Culture series' ships Minds. Getting started This project requires Go to be installed. On OS X with

Jan 2, 2022

⚡️A tiny web3 platform for hack clubbers

⚡️A tiny web3 platform for hack clubbers

Ethermint Ethermint is a scalable and interoperable Ethereum library, built on Proof-of-Stake with fast-finality using the Cosmos SDK which runs on to

Sep 25, 2022

A tiny Crypto Project with REST API

Goal ⚽ Golang으로 아무 쓸모 없는 블록체인을 한땀 한땀 만들어보면서 BTC나 ETH에 적용된 블록체인 기법 이해해보기! Special Thanks to Nico! Current... 🏗️ Work 🏃 자세한 내용은 issue와 PR을 확인하세요. Now

Dec 30, 2021

DERO: Secure, Anonymous Blockchain with Smart Contracts. Subscribe to Dero announcements by sending mail to [email protected] with subject: subscribe announcements

DERO: Secure, Anonymous Blockchain with Smart Contracts.  Subscribe to Dero announcements by sending mail to lists@dero.io with subject: subscribe announcements

Welcome to the Dero Project DERO News Forum Wiki Explorer Source Twitter Discord Github Stats WebWallet Medium Table of Contents ABOUT DERO PROJECT DE

Dec 7, 2022

Secure software enclave for storage of sensitive information in memory.

MemGuard Software enclave for storage of sensitive information in memory. This package attempts to reduce the likelihood of sensitive data being expos

Dec 30, 2022

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

Jan 7, 2023

A simple, secure self-destructing message service, using HashiCorp Vault product as a backend

A simple, secure self-destructing message service, using HashiCorp Vault product as a backend

sup3rS3cretMes5age! A simple, secure self-destructing message service, using Has

Mar 5, 2022
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.

Themis provides strong, usable cryptography for busy people General purpose cryptographic library for storage and messaging for iOS (Swift, Obj-C), An

Jan 9, 2023
profane password? generator

profaneword profane password generator (probably insecure), as suggested by u/gatestone. This is still missing some requirements: special characters e

Apr 21, 2022
fastrand implements a cryptographically secure pseudorandom number generator.

10x faster than crypto/rand. Uses securely allocated memory. The generator is seeded using the system's default entropy source, and thereafter produces random values via repeated hashing. As a result, fastrand can generate randomness much faster than crypto/rand, and generation cannot fail beyond a potential panic during init().

Nov 25, 2022
A simple and lightweight encrypted password manager written in Go.
A simple and lightweight encrypted password manager written in Go.

Osiris Password Manager A simple and lightweight encrypted password manager written in Go

Jun 16, 2022
Secret - Encrypt anything with a password
 Secret - Encrypt anything with a password

Secret - Encrypt anything with a password Ever wanted to hide a file? Now you can do it really easily! Usage secret {-e/--encrypt | -d/--decrypt} <sou

Aug 10, 2022
:key: Idiotproof golang password validation library inspired by Python's passlib

passlib for go 100% modules-free. Python's passlib is quite an amazing library. I'm not sure there's a password library in existence with more thought

Dec 19, 2022
A convenience library for generating, comparing and inspecting password hashes using the scrypt KDF in Go 🔑

simple-scrypt simple-scrypt provides a convenience wrapper around Go's existing scrypt package that makes it easier to securely derive strong keys ("h

Dec 22, 2022
 🚀 cpwd is create password tool
 🚀 cpwd is create password tool

cpwd ?? cpwd is create password tool Install source code git clone https://github.com/songqii/cpwd_code.git cd $GOPATH/src/cpwd_code go build brew br

Dec 29, 2021
Use the HashPassword function to generate a hashed value for the provided password

hasher Use the 'HashPassword' function to generate a hashed value for the provided password. h, err := hasher.HashPassword("password") // h == XohImNo

Nov 1, 2021
Blooming Password

Blooming Password A program that implements the NIST 800-63-3b Banned Password Check using a bloom filter built from the Have I been pwned SHA1 passwo

Oct 13, 2022