Class SRP6Util

java.lang.Object
org.bouncycastle.crypto.agreement.srp.SRP6Util

public class SRP6Util extends Object
  • Constructor Details

    • SRP6Util

      public SRP6Util()
  • Method Details

    • calculateK

      public static BigInteger calculateK(Digest digest, BigInteger N, BigInteger g)
    • calculateU

      public static BigInteger calculateU(Digest digest, BigInteger N, BigInteger A, BigInteger B)
    • calculateX

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

      public static BigInteger generatePrivateValue(Digest digest, BigInteger N, BigInteger g, SecureRandom random)
    • validatePublicValue

      public static BigInteger validatePublicValue(BigInteger N, BigInteger val) throws CryptoException
      Throws:
      CryptoException
    • 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.