#cpp_rsa C++ rsa 加密解密
npm i cpp_rsa
var addon = require('bindings')('cpp_rsa'); let nodes = new addon.NODES( __dirname + "/rsa_public_key.pem", __dirname + "/rsa_private_key.pem"); let p1 = nodes.publicEncrypt("123456789") let w1 = nodes.privateDecrypt(p1) console.log("data", p1, w1)
let p2 = nodes.privateEncrypt("123456789") let w2 = nodes.publicDecrypt(p2) console.log("data2", p2, w2)
##环境准备 cmake cmake-js opencv curl curl -O http://static-res.haizitong.com/nodejs/cmake-3.3.2.tar.gz tar xzvf cmake-3.3.2.tar.gz cd cmake-3.3.2 ./bootstrap gmake make install
cd ../../
apt install libcrypto++-dev
npm i -g cmake-js ln -s /opt/node/bin/cmake-js /usr/local/bin/cmake-js