BoxLang 🚀 A New JVM Dynamic Language Learn More...

CFWheels bCrypt

v1.0.2 CFWheels Plugins

cfwheels-bcrypt

Build Status

CFWheels 2.x plugin helper methods for the bCrypt Java Lib

Note, this plugin requires CFWheels 2.x due to the automatic java mapping

Usage

Encrypt a password

password = "CatzAreBetterThanDogz";

// Hash a password for the first time
hashedPassword   = bCryptHashPW(password, bCryptGenSalt());

// With different complexity:
// gensalt's log_rounds parameter determines the complexity
// the work factor is 2**log_rounds, and the default is 10
hashedPassword   = bCryptHashPW(password, bCryptGenSalt(12));

Compared hashed password

// Check that an unencrypted password matches one that has
// previously been hashed
result = bCryptCheckPW(candidate,hashed);
  •   Tom King
  • Published
  • 1.0.2 is the latest of 3 release(s)
    Published
  • Published on {{ getFullDate("2017-05-16T09:03:02Z") }}

$ box install cfwheels-bcrypt

 
  • {{ getFullDate("2017-05-03T04:22:32Z") }}
  • {{ getFullDate("2017-05-16T09:03:02Z") }}
  • 3,601
  • 85