【发布时间】:2018-12-22 23:16:38
【问题描述】:
我正在尝试使用 crypto.js 中的公钥加密,我想使用 publicEncrypt 加密一些消息,然后使用 privateDecrypt 解密它。
const crypto=require('crypto');
let alice=crypto.getDiffieHellman('modp14');
alice.generateKeys();
let enc=crypto.publicEncrypt(alice.getPublicKey(),Buffer.from('hello'));
但是,crypto.publicEncrypt 行导致以下错误:
"错误:错误:0906D06C:PEM 例程:PEM_read_bio:no start line"
【问题讨论】:
标签: node.js encryption public-key-encryption diffie-hellman