@aws-crypto/hkdf-node
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

@aws-crypto/hkdf-node

This module exports a HMAC-based Key Derivation Function (HKDF) for Node.js. HKDF is very simple to implement, but this module has been reviewed and has extensive test vectors.

This module is used in the the AWS Encryption SDK for JavaScript to provide HKDF key derivation for specific algorithm suites.

Specification: https://tools.ietf.org/html/rfc5869

install

npm install @aws-crypto/hkdf-node

use

  const HKDF = require('@aws-crypto/hkdf-node')
  const expand = HKDF('sha256')('some key', 'some salt')
  const info = {some: 'info', message_id: 123}
  const key = expand(32, Buffer.from(JSON.stringify(info)))

test

npm test

license

This SDK is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information.

Readme

Keywords

none

Package Sidebar

Install

npm i @aws-crypto/hkdf-node

Weekly Downloads

217,555

Version

4.0.0

License

Apache-2.0

Unpacked Size

36.6 kB

Total Files

22

Last publish

Collaborators

  • amzn-oss
  • seebees
  • agray256
  • lavaleri
  • salkeldr
  • aws-crypto-tools-ci-bot
  • mattsb42-aws
  • farleyb-aws