Class SRP6Util


  • public class SRP6Util
    extends Object
    • Constructor Detail

      • SRP6Util

        public SRP6Util()
    • Method Detail

      • calculateX

        public static BigInteger calculateX​(Digest digest,
                                            BigInteger N,
                                            byte[] salt,
                                            byte[] identity,
                                            byte[] password)
      • calculateM1

        public static BigInteger calculateM1​(Digest digest,
                                             BigInteger N,
                                             BigInteger A,
                                             BigInteger B,
                                             BigInteger S)
        Computes the client evidence message (M1) according to the standard routine: M1 = H( A | B | S )
        Parameters:
        digest - The Digest used as the hashing function H
        N - Modulus used to get the pad length
        A - The public client value
        B - The public server value
        S - The secret calculated by both sides
        Returns:
        M1 The calculated client evidence message
      • calculateM2

        public static BigInteger calculateM2​(Digest digest,
                                             BigInteger N,
                                             BigInteger A,
                                             BigInteger M1,
                                             BigInteger S)
        Computes the server evidence message (M2) according to the standard routine: M2 = H( A | M1 | S )
        Parameters:
        digest - The Digest used as the hashing function H
        N - Modulus used to get the pad length
        A - The public client value
        M1 - The client evidence message
        S - The secret calculated by both sides
        Returns:
        M2 The calculated server evidence message
      • calculateKey

        public static BigInteger calculateKey​(Digest digest,
                                              BigInteger N,
                                              BigInteger S)
        Computes the final Key according to the standard routine: Key = H(S)
        Parameters:
        digest - The Digest used as the hashing function H
        N - Modulus used to get the pad length
        S - The secret calculated by both sides
        Returns:
        the final Key value.