I'm building an app for the education sector where teachers create sensitive data, like student names and comments. The app encrypts this data on the device before sending it to a database, and users decrypt it with a password they set during the initial setup. Currently, the encryption key is only stored in memory for security, meaning users have to enter their password every time they open the app, which can be annoying. I'm looking for ways to enhance user experience while maintaining security. One idea is to let users choose to save the key in local storage with a warning about potential risks. Has anyone implemented End-to-End encryption before and have tips on balancing security with ease of use?
6 Answers
Have you looked into WebAuthn? It's a newer technology that could provide a seamless user experience while maintaining security.
You could implement optional secure key storage, perhaps encrypted or device-bound, to help users avoid frequent password entries. But I’d recommend keeping the default setting to maximum security with everything stored in memory.
You have a few options here: keep forcing a login each time without saving anything, use a secret key combined with the password as salt, or provide users the option of secure key storage. Always ensure that the primary option prioritizes maximum security first, as that’s essential for sensitive data.
Consider using passkeys to allow users to utilize FaceID or TouchID for authentication. This method could streamline the experience while keeping data secure. It might be a little tricky for some users initially, but it helps reduce the friction of typing passwords.
That's a solid point! I think passkeys will be a future addition once I address the initial password setup.
Your idea of a checkbox to save the key in local storage sounds practical. Users are already familiar with similar options on various websites, and it gives them control over their security. Just make sure to add a warning for those who might not be as security-conscious, so they know the risks involved in leaving it unlocked.
Thanks for the feedback! I agree, as long as users are informed, it seems like a reasonable trade-off.
Consider using asymmetric cryptography to generate device-bound keys. You could create a unique key for every user session and securely store it. It’s a common practice in many secure applications, and it ensures that the keys are not easily extractable.

No, I haven't yet. Thanks for the suggestion! I'll definitely check it out.