Page MenuHomePhabricator

Enable AES encryption with custom IV on native
AbandonedPublic

Authored by marcin on Wed, Sep 25, 11:03 AM.
Tags
None
Referenced Files
F2839996: D13466.diff
Sun, Sep 29, 4:19 AM
Unknown Object (File)
Wed, Sep 25, 12:22 PM
Unknown Object (File)
Wed, Sep 25, 12:21 PM
Unknown Object (File)
Wed, Sep 25, 12:04 PM
Subscribers

Details

Reviewers
kamil
tomek
bartek
Summary

Subsequent calls to AES encrypt with the same key and the same data will yield different result. This is because we generate different IV for each call. Generally speaking this is OK, but for large notifs we want the same result to minimize the number of uploads to blob service. We can achieve this by generating IV once per notif and using it while encrypting for different devices.

Test Plan

TODO

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

I am actually starting to question this. While putting those diffs I came up with better idea how to achieve the same effect using just JS. I will try to get on phab tomorrow morning. The idea is to pass to createAPNsVisualNotif and createAndroidVisualNotif a map from stringified unencrypted notification + messageInfo to a promise resolving to its encrypted version and a hash.

Please avoid the initialism "IV" in factor of "InitVector", "InitializationVector", etc.

Sorry for the confusion. This differential was supposed to bo abandoned.