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", () => {