philcockfield / file-system-cache

A super-fast, promise based cache that reads and writes to the file-system.
MIT License
54 stars 14 forks source link

Feature Request: Allow users to encrypt their FS cache #24

Open trevor-vaughan opened 1 year ago

trevor-vaughan commented 1 year ago

As a user, I would like the ability to selectively encrypt my filesystem cache.

I'd be happy to help with implementation on this if you are open to the idea.

rasander commented 1 year ago

Wouldn't it be better do encrypt/decrypt data in the application layer, when before and after getter/setter, using libraries that are good for encryption?

I think it is better to keep these two things isolated, also do lower the amount of dependencies in the library.

philcockfield commented 1 year ago

Agree.

trevor-vaughan commented 1 year ago

There are no additional dependencies and a built-in wrapper (while not the javascript way of rewriting everything under the sun) would be helpful.

Granted, I guess I could just write a module that wraps this one to do the same thing but, given that it can use the built-in crypto library, it seems reasonable as a native feature.

philcockfield commented 1 year ago

Agree with this too @trevor-vaughan - I've started a PR on this.