1.1.3 • Published 4 months ago

react-native-crypto-aes-cbc v1.1.3

Weekly downloads
5
License
MIT
Repository
bitbucket
Last release
4 months ago

react-native-crypto-aes-cbc

Getting started

$ npm install react-native-crypto-aes-cbc --save

Mostly automatic installation

$ react-native link react-native-crypto-aes-cbc

Usage

import CryptoAesCbc from 'react-native-crypto-aes-cbc';
secretKey = '12345678901111111234567890111111';
iv = '1111111234567890';
secretKeyInBASE64 = 'MTIzNDU2Nzg5MDExMTExMTEyMzQ1Njc4OTAxMTExMTE=';
ivInBASE64 = 'MTExMTExMTIzNDU2Nzg5MA==';
keysize128 = '128';
keysize256 = '256';
text = 'Sachin Agrawal';

CryptoAesCbc.encryptInHex(
  ivInBASE64,
  secretKeyInBASE64,
  'sachin agrawal',
  '128'
).then((encryptString) => {
  console.log(encryptString);
});
CryptoAesCbc.encryptInBase64(
  ivInBASE64,
  secretKeyInBASE64,
  'sachin agrawal',
  '128'
).then((encryptString) => {
  console.log(encryptString);
});
CryptoAesCbc.encryptInHex(
  ivInBASE64,
  secretKeyInBASE64,
  'sachin agrawal',
  '256'
).then((encryptString) => {
  console.log(encryptString);
});
CryptoAesCbc.encryptInBase64(
  ivInBASE64,
  secretKeyInBASE64,
  'sachin agrawal',
  '256'
).then((encryptString) => {
  console.log(encryptString);
});
CryptoAesCbc.decryptByBase64(
  ivInBASE64,
  secretKeyInBASE64,
  'ZN+DBxlPG+2lmWx6Bu7bqA==',
  '128'
).then((decryptString) => {
  console.log(decryptString);
});
CryptoAesCbc.decryptByHex(
  ivInBASE64,
  secretKeyInBASE64,
  '64df8307194f1beda5996c7a06eedba8',
  '128'
).then((decryptString) => {
  console.log(decryptString);
});
CryptoAesCbc.decryptByBase64(
  ivInBASE64,
  secretKeyInBASE64,
  'Re3CIB8H3wYkUdl/l6WGGw==',
  '256'
).then((decryptString) => {
  console.log(decryptString);
});
CryptoAesCbc.decryptByHex(
  ivInBASE64,
  secretKeyInBASE64,
  '45edc2201f07df062451d97f97a5861b',
  '256'
).then((decryptString) => {
  console.log(decryptString);
});
CryptoAesCbc.sha256('sachin').then((hashKey) => {
  console.log(hashKey);
});
Type of HMAC "HmacSHA256"; "HmacSHA1", "HmacSHA512"
1.1.3

4 months ago

1.1.2

10 months ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago