Murvin Lai
  • Me
  • Career
  • Tech Blog
  • My Projects
  • Open Source
    • Install Node.js
    • Node.JS + MongoDB on AWS
    • Node.js + MongoDB + Mongoose
    • Node Crypto Performance
    • NPM
    • My Node Tips
    • Dev NoTe
    • Req and Res in Node.js
    • Remote HTTP Request
  • Foodies
    • My Menu
  • lO_Ok

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:
  • test-aes.js
  • test-crypto-run.js


Result:
  • output.txt


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.  :-)




Copyright @2012 Murvinlai.com