Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XEP-0384 OMEMO implementation #216

Open
Urbiwanus opened this issue Jul 5, 2017 · 16 comments
Open

XEP-0384 OMEMO implementation #216

Urbiwanus opened this issue Jul 5, 2017 · 16 comments

Comments

@Urbiwanus
Copy link

@Urbiwanus Urbiwanus commented Jul 5, 2017

Please think about implementing OMEMO (XEP-0384) ( https://conversations.im/omemo/ ).
@keyser-soeze did an implementation in the https://github.com/cryptocat/cryptocat project.

File : https://github.com/cryptocat/cryptocat/blob/master/src/js/omemo.js

Regards

@Urbiwanus
Copy link
Author

@Urbiwanus Urbiwanus commented Jul 12, 2017

FYI : I added stanza.io to https://omemo.top/

@legastero
Copy link
Owner

@legastero legastero commented Jul 15, 2017

The standardization story at the XSF for OMEMO is a mess right now, so I really don't want to touch anything until that is sorted out. Otherwise, yes, I'm eager to add support.

But it is also the sort of feature that really requires deeper app-level integration that wouldn't be appropriate for a library to handle 100%. So we could provide all of the convenience methods and stanza definitions needed, but it wouldn't be able support OMEMO 'out of the box' without additional setup.

@Urbiwanus
Copy link
Author

@Urbiwanus Urbiwanus commented Jul 17, 2017

@legastero
Great news
Have you checked @keyser-soze implementation ? May it can help to get a good starting point

@trillerpfeife
Copy link

@trillerpfeife trillerpfeife commented Sep 26, 2017

It seems that XEP-0384: OMEMO Encryption Version 0.2 (2017-06-02) will stay now with the SignalProtocol. Any further development using Olm will be a new XEP.
So eventually development on OMEMO on stanza.io could be started.

@the-eater
Copy link

@the-eater the-eater commented Mar 12, 2018

I've created, (most likely) another, implementation of OMEMO for stanza.io, here.

If there is any intrest here I can clean it up a bit and extract it from this project.

it depends on libsignal and is tested against Conversations, Dino and Gajim, the only thing that needs to be implemented on the user end, is the store which stores the keys, pretty much the same as the one needed to implement for libsignal to work.

@mmikel
Copy link

@mmikel mmikel commented May 10, 2018

Of course it's very interesting!

@andrewvmail
Copy link

@andrewvmail andrewvmail commented Jul 10, 2018

@the-eater interested here !

@the-eater
Copy link

@the-eater the-eater commented Jul 10, 2018

@andrewvmail I'll try to make some time this weekend :)

@mmikel
Copy link

@mmikel mmikel commented Aug 24, 2018

any news?

1 similar comment
@goors
Copy link

@goors goors commented Oct 9, 2018

any news?

@the-eater
Copy link

@the-eater the-eater commented Oct 10, 2018

I don't have time (and/or motivation) to clean it up completely, but this should work: https://github.com/the-eater/stanza.io/tree/feature/omemo/lib/plugins

All API's are async, the hints plugin is needed to tell the XMPP server that the message should be stored server side

There is a lot of ES6 usage in there, but you should be able to run it through babel without problems. I've edited so far that it should run in all current browsers

⚠️ Be warned: This is made to run in the browser with libsignal.js loaded (for the libsignal: https://github.com/the-eater/Fossil/blob/master/public/js/libsignal-protocol.js). there is no node.js support!

usage and how to implement can be found here:

Initialization: https://github.com/the-eater/Fossil/blob/master/src/fossil.js#L62
Sending messages: https://github.com/the-eater/Fossil/blob/master/src/fossil/contact.js#L46
Storage: https://github.com/the-eater/Fossil/blob/master/src/fossil/storage.js
Decryption and decoding: https://github.com/the-eater/Fossil/blob/master/src/fossil/message.js#L19

@mmikel
Copy link

@mmikel mmikel commented Dec 6, 2018

Cleanapped version ;) Tested with Chrome browser and Conversations

omemo.zip

@oliverschulze
Copy link

@oliverschulze oliverschulze commented Sep 25, 2019

Hi,
I have seen there is some kind of support for OMEMO within the code (xep0384.ts). Is there any information how to use this?

@Neustradamus
Copy link

@Neustradamus Neustradamus commented Mar 30, 2020

Any news on it?

@IgorVNC
Copy link

@IgorVNC IgorVNC commented Jun 22, 2020

Hey @mmikel, thank you for providing a zipped version, very helpful!

May I ask you one clarification please

  async getAnnouncedDeviceIds(jid) {
    if (!jid) {
      jid = this.client.jid;
    }

    if (typeof jid !== 'string') {
      jid = jid.bare;
    }

    if (!this.subscriptions.has(jid)) {
      try {
        await this.client.subscribeToNode(jid, 'eu.siacs.conversations.axolotl.devicelist');
      } catch (e) {
      }
      this.subscriptions.add(jid);
    }

   ....

Is it really needed to subscribe to own user node? (e.g. when 'jid' is not passed here)

Thanks in advance

@the-eater
Copy link

@the-eater the-eater commented Jun 22, 2020

@IgorVNC when announcing the device list you need to retain the old device ids, so that's why we subscribe to it see e.g.

https://github.com/the-eater/Fossil/blob/c8484d5df67374cc52c0ec0625a35e1a903c0f91/src/fossil/stanzaio/omemo.js#L354

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
10 participants
You can’t perform that action at this time.