From 57c5facc6e81695f0cd2d4c14f22020e0632cc01 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 12 Jun 2023 17:54:09 +0100 Subject: [PATCH] Zip exports --- packages/backend-core/src/security/encryption.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/src/security/encryption.ts b/packages/backend-core/src/security/encryption.ts index 8a2657bb40..0147b45c6c 100644 --- a/packages/backend-core/src/security/encryption.ts +++ b/packages/backend-core/src/security/encryption.ts @@ -84,7 +84,7 @@ export async function encryptFile( outputFile.write(salt) outputFile.write(iv) - inputFile.pipe(cipher).pipe(outputFile) + inputFile.pipe(zlib.createGzip()).pipe(cipher).pipe(outputFile) return new Promise<{ filename: string; dir: string }>(r => { outputFile.on("finish", () => { @@ -120,7 +120,7 @@ export async function decryptFile( const stretched = stretchString(secret, salt) const decipher = crypto.createDecipheriv(ALGO, stretched, iv) - inputFile.pipe(decipher).pipe(outputFile) + inputFile.pipe(decipher).pipe(zlib.createGunzip()).pipe(outputFile) return new Promise(r => { outputFile.on("finish", () => {