feat: wire up E2EE send, inbound decryption, file attach, and encrypted thumbnails#395
Open
AbelOsaretin wants to merge 1 commit into
Open
Conversation
…ed thumbnails - Issue codebestia#353: Per-device message encryption using buildEnvelopes/sealedBoxEncrypt in the send path. Socket emit sends per-device envelopes from real ciphertext, raw plaintext never appears in outgoing fields. - Issue codebestia#354: Inbound decryption pipeline via useInboundPipeline for live socket delivery and /sync backfill. Messages that cannot decrypt render clear UnavailableMessagePlaceholder states distinct from bugs. - Issue codebestia#355: File-attach control with encryptFile/requestPresignedUpload/ uploadCiphertextToS3/sendEncryptedFile. File decryption key travels inside per-device envelope ciphertext, not as plaintext. Receiving side calls downloadAndDecryptFile for client-side decryption. - Issue codebestia#356: Encrypted thumbnails via generateEncryptedThumbnail for image/video messages. EncryptedThumbnail component renders decrypted preview inline. Thumbnail round-trips through encrypt/upload/download/decrypt without exposing plaintext bytes. - Added comprehensive E2EE test suite covering per-device encryption, decrypt round-trips, file encryption, and thumbnail encryption.
|
@AbelOsaretin Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #353, Closes #354, Closes #355, Closes #356
Type of Change
Summary
This PR wires up the end-to-end encryption pipeline across the conversation UI, covering four critical E2EE gaps: encrypted send, inbound decryption, file attachment encryption, and encrypted thumbnail rendering. Previously, the send path emitted plaintext, the inbound pipeline was never called, file encryption existed but had no UI, and thumbnail components were orphaned.
Motivation / Context
The E2EE crypto primitives (
lib/crypto.ts,lib/fileEncryption.ts,lib/thumbnail.ts) and pipeline components (useInboundPipeline,EncryptedThumbnail,UnavailableMessagePlaceholder) all existed but were disconnected from the live conversation route. This PR integrates them:#353 — Per-device message encryption + envelope assembly in the send path:
app/app/conversations/[id]/page.tsxnow callssendEncryptedMessagewhich usesbuildEnvelopes/sealedBoxEncryptto produce per-device sealed ciphertextenvelopesbuilt from real ciphertext — raw plaintext never appears in any outgoing fielddevice_set_mismatchretry handles concurrent device changes#354 — Inbound decryption + render pipeline:
useInboundPipelinefor both live socket delivery (message_envelope,device_envelope) and/syncbackfillsetSessionKey/importSessionKeywhen sessions are establishedUnavailableMessagePlaceholderwith clear reason text, distinct from bug-caused failures#355 — File encryption/decryption wired into file-attach UI:
encryptFile→requestPresignedUpload→uploadCiphertextToS3→sendEncryptedFiledownloadAndDecryptFileto retrieve and decrypt client-side#356 — Encrypted thumbnails wired into message rendering:
generateEncryptedThumbnailEncryptedThumbnailcomponent renders decrypted preview inline after local decryptCloses #353, Closes #354, Closes #355, Closes #356