简体   繁体   中英

Node crypto pbkdf2 yields different keys on 32bit and 64bit machines

The following snippet seems to yield different answers on 32 bit and 64 bit machines.

var buf = new Buffer('ojHkXkabdV7X6xcDNKJgrg==', 'base64');
console.log(crypto.pbkdf2Sync('secret', buf.toString('binary'), 10000, 14, 'sha256').toString('base64'));

64bit machine is on Node v0.12.4.

32bit machine is on Node v0.10.12.

Is this even possible ?

I moved node from v0.12.4 to v0.10.12 on the 64 bIt machine and the keys match when the snippet is run on both machines.

I also found the implementation that I really needed resides in v0.12.4 therefore my solution to this issue is to upgrade the 32 bit machine to v0.12.4.

Sorry folks ! This is not an architecture problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM