开发者社区> 镜像站> NPM> mindvault
mindvault
Deterministic seeds from passphrases suitable for WetWare RAM (Read: the human brain)
Last updated 4 years ago by emilbay .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mindvault 
SYNC missed versions from official npm registry.

mindvault

Deterministic seeds from passphrases suitable for WetWare RAM (Read: the human brain)

Usage

var hash = require('mindvault')
var crypt = require('ssb-keys')
var generatePassphrase = require('eff-diceware-passphrase')

var appId = Buffer.alloc(hash.APP_ID_BYTES).fill('mindvault')
var salt = Buffer.from('john@example.com')
var passphrase = Buffer.from(generatePassphrase.entropy(100).join(' '))

var keyPair = crypt.generate('ed25519', hash(passphrase, salt, appId))

// Go crazy with your new key pair

API

mindvault(passphrase, salt, [appId])

  • passphrase must be a Buffer of arbitrary length, and is recommended to have entropy beyond 100 bits.
  • salt must be Buffer of arbitrary length. It ss used to partition the key space, to prevent dictionary attacks and key collisions, and should therefore be unique. One way to achieve this is to have users enter their email address as email addresses are unique by definition.
  • appId is optional, but must be a Buffer of length mindvault.APP_ID_BYTES. Presently that's 32 bytes, and it is used as a key to the salt hashing algorithm Blake2b. This will further partition the salt hash space, making key collisions between different applications, with the same passphrase and salt practically impossible.

Install

npm install mindvault

License

ISC

Current Tags

  • 0.0.1                                ...           latest (4 years ago)

2 Versions

  • 0.0.1                                ...           4 years ago
  • 0.0.0                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 2
Last Month 2
Dependencies (1)
Dev Dependencies (2)
Dependents (0)
None