Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-native-cryptography
Advanced tools
Readme
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 install
android/app/src/main/java/[...]/MainActivity.java
import 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
The npm package react-native-cryptography receives a total of 5 weekly downloads. As such, react-native-cryptography popularity was classified as not popular.
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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.