react-native-crypto-aes-cbc
v1.1.3
Published
encryption crypto aes cbc base64 hexa
Downloads
216
Maintainers
Readme
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"