drupal7

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: 8 Imported by: 0

Documentation

Overview

Package drupal provides verification of passwords hashed using the Drupal 7 password hashing method.

This verifier handles Drupal 7 password hashes that start with $S$ and uses SHA-512 with a custom iteration count and base64 encoding scheme. Note that while more secure than traditional MD5, this is still considered a legacy algorithm for modern applications. See original implementation at https://api.drupal.org/api/drupal/includes!password.inc/function/_password_crypt/7.x

Index

Constants

View Source
const (
	Identifier = "$S$"
	HashLength = 55
	Format     = "%s%s%s%s"
)
View Source
const (
	DefaultMinIterations = 1000
	DefaultMaxIterations = 500000
)

Variables

View Source
var DefaultValidationOpts = &ValidationOpts{
	MinIterations: DefaultMinIterations,
	MaxIterations: DefaultMaxIterations,
}

Functions

This section is empty.

Types

type ValidationOpts added in v0.12.0

type ValidationOpts struct {
	MinIterations int
	MaxIterations 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(hash 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 Drupal 7 password hash.

Jump to

Keyboard shortcuts

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