react-native-seed-cbc WIP
React Native Plugin to encrypt string based on KISA SEED-CBC(Korea Internet & Security Agency) standarization
Getting started
$ npm install react-native-seed-cbc --save
Mostly automatic installation
$ react-native link react-native-seed-cbc
Manual installation
Link .jar library with android studio
- Open your project/android folder in android studio
- Open android/libs folder
- Select KISACrypto.jar = > Build => Edit Libraries & Dependencies
- add new library => choose KISACrypto.jar
- build
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNSeedCbcPackage;
to the imports at the top of the file - Add
new RNSeedCbcPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-seed-cbc' project(':react-native-seed-cbc').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-seed-cbc/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-seed-cbc')
Usage
; // encrypt stringRNSeedCbc// decrypt stringRNSeedCbc
Example
static contextTypes = rootTag: PropTypesnumber ; { } async { const strText = await RNSeedCbc; console; } async { const dcrText = await RNSeedCbc; console; } { return <View style=stylescontainer> <Text style=styleswelcome> Welcome to React Native! </Text> <Button onPress= this title="Learn More" color="#841584" accessibilityLabel="Learn more about this purple button" /> <Button onPress= this title="decrypt" color="#841584" accessibilityLabel="Learn more about this purple button" /> <Text style=stylesinstructions> instructions </Text> </View> ; } const styles = StyleSheet;