Skip to content

Commit cad1176

Browse files
committed
Add link to demo project
1 parent 6e80401 commit cad1176

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ Run `react-native link react-native-aes-crypto` after which you should be able t
3030
### Installation (Android)
3131

3232
##### React Native 0.60 and higher
33-
- Linking is done automatically
33+
34+
- Linking is done automatically
3435

3536
##### Using React Native Link (React Native 0.59 and lower)
37+
3638
- In `android/settings.gradle`
3739

3840
```gradle
@@ -71,6 +73,10 @@ protected List<ReactPackage> getPackages() {
7173

7274
## Usage
7375

76+
### Demo project
77+
78+
[link](https://github.com/tectiv3/react-native-aes-demo)
79+
7480
### Example
7581

7682
```js
@@ -81,14 +87,14 @@ const generateKey = (password, salt, cost, length) => Aes.pbkdf2(password, salt,
8187

8288
const encryptData = (text, key) => {
8389
return Aes.randomKey(16).then(iv => {
84-
return Aes.encrypt(text, key, iv).then(cipher => ({
90+
return Aes.encrypt(text, key, iv, 'aes-256-cbc').then(cipher => ({
8591
cipher,
8692
iv,
8793
}))
8894
})
8995
}
9096

91-
const decryptData = (encryptedData, key) => Aes.decrypt(encryptedData.cipher, key, encryptedData.iv)
97+
const decryptData = (encryptedData, key) => Aes.decrypt(encryptedData.cipher, key, encryptedData.iv, 'aes-256-cbc')
9298

9399
try {
94100
generateKey('Arnold', 'salt', 5000, 256).then(key => {

0 commit comments

Comments
 (0)