Closed DhavalRKansara closed 3 years ago
Hi there
I think you should use the flutter secure storage plugin if you need to store sensitive data
Hi there
I think you should use the flutter secure storage plugin if you need to store sensitive data
I know how secure storage work it store data in keychain and keystore and I am also storing some sensitive data for app into it such as token, PIN etc...
But is it okay to store json data which consume 30 to 40mb of memory in secure storage?
I think it is fine because the plugin does not save the data inside the keystore but instead the keys used to encrypt/decrypt that data or at least that's what the readme says it does on Android.
Also, according to this issue, there does not seem to be any limit in the size of the data
@fabianMendez Okay That is once a solution to store the data using flutter_secure_storage but still I want to know the information which I have mentioned above. because this is good for my use case when directly I can store JSON and retrieve it. Do you have any idea from above 3 points which I have mentioned n the problem?
- Can you please add some more information where this plugin store the data inside the phone(Android and iOS)?
- The stored data for the application is accessible for the user or not?
- Are you using any encryption algorithm to store the data?
Alright, answering your questions:
example.json
:final storage = new LocalStorage('example.json`);
In Android this file would end up in this path:
/data/data/your.app.package/app_flutter/example.json
If you try to cat the above path without root, you will get a "Permission denied" error:
generic_x86_64:/ $ cat /data/data/your.app.package/app_flutter/example.json
cat: /data/data/your.app.package/app_flutter/example.json: Permission denied
If you cat the above path with root you will see it's content:
generic_x86_64:/ $ su
generic_x86_64:/ # cat /data/data/your.app.package/app_flutter/example.json
{"hello":"world"}
Thanks for the answer @fabianMendez.
@lesnitsky @fabianMendez anwer is correct?
@DhavalRKansara yes
check out https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider for more info (local_storage uses getApplicationDocumentsDirectory
from path_provider
)
Hi, I have gone through this plugin and also I have used the localstorage for my application to store the sensitive data. You have just mentioned the
Simple JSON file-based storage for flutter
in the readme file. I have some doubts and I suggest you update your readme file with the answer to the below questions.