Sodium wrapper for working with BEP44 on bittorrent-dht
npm install bittorrent-dht-sodiumbittorrent-dht-sodium
> Sodium wrapper for working with BEP44 on bittorrent-dht
``js
var eddsa = require('bittorrent-dht-sodium')
const DHT = require('bittorrent-dht')
const dht = new DHT({
verify: eddsa.verify
})
const keys = eddsa.keygen()
dht.put({
v: Buffer.from('Hello world'),
k: keys.pk,
seq: 0,
sign: (msg) => {
return eddsa.sign(msg, keys.sk)
}
}, function (err, hash) {
// ...
})
`
Derive a Ed25519 keypair, optionally deriving the pk from an exisiting sk.pk
Returns as Public Key, sk as Secret Key. The sk here is not compatibleed25519-supercop
with , as the encoding is different, but signatures will be
the same.
Sign Buffer msg with sk returning the signature as a Buffer
Verify Buffer sig against Buffer msg with pk returning boolean whether
valid or not.
Generate a 64 byte random salt. This is equal to the block size of SHA-1, the
hash function used by the DHT.
`sh``
npm install bittorrent-dht-sodium