Skip to content
Scala port of BCrypt from a Java library
Scala
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
project
src
.gitignore
.travis.yml
README.md
build.sbt

README.md

Scala BCrypt

Build Status

Scala port of a Java BCrypt library.

Goals:

  1. Have a version of BCrypt in Scala
  2. Learn how it works

TODO:

  1. Implement Version 2b
  2. Better testing

How to Use:

import ft.crypt.bcrypt.BCrypt
val plain = "YourPlainPassword"
// Generate the salt.  Can take log rounds (between 2 and 30, where 30 will be the hardest and will take a long time)
val salt = BCrypt.generateSalt
val hashed = BCrypt.hashPassword(plain, salt)
val passwordsMatch = BCrypt.checkPassword(plain, hashed)
if (passwordsMatch) {
  println("Congrats!  You can go in")
} else {
  println("Call the police!")
}
You can’t perform that action at this time.