3.1.0 • Published 8 months ago

aes-cmac v3.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 months ago

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

3.1.0

8 months ago

3.0.2

1 year ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

3 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago