Export cryptographic keys to an easily printable format
ameba23 a581bd0257 change name in package json 1 year ago
test add test 1 year ago
LICENSE add test 1 year ago
README.md add comment option 1 year ago
example.png crop img 1 year ago
index.js add comment option 1 year ago
package.json change name in package json 1 year ago

README.md

Paper key export

For backing up cryptographic keys on paper. Takes a array of keys with names and creates a PDF.

  • mnemonics using BIP 39 (keys must be between 16 and 32 bytes)
  • QR codes
  • Removes files securely using skrub

Example:

const paperKeys = require('.')
const crypto = require('crypto')
const keys = [
  {
    name: 'My important key',
    data: crypto.randomBytes(32)
  },
  {
    name: 'Another important key',
    data: crypto.randomBytes(32)
  }
]

paperKeys.createPdf('./key-backup.pdf', keys, (err) => {
  if (err) throw err
})

Example PDF output:

example

API

createPdf (outputFile, keys, callback)

creates a pdf outputFile.

  • keys should be an array of objects of the form:
    • name - a string describing the key (may contain markdown formatting).
    • data - the key as a buffer or hex encoded string.
    • comment - an optional comment string to include (may contain markdown formatting).

removePdf (filePath)

Securely removes the given file. Returns a promise.

mnemonicToKey (mnemonic)

Turn a mnemonic back into a key. Takes a string, returns a buffer.