node.js stream 加解密
来源:互联网 发布:笑郭天盾网络验证 编辑:程序博客网 时间:2024/06/13 22:37
var crypto = require('crypto'), algorithm = 'aes-256-ctr', password = 'testpassword';var fs = require('fs');function encryptStream(input,output){var encrypt = crypto.createCipher(algorithm, password);var inStream = fs.createReadStream(input);var outputStream = fs.createWriteStream(output);inStream.pipe(encrypt).pipe(outputStream);}function decryptStream(input,output){var decrypt = crypto.createDecipher(algorithm, password);var inStream = fs.createReadStream(input);var outputStream = fs.createWriteStream(output);inStream.pipe(decrypt).pipe(outputStream);}//input pathvar intext = '';//output pathvar outtext= '';encryptStream(intext,outtext);//decryptStream(intext,outtext);
0 0
- node.js stream 加解密
- Node.js基本模块crypto(加解密)
- node.js 使用crypto模块进行RSA加解密操作
- Node.js Stream(流)
- node.js Stream
- node.js stream I
- node.js stream
- Node.js Stream(流)
- Node.js Stream(流)
- Node.js Stream(流)
- Node.js Stream(流)
- Node.js stream模块
- [Node.js]Stream
- [Node.js]Stream
- [Node.js]Stream
- [Node.js]Stream
- Node.js Stream(流)
- node.js中的Stream
- Android小知识——添加多个View
- JAVA/C 线性顺序存储结构
- Android小知识——一个界面有多个listView
- 网络文件系统
- Android小知识——listView的分割线高度和颜色
- node.js stream 加解密
- leetcode 342 Power of Four C++
- Oracle 常用的函数
- 通过JDBC访问数据库
- 【Codevs1228】苹果树(dfs序+树状数组)
- Android小知识——Adapter的使用
- DrawerLayout+NavigationView打造Google原生Material Design风格侧滑菜单
- [hihoCoder] #1307 : 穿越禁区 解题报告
- 全面剖析Redis Cluster原理和应用