SCryptUtil

tsec.passwordhashers.jca.SCryptUtil$
object SCryptUtil extends ManagedRandom

SCrypt util scala adaption for Will Glozer's (@wg on github) SCryptUtil, improving on SHA1PRNGs, bad security in particular.

SCrypt described here: http://www.tarsnap.com/scrypt.html

The hashed output is an extended implementation of the Modular Crypt Format that also includes the scrypt algorithm parameters.

Format: $s0$PARAMS$SALT$KEY.

<dl>

PARAMS
<dt>32-bit hex integer containing log2(N) (16 bits), r (8 bits), and p (8 bits)</dt>
SALT
<dt>base64-encoded salt</dt>
KEY
<dt>base64-encoded derived key</dt> </dl>

s0 identifies version 0 of the scrypt format, using a 128-bit salt and 256-bit derived key.

Attributes

Source
SCryptUtil.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
SCryptUtil.type

Members list

Value members

Concrete methods

def check(passwd: Array[Byte], hashed: String): Boolean

Compare the supplied plaintext password to a hashed password.

Compare the supplied plaintext password to a hashed password.

Value parameters

hashed

scrypt hashed password.

passwd

Plaintext password.

Attributes

Returns

true if passwd matches hashed value.

Source
SCryptUtil.scala
def scrypt(passwd: Array[Byte], N: Int, r: Int, p: Int): String

Hash the supplied plaintext password and generate output in the format described in

Hash the supplied plaintext password and generate output in the format described in

Value parameters

N

CPU cost parameter.

p

Parallelization parameter.

passwd

Password.

r

Memory cost parameter.

Attributes

Returns

The hashed password.

Source
SCryptUtil.scala

Inherited methods

Attributes

Inherited from:
ManagedRandom
Source
ManagedRandom.scala