node crypto decipher data
来源:互联网 发布:win10 uefi 安装Ubuntu 编辑:程序博客网 时间:2024/06/05 16:36
var fs = require('fs');
var crypto = require('crypto');
var keyPem = fs.readFileSync('./key.pem');
// var certPem = fs.readFileSync('./cert.pem');
var publicKey = keyPem.toString('ascii');
// var certKey = certPem.toString();
var data = "hahahahahaahahahhahahhhahahahahaa";
console.log('befor sign: ' + data);
var cipher = crypto.createCipher('blowfish',publicKey);
var ciphered = cipher.update(data,'binary','hex');
ciphered += cipher.final('hex');
console.log(data.length);
console.log('after ciphered:' + ciphered);
var decipher = crypto.createDecipher('blowfish',publicKey);
var deciphered = decipher.update(ciphered,'hex','utf8');
deciphered += decipher.final('utf8');
console.log('after deciphered: ' + deciphered);
var crypto = require('crypto');
var keyPem = fs.readFileSync('./key.pem');
// var certPem = fs.readFileSync('./cert.pem');
var publicKey = keyPem.toString('ascii');
// var certKey = certPem.toString();
var data = "hahahahahaahahahhahahhhahahahahaa";
console.log('befor sign: ' + data);
var cipher = crypto.createCipher('blowfish',publicKey);
var ciphered = cipher.update(data,'binary','hex');
ciphered += cipher.final('hex');
console.log(data.length);
console.log('after ciphered:' + ciphered);
var decipher = crypto.createDecipher('blowfish',publicKey);
var deciphered = decipher.update(ciphered,'hex','utf8');
deciphered += decipher.final('utf8');
console.log('after deciphered: ' + deciphered);
阅读全文
0 0
- node crypto decipher data
- Node crypto crc32 加密
- Node.js crypto模块
- node 的crypto加密
- Node(12) crypto for encrytion
- Node.js加密算法库Crypto
- node中的加密模块 crypto
- node.js 的crypto模块,加密cookie
- node.js 的crypto模块用来加密
- Pitfall in node crypto and base64 encoding
- node crypto sha192 翻译为java
- node.js之基础加密算法模块crypto
- Node.js基本模块crypto(加解密)
- JavaScript基础之Node.js与crypto
- Node.js内置模块之加密crypto
- Crypto++
- Crypto++
- Crypto
- 决策树学习
- nginx使用负载均衡进行压力测试得到的结论
- 小白笔记---------------------------------leetcode(48. Rotate Image )
- Pascal运算符和优先级
- java常用数据结构list底层源码详解
- node crypto decipher data
- An impassioned circulation of affection CodeForces
- 复习c结构体
- 修理牧场-优先级队列
- 求单链表倒数第K个数(java)
- 一位资深程序员大牛给予Java初学者的学习路线建议
- 第三节 java 自增,自减,三元运算,短路运算
- 7.4用穷举法的调用函数
- CCF CSP 201509-1 数列分段