scastiel / protonmail-export

Export your ProtonMail e-mails. DEPRECATED, prefer ProtonMail Bridge: https://protonmail.com/bridge
54 stars 9 forks source link

add private key instructions for users using "single password" mode #6

Open Kortanul opened 7 years ago

Kortanul commented 7 years ago

if the user has chosen to use only one password, instead of having to enter the second password, then PM generates a password for the private key using a salt and the log-in password.

to get that password, a user needs to use something like https://github.com/dexice/pmpkpe to get that passphrase.

alternatively, if you don't trust that program, then you can use PM's own code to get it while in the browser. here's how:

  1. at step 5 in the "How to download your ProtonMail private key?" instructions, find the "KeySalt".
  2. ensure you are still in the console of developer tools.
  3. run the following:
    
    password = "LOGIN PASSWORD";
    salt ="SALT FROM STEP 1";

saltBinary = pmcrypto.binaryStringToArray(pmcrypto.decode_base64(salt)); keySalt = dcodeIO.bcrypt.encodeBase64(saltBinary, 16); bcryptKey = dcodeIO.bcrypt.hashSync(password, '$2y$10$' + keySalt);

key = bcryptKey.slice(29); console.log(key);



what it prints out is the password for your private key.
ghost commented 7 years ago

This was the missing step for me. It should definitely be included in the actual README

mkasprz commented 6 years ago

Small contribution to make things more obvious.

password = "<LOGIN PASSWORD WITH BACKSLASHED SPECIAL CHARACTERS>";
salt ="<SALT FROM STEP 1>";

Thanks.