A "crypto/rsa: decryption error" message popped up after I reinstalled CubeBackup. What’s gone wrong?
You may run into a “… crypto/rsa: decryption error crypto/rsa: decryption error” in the configuration wizard after reinstalling CubeBackup. For example:
What does this error mean?
When CubeBackup is uninstalled, all backup files, data indexes, configuration files, as well as the encryption key remain untouched. When you reinstall CubeBackup on the same computer, to the same directory, CubeBackup will continue incremental backups where you left off using the same configuration and encryption key as before.
However, you may run into the “crypto/rsa: decryption error” if:
- You reinstalled CubeBackup on a different computer or to a different directory, while trying to point to the original backup data during the initial configuration.
- You manually removed the CubeBackup installation folder before reinstalling.
By default, your backup data was encrypted in CubeBackup. When you reinstall CubeBackup in a different place, a new encryption key pair is generated, which is different than the pair used to encrypt your data originally. Therefore, your old backups cannot be accessed(decrypted) by the new install. For more information about data encryption and the encryption key, please visit https://www.cubebackup.com/docs/faq/backup-encryption-key/.
NOTE: We strongly recommend keeping the files in the original installation folder when uninstalling CubeBackup. You should be especially careful to keep a copy of the encryption file <installation directory>/db/keys.json and store it in a safe place. Should the keys.json encryption file be lost, all backup data will become unreadable!
To fix this issue:
Please use the original keys.json encryption key file left over from your first install:
Copy the original keys.json file to overwrite the keys.json file generated by the second install.
Tip: The original encryption key should be stored in the <CubeBackup first installation directory>/db folder if you did not manually remove this directory.
Restart the CubeBackup service.
If CubeBackup is installed on Linux, run this command in the bash shell:
sudo /opt/cubebackup/cbsrv restart
If CubeBackup is installed on Windows, enter services.msc in the command line, then in the Services list that pops up, right-click the CubeBackup entry, and select Restart.
Retry the configuration wizard by clicking the Next button.
If you cannot find the original keys.json file, all G Suite data which has been backed up by your first installation will be unreadable since it cannot be decrypted without the correct encryption key. You will, unfortunately, have to restart everything from scratch:
- Remove the backup data directory.
- Remove the data index directory.
- Retry the configuration wizard by clicking the Next button.