A pure clientside JavaScript tool to decrypt and explore UniFi network backup files (.unf) in your browser.
✅ No server required - Everything runs in your browser
✅ Secure decryption - Uses AES-128-CBC with hardcoded UniFi keys
✅ File extraction - Explores ZIP archive contents with proper data descriptor handling
✅ Automatic decompression - Handles DEFLATE and gzip compression
✅ BSON to JSON conversion - View database contents as readable JSON
✅ Metadata display - Shows backup file info
✅ File preview - View text, JSON, images, and converted BSON data
✅ Download fixed ZIP - Export decrypted and decompressed backup files
UniFi backup files (.unf) are encrypted using AES-128-CBC with a static key and IV hardcoded in the UniFi software:
- Key:
bcyangkmluohmars(16 bytes) - IV:
ubntenterpriseap(16 bytes) - Mode: CBC with NoPadding
- Result: A ZIP archive containing backup data
The tool:
- Reads the encrypted .unf file
- Decrypts using AES-128-CBC (CryptoJS library)
- Repairs ZIP structure if needed (handles data descriptors and malformed EOCD)
- Extracts files with DEFLATE decompression
- Decompresses gzip files and converts BSON to JSON
- Displays file list and metadata with interactive preview
- Allows downloading a fixed ZIP with all decompressed files
Works with UniFi backups from v7.0 and later (likely earlier versions too, as the encryption key is static and hardcoded).
Tested with: v9.5.21
UniFi backups typically contain:
db.gz- Main database (MongoDB BSON, gzipped)db_stat.gz- Statistics databaseversion- UniFi version infoformat- Format version identifiertimestamp- Backup timestampsystem.properties- System configurationsites/- Per-site configuration and databases
- Open
backup-explorer.htmlin a modern web browser - Click the drop zone or select a
.unfbackup file - Wait for decryption and extraction
- Browse files and click to preview contents (BSON files automatically converted to JSON)
- Click "📥 Download Fixed ZIP" to export all decrypted and decompressed files
The tool automatically converts BSON database files to JSON for viewing in the browser. The downloaded ZIP contains the raw BSON files for use with MongoDB tools.
If you need to work with the BSON files directly:
# Install MongoDB tools (if not already installed)
sudo apt install mongodb-database-tools # Linux
brew install mongodb-database-tools # macOS
# Convert BSON database to JSON
bsondump db > backup.json- Algorithm: AES-128 (Rijndael with 128-bit key)
- Mode: CBC (Cipher Block Chaining)
- Padding: None (NoPadding)
- Key Derivation: Static - no derivation, hardcoded in UniFi software
openssl enc -d -in backup.unf -out backup.zip -aes-128-cbc \
-K 626379616e676b6d6c756f686d617273 \
-iv 75626e74656e74657270726973656170 -nopad- CryptoJS 4.2.0 - AES-128-CBC decryption
- JSZip 3.10.1 - ZIP file parsing and extraction
- pako 2.1.0 - DEFLATE and gzip decompression
- BSON 7.0.0 - BSON to JSON conversion
- js-bzip2 1.3.8 - Bzip2 decompression support
✅ No data is sent to any server
✅ All processing happens in your browser
✅ No cookies or tracking
✅ Open source - inspect the code
Works on any modern browser supporting:
- ES6+ JavaScript
- ArrayBuffer / Uint8Array
- Web Crypto (for CryptoJS)
Tested on:
- Chrome/Chromium 90+
- Firefox 88+
- Safari 14+
- Edge 90+
backup-explorer.html- Main tool (single HTML file with embedded CSS and JavaScript)README.md- This file
The decryption uses static keys from UniFi source code. If decryption fails:
- Ensure the file is a valid
.unfbackup from UniFi - Check the browser console (F12) for error messages
- The file might be from an unsupported UniFi version (though unlikely)
The tool automatically handles:
- Malformed ZIP end-of-central-directory (EOCD) records
- Data descriptors in local file headers
- DEFLATE-compressed files within the ZIP
- Missing central directory entries
If files still don't show:
- Check the browser console (F12) for detailed error messages
- The file might be severely corrupted
- Try with a different backup file
The tool automatically converts BSON to JSON for viewing in the browser. If this fails:
- Download the ZIP and use MongoDB tools:
bsondump db > backup.json - Check the browser console for BSON parsing errors
- The BSON file might be corrupted or in an unexpected format
This tool is provided as-is for exploring your own UniFi backups. Respect copyright and only decrypt backups you have permission to access.
Made with ❤️ for UniFi users
No warranty - use at your own risk