Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
#SRP - Secure Remote Password
Implementation of the SRP Authentication and Key Exchange System and protocols in Secure Remote Password (SRP) Protocol for TLS Authentication
The goals are to provide at a minimum:
Additionally, I would like the API to provide:
##Prerequisites
GNU libgmp for those big big numbers.
libgmp3-dev
gmp
##Installation
npm install srp
or git clone
this archive and run npm install
in it.
##Tests
Run npm test
.
Tests include the RFC 5054 test vectors.
##Description of the Protocol
###Initial Setup
Carol the Client wants to share messages with Steve the server. Before this can happen, they need to perform a one-time setup step.
Carol and Steve agree on a large random number N
and a generator
g
. These can be published in advance or better yet hard-coded in
their implementations. They also agree on a cryptographic hashing
function H
.
Carol establishes a password and remembers it well. She the generates
some random salt, s
, and compputes the verifier v
as g ^ H(s | H(I | ':' | P)) % N
, where I
is Carol's identity, and |
denotes
concatenation.
Carol then sends Steve I
, s
, and v
. She also sends the size of
N
and the name of the hashing algorithm she has chosen.
Steve stores I
, s
, and v
. Carol remembers P
. This sequence
is performed once, after which Carol and Steve can use the SRP
protocol to share messages.
###Message Protocol
First, Carol generates an ephemeral private key a
. She computes the
public key A
as g^a % N
. She sends Steve I
and A
.
Client sends I
, A
.
Steve looks up v
and s
. Steve generates an ephemeral private key
b
and computes the public key B
as k * v + g^b % N
, where k
is
H(N | PAD(g))
. (PAD
designates a function that left-pads a byte
string with zeroes until it is the same size as N
.) Steve sends s
and B
.
Server replies with s
and B
.
Both now compute the scrambling parameter u
as u = H(PAD(A) | PAD(B))
.
Now both Carol and Steve have the parameters they need to compute
their session key, S
.
For Carol, the formula is:
S_client = (B - k * g^x) ^ (a + u * x)
For Steve, the formula is:
S_server = (A * v ^ u) ^ b
They both now compute the shared session key, K
, as H(S)
. (The
hash is taken to obscure any structure that may be visible in S
.)
Now Carol and Steve must convince each other that their values for K
match. Here, Carol hashes and hashes again her session key and sends
it to Steve. If he gets the same result when hashing his session key
twice, he hashes his session key once and sends it back to Carol, who
can check if she wishes that she gets the same value.
###Glossary of Terms
N
a large prime number
g
a generator
H
a secure hashing function
|
the concatenation operator
PAD
a function that left-pads a block of bytes with zeroes until it is the same length as N
I
the identity of the client (a string)
P
the password of the client (a string)
s
some random salt (a string)
v
the verifier
k
a multiplier, H(N | PAD(g))
u
a scrambling parameter
a
an ephemeral private key known to the client
A
the public key from a
b
an ephemeral private key known to the server
B
the public key from b
x
an intermediate value, H(s | H(I | ":" | P))
S
the session key
K
a hash of the session key shared between client and server
##Resources
##License
MIT
FAQs
Secure Remote Password (SRP)
We found that srp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.