From 8bdfac0451065a74281fa201224841805f2c68fe Mon Sep 17 00:00:00 2001 From: Dobes Vandermeer Date: Wed, 3 Jul 2019 16:08:17 -0700 Subject: [PATCH] Add a note about username usage --- readme.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/readme.md b/readme.md index 0d03f90..edc5c68 100644 --- a/readme.md +++ b/readme.md @@ -36,6 +36,14 @@ console.log(verifier) *note:* `derivePrivateKey` is provided for completeness with the SRP 6a specification. It is however recommended to use some form of "slow hashing", like [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2), to reduce the viability of a brute force attack against the verifier. +*note:* The use of a username as part of the verifier calculation means that if the user changes their +username they must simultaneously provide an update salt and verifier to the server. If a user +is able to login with multiple identifiers (e.g. username, phone number, or email address) you would +need a separate verifier for each identifier. To avoid these issues you can leave the `username` blank +for purposes of this algorithm. The downside of not using a username is that a server can do an attack +to determine whether two users have the same password. For normal apps that trust the server but use +SRP just to avoid transmitting plaintext passwords, this may be an acceptable trade-off. + ### Logging in Authenticating with the server involves mutliple steps.