Class 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 key K.

    Use (2) in a password-only proof where the calculation of K can be skipped.

    Refer to the package docs for more info on notation used.

    • 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 key K.

        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 of K can 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