cfboom.security.crypto.bcrypt

Class BCryptPasswordEncoder

lucee.Component
    extended by cfboom.lang.Object
      extended by cfboom.security.crypto.bcrypt.BCryptPasswordEncoder
All Implemented Interfaces:
PasswordEncoder

Implementation of PasswordEncoder that uses the BCrypt strong hashing function. Clients can optionally supply a "strength" (a.k.a. log rounds in BCrypt) and a SecureRandom instance. The larger the strength parameter the more work will have to be done (exponentially) to hash the passwords. The default value is 10.

Class Attributes:
  • output : false
  •  
  • displayname : Class BCryptPasswordEncoder
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
  • author : Dave Syer
  •  
    Property Summary
    type property default serializable required
    any javaLoader


    • access = public
    • returntype = any
    • inject = loader@cbjavaloader
    true false
    any strength


    • access = public
    • returntype = any
    • inject = coldbox:setting:strength@cfboom-security
    true false
    Constructor Summary
    init([numeric strength])
    Method Summary
    string encode(string rawPassword)
    boolean matches([string rawPassword], [string encodedPassword])
    void onDIComplete()
     
    Methods inherited from class cfboom.lang.Object
    $equals, getComponentName, getIdentityHashCode, getIdentityString, getMeta, hashCode, toString
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init([numeric strength])

    Parameters:
    strength

    Property Detail

    javaLoader

    property any javaLoader

    Attributes:
    access - public
    required - false
    returntype - any
    inject - loader@cbjavaloader
    serializable - true

    strength

    property any strength

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:setting:strength@cfboom-security
    serializable - true

    Method Detail

    encode

    public string encode(string rawPassword)

    Specified by:
    encode in interface PasswordEncoder
    Parameters:
    rawPassword

    matches

    public boolean matches([string rawPassword], [string encodedPassword])

    Specified by:
    matches in interface PasswordEncoder
    Parameters:
    rawPassword
    encodedPassword

    onDIComplete

    public void onDIComplete()