Storing my private key of imported wallet when I re-login

I’m building the flow of login using web3auth and think that it’s very convenient for user if the private key of imported wallet will also be stored when they re-login with their email or community account, since it’s common when 1 user manages many wallet
Do you guys have any solution for this?

Hey @ha2501.th thanks of the request,

This feature is existing for our Core Kit tKey JS SDK, where one can use the Private Key Module and/or the Seed Phrase Module to store their user’s personal private key or seed phrase on the user’s request.

However, with our Plug and Play products it doesn’t exist as of now.

For the hack to implement this, you can take the web3auth private key to encrypt the user’s personal private key and store the result in your database. On successful login via Web3Auth, you can help them access their other wallet by decrypting the result using web3auth private key. This way you’re storing your user’s private key non custodially and safely, since it cannot be used otherwise.