Post
Topic
Board Development & Technical Discussion
Merits 3 from 2 users
Topic OP
PBKDF2 questions
by
Sanglotslongs
on 31/03/2021, 10:04:18 UTC
⭐ Merited by o_e_l_e_o (2) ,ETFbitcoin (1)
Hello,

I'm trying to understand the PBKFD2 function.

From "learnmeabitcoin" :



So PBKFD2 is :
HMAC-SHA512 with password as "mnemonic sentence" and salt as "mnemonic sentence + passphrase".

For my example I will use an empty passphrase.

For HMAC I'm using : https://www.freeformatter.com/hmac-generator.html#ad-output
To check PBKFD2 I'm using https://iancoleman.io/bip39/


BIP39 mnemonic :
Code:
conduct coral enrich local script mountain remain fringe latin throw w
ood web

Entropy HEX :
Code:
2ec6052c41ac1b212d62e87d7c2bf4fc


I did a modification at IANCOLEMAN/BIP39 html file changing :

Code:
var Mnemonic = function(language) {

    var PBKDF2_ROUNDS = 2048;
    var RADIX = 2048;

    var self = this;
    var wordlist = [];

With :


Code:
var Mnemonic = function(language) {

    var PBKDF2_ROUNDS = 1;
    var RADIX = 2048;

    var self = this;
    var wordlist = [];


With my BIP39 file with PBKDF2_ROUNDS = 1 I have :

BIP39 Seed from IANCOLEMAN file :
Code:
001f53a43e04c1dd4980bc65ea6f68c33124a671ce9d407b1c5c52adcbfddef3f51784f824af6c6f8cd7beb2cdad02b39638e3c77dd0fd48865573fcb73cf0df

But with my online tool HMAC-SHA512 :
Code:
6d03c97c00754be669e684b37cdad6a35ac989ce61411ac38823074fdae281b8ad2a707ea0d341e7a5b5b2e6ae465669a635d2402845a20ad80b320abaa45b60


What I'm doing wrong ? I just want to understand this function but I can be wrong in many ways , wrong input type for HMAC, is the default passphrase really empty etc.