Class BCrypt


  • public class BCrypt
    extends java.lang.Object
    BCrypt implements OpenBSD-style Blowfish password hashing using the scheme described in "A Future-Adaptable Password Scheme" by Niels Provos and David Mazieres.

    This password hashing system tries to thwart off-line password cracking using a computationally-intensive hashing algorithm, based on Bruce Schneier's Blowfish cipher. The work factor of the algorithm is parameterised, so it can be increased as computers get faster. The amount of work increases exponentially (2**log_rounds), so each increment is twice as much work. The default log_rounds is 10, and the valid range is 4 to 30.

    • Constructor Summary

      Constructors 
      Constructor Description
      BCrypt()  
    • Method Summary

      Modifier and Type Method Description
      void hash​(byte[] hpass, byte[] hsalt, byte[] output)
      Compatibility with new OpenBSD function.
      void pbkdf​(byte[] password, byte[] salt, int rounds, byte[] output)
      Compatibility with new OpenBSD function.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BCrypt

        public BCrypt()
    • Method Detail

      • hash

        public void hash​(byte[] hpass,
                         byte[] hsalt,
                         byte[] output)
        Compatibility with new OpenBSD function.
      • pbkdf

        public void pbkdf​(byte[] password,
                          byte[] salt,
                          int rounds,
                          byte[] output)
        Compatibility with new OpenBSD function.