tectiv3 / React Native Aes
Licence: mit
Native module for AES encryption
Stars: ✭ 120
Labels
Projects that are alternatives of or similar to React Native Aes
Beancounter
Utility to audit the balance of Hierarchical Deterministic (HD) wallets. Supports multisig + segwit wallets.
Stars: ✭ 109 (-9.17%)
Mutual labels: crypto
Ecency Mobile
Ecency Mobile - reimagined social blogging, contribute and get rewarded (for Android and iOS)
Stars: ✭ 103 (-14.17%)
Mutual labels: crypto
Cryptogotchas
A collection of common (interesting) cryptographic mistakes.
Stars: ✭ 118 (-1.67%)
Mutual labels: crypto
Macao Social Wallet
Simple Social Wallet made without javascript using the Freecoin toolkit
Stars: ✭ 110 (-8.33%)
Mutual labels: crypto
Chain Main
Crypto.org Chain⛓: Croeseid Testnet and beyond development
Stars: ✭ 109 (-9.17%)
Mutual labels: crypto
Streamcryptor
Stream encryption & decryption with libsodium and protobuf
Stars: ✭ 112 (-6.67%)
Mutual labels: crypto
Kupi Terminal
Ccxt based, open source, customized, extendable trading platform that supports 130+ crypto exchanges.
Stars: ✭ 104 (-13.33%)
Mutual labels: crypto
Tools For Cryptanalysis
A repository that aims to provide tools for cryptography and cryptanalysis
Stars: ✭ 112 (-6.67%)
Mutual labels: crypto
Keepass4web
An application that serves KeePass database entries on a web frontend
Stars: ✭ 115 (-4.17%)
Mutual labels: crypto
Nanocurrency Js
🔗 A toolkit for the Nano cryptocurrency, allowing you to derive keys, generate seeds, hashes, signatures, proofs of work and blocks.
Stars: ✭ 113 (-5.83%)
Mutual labels: crypto
React Native AES
AES encryption/decryption for react-native
Installation
npm install --save react-native-aes-crypto
or
yarn add react-native-aes-crypto
Installation (iOS)
Using CocoaPods (React Native 0.60 and higher)
cd ios
pod install
Using React Native Link (React Native 0.59 and lower)
Run react-native link react-native-aes-crypto
after which you should be able to use this library on iOS.
Installation (Android)
React Native 0.60 and higher
- Linking is done automatically
Using React Native Link (React Native 0.59 and lower)
- In
android/settings.gradle
...
include ':react-native-aes-crypto'
project(':react-native-aes-crypto').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-aes-crypto/android')
- In
android/app/build.gradle
...
dependencies {
...
compile project(':react-native-aes-crypto')
}
- register module (in MainApplication.java)
......
import com.tectiv3.aes.RCTAesPackage;
......
@Override
protected List<ReactPackage> getPackages() {
......
new RCTAesPackage(),
// or
// packages.add(new RCTAesPackage());
......
}
Usage
Example
import { NativeModules, Platform } from 'react-native'
var Aes = NativeModules.Aes
const generateKey = (password, salt, cost, length) => Aes.pbkdf2(password, salt, cost, length)
const encryptData = (text, key) => {
return Aes.randomKey(16).then(iv => {
return Aes.encrypt(text, key, iv).then(cipher => ({
cipher,
iv,
}))
})
}
const decryptData = (encryptedData, key) => Aes.decrypt(encryptedData.cipher, key, encryptedData.iv)
try {
generateKey('Arnold', 'salt', 5000, 256).then(key => {
console.log('Key:', key)
encryptData('These violent delights have violent ends', key)
.then(({ cipher, iv }) => {
console.log('Encrypted:', cipher)
decryptData({ cipher, iv }, key)
.then(text => {
console.log('Decrypted:', text)
})
.catch(error => {
console.log(error)
})
Aes.hmac256(cipher, key).then(hash => {
console.log('HMAC', hash)
})
})
.catch(error => {
console.log(error)
})
})
} catch (e) {
console.error(e)
}
Or
async function asyncDecrypt(cipher, key, iv) {
try {
var text = await decryptData({ cipher, iv }, key)
console.log(text)
return text
} catch (e) {
console.error(e)
}
}
methods
encrypt(text, key, iv)
decrypt(base64, key, iv)
pbkdf2(text, salt, cost, length)
hmac256(cipher, key)
sha1(text)
sha256(text)
sha512(text)
randomUuid()
randomKey(length)
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].