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
F3150759: D4384.diff
Tue, Nov 5, 12:24 AM
Unknown Object (File)
Sat, Nov 2, 4:26 AM
Unknown Object (File)
Sat, Oct 26, 2:50 AM
Unknown Object (File)
Thu, Oct 24, 11:05 PM
Unknown Object (File)
Wed, Oct 23, 7:15 PM
Unknown Object (File)
Mon, Oct 7, 12:26 AM
Unknown Object (File)
Mon, Oct 7, 12:25 AM
Unknown Object (File)
Oct 5 2024, 1:51 AM

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