Skip to content

Files

Latest commit

0dc7b77 · Sep 10, 2020

History

History
22 lines (16 loc) · 744 Bytes

README.md

File metadata and controls

22 lines (16 loc) · 744 Bytes

firebase-scrypt-java

Java implementation of Firebase's custom scrypt implementation, based on firebase/scrypt.

Usage:

// The user's raw text password
String passwd = "user1password";

// Params from the exported account
String salt = "42xEC+ixf3L2lw==";

// Params from the project's password hash parameters
String saltSep = "Bw==";
String signerKey = "jxspr8Ki0RYycVU8zykbdLGjFQ3McFUH0uiiTvC8pVMXAn210wjLNmdZJzxUECKbm0QsEmYUSDzZvpjeJ9WmXA==";
int rounds = 8;
int memcost = 14;

String expectedHash = "lSrfV15cpx95/sZS2W9c9Kp6i/LVgQNDNC/qzrCnh1SAyZvqmZqAjTdn3aoItz+VHjoZilo78198JAdRuid5lQ==";

assertTrue(FirebaseScrypt.check(passwd, expectedHash, salt, saltSep, signerKey, rounds, memcost));