aes-cmac-dibeling
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

AES-CMAC

AES CMAC implementation in typescript.

Install

npm i aes-cmac

Examples

NodeJS (CommonJS)

(async () => {
  const AesCmac = require('aes-cmac').AesCmac;

  const key = Buffer.from('2b7e151628aed2a6abf7158809cf4f3c', 'hex');
  const msg = Buffer.from('6bc1bee22e409f96e93d7e117393172a', 'hex');

  const aesCmac = new AesCmac(key);
  const result = Buffer.from(await aesCmac.calculate(msg));

  console.log(result.toString('hex'));
})();

NodeJS (ECMAScript modules)

import { AesCmac } from 'aes-cmac';

(async () => {
  const key = Buffer.from('2b7e151628aed2a6abf7158809cf4f3c', 'hex');
  const msg = Buffer.from('6bc1bee22e409f96e93d7e117393172a', 'hex');

  const aesCmac = new AesCmac(key);
  const result = Buffer.from(await aesCmac.calculate(msg));

  console.log(result.toString('hex'));
})();

References

/aes-cmac-dibeling/

    Package Sidebar

    Install

    npm i aes-cmac-dibeling

    Weekly Downloads

    1

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    33.9 kB

    Total Files

    8

    Last publish

    Collaborators

    • danielibel