mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 14:10:53 +03:00
add streaming
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user