code: function evp_kdf (data, salt, opts) { // eslint-disable-line
    // A single EVP iteration, returns `D_i`, where block equlas to `D_(i-1)`
    function iter (block) {
      var hash = crypto.createHash(opts.digest || 'md5')
      hash.update(block)
      hash.update(data)
      hash.update(salt)
      block = hash.digest()
  
      for (var i = 1; i < (opts.count || 1); i++) {
        hash = crypto.createHash(opts.digest || 'md5')
        hash.update(block)
        block = hash.digest()
      }
  
      return block
    }
  
    var keysize = opts.keysize || 16
    var ivsize = opts.ivsize || 16
  
    var ret = []
  
    var i = 0
    while (Buffer.concat(ret).length < (keysize + ivsize)) {
      ret[i] = iter((i === 0) ? Buffer.alloc(0) : ret[i - 1])
      i++
    }
  
    var tmp = Buffer.concat(ret)
  
    return {
      key: tmp.slice(0, keysize),
      iv: tmp.slice(keysize, keysize + ivsize)
    }
  }
docs: /*
  opts:
  - digest - digest algorithm, defaults to md5
  - count - hash iterations
  - keysize - desired key size
  - ivsize - desired IV size
  
  Algorithm form https://www.openssl.org/docs/manmaster/crypto/EVP_BytesToKey.html
  
  FIXME: not optimised at all