Chatto/src/main/frontend/workers/encryption-worker/main.ts

9 lines
339 B
TypeScript
Raw Normal View History

import registerPromiseWorker from 'promise-worker/register';
import * as sjcl from 'sjcl'
registerPromiseWorker((payload) => {
// console.log(payload)
// console.log('decrypted = ' + sjcl.decrypt(payload.passphrase, JSON.stringify(payload.cipher)));
return sjcl.decrypt(payload.passphrase, JSON.stringify(payload.cipher))
});