React Native Cipher is a library that provides encryption and decryption functionalities for React Native applications.
yarn add @finan-me/react-native-cipher
To ensure React Native Cipher works properly, you should also install the following libraries:
yarn add react-native-randombytes
yarn add node-libs-react-native
This package exports a mapping of absolute paths to each module implementation, keyed by module name. Modules without React Native compatible implementations are null.
These modules can be used with React Native Packager's metro.config.js or Webpack's resolve.alias.
Usage with React Native Packager Add a metro.config.js file in the root directory of your React Native project and set resolver.extraNodeModules:
// metro.config.js
module.exports = {
resolver: {
extraNodeModules: require('node-libs-react-native'),
},
};
Node has certain globals that modules may expect, such as Buffer or process. React Native does not provide these globals. The node-libs-react-native/globals module in this package will shim the global environment to add these globals. Just require (or import) this module in your app before anything else.
import 'node-libs-react-native/globals';