Skip to main content

Decryption utility for Home Assistant backups

Project description

What is this?

This is a command-line python module that allows you to turn an encrypted Home Assistant backup (aka "Password Protected") into a non-encrypted backup. You might find this useful in situations such as:

  • Your backup has been corrupted and you're just trying to get what you can out of it.
  • You're trying to get just one or two files out of a backup without having to restore the whole thing.

Home Assistant backups are just compressed tar files but to encrypt them with a password it uses a non-standard encryption scheme. To the author's knowledge there is not way to decrypt these with standard compression/decompression tools which is why he wrote this little utility.

A note on reliability and expectations

This tool isn't sanctioned by the developers of Home Assistant and isn't updated in response to changes Home Assistant makes to the format of its backup files. This tool hacks apart a backup and then builds it back up, which makes it very sensitive to any changes the Home Assistant developers make to the backup file format.

It has been tested on backups created by Home Assistant version 2022.6.7. If you encounter an error using this tool please consider creating an issue for it on GitHub to notify the maintainer, you'll probably be helping many other users if you bring attention to an issue.

Installation

Make sure you have python 3 and pip installed on your system. Search around on Google for how to install them on your operating system. Thenf rom the command line:

pip install decrypt-ha-backup

Usage

Download your backup from Home Assistant. Ensure you have at least twice the free space on your hard drive available, and run:

python3 -m decrypt-ha-backup /path/to/your/backup.tar

You will be asked for the backups' password, after being processed the decrypted backup will be placed at /path/to/your/Decrypted backup.tar.

Optional Arguments

  • --password secret_password Pass in the password
  • --output_filename /path/to/output.tar Specify the output file name

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

decrypt-ha-backup-2023.10.28.1.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

decrypt_ha_backup-2023.10.28.1-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page