Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Sending encrypted message using OMEMO with StropheJS

I'm trying to send an encrypted message with OMEMO and stropheJS

The documentation of OMEMO with Xmpp can be found here

I've built an xmpp message like this:

const message = $msg(msgHeader)
    .c('active', { xmlns: 'http://jabber.org/protocol/chatstates' })
    .up()
    .c('request', { xmlns: "urn:xmpp:receipts" })
    .up()
    .c('encrypted', { xmlns: 'eu.siacs.conversations.axolotl' })
    .c('header', { sid: xmppUser.sid })
    .c('key', { rid: xmppUser.rid }, "key")
    .c('key', { rid: xmppUser.rid, prekey: true }, 'preKey')
    .c('iv')
    .up()
    .up()
    .c('payload')
    .t(messageToSend)
    .up()
    .up()
    .c('encryption', { xmlns: 'urn:xmpp:eme:0', namespace: 'eu.siacs.conversations.axolotl', name: 'OMEMO' })
    .up()
    .c('store', { xmlns: 'urn:xmpp:hints' })

and I send it by calling:

xmppConnection.send(message);

the message is delivered but its content is not encrypted and the messaged is not archived in Openfire

Comments