
Product
Introducing Supply Chain Attack Campaigns Tracking in the Socket Dashboard
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.
A Go implementation of the Secure Remote Password Protocol (SRP)
This package implements SRP as defined in RFC 2945 and RFC 5054.
RFC 2945: The SRP Authentication and Key Exchange System
RFC 5054: Using the Secure Remote Password (SRP) Protocol for TLS Authentication
This package exposes several methods defined in AuthClient and AuthServer interfaces
to complete the authentication flow. It offers a default Client and Server set to use
SHA256 as the hashing algorithm and the 4096 prime value group from RFC 5054 Section 3.2.
c, _ := NewDefaultClient("username", "password")
s, _ := NewDefaultServer()
You can pass your own hashing algorithm or prime value group as well.
g, _ := NewGroup(Group8192)
c, _ := NewClient(crypto.SHA512, g, "username", "password")
s, _ := NewServer(crypto.SHA512, g)
This package provides the tooling to enroll and validate a user. Using this library however will still require you to:
A detailed overview on authentication can be found on RFC 2945 Page 3. In general, we implement the following flow where:
Client Server
---------- ----------
Calculate a, A
I, A --------->
Calculate b, B
<--------- B, s
Calculate K, M1
M1 ---------> Calculate K, M2
Confirm M2
<--------- M2
Confirm M2
At each stage of the auth flow, client/server will receive/return several credentails (ex. salt, verifier, proof, public keys) to move forward with the premasterkey calculation.
uname, salt, verifier, err := c.Enroll()
isEnrolled := s.ProcessEnroll(uname, salt, verifier)
uname, cPubKey := c.Auth()
# You will need to implement this
salt, verifier := RetrieveThisFromSomeStorage()
# On success we will receive the salt and ephemeral public key for the client
sPubKey, salt, err := s.ProcessAuth(uname, salt, cPubKey, verifier)
cProof, err := c.ProveIdentity(sPubKey, salt)
sProof, err := s.ProcessProof(cProof)
isServerValid := c.IsProofValid(sProof)
Validation of both the server and client proof ensures that they both calculated
the same PremasterKey. At this point you may authenticate the user or use the
shared key as part of your authentication protocol.
Tests rely on testify's assert library. It should install automatically if this project is stored outside of your GOPATH. If it is inside GOPATH, you first need to enable module support.
export GO111MODULE=on
Run tests
make test
golangci-lint is used for linting. To install (OSX)
brew install golangci/tap/golangci-lint
Run linter
make lint
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.

Security News
Node.js 25.4.0 makes require(esm) stable, formalizing CommonJS and ESM compatibility across supported Node versions.