code: function encryptWithHeader (input, firstKey = 0xAB) {
    const msgBuf = encrypt(input, firstKey);
    const outBuf = Buffer.alloc(msgBuf.length + 4);
    outBuf.writeUInt32BE(msgBuf.length, 0);
    msgBuf.copy(outBuf, 4);
    return outBuf;
  }
docs: Encrypts input that has a 4 byte big-endian length header;
  each byte is XOR'd with the previous encrypted byte.
  @alias  module:tplink-smarthome-crypto.encryptWithHeader
  @param  {(Buffer|string)} input           Buffer/string to encrypt
  @param  {number} [firstKey=0xAB]
  @return {Buffer}                 encrypted buffer with header