protonmail-export
protonmail-export copied to clipboard
add private key instructions for users using "single password" mode
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:
- at step 5 in the "How to download your ProtonMail private key?" instructions, find the "KeySalt".
- ensure you are still in the console of developer tools.
- 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.
This was the missing step for me. It should definitely be included in the actual README
Small contribution to make things more obvious.
password = "<LOGIN PASSWORD WITH BACKSLASHED SPECIAL CHARACTERS>";
salt ="<SALT FROM STEP 1>";
Thanks.