/lib-cipher

Scala library providing a simple interface to bcrypt with minimal dependencies. Supports scala2 and scala3

Primary LanguageScalaMIT LicenseMIT

lib-cipher

Simple access to hash and verify values with bcrypt

Example

    val cipher = com.mbryzek.cipher.Ciphers().latest
    val enc = cipher.hash("plaintext")
    println(
      s"Encrypted hash, base 64 encoded is: ${enc.hash}. Config rounds[${enc.rounds}], timeMs[${enc.timeToHashMs}]"
    )
    if (cipher.isValid(plaintext = "test", hash = enc.hash, salt = enc.salt)) {
      println("Plaintext matches hash")
    } else {
      println("Plaintext does not match hash")
    }