|
Answer» React Native does not come bundled with any way of storing sensitive data. However, there are pre-existing solutions for Android and iOS platforms. iOS - Keychain Services Keychain Services allows you to securely store small chunks of sensitive info for the user. This is an ideal place to store CERTIFICATES, tokens, passwords, and any other sensitive information that doesn’t belong in Async Storage.
Android - Secure Shared Preferences# Shared Preferences is the Android equivalent for a persistent key-value data store. Data in Shared Preferences is not encrypted by DEFAULT, but Encrypted Shared Preferences wraps the Shared Preferences class for Android, and automatically encrypts keys and values.
Android - Keystore The Android Keystore system lets you store cryptographic keys in a container to MAKE it more difficult to extract from the device. In order to use iOS Keychain services or Android Secure Shared Preferences, you can EITHER write a bridge yourself or use a library that wraps them for you and provides a unified API at your own RISK. Some libraries to consider: - Expo-secure-store
- React-native-keychain
- react-native-sensitive-info - secure for iOS, but uses Android Shared Preferences for Android (which is not secure by default). There is however a branch that uses Android Keystore.
|