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)
Sat, Nov 9, 4:32 AM
Unknown Object (File)
Sat, Nov 9, 2:35 AM
Unknown Object (File)
Sat, Nov 9, 2:19 AM
Unknown Object (File)
Fri, Nov 8, 11:20 PM
Unknown Object (File)
Tue, Nov 5, 3:01 AM
Unknown Object (File)
Tue, Nov 5, 2:58 AM
Unknown Object (File)
Tue, Nov 5, 2:55 AM
Unknown Object (File)
Tue, Nov 5, 2:47 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
Lint Not Applicable
Unit
Tests Not Applicable

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