I'd only suggest public key encryption if you want the ability to set a user's password without their interaction (this can be handy for resets and shared passwords).
Public key
- The OpenSSL extension, specifically
openssl_public_encrypt
and openssl_private_decrypt
- This would be straight RSA assuming your passwords will fit in key size - padding, otherwise you need a symmetric layer
- Store both keys for each user, the private key's passphrase is their application password
Symmetric
- The Mcrypt extension
- AES-256 is probably a safe bet, but this could be a SO question in itself
- You don't - this would be their application password
Both
4
. Yes - users would have to enter their application password every time, but storing it in the session would raise other issues
5
.
- If someone steals the application data, it's as secure as the symmetric cipher (for the public key scheme, it's used to protect the private key with the passphrase.)
- Your application should definitely be only accessible over SSL, preferably using client certificates.
- Consider adding a second factor for authentication which would only be used once per session, like a token sent via SMS.