Skip to content
English
  • There are no suggestions because the search field is empty.

Manually Decrypt Backup Files

Use Kilter's built-in tools to manually decrypt single files or entire backup folders.

When encrypted backups are enabled, Kilter stores each backup file on disk with a .enc or .Nenc extension. In normal operation Kilter decrypts these files for you. This article covers the cases where you need the plain-text file outside of the Kilter interface, for example during an audit, a disaster-recovery exercise, or when working with Kilter Support.

Before You Begin: Use a Supported Option If You Can

Manual decryption requires handling the appliance's file encryption key. Where possible, use one of these instead:

  • Download from the UI. Downloading a file from a device's backup history returns the decrypted file automatically.
  • Compare and Restore. Kilter decrypts files as needed for comparisons and restores.
  • Export without encryption. If your administration settings allow it, remote exports (S3, Glacier, Azure File Share) can be sent decrypted. Kilter decrypts the files to a temporary folder before archiving them.

Treat the encryption key like a password. Anyone holding the key can read every encrypted backup from that appliance. Do not store it with the backups, paste it into tickets or chat, or leave it in shell history.What You Need

  • The encrypted file(s), copied from /data/backups/<device id>/backup_<history id>/ on the appliance (or from your export archive).
  • The appliance's key.
  • A workstation or the appliance with openssl and python3 available.

Which Key?

If the encryption key has been rotated, the appliance keeps the previous key as well. Backups completed beforethe rotation date were encrypted with the previous key; later backups use the current key. Ask Support for both keys and the rotation date if your appliance has rotated keys. If decryption fails with an invalid padding error (see Troubleshooting), try the other key.

Procedure

1. Locate the Helper Script

Kilter includes a decryption script at: /backbox/app-server/bin/decryptFile.sh

2. Decrypt a Single File

  • Supply an explicit output path: decryptFile.sh <in> <out>
  • If no output is specified, the decrypted file is written to /data/tmp/. The extension is removed upon decryption.
  • Both .enc and .Nenc files are handled the same way

Read the key from a protected file or prompt rather than typing it directly in the command line, so it does not land in shell history:

read -rs BB_KEY        # paste the 64-character hex key, then press Enter python3 bb_decrypt.py "$BB_KEY" running-config.txt.enc running-config.txt unset BB_KEY

3. Decrypt a Whole Backup Folder

src=/data/backups/507/backup_2529
dst=/data/tmp/decrypted_2529
mkdir -p "$dst"
find "$src" -type f \( -name '*.enc' -o -name '*.Nenc' \) | while read -r f; do
base=$(basename "$f")
base="${base%.enc}"; base="${base%.Nenc}"
/backbox/app-server/bin/decryptFile.sh "$f" "$dst/$base"
done

4. Verify

Open the decrypted file. Configuration backups should be readable text. You can also run file <name> to confirm the type (text, tar archive, and so on). Compare against the Kilter UI download of the same backup if in doubt.

Troubleshooting

Symptom Likely Cause
Invalid padding ... wrong key Wrong key, for example a backup from before a key rotation, or the file is not encrypted.
not a multiple of 16 bytes The file is incomplete, was transferred in text mode, or is not a Kilter encrypted file.
Output looks like random bytes The file was already decrypted, or the key is wrong but happened to pass the padding check. Try the other key.
Decrypted text has odd characters every 15 bytes openssl was used alone; use the helper script so padding bytes are removed.

Security Recommendations

  • Perform decryption on a trusted, access-controlled system and delete decrypted copies when finished.
  • Backups can contain device credentials and sensitive configuration. Handle decrypted output accordingly.
  • Never share the encryption key over email or chat. Rotate it if you believe it has been exposed.

Related Articles

If you need additional information, contact support@backbox.com.