Page MenuHomePhabricator

[client-backup] implement functions to decrypt backup
ClosedPublic

Authored by kamil on Aug 29 2023, 2:41 AM.
Tags
None
Referenced Files
F3519647: D9000.id.diff
Sun, Dec 22, 10:44 PM
Unknown Object (File)
Thu, Dec 19, 5:59 PM
Unknown Object (File)
Fri, Dec 6, 5:53 PM
Unknown Object (File)
Nov 20 2024, 4:37 PM
Unknown Object (File)
Nov 20 2024, 4:37 PM
Unknown Object (File)
Nov 20 2024, 4:36 PM
Unknown Object (File)
Nov 20 2024, 4:18 PM
Unknown Object (File)
Nov 10 2024, 6:10 PM
Subscribers

Details

Summary

Decrypting backup with AES-256 in GCM mode.

Depends on D8999

Test Plan

Encrypt/decrypt different types of both UserData and UserData.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Aug 29 2023, 3:23 AM
kamil added inline comments.
native/backup/encryption.js
59 ↗(On Diff #30479)

if we were able to decrypt, it means it exactly the same object as we encrypted so we can assume the type without additional validation

marcin added inline comments.
native/backup/conversion-utils.js
19 ↗(On Diff #30479)

This function (and its counterpart) should be in a generic place. Directory native/utils/ looks like the right place.

This revision is now accepted and ready to land.Aug 29 2023, 6:37 AM
native/backup/conversion-utils.js
19 ↗(On Diff #30479)

I have mixed feelings about this idea... name is generic but it's placed on purpose in this directory.

A case when we will need to take bytes (which are bytes of UTF-8 string) and convert it to string, and then parse it because this string is JSON is something really backup related, not generic.