Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@aws-crypto/kdf-ctr-mode-node

Package Overview
Dependencies
Maintainers
8
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-crypto/kdf-ctr-mode-node

nodejs kdf ctr mode crypto primitive

latest
npmnpm
Version
4.1.0
Version published
Weekly downloads
130K
12.96%
Maintainers
8
Weekly downloads
 
Created
Source

@aws-crypto/kdf-ctr-mode-node

This module exports a Key Derivation Function in Counter Mode with a Pseudo Random function with HMAC SHA 256 for Node.js.

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

Specification: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-108r1.pdf

install

npm install @aws-crypto/kdf-ctr-mode-node

use


const digestAlgorithm = 'sha256'
const initialKeyMaterial = gottenFromSomewhereSecure()
const nonce = freshRandomData()
const purpose = Buffer.from('What this derived key is for.', 'utf-8')
const expectedLength = 32

const KDF = require('@aws-crypto/kdf-ctr-mode-node')
const derivedKey = KDF.kdfCounterMode({
        digestAlgorithm,
        ikm: initialKeyMaterial,
        nonce,
        purpose,
        expectedLength,
      })

test

npm test

license

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

FAQs

Package last updated on 17 Jan 2025

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