Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-crypto/hkdf-node

Package Overview
Dependencies
Maintainers
8
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-crypto/hkdf-node

nodejs hkdf crypto primitive

  • 1.9.0
  • npm
  • Socket score

Version published
Maintainers
8
Created

What is @aws-crypto/hkdf-node?

@aws-crypto/hkdf-node is an npm package that provides an implementation of the HMAC-based Extract-and-Expand Key Derivation Function (HKDF) for Node.js. It is part of the AWS Crypto Tools suite and is designed to help developers securely derive cryptographic keys from a shared secret.

What are @aws-crypto/hkdf-node's main functionalities?

Key Derivation

This feature allows you to derive a cryptographic key from an initial keying material (IKM) using the HKDF algorithm. The code sample demonstrates how to use the HKDF class to derive a key with a specified length, using optional salt and info parameters.

const { HKDF } = require('@aws-crypto/hkdf-node');
const crypto = require('crypto');

const ikm = crypto.randomBytes(32); // Initial Keying Material
const salt = crypto.randomBytes(16); // Optional salt
const info = Buffer.from('example info'); // Optional context and application specific information
const length = 32; // Length of the derived key

const hkdf = new HKDF('sha256');
hkdf.deriveKey(ikm, salt, info, length).then(derivedKey => {
  console.log('Derived Key:', derivedKey.toString('hex'));
}).catch(err => {
  console.error('Error deriving key:', err);
});

Other packages similar to @aws-crypto/hkdf-node

FAQs

Package last updated on 27 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc