π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Restore thumb
Manav Rathi91e45fe64a99
diff --git a/web/packages/base/crypto/index.ts b/web/packages/base/crypto/index.tsindex 72b446732c..d267670a71 100644--- a/web/packages/base/crypto/index.ts+++ b/web/packages/base/crypto/index.ts@@ -147,7 +147,21 @@ export const encryptBlob = (data: BytesOrB64, key: BytesOrB64) =>export const encryptBlobB64 = (data: BytesOrB64, key: BytesOrB64) =>inWorker()? ei._encryptBlobB64(data, key)- : sharedCryptoWorker().then((w) => w._encryptBlobB64(data, key));+ : sharedCryptoWorker().then((w) => w.encryptBlobB64(data, key));++/**+ * Encrypt the thumbnail for a file.+ *+ * This is midway variant of {@link encryptBlob} and {@link encryptBlobB64} that+ * returns the decryption header as a base64 string, but leaves the data+ * unchanged.+ *+ * Use {@link decryptThumbnail} to decrypt the result.+ */+export const encryptThumbnail = (data: BytesOrB64, key: BytesOrB64) =>+ inWorker()+ ? ei._encryptThumbnail(data, key)+ : sharedCryptoWorker().then((w) => w.encryptThumbnail(data, key));/*** Encrypt the JSON metadata associated with an Ente object (file, collection or@@ -221,6 +235,14 @@ export const decryptBlobB64 = (blob: EncryptedBlob, key: BytesOrB64) =>? ei._decryptBlobB64(blob, key): sharedCryptoWorker().then((w) => w.decryptBlobB64(blob, key));+/**+ * Decrypt the thumbnail encrypted using {@link encryptThumbnail}.+ */+export const decryptThumbnail = (blob: EncryptedBlob, key: BytesOrB64) =>+ inWorker()+ ? ei._decryptThumbnail(blob, key)+ : sharedCryptoWorker().then((w) => w.decryptThumbnail(blob, key));+/*** Decrypt the metadata JSON encrypted using {@link encryptMetadataJSON}.*diff --git a/web/packages/base/crypto/worker.ts b/web/packages/base/crypto/worker.tsindex a9a9d84bcb..265dbe1c68 100644--- a/web/packages/base/crypto/worker.ts+++ b/web/packages/base/crypto/worker.ts@@ -17,7 +17,7 @@ export class CryptoWorker {generateBlobOrStreamKey = ei._generateBlobOrStreamKey;encryptBoxB64 = ei._encryptBoxB64;encryptThumbnail = ei._encryptThumbnail;- _encryptBlobB64 = ei._encryptBlobB64;+ encryptBlobB64 = ei._encryptBlobB64;encryptStreamBytes = ei._encryptStreamBytes;initChunkEncryption = ei._initChunkEncryption;encryptStreamChunk = ei._encryptStreamChunk;