Your Proton Mail(new window) private key is generated in your browser. Before sending the private key to the server for storage, we encrypt it with your password (or mailbox password if you use two-password mode). This ensures that you and only you can use your private key.
To protect your private key we first use bcrypt to create a hash of your password, using a randomly generated salt that differs for each user. The result is then used to encrypt your private key with AES-256. By hashing it with bcrypt first, we make it much slower for anyone who tries to guess your password to decrypt your private key. We use a different salt for each user, which means that an attacker trying to obtain passwords by brute force will only be able to target one user at a time, further slowing them down.
In general, to protect your private key from being leaked the best approach is to choose a strong password(new window).