pinqy520 / mobx-persist

persist mobx stores
MIT License
560 stars 62 forks source link

Encrypting data - best practice? #47

Closed oriharel closed 6 years ago

oriharel commented 6 years ago

I'd like my data to be encrypted when persisted. What would you suggest as a best practice for that? suppose I'll take care of the encrypting key generation and the algorithm - where would be the best place to perform such an action in the flow? My case is in React Native.

oriharel commented 6 years ago

Managed using Serializr

ararog commented 5 years ago

@oriharel I have similar requirement, how you manage to do that?

oriharel commented 5 years ago

I believe @blankg can add a code snippet

blankg commented 5 years ago

@ararog, missed this mention but here is the code snippet anyway: import { createModelSchema, custom } from "serializr"; class User { @persist @observable username = ""; } createModelSchema(User, { username: custom(encryptString, decryptString) });