Node.js Scrypt包中Firebase SCrypt参数的用法 [英] Usage of Firebase SCrypt params in nodejs scrypt package

查看:60
本文介绍了Node.js Scrypt包中Firebase SCrypt参数的用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为此苦苦挣扎了一段时间,希望有人以前做过,并且可以在我的途中为我提供帮助.我到Firebase员工那里请求scrypt参数,以便将用户身份验证从Firebase迁移到我们自己的服务器.现在我有了这些参数,但是我不知道它们应该如何映射到节点scrypt包( https://www.npmjs.com/package/scrypt ).Firebase参数具有以下格式:

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
}

这些应该以某种方式映射到nodejs scrypt参数上,但是我找不到相似之处.任何帮助将不胜感激!

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

推荐答案

在使scrypt正常工作方面费了很多劲.此处的文档 https://github.com/firebase/scrypt#password-hashing看起来已经过时了.决定分享知识,了解我们如何在团队中正确地做事.

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.

工作命令

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

不需要盐+分隔符串联和base64操作.

No need for salt+separator concatenation and base64 manipulations.

这篇关于Node.js Scrypt包中Firebase SCrypt参数的用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆