Skip to content

rmleon/scalaBCrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!") }

About

Scala port of BCrypt from a Java library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages