Page MenuHomePhabricator

[client-backup] implement functions to decrypt backup
ClosedPublic

Authored by kamil on Aug 29 2023, 2:41 AM.
Tags
None
Referenced Files
F3521722: D9000.diff
Mon, Dec 23, 4:32 AM
F3520795: D9000.id30679.diff
Mon, Dec 23, 1:23 AM
F3520794: D9000.id30479.diff
Mon, Dec 23, 1:23 AM
F3520755: D9000.diff
Mon, Dec 23, 1:17 AM
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
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
Branch
client-backup
Lint
No Lint Coverage
Unit
No Test Coverage

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

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

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

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.