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:

decryption error

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 and decrypted by the new installation. For more information about data encryption and the encryption key, please visit How is the backup encrypted in CubeBackup.

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!

Solution 1

Please use the original keys.json encryption key file left over from your first install:

  1. 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.

  2. Restart the CubeBackup service using the following command.

    Please run this command.

    sudo /opt/cubebackup/bin/cbsrv restart

    Open a Command Prompt as Administrator, and run this command.

    "C:\Program Files\CubeBackup4\bin\cbsrv.exe" restart

    Open the Windows PowerShell as Administrator, and run this command.

    & "C:\Program Files\CubeBackup4\bin\cbsrv.exe" restart

    Please run this command to restart the container.

    sudo docker restart <container-name>

  3. Retry the configuration wizard by clicking the Next button.

Solution 2

If you cannot find the original keys.json file, all Google Workspace 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:

  1. Remove the backup data directory.
  2. Remove the data index directory.
  3. Retry the configuration wizard by clicking the Next button.