fix(restore): check for AES instead of cipher to detect encrypted backup

Seems more consistent, have seen the following outputs with `file`:

- GPG symmetrically encrypted data (AES256 cipher)
- PGP symmetric key encrypted data - AES with 256-bit key salted & iterated - SHA512 .

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2025-08-13 12:03:24 +05:30
parent 9eda39ff61
commit c22ff226aa
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -225,7 +225,7 @@ def _restore(
click.secho("Failed to detect type of backup file", fg="red")
sys.exit(1)
if "cipher" in out.decode().split(":")[-1].strip():
if "AES" in out.decode().split(":")[-1].strip():
if encryption_key:
click.secho("Encrypted backup file detected. Decrypting using provided key.", fg="yellow")