This repository has been archived on 2026-06-01. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
lamassu-server/packages/server/bin/hkdf
2025-12-31 19:04:13 +01:00

17 lines
451 B
JavaScript
Executable file

#!/usr/bin/env node
'use strict'
const hkdf = require('futoin-hkdf')
const label = process.argv[2]
const masterSeedHex = process.argv[3].trim()
if (process.argv.length !== 4) {
console.error('hdkf <label> <masterKey>')
console.error('masterKey should be in hex encoding.')
process.exit(3)
}
const masterSeed = Buffer.from(masterSeedHex, 'hex')
console.log(hkdf(masterSeed, 32, { salt: 'lamassu-server-salt', info: label }).toString('hex'))