Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Usage of Firebase SCrypt params in nodejs scrypt package

I've been struggling with this for some time now, hopefully someone has done this before and can help me on my way. I went to the Firebase people to request the scrypt params in order to migrate our user authentication away from Firebase to our own server. Now I got those params, but I have no clue as how they should map towards the node scrypt package (https://www.npmjs.com/package/scrypt). The Firebase params are of the following format:

hash_config: {
    algorithm: SCRYPT,
    base64_signer_key: asdf1234
    base64_salt_seperator: xxxx
    rounds: 123456
    mem_cost: 098765
}

Somehow these should map onto the nodejs scrypt params, but I can't find the similarities. Any help would be much appreciated!

like image 325
Matjuhh Avatar asked Aug 04 '26 03:08

Matjuhh


1 Answers

Struggled a lot with getting scrypt work properly. The documentation from here https://github.com/firebase/scrypt#password-hashing looks like outdated. Decided to share knowledge how we did things correctly in our team.

Working command

scrypt {key} {salt} {saltSeparator} {rounds} {memcost} [-P]

No need for salt+separator concatenation and base64 manipulations.

like image 69
Rashad Ibrahimov Avatar answered Aug 06 '26 16:08

Rashad Ibrahimov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!