Table of Contents

IPasswordHasher Interface

Hashes and verifies user passwords in Sphinx.

Remarks

All Sphinx password handling goes through this interface: the user manager only ever calls HashPassword and VerifyHashedPassword. A custom hashing algorithm (for example PBKDF2, bcrypt or argon2) can therefore be plugged in by implementing this interface and assigning it to the TSphinxConfig.PasswordHasher property. When no custom hasher is assigned, Sphinx uses its built-in TDefaultPasswordHasher. An implementation is shared across concurrent requests, so it must be stateless / thread-safe.

Syntax

Unit: Sphinx.PasswordHasher

IPasswordHasher = interface(IInterface);

Methods

Name Description
HashPassword Hashes a password, returning the value to be stored for the user.
VerifyHashedPassword Verifies a provided password against a previously stored hash.