This tool allows you to decrypt Home Assistant backups outside of Home Assistant, using your emergency kit or a known password.
- Python 3.7 or newer
cryptography
package installed (pip install cryptography
)
- Download the script (
decrypt_backup.py
) - Make it executable:
chmod +x decrypt_backup.py
- Create a new directory for decryption
- Place these files in the directory:
- The script (
decrypt_backup.py
) - Your backup .tar file
- Your emergency kit text file (optional)
- The script (
- Run the script:
./decrypt_backup.py
- If an emergency kit file is present, the script will automatically extract the key
- If no kit file is found or the key can't be extracted, you'll be prompted to enter the key manually
The script will automatically:
- Find your emergency kit and extract the encryption key
- Process all backup files in the directory
- Create extracted directories with the decrypted content
If you encounter any issues:
-
Make sure you have the
cryptography
package installed:pip install cryptography
-
Verify that your emergency kit file contains the encryption key
-
Ensure your backup files are in the correct format (.tar)
-
Check that all files are in the same directory as the script
This tool is designed to work with Home Assistant backups created with encryption enabled. It will not work with unencrypted backups or backups from other systems.
- Keep your emergency kit secure - it contains your encryption key
- After decryption, store the decrypted files in a secure location
- Consider deleting the emergency kit file after use if you don't need it
If you encounter issues, you can:
- Verify your emergency kit is valid by checking it in Home Assistant
- Ensure your backup files were properly downloaded
- Try creating a new backup in Home Assistant to test with