Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
@tradle/kiki
Advanced tools
Wrappers for DSA, EC, Bitcoin and other keys to provide a common API for signing/verifying/importing/exporting
Wrappers for DSA, EC, Bitcoin and other keys to provide a common API for signing/verifying/importing/exporting
this module is used by Tradle
var kiki = require('kiki');
var Keys = kiki.Keys
// load ec public key
var ecPubKey = new Keys.EC({
pub: '022ee9fefd1b275d4ee1e7c41157cd4753ad4cbd0cbfdc76eef85ebae230bf27ee'
})
// load ec private key
var ecPrivKey = new Keys.EC({
priv: '01762d59097688a1f1cd241aadee4cb1bd3d37017f71501b28e85ecdab5349c2'
})
// new ec private key
var newECKey = Keys.EC.gen({
curve: 'ed25519'
})
// new bitcoin key
var btcKey = Keys.Bitcoin.gen({
networkName: 'bitcoin'
})
// new dsa key
var dsaKey = Keys.DSA.gen()
// keys with metadata
btcKey = Keys.Bitcoin.gen({
networkName: 'testnet',
// arbitrary metadata
label: 'most excellent key',
purpose: 'messaging'
})
var sig = ecKey.signSync('hey ho')
var verified = ecKey.verifySync('hey ho', sig)
ecKey.sign('hey ho', function (err, sig) {
// async is supported for all
ecKey.verify('hey ho', function (err, verified) {
// verified is a boolean
})
})
var pub = ecKey.exportPublic()
var priv = ecKey.exportPrivate()
{
"curve": "ed25519",
"fingerprint": "de26dffa5dc9e3866ea23d9120578b768b945b1385d8393d275d715470dd6056",
"type": "ec",
"value": "022ee9fefd1b275d4ee1e7c41157cd4753ad4cbd0cbfdc76eef85ebae230bf27ee",
// whatever metadata you added
"purpose": "sign",
"label": "one key to rule them all"
}
{
"curve": "ed25519",
"fingerprint": "de26dffa5dc9e3866ea23d9120578b768b945b1385d8393d275d715470dd6056",
"priv": "01762d59097688a1f1cd241aadee4cb1bd3d37017f71501b28e85ecdab5349c2",
"type": "ec",
"value": "022ee9fefd1b275d4ee1e7c41157cd4753ad4cbd0cbfdc76eef85ebae230bf27ee",
// whatever metadata you added
"purpose": "sign",
"label": "one key to rule them all"
}
// recover to typed instance (ECKey/DSAKey/etc.)
var ecKey = kiki.toKey(pub || priv)
Generate a new key. Different keys may have different required properties (this asymmetry can't be avoided.)
Some keys have deterministic signatures - same outputs for the same inputs. Some don't.
Simple mock for a "secure element" type API, where you don't have access to the private keys. Give it a public key, an operation and data, and it will perform signing, decrypting, etc.
var kiki = require('kiki').kiki
var secureEl = kiki(privKeys) // setup the mock secure element
secureEl.sign(pubKey, msg, callback)
secureEl.ecdh(ecPubKey1, ecPubKey2, callback)
FAQs
Wrappers for DSA, EC, Bitcoin and other keys to provide a common API for signing/verifying/importing/exporting
The npm package @tradle/kiki receives a total of 14 weekly downloads. As such, @tradle/kiki popularity was classified as not popular.
We found that @tradle/kiki demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.