# react-native-rncryptor

> React Native RNCryptor AES 256 encryption

Latest version **1.0.2** (published 2018-10-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-rncryptor
pnpm add react-native-rncryptor
yarn add react-native-rncryptor
bun add react-native-rncryptor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-10-07 |
| First published | 2018-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 71.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | richfisher |
| Maintainers | richfisher |
| Keywords | aes, aes-256, rncryptor, crypto, cbc, pbkdf2, react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-rncryptor
- Repository: https://github.com/richfisher/react-native-rncryptor-aes-256
- Homepage: https://github.com/richfisher/react-native-rncryptor-aes-256#readme
- Issues: https://github.com/richfisher/react-native-rncryptor-aes-256/issues
- npm.io page: https://npm.io/package/react-native-rncryptor

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-10-07
- 1.0.1 — 2018-10-07
- 1.0.0 — 2018-10-07

## README

# React Native RNCryptor
It's an easy-to-use library for encrypting data with AES 256 in React Native. 

[RNCryptor](http://rncryptor.github.io/JNCryptor/javadoc/) developed popular and easy-to-use AES libs, implementations are available in [C](https://github.com/RNCryptor/RNCryptor-C), [C++](https://github.com/RNCryptor/RNCryptor-cpp), [C#](https://github.com/RNCryptor/RNCryptor-cs), [Erlang](https://github.com/RNCryptor/RNCryptor-erlang), [Go](https://github.com/RNCryptor/RNCryptor-go), [Haskell](https://github.com/RNCryptor/rncryptor-hs), [Java](https://github.com/RNCryptor/JNCryptor),
[PHP](https://github.com/RNCryptor/RNCryptor-php), [Python](https://github.com/RNCryptor/RNCryptor-python),
[Javascript](https://github.com/chesstrian/JSCryptor), and [Ruby](https://github.com/RNCryptor/ruby_rncryptor).

The data format includes all the metadata required to securely implement AES encryption, as described in ["Properly encrypting with AES with CommonCrypto,"](http://robnapier.net/aes-commoncrypto). Specifically, it includes:

* AES-256 encryption
* CBC mode
* Password stretching with PBKDF2
* Password salting
* Random IV
* Encrypt-then-hash HMAC

## Getting started

`$ npm install react-native-rncryptor --save`

`$ react-native link react-native-rncryptor`

## Usage
```javascript
import RNCryptor from 'react-native-rncryptor';

RNCryptor.encrypt('a text', 'password').then((encryptedbase64)=>{
  console.log(encryptedbase64)
}).catch((error)=>{
  console.log(error)
})

RNCryptor.decrypt('encrypted base64', 'password').then((plaintext)=>{
  console.log(plaintext)
}).catch((error)=>{
  console.log(error)
})
```

## License
MIT

---
_Source: https://npm.io/package/react-native-rncryptor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
