Skip to content
Convert OTR keys from Pidgin format to Gajim format
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This program converts OTR keys from Pidgin format to Gajim format.

Your Pidgin OTR files are here:

~/.purple/otr.private_key  # secret key(s)
~/.purple/otr.fingerprints # fingerprints

Your Gajim OTR files are here:

~/.local/share/gajim/ACCOUNT.key3 # secret key
~/.local/share/gajim/ACCOUNT.fpr  # fingerprints

When you run, it automatically loads your Pidgin OTR files from ~/.purple/. Then it creates a new directory relative to your current path called output and saves Gajim-formatted .key3 and .fpr files into it for each Pidgin account you have.

You then have to manually copy the .key3 and .fpr files from the output directory into ~/.local/share/gajim/. You may have to slightly rename the files (e.g. remove the username@ prefix).

I copied a bunch of code from Guardian Project's otrfileconverter project to load and parse the Pidgin OTR private key file:

How to Use

First install Gajim:

sudo apt-get install gajim

Run it and set up your jabber accounts. Click Edit, Plugins, switch to the Available tab, and download and install the Off-the-Record plugin. On the Plugins window, click Configure while Off-the-Record is selected to open the OTR plugin settings. For each jabber account, generate a new OTR key (just to create filenames that we'll overwrite). When you have done this, completely exit Gajim.

Then download and run pidgin2gajim:

git clone
cd pidgin2gajim
virtualenv env  # needs python-virtualenv 
. env/bin/activate
pip install pyparsing
pip install python-potr
ls -l output

Then overwrite your Gajim OTR keys with the ones that were just created in the output directory. Something like:

# note: gajim does not want the username@ prefix
cp output/ ~/.local/share/gajim/
cp output/ ~/.local/share/gajim/

Now open Gajim again. If all went well, you should now have your Pidgin OTR keys in Gajim.

There is a known bug where Gajim sometimes crashes the first time it tries to parse your saved fingerprints:

If this happens, you can just run Gajim again and it should work fine. You'll just be missing a couple of fingerprints from people you've talked to. Your actual secret key should be exactly the same and have the same fingerprint.

You can’t perform that action at this time.