react-native-keychain vs react-native-encrypted-storage
Secure Storage Libraries for React Native Comparison
1 Year
react-native-keychainreact-native-encrypted-storage
What's Secure Storage Libraries for React Native?

Secure storage libraries for React Native provide developers with tools to securely store sensitive information, such as tokens, passwords, and user data, on mobile devices. These libraries ensure that the stored data is encrypted and protected against unauthorized access, which is crucial for maintaining user privacy and security in mobile applications. By using these libraries, developers can implement secure authentication and data management practices, enhancing the overall security posture of their applications.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
react-native-keychain210,0463,363230 kB1604 months agoMIT
react-native-encrypted-storage41,904574151 kB41-MIT
Feature Comparison: react-native-keychain vs react-native-encrypted-storage

Storage Mechanism

  • react-native-keychain:

    react-native-keychain utilizes the device's native secure storage solutions, such as the Keychain on iOS and the Keystore on Android. This provides a more robust and secure method for storing sensitive information, such as passwords and authentication tokens, ensuring that data is protected by the operating system's security features.

  • react-native-encrypted-storage:

    react-native-encrypted-storage uses a simple key-value storage mechanism that encrypts data before saving it to the device's storage. This makes it easy to implement and suitable for storing small amounts of data securely, such as user tokens or preferences.

Encryption

  • react-native-keychain:

    While react-native-keychain does not handle encryption directly, it relies on the underlying secure storage mechanisms of the operating system, which provide strong encryption and security features, making it suitable for storing highly sensitive information.

  • react-native-encrypted-storage:

    This library automatically encrypts data using AES encryption before storing it, ensuring that even if someone gains access to the device's storage, they cannot read the sensitive information without the proper decryption key.

Ease of Use

  • react-native-keychain:

    react-native-keychain has a more complex API due to its focus on credential management, which may require a deeper understanding of authentication flows. However, it offers extensive features for managing user credentials securely.

  • react-native-encrypted-storage:

    This library is designed for simplicity and ease of use, allowing developers to quickly implement secure storage with minimal setup. It provides a straightforward API for storing and retrieving data, making it accessible for developers of all skill levels.

Use Cases

  • react-native-keychain:

    Best suited for applications that require secure user authentication, such as login systems, where managing user credentials and sessions securely is critical.

  • react-native-encrypted-storage:

    Ideal for applications that need to store small amounts of sensitive data, such as user preferences, tokens, or configuration settings, where simplicity and speed are priorities.

Platform Support

  • react-native-keychain:

    Also supports both iOS and Android, leveraging the native secure storage capabilities of each platform, ensuring that sensitive data is stored securely according to platform-specific best practices.

  • react-native-encrypted-storage:

    Supports both iOS and Android platforms, providing a consistent API for secure storage across devices, making it easier to develop cross-platform applications.

How to Choose: react-native-keychain vs react-native-encrypted-storage
  • react-native-keychain:

    Choose react-native-keychain if you require a more comprehensive solution for managing user credentials and authentication. It provides a secure way to store passwords and sensitive information, leveraging the device's secure storage mechanisms. This is ideal for applications that need to handle user login sessions and require a higher level of security.

  • react-native-encrypted-storage:

    Choose react-native-encrypted-storage if you need a simple and straightforward solution for securely storing key-value pairs with encryption. It is particularly useful for scenarios where you want to store small amounts of sensitive data like tokens or user preferences without the overhead of managing complex authentication flows.

README for react-native-keychain

react-native-keychain

Tests npm npm

This library provides access to the Keychain (iOS) and Keystore (Android) for securely storing credentials like passwords, tokens, or other sensitive information in React Native apps.

Installation

  1. Run yarn add react-native-keychain
  2. Run pod install in ios/ directory to install iOS dependencies.
  3. If you want to support FaceID, add a NSFaceIDUsageDescription entry in your Info.plist.
  4. Re-build your Android and iOS projects.

Documentation

Please refer to the documentation website on https://oblador.github.io/react-native-keychain

Changelog

Check the GitHub Releases page.

Maintainers


Joel Arvidsson

Author

Dorian Mazur

Maintainer

Vojtech Novak

Maintainer

Pelle Stenild Coltau

Maintainer

Oleksandr Kucherenko

Contributor

Used By

This library is used by several projects, including:

License

MIT © Joel Arvidsson 2016-2020