javascriptnode.jscryptographyaescmac

AES-CMAC module for Node.js?


Is there a Node.js module that handles AES-CMAC (RFC 4493)?

I've been searching around NPM, Google, and the like, but haven't found one. Somebody within my company built one that wraps Crypto++ as a C++ addon for Node.js, but unfortunately it doesn't build on Windows (depends on make). Just looking for possible alternatives.

This is similar to this other question, but I'm hoping for a Node.js specific implementation instead of a plain JavaScript one. Ideally something that makes use of Node's crypto library or a C/C++ addon for performance.

It seems like it wouldn't be too hard to build one, but I'd like to avoid doing so if there is already one out there.


Solution

  • Since I couldn't find anything, I ended up creating my own module: node-aes-cmac

    As I learned more, I discovered that RFC 4493 is specific for 128 bit keys (AES128). But it references the NIST Special Publication 800-38B which gave the additional information I needed to support 192 and 256 bit keys as well.