LinusU / LinusU/secure-remote-password

Padding of g

Open
#12 29 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
110
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Hello,

I'd like to thank for the excellent SRP-6a implementation!
Nice API, very clean code, so easy to follow 👍
I have a .NET backend, so I've converted the code to C#.

While porting the code I noticed that the library doesn't pad the value of g.
RFC5054 specifies that g should be left-padded with zeros to be the same length as N.

The leads to the miscalculated value of the k multiplier: k = H(N | PAD(g)).
As a result, the code doesn't pass the SRP test vectors (RFC5054, Appendix B).
Namely, the values of k, B and S don't match.

The library works just fine without the padding as long as the same code
is used on both client and server. But if the server code strictly follows the RFC,
the client won't be able to authenticate because of the different values of k.

Shouldn't it be fixed?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the library's SRP calculations with RFC5054 Appendix B, focusing on the padded value of g and the resulting k, B, and S values. Confirm that the implementation matches the RFC test vectors and that authentication remains interoperable with an RFC-compliant peer.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, cryptography, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.