Decrypting an IPCop 1.4.11 backup key
I was put in the unfortunate position of needing to reload my IPCop. No problem, I’ll export the backup key, and download the latest backup file to my local machine. This I do, quite easily.
So, I reload the IPCop box, skip the floppy restore option, thinking I’m going to restore it via the web interface, so who cares anyway.
I get to the web interface, access the backup option. First thing I realise - there’s no way to import my saved backup key. Darn. So I try import the dat backup anyway. The interface tells me to bugger off, it can’t decrypt the file. Grrr. So what now?
I ssh to the IPCop box, and checkout the existing backup key. Then I check my saved backup key. My saved one is encrypted. Double darn (Ok, I said something far more nasty really).
Google… can’t find a damn thing. The only references I can find is some people copying their backup.key from an old hard disk to the new one. Whoop te doo. That does NOT help me. So, I download the IPCop source code, peruse a couple of files, and figure out how to decrypt the key.
To make my life easier, I used WinSCP to transfer my encrypted key to the IPCop box, then it’s a simple matter of running:
/usr/bin/openssl enc -a -d -aes256 -salt -pass pass:<yourpasswordhere> -in encrypted.backup.key -out decrypted.backup.key
You obviously need to insert your backup password where it says <yourpasswordhere>. If you forgot it, sorry mate, can’t help you.
Once that’s done, simply copy your decrypted.backup.key to the correct place:
cp decrypted.backup.key /var/ipcop/backup/backup.key
and overwrite the existing file.
Now you can import your saved backup and restore your settings.
Hope this helps someone. :p
EDIT: Whoops. Didn’t realise that the < & > that I inserted originally failed to render cuz the engine thought it was an html tag. Ugh.

