
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
react-native-cryptography
Advanced tools
Important notes: On iOS, this is not a library project - see installation instructions
iOS CryptoSwift
Android BouncyCastle !TODO finish md5 and sha256!
| func | ios | android |
|---|---|---|
AES 128 | ✓ | ✓ |
AES 192 | ✓ | ✓ |
AES 256 | ✓ | ✓ |
AES 128 (pass 16 bytes key and iv)
AES 192 (pass 24 bytes key and iv)
AES 256 (pass 32 bytes key and iv)
| func | ios | android |
|---|---|---|
MD5 | ✓ | TODO |
SHA256 | ✓ | TODO |
$ npm install react-native-cryptography --save
Android:
$ react-native link react-native-cryptography
iOS: See manual installation section
<Your Target> ➜ Add Files to [your project's name]node_modules ➜ react-native-cryptography and add RNCryptography.m + RNCryptography.swift#import <React/RCTBridge.h>Podfile in the sources root dir and add pod 'CryptoSwift' to it.cd ios/ && pod installandroid/app/src/main/java/[...]/MainActivity.javaimport com.reactlibrary.RNCryptographyPackage; to the imports at the top of the filenew RNCryptographyPackage() to the list returned by the getPackages() methodandroid/settings.gradle:
include ':react-native-cryptography'
project(':react-native-cryptography').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-cryptography/android')
android/app/build.gradle:
compile project(':react-native-cryptography')
import React, { Component } from 'react';
import { Button, StyleSheet, Text, TextInput, View } from 'react-native';
import RNCryptography from 'react-native-cryptography';
const styles = StyleSheet.create({
container: {
flex: 1,
marginTop: 50,
justifyContent: 'flex-start',
alignItems: 'center',
},
});
export default class App extends Component {
static AES_KEY_128 = 'keykeykeykeykeyk';
static AES_IV_128 = 'drowssapdrowssap';
encryptAES() {
RNCryptography.encryptAES('Hello, I am the message to cipher', App.AES_KEY_128, App.AES_IV_128)
.then(value => console.log(value))
.catch(err => console.error(err));
}
decryptAES() {
RNCryptography.decryptAES('FNblGLlDskkoe1vLbwtTJ8xeIXmQp3udaFL8KI91hfGhYFyqA0eLcfoy3iFFw2af', App.AES_KEY_128, App.AES_IV_128)
.then(value => console.log(value))
.catch(err => console.error(err));
}
md5() {
RNCryptography.md5('string to digest').then(digest => console.log(digest));
}
sha256() {
RNCryptography.sha256('string to digest').then(digest => console.log(digest));
}
render() {
return (
<View style={styles.container}>
<Button onPress={this.encryptAES} title={'encrypt with AES'} />
<Button onPress={this.decryptAES} title={'decrypt AES'} />
<Button onPress={this.md5} title={'MD5'} />
<Button onPress={this.sha256} title={'SHA256'} />
</View>
);
}
}
FAQs
Description RN lib of standard cryptographic functions
We found that react-native-cryptography demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.