[英]How do I enable AES-NI (hardware acceleration) for Node.js crypto on Linux?
I wrote a basic function to test the speed of the AES-256-CBC mode of the Node.js built-in crypto functions. 我编写了一个基本函数来测试Node.js内置加密函数的AES-256-CBC模式的速度。 These functions use OpenSSL, so they should support AES-NI, but when I correctly enable AES-NI and do a command-line test of OpenSSL the encryption speed is ~350MB/s on OpenSSL and only ~100MB/s on Node.js Crypto.
这些功能使用OpenSSL,因此它们应该支持AES-NI,但是当我正确启用AES-NI并对OpenSSL进行命令行测试时,OpenSSL的加密速度为〜350MB / s,而Node.js的加密速度仅为〜100MB / s。加密货币。
I used this answer to enable OpenSSL AES-NI in the command line and ran it as follows: 我使用此答案在命令行中启用OpenSSL AES-NI并如下运行:
openssl speed -evp aes-256-cbc
My question is, how do I make the speed of the Node.js crypto functions for AES match that of OpenSSL run in the command line? 我的问题是,如何使AES的Node.js加密函数的速度与在命令行中运行的OpenSSL的速度匹配? I suspect the reason is failure to use AES-NI
我怀疑原因是无法使用AES-NI
It seems that this was not correctly enabled until the latest release v0.12 (that was just released publicly). 在最新版本v0.12(刚刚公开发布)之前,似乎没有正确启用此功能。
Some of the notes are available here http://strongloop.com/strongblog/performance-node-js-v-0-12-whats-new/ 此处提供了一些说明, 网址为http://strongloop.com/strongblog/performance-node-js-v-0-12-whats-new/
No, you are doing it right. 不,您做对了。 The performance of OpenSSL in Node is a bit disappointing.
Node中OpenSSL的性能令人失望。 Most production Node.js deployments terminate SSL connections in something other than Node.js and then forward the unencrypted connections to Node.js.
大多数生产Node.js部署会终止Node.js之外的SSL连接,然后将未加密的连接转发到Node.js。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.