namespace Infrastructure.PasswordHashing; /// /// Service for hashing and verifying user passwords. /// public interface IPasswordInfrastructure { /// /// Hashes a plaintext password, generating a new random salt. /// /// The plaintext password to hash. /// A string encoding both the salt and the resulting hash, suitable for storage. public string Hash(string password); /// /// Verifies a plaintext password against a previously stored hash. /// /// The plaintext password to verify. /// The stored salt/hash string previously produced by . /// true if the password matches the stored hash; otherwise false. public bool Verify(string password, string stored); }