Go to file
2016-04-13 21:08:25 +02:00
src/main/java/eu/siacs/conversations initial working commit 2016-03-28 12:52:05 +02:00
openbrowser.sh add wrapper script to open browser or image viewer 2016-03-28 15:05:40 +02:00
pom.xml use java 7 instead of 8 2016-03-28 15:04:51 +02:00
README.md include small browser wrapper script in the readme 2016-04-13 21:08:25 +02:00

ImageDownloader

When Conversations uploads an encrypted image with XEP-0363: HTTP Upload it appends the encryption key as an anchor to the URL.

The anchor is made of 96 characters which represent 48 bytes in HEX. The first 16 bytes are the IV the last 32 bytes are the key.

The encryption mode is aes-gcm. The authentcation tag of 16 bytes is appended to the file.

This Java project provides sample code on how to download and dercypt a file. Output is to stdout. Redirect to file or pipe to image viewer.

Compile with mvn package

Find a compiled version here

Usage: java -jar ImageDownloader.jar http://host.tld/path/to/file.jpg#theivandkey

If you change your browser in gajim to something like this script it will automatically open image links in your image viewer if you click on them.

#!/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