cryptipass

cryptipass is a flexible, high-entropy passphrase generator that creates secure, pronounceable passwords using a probabilistic model. It's designed for security-conscious developers who need memorable yet strong passphrases.
Features
- Pronounceable Passwords: Generates words based on real-world token patterns, making them easy to remember.
- Highly Customizable: Define your own word list or use pre-defined patterns like symbols, numbers, and mixed-case letters.
- Secure Randomness: Uses cryptographic-grade randomness (
crypto/rand
) for generating passphrases.
- Entropy Analysis: Built-in entropy calculations and certification to ensure high randomness and strength.
- Pattern-Based Generation: Control password structure using customizable patterns (e.g., words, digits, symbols).
Installation
To install cryptipass
, use go get
:
go get github.com/francescoalemanno/cryptipass/v2
Then, import it into your project:
import "github.com/francescoalemanno/cryptipass/v2"
NOTE: We also have a CLI available for non-library uses.
Quick Start
Here's how to generate a passphrase using the default word style:
package main
import (
"fmt"
"github.com/francescoalemanno/cryptipass/v2"
)
func main() {
gen := cryptipass.NewInstance()
passphrase, entropy := gen.GenPassphrase(4)
fmt.Println("Passphrase:", passphrase)
fmt.Println("Entropy:", entropy)
}
Want more control over the pattern? Use GenFromPattern
:
pass, entropy := gen.GenFromPattern("w-d-s")
fmt.Println("Generated Password:", pass)
Possible patterns are formed by combining:
- 'w' lowercase word, 'W' for uppercase word.
- 'c' a lowercase character, 'C' a uppercase character.
- 's' symbol, 'd' digit.
other symbols are interpolated in the final password and to interpolate one of the reserved symbols use escaping with "".
Custom Word Lists
You can customize the word style by creating a new instance from your own token set:
myTokens := []string{"alpha", "bravo", "charlie", "delta"}
gen := cryptipass.NewCustomInstance(myTokens, 1)
pass, entropy := gen.GenPassphrase(3)
fmt.Println("Custom Passphrase:", pass)
fmt.Println("Entropy:", entropy)
Documentation
Full API documentation is available at GoDoc.
License
cryptipass
is licensed under the MIT License. See LICENSE for details.
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check out issues or open a pull request.
cryptipass – Secure, flexible, and pronounceable passphrases for your Go applications.