Page MenuHomePhabricator

Implement encryption-decryption layer for elementary file operations
ClosedPublic

Authored by marcin on Jun 28 2022, 8:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 2:50 AM
Unknown Object (File)
Mon, Nov 25, 2:43 AM
Unknown Object (File)
Mon, Nov 25, 2:32 AM
Unknown Object (File)
Mon, Nov 25, 2:28 AM
Unknown Object (File)
Mon, Nov 25, 2:24 AM
Unknown Object (File)
Mon, Nov 25, 2:18 AM
Unknown Object (File)
Mon, Nov 11, 7:40 PM
Unknown Object (File)
Mon, Nov 11, 5:12 PM

Details

Summary

Implements encryption-decryption layer for flat-file message store operations.

Test Plan

Modify AppDelegate so that on AppLaunch it encrypts and decrypts some text then assert they are equal.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

your diffs miss the prefixes in their titles ([native])

native/ios/Comm/TemporalMessageStorage/EncryptedFileUtils.mm
75 ↗(On Diff #13908)

newline

tomek added inline comments.
native/ios/Comm/TemporalMessageStorage/EncryptedFileUtils.mm
16–17 ↗(On Diff #13908)

Shouldn't we use self?

61 ↗(On Diff #13908)

Why do we need to modify the length?

This revision is now accepted and ready to land.Jun 29 2022, 8:04 AM
native/ios/Comm/TemporalMessageStorage/EncryptedFileUtils.mm
16–17 ↗(On Diff #13908)

All methods in this class are static (or "type methods" speaking more Obj-C language), so we can't use self here. I decided to go with type methods since I don't see how to naturally introduce state for this class.

native/ios/Comm/TemporalMessageStorage/EncryptedFileUtils.mm
16–17 ↗(On Diff #13908)

Ok, that makes sense!

Introduce files to project.pbxproj

native/ios/Comm/TemporalMessageStorage/EncryptedFileUtils.mm
61 ↗(On Diff #13908)

Length of the buffer might change during encryption/decryption process

Manually implement padding. Switch to AES algorithm with ECB mode

Change encryption algorithm to AES CBC, decrypt each message separately

Rename Temporal to Temporary

Rename Temporal to Temporary