SecureHash

io.github.nremond.legacy.SecureHash
case class SecureHash(iterations: Int, dkLength: Int, cryptoAlgo: String)

This is the legacy API.

Attributes

cryptoAlgo

HMAC+SHA512 is the default as HMAC+SHA1 is now considered weak

dkLength

derived-key length, default to 32

iterations

the number of encryption iterations. Default to 210000

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def validatePassword(password: String, hashedPassword: String): Boolean

Validate a password against a password hash

Validate a password against a password hash

this function will first try to validate with the new format as generated by io.github.nremond.SecureHash.createHash. if it fails, it will fall back to the old format, making this function very useful when transitioning form the old to the new format.

Attributes

hashedPassword

the password hash.

password

the password to validate

Returns:

true is the password is valid

Deprecated methods

def createHash(password: String): String

Creates a hashed password using PBKDF2

Creates a hashed password using PBKDF2

this function output a string in the following format:

salt:key

  • salt : hex encoded salt

  • key : hex encoded derived key

Example :

a9c654289407047fd197516196e14b97bdabfa4bc934d0e9:f2f458b2502ca7595a4c964b14f146bd9c49174fa41b625227602bf4aaffbf5e

Attributes

password

the password to hash

Deprecated
true

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product