Page MenuHomePhabricator

[client-backup] implement functions to decrypt backup
ClosedPublic

Authored by kamil on Aug 29 2023, 2:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 5, 8:31 PM
Unknown Object (File)
Sun, Jan 5, 5:57 AM
Unknown Object (File)
Mon, Dec 23, 12:21 PM
Unknown Object (File)
Mon, Dec 23, 9:41 AM
Unknown Object (File)
Mon, Dec 23, 4:32 AM
Unknown Object (File)
Mon, Dec 23, 1:23 AM
Unknown Object (File)
Mon, Dec 23, 1:23 AM
Unknown Object (File)
Mon, Dec 23, 1:17 AM
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.