A Weird Imagination

Viewing Signal messenger backups

Posted in

The problem#

Signal is a privacy-focused instant messaging application which ensures end-to-end encryption on all messages and generally goes out of its way to avoid accidentally revealing your conversations to third parties. As is common with security mechanisms, this necessarily adds some friction some some tasks you actually want to do. In particular, this means viewing your message history outside of the official app is unsupported. Which is especially a problem due to the app being tied to a smartphone that will likely only continue being usable for at most several years. So there's no official way to maintain access to your conversations indefinitely in contrast to IRC and Pidgin logs I have going back decades.

The solution#

The Signal Andriod app supports making encrypted backups (there is no way to get messages out of Signal iOS).

When you enable backups, it gives you a "passphrase" (a sequence of 30 digits). If you have lost this passphrase, there is no way to recover it, but you can disable backups and then re-enable them which will generate a fresh passphrase that will be used for your backups going forward. I recommend storing this passphrase in a password manager like KeePassXC.

To actually use the backup file, you'll need to know where it is. The location is shown on the Signal settings under Chats -> Chat backups -> Backup folder. You can copy it to your computer by plugging the phone in with a USB cable and using an MTP client, which is included in most file managers (I use XFCE's Thunar).

Once you have the backup file and passphrase, you can use signalbackup-tools to convert the backup to something human-readable:

signalbackup-tools [input] [passphrase] \
                   --exporthtml [directory] --allhtmlpages

The output does a good job of trying to look like the Signal interface. See the documentation for more options on controlling the output including various options to filter the output to just some conversations or time ranges.

The details#

Building signalbackup-tools#

The documentation provides multiple ways to install signalbackup-tools. I was able to use the straightforward method of cloning the repository and running the build script BUILDSCRIPT.bash.

But I first tried to use the recommended Dockerfile, which unfortunately has bitrotted. Luckily, it was easy to fix, so if you want to use Docker, you can use my fork, which I have made a merge request for, so it may be merged into the main repository by the time you read this.

The fixes were straightforward: the filename of the build script had changed, the Dockerfile used an old version of Fedora so I just looked up the version number of the current version, and the build complained about dbus not being available so I modified it to include that package (although since it's used for communicating with Signal Desktop which presumably won't work from inside Docker anyway, I probably should have just added --config without_dbus to the build command instead).

Signal Desktop#

While there is no offical support for backing up conversations from Signal Desktop or iOS, one workaround is that signalbackup-tools does have experimental support for import data from Signal Desktop. Then if you have Signal Desktop linked to your Signal account, you can get access to your messages even if you normally use Signal on iOS. Note that linked devices only get messages since they were linked, so this does not get you access to past messages, it's something you would need to do proactively before the messages you want access to are sent.

While there are various operations that allow modifying an Android backup by loading data from Signal desktop, if you just want a human-readable export, there's a single command:

signalbackup-tools --exportdesktophtml [OUTPUTDIR]

Unfortunately, as the documentation warns, this is an experimental feature that may not work. For me, that looks like it's working for a bit and then errors out with

[Error]: Failed to get Sticker filesize. Skipping...
[Error]: Failed to import stickers

and trying to add command-line options to not work with stickers had no effect.

Restoring for another user#

I don't have a solution here, but the impetus for me to look into this was that a friend had lost their Signal logs and wanted me to send them my logs of our conversations. I was able to use the above to send them HTML of our conversation history, but I was wondering if it would be possible to merge my backup of our conversation into their history.

I haven't tried yet, and it would be a technical process requiring either I had access to their full backup or that they were able to use signalbackup-tools themselves, so this is unlikely to actually happen. But also it would require adding an option to signalbackup-tools to rewrite a thread to change who is the sender so it would look like for the other user.

This is possibly an interesting project for the future, but realistically sufficiently niche to likely not be worth doing. And due to the ever changing format of Signal's backups, would likely require a non-trivial amount of effort to maintain.

Comments

Have something to add? Post a comment by sending an email to comments@aweirdimagination.net. You may use Markdown for formatting.

There are no comments yet.