This is my crypto performance test.
First, here is the list of npm packages I use:
- microtime
- node-uuid
- dcrypt
There are couple tests:
1) Just Date.now() + Math.rand();
2) Built-in hash md5 / sha512
3) Built-in encrypt & decrypt with aes-256-cbc
4) 3rd party aes 256 js lib
5) NPM dcrypt with aes-256-cbc
Files:
Result:
Conclusion:
The built-in crypt library is fast and generate the same result as dcrypt library as expected. They both rely on the openssl. Node-uuid is 40% slower than date+random number for generating unique number. However, it is only ~50 micro seconds difference. Not a big deal for most application. :-)