I am creating a cross-platform application, in which I am encrypting all data using AES-GSM. So my problem is that I want to store private keys locally on the user's device (either Android, IOS, Web, etc.). But Since for login I have multiple options i.e either biometric(in case of offline), PIN, OTP, Email-Password, or Sign in with Google.
Since authentication is mainly using Firebase Authentication, and user can also open the app offline, after being logged in once before, using biometrics or PIN. How can I store the secret key? For PIN also, I am storing it using salted hash so I cannot encrypt key based on PIN, as users also have the option of logging in using Biometrics, which only returns true or false. Can anyone suggest me any solution?