Package com.github.glusk.srp6_variables
Class SRP6ClientSessionProof
- java.lang.Object
-
- com.github.glusk.caesar.AbstractBytes
-
- com.github.glusk.srp6_variables.SRP6ClientSessionProof
-
- All Implemented Interfaces:
Bytes
public final class SRP6ClientSessionProof extends AbstractBytes
SRP-6 Client Session Proof (M1).This variable is computed as either (1):
M1 = H(H(N) xor H(g), H(I), s, A, B, K)
or (2):M1 = H(A, B, S)
Use (1) to prove a shared, strong session keyK.Use (2) in a password-only proof where the calculation of
Kcan be skipped.Refer to the
package docsfor more info on notation used.
-
-
Constructor Summary
Constructors Constructor Description SRP6ClientSessionProof(ImmutableMessageDigest hashFunction, SRP6IntegerVariable prime, SRP6IntegerVariable generator, Bytes identity, Bytes salt, SRP6IntegerVariable clientPublicKey, SRP6IntegerVariable serverPublicKey, Bytes sessionKey, ByteOrder byteOrder)Creates a new SRP-6 Client Session Proof that proofs the existence of a shared, strong session keyK.SRP6ClientSessionProof(ImmutableMessageDigest hashFunction, SRP6IntegerVariable prime, SRP6IntegerVariable clientPublicKey, SRP6IntegerVariable serverPublicKey, SRP6IntegerVariable sharedSecret, ByteOrder byteOrder)Creates a new SRP-6 password-only Client Session Proof where the calculation ofKcan be skipped.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]asArray()-
Methods inherited from class com.github.glusk.caesar.AbstractBytes
equals, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.glusk.caesar.Bytes
asHexString, reversed
-
-
-
-
Constructor Detail
-
SRP6ClientSessionProof
public SRP6ClientSessionProof(ImmutableMessageDigest hashFunction, SRP6IntegerVariable prime, SRP6IntegerVariable generator, Bytes identity, Bytes salt, SRP6IntegerVariable clientPublicKey, SRP6IntegerVariable serverPublicKey, Bytes sessionKey, ByteOrder byteOrder)
Creates a new SRP-6 Client Session Proof that proofs the existence of a shared, strong session keyK.The formula used is as follows:
M1 = H(H(N) xor H(g), H(I), s, PAD(A), PAD(B), K)
Client public key (A) and server public key (B) are zero-padded to the byte length of prime (N).- Parameters:
hashFunction- a one-way hash function - H()prime- SRP-6 Integer Variable: prime (N)generator- SRP-6 Integer Variable: generator (g)identity- SRP-6 variable: cleartext username - identity (I)salt- SRP-6 Variable: salt (s)clientPublicKey- SRP-6 Integer Variable: client public key (A)serverPublicKey- SRP-6 Integer Variable: server public key (B)sessionKey- SRP-6 Variable: session key (K)byteOrder- the byte order to use when converting SRP-6 Integer Variables to a byte sequence
-
SRP6ClientSessionProof
public SRP6ClientSessionProof(ImmutableMessageDigest hashFunction, SRP6IntegerVariable prime, SRP6IntegerVariable clientPublicKey, SRP6IntegerVariable serverPublicKey, SRP6IntegerVariable sharedSecret, ByteOrder byteOrder)
Creates a new SRP-6 password-only Client Session Proof where the calculation ofKcan be skipped.The formula used is as follows:
M1 = H(PAD(A), PAD(B), PAD(S))
Client public key (A), server public key (B) and shared secret (S) are zero-padded to the byte length of prime (N).- Parameters:
hashFunction- a one-way hash function - H()prime- SRP-6 Integer Variable: prime (N)clientPublicKey- SRP-6 Integer Variable: client public key (A)serverPublicKey- SRP-6 Integer Variable: server public key (B)sharedSecret- SRP-6 Variable: shared secret (S)byteOrder- the byte order to use when converting SRP-6 Integer Variables to a byte sequence
-
-
Method Detail
-
asArray
public byte[] asArray() throws IllegalStateException- Throws:
IllegalStateException- if byte length ofNis shorter than the byte length of eitherAB, orS
-
-