monal-im / Monal

Monal for XMPP (iOS and macOS)
https://monal-im.org
Other
498 stars 102 forks source link

XEP-0384: OMEMO Encryption #9

Closed tristan-k closed 5 years ago

tristan-k commented 8 years ago

OMEMO is an XMPP Extension Protocol (XEP) for secure multi-client end-to-end encryption. It is an open standard based on Axolotl and PEP which can be freely used and implemented by anyone.

For further reading on an iOS implemention, see this report about ChatSecure status on OMEMO.

marmistrz commented 6 years ago

Why?

anurodhp commented 6 years ago

@chrisballinger So, I am looking at the cocoa pod you have published for omemo, assuming that it is a good idea for the two main iOS clients and my Mac client to all share the same code. I am not able to actually get it decode the keys that gajim is sending it. It looks like an issue with the protobuf prior to even decrypting the message field in the protobuf. The things that Daniel sent me also do not decode, I dont know where the error is or if there is a step that isn't documented that I am missing when dealing with key data on a message.

As a test im curious to see if you are able to decode any of the base64 protobuf strings using protoc --decode_raw or this tool online: https://protogen.marcgravell.com/decode

chrisballinger commented 6 years ago

@anurodhp Glad to hear you're joining the OMEMO fold! It would be great to have Monal support OMEMO so we can finally have a native macOS client :) I've never tested with Gajim, only with Conversations and Zom, and a few times with Dino. I'd be happy to take a look at your code if it's in a branch somewhere.

Are you referring to our work on XMPPFramework's OMEMOModule? Or SignalProtocol-ObjC?

anurodhp commented 6 years ago

I’m looking at the signalprotocol objective-c. Gajim can talk to chat secure, I’ve tested it. I’m trying to understand what the proto buf is doing. Could you try looking at one of your base 64 key strings? My errors are protobuf related prior to and decryption.

anurodhp commented 6 years ago

@chrisballinger I am currently spiking it out to understand the protocol better. You can see me tinkering with it here https://github.com/anurodhp/Monal/blob/988cbc207a65bd013a81d4208405a4b6a9c1807b/Monal/Classes/xmpp.m#L1687

decryptciphertext fails at 1708 with an invalid protobuffer, so it never actually gets as far as extracting the encrypted key from the signal message.

chrisballinger commented 6 years ago

Hmm. Can't tell from looking at it. Have you looked at the usage example of SignalProtocolObjC in ChatSecure?

These may be useful as well for the base64/xmpp/xml portion:

anurodhp commented 6 years ago

It's really odd. ill try reproducing my tests on chat secure in the simulator. @chrisballinger are you on xmpp, add me anurodhp@jabb3r.org

anurodhp commented 6 years ago

@chrisballinger I'll be sending your a PR for a change I made to your code to get it to work when using the cocoa pod.

My mistake was passing the key NSdata in my implementation of the store and not using the serialize method.

Unrelated, fixing AES to GCM-128 helped a lot.. :)

https://monal.im/blog/update-on-omemo-2/

herbsmn commented 6 years ago

Sweet! https://monal.im/blog/ios-has-omemo-working/

Echolon commented 6 years ago

Shouldnt it be shown somehow, that a message is (OMEMO) encrypted. However - I suggest to just show the user that is encrypted and only give details about it in a hidden menu or so. Because most even cannot explain what encryption itself is.

dholl commented 5 years ago

Or perhaps a small green padlock or check-mark somewhere near each message? (and if a message is unencrypted, perhaps a small gray unlocked padlock or a gray x-mark?)

dholl commented 5 years ago

Ahh, I found the Monal beta release... :) I like the little lock icon next to the memo messages.

dholl commented 5 years ago

So.... Since Monal beta has OMEMO, when does this issue get closed?

Specifically, I'd like to report a new OMEMO-related issue that I didn't see in the tracker, and I'm wondering: Should I included it here in this issue? Or should I create a new separate issue?

I'm using both Conversations (on phone) and Monal beta (on laptop, downloaded an hour ago, "Version 2.2 (96)"). When I send a message with Conversations to another contact, Monal can also see what I sent, because Conversations encrypted the message for both the destination contact, as well as for Monal running on my laptop. But when I send a message with Monal, only my contact can see it, and on Conversations, I only see a message from me saying "Message was not encrypted for this device." So, I take it that Monal isn't including my other OMEMO keys as well.

So, I'm wondering if I should create a new issue to request support for encrypting to my other devices. And if @anurodhp suspects this could be an opportunity for a contribution, I'm game for trying to add this support myself. (I'm just unfamiliar with Monal's code, but I'm game to get up to speed and help out if my contributions would be helpful and welcome.)

Thank you!

anurodhp commented 5 years ago

It’s actually in both clients , I’m just keeping it out of iOS releases since that has a different audience . Let’s close this. The whole reason the Mac beta is out is to find bugs, please file that as a new bug and I’ll fix it .

anurodhp commented 5 years ago

Also you are always welcome to look at the code and tinker. If you fix anything send over a pull request

benjaminbischoff commented 5 years ago

It’s actually in both clients , I’m just keeping it out of iOS releases since that has a different audience .

So the actual iOS version has the OMEMO feature (to read encrypted messages) not yet enabled?, that would explain why it will not work .... And I think with the start of Conversations and Quicksy more people would like to chat with iOS-people ..., and therefore they will need OMEMO ;)

anurodhp commented 5 years ago

Yeah I’m working out al the logic bugs in the Mac betas. Please bang at it and submit bugs. I need to make the ui fornkey inspection and trust. It’s coming soon

dholl commented 5 years ago

It’s actually in both clients , I’m just keeping it out of iOS releases since that has a different audience . Let’s close this. The whole reason the Mac beta is out is to find bugs, please file that as a new bug and I’ll fix it .

Also you are always welcome to look at the code and tinker. If you fix anything send over a pull request

Thank you! Will do.

jelmer commented 5 years ago

Is there a bug tracking the OMEMO support on iOS?

anurodhp commented 5 years ago

The Mac and iOS apps are the same thing and have the same bugs. If there are any specific issues just file a new bug for that issue

Echolon commented 4 years ago

Dear discussion participants,

I post this here because the next Monal update is upcoming. We introduced many changes to the back-end and we want to ensure usability and quality. Therefore we call for testers of the also upcoming beta on Testflight. So, even we cannot guarantee all issues has been fixed or considered yet we ask for your help!

We really appreciate your help and are looking forward to a better establishment of XMPP on iOS and Mac!