Page MenuHomePhabricator

[web] Add function to decrypt media
ClosedPublic

Authored by bartek on Mar 31 2023, 6:22 AM.
Tags
None
Referenced Files
F3514386: D7268.id24528.diff
Sun, Dec 22, 4:33 AM
F3513238: D7268.diff
Sat, Dec 21, 11:18 PM
Unknown Object (File)
Thu, Dec 12, 7:57 PM
Unknown Object (File)
Thu, Dec 5, 8:39 PM
Unknown Object (File)
Thu, Dec 5, 8:39 PM
Unknown Object (File)
Thu, Dec 5, 8:38 PM
Unknown Object (File)
Nov 21 2024, 5:46 PM
Unknown Object (File)
Nov 13 2024, 5:41 AM
Subscribers

Details

Summary

Web counterpart of D7224. It slightly differs from the native counterpart. A key difference is that we save it as a blob and generate object URL for that.

Test Plan

Called this function giving url to encrypted media. Set returned url as an image source. Confirmed the image is displayed

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.

Remove thousand separators from PADDING_THRESHOLD

bartek published this revision for review.Apr 3 2023, 3:19 AM
marcin added inline comments.
web/media/encryption-utils.js
90 ↗(On Diff #24528)

Probably irrelevant, but what do we need time measurement for? If just for formalities then it probably doesn't matter where we put calls to Date.now() but if we want to be able to use if for profiling how fast crypto operations are we might want to put decryptStartTime declaration jut before call to AES.decrypt. On the other hand I am not sure how fast is hexToUintArray. Perhaps it is so fast it can be neglected during time measurements.

This revision is now accepted and ready to land.Apr 3 2023, 4:47 AM
web/media/encryption-utils.js
90 ↗(On Diff #24528)

Yeah, this is pretty general because helper steps (like hex -> uint8array) are insignificant. If the whole step takes too long, then measurements can potentially be split for in-depth insights while debugging

This revision was automatically updated to reflect the committed changes.