Hi, I am wondering how to store sensitive informat...
# multiplatform
a
Hi, I am wondering how to store sensitive information for windows and Linux targets. I come from the mobile world and Apple and android have supported mechanisms I know of. My search for Linux and windows alternatives was fruitless so far.
f
(not an expert) You can assume, a user can access any files on the PC they like. (unlike on Android and iOS) So for local storage, you would need to look at cryptography. Other option would be to save on your cloud.
j
One way is to encrypt the data and store the encryption key in (one of) the OS security mechanisms. For example, Electron offers a
safeStorage
API (https://www.electronjs.org/docs/latest/api/safe-storage) that supports Mac OS Keychain, Windows DPAPI and multiple Linux things. Unfortunately, I'm not aware of any library that does the same for JVM.
a
Thanks, it boils down mostly to some auth token to not have the user sign in all the time, so I was thinking keychain and encrypted preferences, but was hoping to have something quick and easy for windows / linux as well
I was hoping this is a common enough problem that someone had solved this already. Not a fan to do cryptography myself if I can avoid it.
2