# react-native-crypton

> implement native encryption for react native,simple and easy to use

Latest version **1.0.6** (published 2020-09-10) · 0 weekly downloads

## Install

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

## 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.6 |
| Published | 2020-09-10 |
| First published | 2019-05-29 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 66.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | https://github.com/amirhosein5858 |
| Maintainers | amir1994 |
| Keywords | react-native, encryption, pbkdf2, AES |

## Links

- npm: https://www.npmjs.com/package/react-native-crypton
- Homepage: https://github.com/owner/project#readme
- npm.io page: https://npm.io/package/react-native-crypton

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2020-09-10
- 1.0.5 — 2019-06-25
- 1.0.4 — 2019-06-10
- 1.0.3 — 2019-06-06
- 1.0.2 — 2019-06-06
- 1.0.1 — 2019-06-02
- 1.0.0 — 2019-05-29

## README

# Crypton

## react-native-crypton 
An encryption pakage for react native based on native implemention 



## Getting started

`$ npm install react-native-crypton --save`

### automatic installation

`$ react-native link react-native-crypton`

### Manual installation


#### iOS
1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-crypton` and add `RNCrypton.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNCrypton.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)<

#### Android

1. Open up `android/app/src/main/java/[...]/MainActivity.java`
  - Add `import com.reactlibrary.RNCryptonPackage;` to the imports at the top of the file
  - Add `new RNCryptonPackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
  	```
  	include ':react-native-crypton'
  	project(':react-native-crypton').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-crypton/android')
  	```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
  	```
      compile project(':react-native-crypton')
  	```

<!-- #### Windows
[Read it! :D](https://github.com/ReactWindows/react-native)

1. In Visual Studio add the `RNCrypton.sln` in `node_modules/react-native-crypton/windows/RNCrypton.sln` folder to their solution, reference from their app.
2. Open up your `MainPage.cs` app
  - Add `using Crypton.RNCrypton;` to the usings at the top of the file
  - Add `new RNCryptonPackage()` to the `List<IReactPackage>` returned by the `Packages` method -->
## Added encyption methodes
1. AES-256-CBC Encryption & Decryption with PBKDF2


<!-- ## Added hash methodes android only just now (will be update soon)
1. MD5
2. SHA-1
3. SHA-224
4. SHA-256
5. SHA-384
6. SHA-512 -->

## Usage
```javascript
import { Pbkdf2 } from 'react-native-crypton';

//encrypt
//text 		= String we want to decrypt in base-64
//password		= String password
Pbkdf2.encrypt("<text>", "<password>")
      .then(r => console.log('encrypted:: ', r))
      .catch(e => console.log('enc catched: ', e));

//decrypt
 Pbkdf2.decrypt("<encrypted_text>", "<password>")
      .then(r => console.log('decrypted:: ', r))
      .catch(e => console.log('dec catched: ', e));


```

## Tasks:
- ios pbkdf2 

## Contact
[Linkedin](https://www.linkedin.com/in/amirhuusein/)

E-mail: amirhosein5858@gmail.com 
Backup e-mail: amir@rednode.ir
## Thanks to
[CryptoSwift](https://github.com/krzyzanowskim/CryptoSwift)

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