Duplicati: How to manually decrypt backup files (default AES encryption)?

Created on 13 Dec 2017  ·  5Comments  ·  Source: duplicati/duplicati



  • [x] I have searched open and closed issues for duplicates.

Environment info


  • Duplicati version: 2.0.2.13_canary_2017-11-22
  • Operating system: Synology DSM 6.1, Debian 9.3 (stretch)
  • Backend: n/a

Description


I wonder could anyone suggest a tool (ideally Linux command line) for decrypting Duplicati's .zip.aes archive files please? I'm just trying to do a little "due diligence" before committing to Duplicati, and would like to verify both that the backups are correctly encrypted, and that in a worst case situation I could still (albeit extremely laboriously) obtain data from the encrypted backups even without Duplicati. Looking at the white paper and elsewhere, I couldn't find obvious documentation of the default encryption mechanism, and playing around with a sample backup using a few tools to decrypt AES-256 (openssl, aespipe, gpg) I didn't have much luck: openssl and gpg both expected the encrypted files to have more structure (magic number, etc.) and I could easily believe that the garbage aespipe produced was down to my failure to invoke it correctly.

Steps to reproduce

  1. Make a backup
  2. Get hold of the .zip.aes files
  3. How to decrypt?


  • Actual result:
    Failed to decrypt using openssl, gpg, aespipe; entirely possible there's an invocation of these that works, but I couldn't find it.
  • Expected result:
    Expect that the encryption is standard/well-defined enough that some third party tool can decrypt it?

Screenshots


Debug log


Most helpful comment

Awesome that you got it working. I chose to use AESCrypt because there was an open source implementation, such that there is a good chance you can recover even if Duplicati stops to exist.

Since you are looking at the "restore without Duplicati", you may want to try this as well: https://github.com/duplicati/duplicati/tree/master/Tools/Commandline/RestoreFromPython

All 5 comments

Hmm, making progress on this: the developer documentation mentions AESCrypt, which looks as if it's Windows-originated (not available as part of Debian stretch, anyway), but source code is available here. Giving that a try, will report back.

Ok, solved: obtained AESCrypt as above and decrypted successfully. Not entirely trivial, as aescrypt itself wants keyfiles to be in UTF-16LE format for some reason, but it comes with a utility to help with that. Here are the necessary incantations:

aescrypt_keygen -p 'PASSWORD' KEYFILE
aescrypt -d -k KEYFILE DUPLICATI-FILE.zip.aes

The first command stores your password in KEYFILE using the correct format; the second command decrypts DUPLICATI-FILE.zip.aes to DUPLICATI-FILE.zip.

AESCrypt was trivial to build: after downloading and extracting, I just cd'ed to the source directory and typed make.

Alternatively, you can use SharpAESCrypt.exe, located in the Duplicati program folder.
Duplicati.CommandLine.RecoveryTool.exe can be used to download all remote files to a local folder and decrypt the files.

Thanks @kees-z - in the spirit of "Trust No One", I wanted to decrypt using something not from Duplicati itself!

Awesome that you got it working. I chose to use AESCrypt because there was an open source implementation, such that there is a good chance you can recover even if Duplicati stops to exist.

Since you are looking at the "restore without Duplicati", you may want to try this as well: https://github.com/duplicati/duplicati/tree/master/Tools/Commandline/RestoreFromPython

Was this page helpful?
0 / 5 - 0 ratings