protonmail-export icon indicating copy to clipboard operation
protonmail-export copied to clipboard

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

Open Kortanul opened this issue 8 years ago • 2 comments

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.

Kortanul avatar May 13 '17 21:05 Kortanul

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

ghost avatar Aug 11 '17 14:08 ghost

Small contribution to make things more obvious.

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

Thanks.

mkasprz avatar Nov 06 '17 12:11 mkasprz