Skip to content

File encryption/decryption wired into a real file-attach UI #355

Description

@codebestia

lib/fileEncryption.ts has correct, standalone AES-256-GCM encrypt/decrypt/upload/download logic, but nothing calls it — there is no file-attach input anywhere in the live conversation UI. This depends on the session/envelope fixes, since the file's symmetric key needs to travel inside a working per-device envelope.

Acceptance criteria:

  • app/app/conversations/[id]/page.tsx gets a file-attach control that calls encryptFile/requestPresignedUpload/uploadCiphertextToS3/sendEncryptedFile
  • The file's decryption key travels inside the per-device envelope ciphertext, not as a separate plaintext field
  • Receiving a file message calls fetchPresignedDownload/downloadAndDecryptFile to retrieve and decrypt it client-side
  • Coordinated with the backend's file-message envelope migration — client and server land together
  • A test exercises the encrypt→upload→download→decrypt round trip against the now-real upload endpoints

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions