π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Denoise
Manav Rathi0240b37032f1
diff --git a/web/packages/base/crypto/ente-impl.ts b/web/packages/base/crypto/ente-impl.tsindex 8a0a01dacb..1c28e3d124 100644--- a/web/packages/base/crypto/ente-impl.ts+++ b/web/packages/base/crypto/ente-impl.ts@@ -1,11 +1,6 @@/** Careful when adding add other imports! */import * as libsodium from "./libsodium";-import type {- BytesOrB64,- DecryptBlobB64,- EncryptedBlob_2,- EncryptJSON,-} from "./types";+import type { BytesOrB64, EncryptedBlob_2, EncryptJSON } from "./types";export const _encryptBoxB64 = libsodium.encryptBoxB64;@@ -55,7 +50,11 @@ export const _decryptMetadataJSON_New = async (new TextDecoder().decode(await _decryptBlob(blob, key)),) as unknown;-export const _decryptMetadataJSON = async (r: DecryptBlobB64) =>+export const _decryptMetadataJSON = async (r: {+ encryptedDataB64: string;+ decryptionHeaderB64: string;+ keyB64: string;+}) =>_decryptMetadataJSON_New({encryptedData: r.encryptedDataB64,diff --git a/web/packages/base/crypto/ente.ts b/web/packages/base/crypto/ente.tsindex 854efcfaae..8feb0ccdce 100644--- a/web/packages/base/crypto/ente.ts+++ b/web/packages/base/crypto/ente.ts@@ -53,7 +53,6 @@ import { inWorker } from "../env";import * as ei from "./ente-impl";import type {BytesOrB64,- DecryptBlobB64,EncryptedBlob_2,EncryptedBox2,EncryptJSON,@@ -202,7 +201,11 @@ export const decryptMetadataJSON_New = (/*** Deprecated, retains the old API.*/-export const decryptMetadataJSON = (r: DecryptBlobB64) =>+export const decryptMetadataJSON = (r: {+ encryptedDataB64: string;+ decryptionHeaderB64: string;+ keyB64: string;+}) =>inWorker()? ei._decryptMetadataJSON(r): sharedCryptoWorker().then((w) => w.decryptMetadataJSON(r));diff --git a/web/packages/base/crypto/types.ts b/web/packages/base/crypto/types.tsindex ba0c80c395..fdc9542062 100644--- a/web/packages/base/crypto/types.ts+++ b/web/packages/base/crypto/types.ts@@ -4,7 +4,6 @@*/export type BytesOrB64 = Uint8Array | string;-/*** Deprecated.*@@ -125,28 +124,3 @@ export interface EncryptedBlobB64_2 {*/decryptionHeader: string;}--/**- * Deprecated.- *- * A variant of {@link DecryptBlobBytes} with the encrypted Blob's data as a- * base64 encoded string.- */-export interface DecryptBlobB64 {- /**- * A base64 string containing the data to decrypt.- */- encryptedDataB64: string;- /**- * A base64 string containing the decryption header that was produced during- * encryption.- *- * The header contains a random nonce and other libsodium metadata. It does- * not need to be kept secret.- */- decryptionHeaderB64: string;- /**- * A base64 string containing the encryption key.- */- keyB64: string;-}