svelte-persistent-store icon indicating copy to clipboard operation
svelte-persistent-store copied to clipboard

[question] Is it possible to encrypt localStorage?

Open beebase opened this issue 3 years ago • 3 comments

thanks.

beebase avatar Aug 06 '22 10:08 beebase

Right now, no. The built in Storage don't provide this feature.

But I was able to easily create a new Storage that encrypt data.

I will publish it when I finish to rewrite the serialization feature of the lib (I'm not that far), except if you urgently need the encryption storage, In which case I can publish it separately.

MacFJA avatar Aug 07 '22 19:08 MacFJA

That's ok, It's not urgent. I'm using encryptjs right now before storing/reading. I just thought it would be convenient skipping that extra code step if svelte-persistent-store could handle that internally.

I'm really enjoying using svelte-persistent-store. Works well with all the browser storage options and it's cool to have this in one package with very easy syntax. Thanks so much and I'll just patiently wait for a next release. 👍

beebase avatar Aug 08 '22 08:08 beebase

Here the new encryption storage: https://github.com/MacFJA/svelte-persistent-store/blob/update/.docs/Examples/04-Encrypted-Storage.md

It will be added in a few day when the PR #22 is merged

The version will probably bump to 2.0.0 as there are many changes that break backward compatibility

MacFJA avatar Aug 13 '22 17:08 MacFJA