From cfad983d088cf74949935458045802a65a0dc1b6 Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Tue, 3 Apr 2018 22:47:53 -0400 Subject: [PATCH] Consistently use `ciphertext` instead of `encrypted` --- js/modules/backup.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/modules/backup.js b/js/modules/backup.js index 3060cc0b675..481053fc5e3 100644 --- a/js/modules/backup.js +++ b/js/modules/backup.js @@ -499,11 +499,11 @@ async function writeAttachment(attachment, options) { throw new TypeError('"attachment.data" is required'); } - const encrypted = await crypto.encryptSymmetric(key, attachment.data); + const ciphertext = await crypto.encryptSymmetric(key, attachment.data); const writer = await createFileAndWriter(dir, filename); const stream = createOutputStream(writer); - stream.write(Buffer.from(encrypted)); + stream.write(Buffer.from(ciphertext)); await stream.close(); } @@ -1092,8 +1092,8 @@ async function encryptFile(sourcePath, targetPath, options) { } const plaintext = await readFileAsArrayBuffer(sourcePath); - const encrypted = await crypto.encryptSymmetric(key, plaintext); - return writeFile(targetPath, encrypted); + const ciphertext = await crypto.encryptSymmetric(key, plaintext); + return writeFile(targetPath, ciphertext); } async function decryptFile(sourcePath, targetPath, options) { @@ -1104,8 +1104,8 @@ async function decryptFile(sourcePath, targetPath, options) { throw new Error('Need key to do encryption!'); } - const encrypted = await readFileAsArrayBuffer(sourcePath); - const plaintext = await crypto.decryptSymmetric(key, encrypted); + const ciphertext = await readFileAsArrayBuffer(sourcePath); + const plaintext = await crypto.decryptSymmetric(key, ciphertext); return writeFile(targetPath, Buffer.from(plaintext)); }