A PHP
based webshop running on a shared hosting
stores libsodium
encrypted personal data in it's MySQL
database. To let users have access to their own data, a design very similar to the one discussed in this topic is implemented: a key is derived from the user's password (PWKEY), which is used to decrypt the user's private key (PRKEY), which is then used to decrypt the user's data.
There is a demand to introduce Login by Facebook/ Instagram/ Pinterest/ etc. and/ or other similar passwordless authentication services (for e.g. sending a login link to the user's registered e-mail) to the webshop. The problem is that without a password, this design is broken.
I am looking for a solution that would allow passwordless authentication while maintaining encryption keys in a manner that is secure and allowing users to decrypt their own data, but I have no idea how to approach this matter.
One might-be solution that came up was to add a second authentication layer: ask for a password/ phrase/ PIN separately right after the user logged in with the chosen authentication method, and generate the PWKEY from that password/ phrase/ PIN – but it would mean that passwordless isn't really passwordless...