I plan to migrate a system developed with PHP Laravel that hashed users password with bcrypt, so just wanted to know is there anyway to convert them somehow in order to make new NodeJS system (with bcrypt) to reuse the current password fields? or the only way forward is to ask user to reset passwords?
Asked
Active
Viewed 1,391 times
2 Answers
1
Are you asking if the hashed password data (stored on the server, for example) can be used in another bcrypt implementation in node, or something else?
Using modules in node should work with the existing password data (as someone already suggested), but remember to use the same exact salting method and options as the previous bcrypt implementation in PHP, obviously, so that bcrypt generates the same data as before. As long as all options and input into bcrypt are the same, the bcrypt implementation in node should produce the same results and be able to be used.

Netside
- 80
- 2
- 9
-
1So do I have to import the same key from the previous system in order to do so? – har2vey Aug 05 '16 at 05:04
-
I didn't see this comment earlier, so sorry if you already answered it. I still think my answer stands, but here is probably a good question/answer to look at if you're still dealing with this (or for other people viewing this page now) --> https://stackoverflow.com/questions/26643587/comparing-bcrypt-hash-between-php-and-nodejs/ – Netside Jun 21 '20 at 03:40
-
Also, I just saw I didn't answer the question in your comment, but the answer is yes. This is a MUST. That's the whole point of keys, not to insult your intelligence or sound rude (there's just no way to decrypt data without it short of codebreaking/cryptoanalysis). – Netside Jul 04 '20 at 17:24
0
Using the bcrypt
or bcryptjs
modules in node with the existing passwords should work just fine.

mscdex
- 104,356
- 15
- 192
- 153
-
1Got it working but with twin-bycrpt package instead of bycrypt, but thanks for the hint. – har2vey Aug 05 '16 at 06:13