Skip to content

Instantly share code, notes, and snippets.

Getting started with OMEMO

This is a short tutorial on how to get started with OMEMO. This is not to replace the XEP but to extend it and give you some clear steps to follow instead of a having to read through a formal specification.

Namespaces

Until OMEMO becomes an official XEP all current implemenations use the namespace eu.siacs.conversations.axolotl instead of urn:xmpp:omemo:0. Sub-namespaces are seperated by a . instead of a :. The device id however is sperated by :. So the namespace for a PEP device bundle for example will look like this: eu.siacs.conversations.axolotl.bundles:1234. You might want to define some constants in your code to have a central place to configure them later. Compare that to how Conversations does this.

The official XEP will also be based on Olm instead of Axolotl which means

<?php
$url_parts = preg_split('/@|\//',$_SERVER["REQUEST_URI"]);
if (count($url_parts) < 4 || empty($url_parts[3])) {
header('Location: https://conversations.im');
die();
} else {
$localpart = strtolower(urldecode($url_parts[2]));
$domainpart = strtolower(urldecode($url_parts[3]));
$jid = $localpart.'@'.$domainpart;
$muc = $url_parts[1] === 'j';

Title: Settling the IM war

Subtitle: Creating an open and federated protocol for instant messaging

Abstract: The world of Instant Messaging is populated with hundreds of providers - all incompatible with each other though history has shown that walled gardens are not sustainable. Why are we unable to agree upon a standard to communicate with each other?

Description: Imagine you would need a separate web browser for every website you visit. Want to shop on Amazon? Download the Amazon browser. Want to surf Reddit? Download the Reddit browser. What seems completely ridiculous in the context of the World Wide Web is a sad reality for instant messaging. The recent years have spawned a sheer number of incompatible instant messaging solutions and forced the user to have multiple accounts with different providers that all do pretty much the same thing. Slack for work, Skype for your parents and Whatsapp for your friends. Wouldn't it be great if they were some kind of standard that would make all th

#!/bin/bash
URL=$1
BROWSER=firefox
JAVA=/usr/lib/jvm/java-8-openjdk/bin/java
IMAGE_DOWNLOADER=/home/daniel/Projects/ImageDownloader/t
if [ ${URL: -97:1} == "#" ]; then
$JAVA -jar $IMAGE_DOWNLOADER $URL | feh -. -
else
$BROWSER $URL
# HG changeset patch
# User Daniel Gultsch <daniel@gultsch.de>
# Date 1455361701 -3600
# Sat Feb 13 12:08:21 2016 +0100
# Node ID 980e5f5bd62ccfcc127cc0928011e10c58709e2e
# Parent 0aa8aa6cdb1b06045dd5e40f38874af8306ed6d7
mod_cloud_notify: put publish-options into <pubsub> not into <publish>
diff -r 0aa8aa6cdb1b -r 980e5f5bd62c mod_cloud_notify/mod_cloud_notify.lua
--- a/mod_cloud_notify/mod_cloud_notify.lua Fri Feb 05 11:37:47 2016 +0100
#!/bin/zsh
set -e
XML="$1"
BASE=${1%.xml}
xsltproc --path . xep.xsl "$1" > "$BASE".html;
<message to="romeo@montague.tld" from="juilet@whateverthenamewas.tld">
<encryption xmlns="eu.siacs.conversations.axolotl">
<header sid="42"> <!-- can be reused -->
<key rid="345"></key>
<key rid="23"></key>
<iv>04af38cd4d</iv>
</header>
<payload>cipher text</payload>
</encryption>
</message>