phpass

package
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package phpass provides verification of passwords hashed using the PHPass algorithm.

Note that PHPass is based on MD5 and is considered weak by modern standards. This package is only provided for legacy applications that wish to migrate away from PHPass to newer hashing methods.

Index

Constants

View Source
const (
	IdentifierP = "$P$"
	IdentifierH = "$H$"

	Format = "%s$%s"
)
View Source
const (
	DefaultMinRounds = 7
	DefaultMaxRounds = 31
)
View Source
const HashLength = 34

Variables

View Source
var DefaultValidationOpts = &ValidationOpts{
	MinRounds: DefaultMinRounds,
	MaxRounds: DefaultMaxRounds,
}

Functions

This section is empty.

Types

type ValidationOpts added in v0.12.0

type ValidationOpts struct {
	MinRounds int
	MaxRounds int
}

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

func NewVerifier added in v0.12.0

func NewVerifier(opts *ValidationOpts) *Verifier

func (*Verifier) Validate added in v0.12.0

func (v *Verifier) Validate(encoded string) (verifier.Result, error)

func (*Verifier) Verify added in v0.12.0

func (v *Verifier) Verify(hash, password string) (verifier.Result, error)

Verify checks if the given password matches the provided PHPass hash.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL