Assume the following example:
I have an online service where user can register and enter personal data. Now I want to encrypt these data. I have a private key Pr1 and public key Pu1.
- User logs in with password at my online service
- Convert login password to fit a private key format = Pr2
- Get public key Pu2 from Pr2
- User enters data to store them online in the database
- Encrypt user entered data with Pu1 and add --recipient Pu2 like Encryption with multiple different keys?
- Now I can copy the encrypted data from the online database to my local machine and decrypt the data with my local Pr1
- Users can decrypt their already entered data online using their normal password which is converted to their Pr2 every time when they log in (step 2a) but is valid the entire session
With that approach no data can be decrypted even if an attacker has access to my server with all files and the database, right? Sure, a brute force attack is possible but it should take some time as for every try a private key needs to be computed. But no private key is stored online or needs to be exchanged. So this should be pretty save.
Here the question: If this approach is secure and practicable, then there must be already something similar or better out there which has these functionalities and uses some nice security standards. What is it?