pbkdf2

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package pbkdf2 implements the functions, types, and interfaces for the module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *types.Config

func NewPBKDF2 added in v0.3.18

func NewPBKDF2(algType types.Type, config *types.Config) (interfaces.Cryptographic, error)

NewPBKDF2 creates a new PBKDF2 crypto instance

func ResolveType added in v0.3.18

func ResolveType(algType types.Type) (types.Type, error)

ResolveType resolves the Type for PBKDF2, providing a default underlying hash if not specified.

Types

type PBKDF2

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

PBKDF2 implements the PBKDF2 hashing algorithm

func (*PBKDF2) Hash

func (c *PBKDF2) Hash(password string) (*types.HashParts, error)

Hash implements the hash method

func (*PBKDF2) HashWithSalt

func (c *PBKDF2) HashWithSalt(password string, salt []byte) (*types.HashParts, error)

HashWithSalt implements the hash with salt method

func (*PBKDF2) Type

func (c *PBKDF2) Type() types.Type

func (*PBKDF2) Verify

func (c *PBKDF2) Verify(parts *types.HashParts, password string) error

Verify implements the verify method

type Params

type Params struct {
	Iterations int
	KeyLength  uint32
}

Params represents parameters for PBKDF2 algorithm

func DefaultParams

func DefaultParams() *Params

func FromMap added in v0.3.18

func FromMap(m map[string]string) (params *Params, err error)

FromMap parses PBKDF2 parameters from a map[string]string.

func (*Params) FromMap added in v0.3.18

func (p *Params) FromMap(params map[string]string) error

func (*Params) String

func (p *Params) String() string

String returns the string representation of parameters

func (*Params) ToMap added in v0.3.18

func (p *Params) ToMap() map[string]string

ToMap converts Params to a map[string]string

func (*Params) Validate added in v0.3.18

func (p *Params) Validate(config *types.Config) error

Jump to

Keyboard shortcuts

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