Package makwa

Examples of makwa.Makwa.verifyPassword()


    Makwa mpriv = new Makwa(privKey, Makwa.SHA256,
      preHash, postHashLength, workFactor);

    String h1 = mpub.hashNewPassword("test1");
    check(mpub.verifyPassword("test1", h1));
    check(mpriv.verifyPassword("test1", h1));
    check(!mpub.verifyPassword("test2", h1));
    check(!mpriv.verifyPassword("test2", h1));
    String h2 = mpriv.hashNewPassword("test1");
    check(mpub.verifyPassword("test1", h2));
    check(mpriv.verifyPassword("test1", h2));
View Full Code Here


    String h1 = mpub.hashNewPassword("test1");
    check(mpub.verifyPassword("test1", h1));
    check(mpriv.verifyPassword("test1", h1));
    check(!mpub.verifyPassword("test2", h1));
    check(!mpriv.verifyPassword("test2", h1));
    String h2 = mpriv.hashNewPassword("test1");
    check(mpub.verifyPassword("test1", h2));
    check(mpriv.verifyPassword("test1", h2));
    check(!mpub.verifyPassword("test2", h2));
    check(!mpriv.verifyPassword("test2", h2));
View Full Code Here

    check(mpriv.verifyPassword("test1", h1));
    check(!mpub.verifyPassword("test2", h1));
    check(!mpriv.verifyPassword("test2", h1));
    String h2 = mpriv.hashNewPassword("test1");
    check(mpub.verifyPassword("test1", h2));
    check(mpriv.verifyPassword("test1", h2));
    check(!mpub.verifyPassword("test2", h2));
    check(!mpriv.verifyPassword("test2", h2));

    // Since each hash value uses its own salt, the strings
    // ought to be different.
View Full Code Here

    check(!mpriv.verifyPassword("test2", h1));
    String h2 = mpriv.hashNewPassword("test1");
    check(mpub.verifyPassword("test1", h2));
    check(mpriv.verifyPassword("test1", h2));
    check(!mpub.verifyPassword("test2", h2));
    check(!mpriv.verifyPassword("test2", h2));

    // Since each hash value uses its own salt, the strings
    // ought to be different.
    check(!h1.equals(h2));
  }
View Full Code Here

    Makwa mprivLarge = new Makwa(privKey, Makwa.SHA256,
      false, 0, 4096);

    String hsmall = mpubSmall.hashNewPassword("test1");
    String hlarge = mpubSmall.setNewWorkFactor(hsmall, 4096);
    check(mprivLarge.verifyPassword("test1", hlarge));
    hlarge = mprivSmall.setNewWorkFactor(hsmall, 4096);
    check(mpubLarge.verifyPassword("test1", hlarge));
    hsmall = mprivLarge.setNewWorkFactor(hlarge, 384);
    check(mpubSmall.verifyPassword("test1", hsmall));
  }
View Full Code Here

    Makwa.DelegationContext dc =
      mpub.hashNewPasswordDelegate("test1", md);
    byte[] req = dc.getRequest();
    byte[] ans = Makwa.processDelegationRequest(req);
    String h = dc.doFinalToString(ans);
    check(mpriv.verifyPassword("test1", h));

    dc = mpub.verifyPasswordDelegate("test1", h, md);
    req = dc.getRequest();
    ans = Makwa.processDelegationRequest(req);
    check(dc.doFinalVerify(ans));
View Full Code Here

    String ref = mpriv.hashNewPassword("speedtest");
    int cc = 2;
    for (;;) {
      long begin = System.currentTimeMillis();
      for (int m = 0; m < cc; m ++) {
        mpriv.verifyPassword("speedtest", ref);
      }
      long end = System.currentTimeMillis();
      long tt = end - begin;
      if (tt > 4000) {
        System.out.printf("priv/s = %.2f",
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.