Common Crypto Algorithms for React Native
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
lib
.DS_Store
.gitignore
README.md

README.md

npm version

React Native Crypto

Common encryption/decryption for react-native

Features

  • RSA
  • AES
  • Hmac
  • Pbkdf2
  • Sha

Installation

npm install @trackforce/react-native-crypto

or

yarn add @trackforce/react-native-crypto

Linking Automatically

react-native link

Linking Manually

iOS

  • See Linking Libraries OR
  • Drag RCTCrypto.xcodeproj to your project on Xcode.
  • Click on your main project file (the one that represents the .xcodeproj) select Build Phases and drag libRCTCrypto.a from the Products folder inside the RCTCrypto.xcodeproj.

(Android)

...
include ':@trackforce/react-native-crypto'
project(':@trackforce/react-native-crypto').projectDir = new File(rootProject.projectDir, '../node_modules/@trackforce/react-native-crypto/android')
  • In android/app/build.gradle
...
dependencies {
    ...
    compile project(':@trackforce/react-native-crypto')
}
  • register module (in MainApplication.java)
......
import com.trackforce.aes.RCTCryptoPackage;

......

@Override
protected List<ReactPackage> getPackages() {
   ......
   new RCTCryptoPackage(),
   ......
}

Local development

  1. yarn install
  2. cd demo
  3. yarn install
  4. react-native run-ios

Note: React native doesn't support Symlinks. See Stackoverflow.

Usage

Example

See example App.tsx for usage

methods

See Typescript typings