Page MenuHomePhabricator

[web] Add function to decrypt media
ClosedPublic

Authored by bartek on Mar 31 2023, 6:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 3, 8:03 PM
Unknown Object (File)
Fri, May 3, 3:41 PM
Unknown Object (File)
Sat, Apr 27, 10:30 PM
Unknown Object (File)
Sat, Apr 27, 10:30 PM
Unknown Object (File)
Sat, Apr 27, 10:30 PM
Unknown Object (File)
Sat, Apr 27, 10:27 PM
Unknown Object (File)
Sat, Apr 27, 9:57 PM
Unknown Object (File)
Fri, Apr 26, 6:54 PM
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.