Versions in this module Expand all Collapse all v0 v0.1.1 Aug 30, 2022 Changes in this version + const DefaultLetterAmbiguousSet + const DefaultLetterSet + const DefaultNumberAmbiguousSet + const DefaultNumberSet + const DefaultSymbolAmbiguousSet + const DefaultSymbolSet + const LengthOK + const LengthStrong + const LengthVeryStrong + const LengthWeak + var DefaultConfig = Config + var DefaultGenerator = New() + var DefaultParams = ScryptParams + var ErrCiphertextFormat = errors.New("Ciphertext input format not as expected") + var ErrCiphertextVer = errors.New("Nonmatched ciphertext version") + var ErrConfigIsEmpty = errors.New("config is empty") + var ErrInvalidVersionUpdate = errors.New(...) + var ErrPassphraseHashMismatch = errors.New("Passphrase hash does not match supplied ciphertext") + var ErrPassphraseLength = errors.New("Passphrase must be at least MinLength") + var ErrScryptParamN = errors.New("Given Scrypt (N) cost factor out of acceptable range") + var ErrScryptParamP = errors.New("Given Scrypt (p) cost factor out of acceptable range") + var ErrScryptParamR = errors.New("Given Scrypt (r) cost factor out of acceptable range") + var ErrSecretBoxDecryptFail = errors.New("SecretBox decryption failed") + var MinLength = 8 + func Benchmark(params ScryptParams) (seconds float64, err error) + func CheckV2(origin, passwordStr string) bool + func GenerateV2(origin string) string + func GetHashVersion(ciphertext string) (version int, err error) + func GetMasterVersion(ciphertext string) (version int, err error) + func Hash(userpass, masterpass string, version int, ...) (pwHashOut string, err error) + func UpdateMaster(newMaster, oldMaster string, newVersion int, ciphertext string, ...) (pwHashOut string, err error) + func Verify(userpass, masterpass, ciphertext string) error + type Config struct + CharacterSet string + ExcludeAmbiguousCharacters bool + ExcludeSimilarCharacters bool + IncludeLowercaseLetters bool + IncludeNumbers bool + IncludeSymbols bool + IncludeUppercaseLetters bool + Length uint + type Generator struct + Config *Config + func New() *Generator + func NewWithConfig(config *Config) *Generator + func (g Generator) Generate() (*string, error) + func (g Generator) GenerateByLength(length uint) string + func (g Generator) GenerateByOK() string + func (g Generator) GenerateByStrong() string + func (g Generator) GenerateByVeryStrong() string + func (g Generator) GenerateByWeak() string + func (g Generator) GenerateMany(amount uint) ([]string, error) + func (g Generator) GenerateManyWithLength(amount, length uint) ([]string, error) + func (g Generator) GenerateWithLength(length uint) (*string, error) + type ScryptParams struct + N int + P int + R int + func GetParams(ciphertext string) (userParams, masterParams ScryptParams, err error)