mediatekformation

SodiumPasswordEncoder
in package
implements PasswordEncoderInterface, SelfSaltingEncoderInterface

Hashes passwords using libsodium.

Tags
author

Robin Chalas robin.chalas@gmail.com

author

Zan Baldwin hello@zanbaldwin.com

author

Dominik Müller dominik.mueller@jkweb.ch

Interfaces, Classes, Traits and Enums

PasswordEncoderInterface
PasswordEncoderInterface is the interface for all encoders.
SelfSaltingEncoderInterface
SelfSaltingEncoderInterface is a marker interface for encoders that do not require a user-generated salt.

Table of Contents

MAX_PASSWORD_LENGTH  = 4096
$memLimit  : mixed
$opsLimit  : mixed
__construct()  : mixed
encodePassword()  : string
Encodes the raw password.
isPasswordValid()  : bool
Checks a raw password against an encoded password.
isSupported()  : bool
needsRehash()  : bool
{@inheritdoc}

Constants

Properties

Methods

__construct()

public __construct([int $opsLimit = null ][, int $memLimit = null ]) : mixed
Parameters
$opsLimit : int = null
$memLimit : int = null
Return values
mixed

encodePassword()

Encodes the raw password.

public encodePassword(mixed $raw, mixed $salt) : string
Parameters
$raw : mixed

The password to encode

$salt : mixed

The salt

Return values
string

The encoded password

isPasswordValid()

Checks a raw password against an encoded password.

public isPasswordValid(mixed $encoded, mixed $raw, mixed $salt) : bool
Parameters
$encoded : mixed

An encoded password

$raw : mixed

A raw password

$salt : mixed

The salt

Return values
bool

true if the password is valid, false otherwise

needsRehash()

{@inheritdoc}

public needsRehash(string $encoded) : bool
Parameters
$encoded : string
Return values
bool

Search results