简体   繁体   English

在 flutter 中构建应用程序时,SharedPrefernces 和 Flutter_secure_storage 包有什么区别? 还是他们做同样的事情?

[英]What is the difference between SharedPrefernces and Flutter_secure_storage packages when building an app in flutter? or do they do the same thing?

I am trying to build an app in flutter using api tokens and i would like to know if SharedPrefences and flutter_secure_storage packages do the same things or if they are different.我正在尝试使用 api 令牌在 flutter 中构建一个应用程序,我想知道 SharedPrefences 和 flutter_secure_storage 包是否做同样的事情或者它们是否不同。

flutter_secure_storage package uses SharedPreferences with MODE_PRIVATE as you can see here :如您在此处看到的, flutter_secure_storage package 使用 SharedPreferences 和 MODE_PRIVATE :

preferences = context.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);

It also uses additional encryption via AES.它还通过 AES 使用额外的加密。 From readme : AES encryption is used for Android. AES secret key is encrypted with RSA and RSA key is stored in KeyStore来自自述文件: AES encryption is used for Android. AES secret key is encrypted with RSA and RSA key is stored in KeyStore AES encryption is used for Android. AES secret key is encrypted with RSA and RSA key is stored in KeyStore . AES encryption is used for Android. AES secret key is encrypted with RSA and RSA key is stored in KeyStore You can find details in the source code .您可以在源代码中找到详细信息。

As for secure tokens and other sensitive data, it would be safer to use flutter_secure_storage instead of raw SharedPreferences with private mode.至于安全令牌和其他敏感数据,使用flutter_secure_storage而不是使用私有模式的原始 SharedPreferences 会更安全。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我将如何保持存储flutter_secure_storage的列表顺序? - How would I keep the order of the list stored flutter_secure_storage? 未找到在通道插件上写入方法的实现。it_nomads.com/flutter_secure_storage - No implementation found for method write on channel plugins.it_nomads.com/flutter_secure_storage 颤动:在构建APK时如何通过Gradle params? - Flutter: how do I pass Gradle params when building an APK? 帐户删除安全存储颤振 - Account Deletion Secure Storage Flutter Flutter:build/app/outputs下的apk/release目录和flutter-apk目录有什么区别? - Flutter: What is the difference between the apk/release directory and flutter-apk directory under build/app/outputs? “flutter build apk”没有构建所有必要的 pub 包,即使这些包在我的 flutter 应用程序中使用 - “flutter build apk” is not building all necessary pub packages even those packages are used in my flutter app 如何实现音频流应用和安全存储 - How to implement audio streaming app and secure storage in flutter Flutter 安全存储未按应用程序启动时的方式初始化 - Flutter Secure Storage not initializing as itended on app start up Flutter 生成的 3 个 APK 有什么区别? - What is the difference between 3 APKs generated from flutter? 构建颤振应用程序时 IntelliJ 中的错误 - Error in IntelliJ when building flutter app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM