Front end of the Slack clone application.

123456789101112131415161718
  1. var xor = require('buffer-xor')
  2. exports.encrypt = function (self, block) {
  3. var data = xor(block, self._prev)
  4. self._prev = self._cipher.encryptBlock(data)
  5. return self._prev
  6. }
  7. exports.decrypt = function (self, block) {
  8. var pad = self._prev
  9. self._prev = block
  10. var out = self._cipher.decryptBlock(block)
  11. return xor(out, pad)
  12. }