A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
515 B

  1. // worker.js
  2. importScripts('https://unpkg.com/promise-worker/dist/promise-worker.register.js');
  3. // importScripts('https://unpkg.com/promise-worker@2.0.1/dist/promise-worker.register.js')
  4. importScripts('https://cdnjs.cloudflare.com/ajax/libs/sjcl/1.0.8/sjcl.min.js');
  5. registerPromiseWorker((payload) => {
  6. // console.log(payload)
  7. // console.log('decrypted = ' + sjcl.decrypt(payload.passphrase, JSON.stringify(payload.cipher)));
  8. return sjcl.decrypt(payload.passphrase, JSON.stringify(payload.cipher))
  9. });