I try to use PBKDF2 but each way I get a different result. Can you tell me what the problem is?
- Node.js
"use strict";
const pbkdf2 = require("pbkdf2"); // npm i pbkdf2
const sha1 = require("sha1"); // npm i sha1
const y = pbkdf2.pbkdf2Sync(
"toto",
"toto",
1000,
8 * 10,
"sha512"
)
.slice(0, 10)
.toString("base64")
;
console.log("y =", y); // X7AxWzPOJiXvfg==
- Online PBKDF2
xAeOzSOt1+xNmA==
- Postgres
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
SELECT encode(
PBKDF2(
'toto',
'toto',
1000,
10,
'sha512'
),
'base64'
);
-- ybQxw9hGrIkkXA==
Thank you in advance!