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

157 views Asked by At

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 ?

1

There are 1 answers

0
trk On

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.