Examples of SRP6VerifierGenerator


Examples of com.nimbusds.srp6.SRP6VerifierGenerator

    throws IOException {
   
    System.out.println("Initialize verifier generator");
    SRP6CryptoParams config = getConfig("\t");
   
    SRP6VerifierGenerator vGen = new SRP6VerifierGenerator(config);
   
    User user = getUser("");
    System.out.println();
   
    System.out.print("Enter preferred salt 's' byte size [16]: ");
   
    String ss = readInput("16");
   
    int saltBytes;
   
    try {
      saltBytes = Integer.parseInt(ss);
     
    } catch (NumberFormatException e) {
   
      System.out.println("Couldn't parse salt 's' byte size: " + e.getMessage());
      return;
    }
   
    BigInteger s = new BigInteger(1, SRP6VerifierGenerator.generateRandomSalt(saltBytes));
   
    BigInteger v = vGen.generateVerifier(s, user.I, user.P);
   
    System.out.println("Generated salt 's' (hex): " + BigIntegerUtils.toHex(s));
    System.out.println();
    System.out.println("Computed password verifier 'v' (hex): " + BigIntegerUtils.toHex(v));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.