add streaming
This commit is contained in:
parent
34cb970f11
commit
1bd7e4d486
16 changed files with 438 additions and 187 deletions
|
@ -1,5 +1,5 @@
|
|||
import { arrayToB64, b64ToArray } from './utils';
|
||||
|
||||
import ECE from './ece.js';
|
||||
const encoder = new TextEncoder();
|
||||
const decoder = new TextDecoder();
|
||||
|
||||
|
@ -179,6 +179,16 @@ export default class Keychain {
|
|||
return ciphertext;
|
||||
}
|
||||
|
||||
async encryptStream(plaintext) {
|
||||
const enc = new ECE(plaintext, this.rawSecret, 'encrypt');
|
||||
return enc;
|
||||
}
|
||||
|
||||
async decryptStream(encstream) {
|
||||
const dec = new ECE(encstream, this.rawSecret, 'decrypt');
|
||||
return dec;
|
||||
}
|
||||
|
||||
async decryptFile(ciphertext) {
|
||||
const encryptKey = await this.encryptKeyPromise;
|
||||
const plaintext = await window.crypto.subtle.decrypt(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue