1.0.2 • Published 4 years ago

my-crypto v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

my-crypto

Installation

This module is designed to be used using either browserify or Node.js it's released in the public npm registry and can be installed using:

npm install my-crypto

Usage

All examples assume that this library is bootstrapped using:

//加密一 已废弃
//加密数据
const {aseEncode} = require('my-crypto');
let data="测试数据",password:'mypass'
let encryptedStr=aseEncode(data,password);
console.log(`加密后的数据:${encryptedStr}`);

//解密数据
const {aseDecode} = require('my-crypto');

let newData=aseDecode(encryptedStr,password);
console.log(`解密后的数据:${newData}`);

//加密二
//加密数据
const {cryptoEncode} = require('my-crypto');
let data="测试数据",key='bc3891deea785e61',iv='80ef89cf94e6416d';
let encryptedStr=cryptoEncode(data,key,iv);
console.log(`加密后的数据:${encryptedStr}`);

//解密数据
const {cryptoDecode} = require('my-crypto');

let newData=cryptoDecode(encryptedStr,key,iv);
console.log(`解密后的数据:${newData}`);

License

MIT