Table of Contents

Class SrpIdentity

Namespace
FishMMO.Auth.Implementation
Assembly
FishMMO-AuthShared.dll

What SRP hashes as an account's identity, and how a sign-in identifier is written on the wire.

public static class SrpIdentity
Inheritance
SrpIdentity
Inherited Members

Remarks

One fixed identity for every account. SRP derives the verifier from x = H(salt, H(identity ":" password)), and every proof hashes the identity again, so a proof verifies only if the identity is byte-for-byte what it was when the password was set. The typed name used to be that identity, and nothing agreed on its spelling: registration and sign-in hashed what the player typed, the Control Panel's password reset and password change hashed the stored lowercase name, and an email sign-in hashed the email — which never matched a verifier made from the username, so email sign-in could not succeed (issue #267).

A constant has the same security here as a name: every account has its own random salt, which is what stops one password guess being tested against many verifiers, and the row a verifier is stored in already says whose it is. It is the identity the Control Panel's wwwroot/js/srp.js uses too, as SRP_IDENTITY; the two must never differ.

Changing Value invalidates every stored password.

Fields

Value

The identity every SRP derivation and proof uses. See the remarks before changing it.

public const string Value = "fishmmo"

Field Value

string

Methods

NormalizeIdentifier(string?)

A username or email address as it is sent and compared: trimmed and lowercased under the invariant culture.

public static string? NormalizeIdentifier(string? identifier)

Parameters

identifier string

A username or email address.

Returns

string

The normalised identifier, or the input when it is null or empty.

Remarks

Invariant, never the current culture: under a Turkish culture "I".ToLower() is a dotless ı. Usernames are ASCII letters, digits and underscores, so for them this changes only A–Z. Account lookups are case-insensitive on the server regardless; this makes the wire form one spelling, so "Jim", "JIM" and "jim" are the same sign-in.