What is asymmetric encryption and why should I want it for my backups?

Asymmetric encryption or public key cryptography is a class of encryption where you have a public key that is derived from a private key. To be a good asymmetric crypto it should be very hard to derive the private key from the public key. Examples of this kind of encryption is used in a lot of places such as PGP (Encrypted messages), TLS (In transit internet connections). The first popular asymmetric algorithm is RSA which is still in wide use even though it is starting to show its age. More modern algorithms include a variety of elliptic curve cryptography algorithms.

Underscore Backup uses the X25519 elliptic curve crypto to encrypt all its data. The way this works is that the private key for this crypto is derived from the password used to encrypt the backup. Only the public key is ever stored on disk or in the backup destinations. A neat feature of public key cryptography is that you need the public key to encrypt data, but you need the private key to decrypt the data. The upside of this is that when Underscore Backup is running in the background on your computer it does not even have the private key required to read your backup, it can only write backups.

What this means is that if your computer gets compromised that means that the contents of your backups are not compromised along with your computer. Only when you enter your password into your application to do a restore will the application have the private key in memory (It is never committed to disk) and it will make sure to forget it as soon as your restore operation is complete.

I know all about encryption, tell me the details please

The private key for encryption is derived from your password using the Argon2 algorithm. Once this is created during setup the public key and the password salt is stored in both your manifest directory and uploaded to your manifest backup destination. For every backup block (A backup block is around 8mb of backup data) that is stored in the backup destination a new X25519 private and public key pair is created. The block public key is stored in a header in the block, the block private key is combined with the backup public key using a Diffie-Hellman key exchange. The resulting 256 bit key is then used to encrypt the rest of the backup block using the symmetric AES 256 encryption scheme.

A Diffie-Hellman key exchange has the property that given two public/private key pairs if you combine the public key of one key and the private key of the other you end up with the same result as when you do it with the other public/private key pair. In the previous operation the private key for the block is discarded after the block has been written (And as noted the public key is written with the block itself). That means that after the block has been written only the backup private key can be used with the block public key to get the symmetric encryption key to read the block.

Beta for version 2.0 release and registration has been opened for service

The first release for the 2.0 beta has now been released and is available for download on for download.

The main new feature though is the introduction of this companion service that will help with many aspects of running Underscore Backup such as.

  • Keep all your sources organized in one place to easily restore from any of your backups to any other backup.
  • Help facilitate sharing of backup data with other users.
  • Optionally allow private key password recovery.
  • Easily access application UI even if running in a context where a desktop is unavailable, such as root on Linux.
  • Use as a backup destination. Storing backup data is the only feature that requires a paying subscription, giving you 512GB of backup storage per $5 per month.
  • Support multiple regions of data storage. Including Oregon, Frankfurt, and Singapore regions to satisfy latency and data governance requirements.

With this release, the registration for accounts on this service has also been opened.

On top of the companion service changes, the following features and improvements are implementing.

  • Switched from pbkdf2 to Argon2 for private key hashing function.
  • Introduced log rotation for the application log.
  • Move the schedule jitter onto a dedicated setting instead of a custom property and default to 1 hour.
  • Changed all references to passphrase to password.
  • Introduced a password strength meter which requires a score of at least "ok" when setting up.
  • Added detection of new versions and easily download and install from inside the application.

The one major feature planned before 2.0 is to be completed is to add continuous backup functionality.

Changing memory configuration

In some cases, especially if you wish to increase the number of parallel uploads and downloads you might wish to increase the maximum heap memory usage for the application.

You need to find a file in the distribution of the application called underscorebackup.cfg. The location of this file depends on your OS. On Windows it is located in C:\Program Files\Underscore Backup\app\underscorebackup.cfg and there is also a second file used for the GUI application called C:\Program Files\Underscore Backup\app\underscorebackup-gui.cfg. On Linux it is located in /opt/underscorebackup/lib/app/underscorebackup.cfg. On MacOS you need to open the Underscore Backup app bundle (Right click, open) and then find the file lib/app/underscorebackup.cfg.

Once you found this file (Or files on Windows) you need to edit the following line.

[JavaOptions]
java-options=-Xmx256m

To increase your usage edit the -Xmx256m to reflect your new value. For instance if you want to use 1GB of memory you could edit it to -Xmx1024m.

On Windows and Linux this edit will be persisted between application upgrades as of version 2.0.0pre2 and later. However on MacOS unfortunately this change will need to be made every time the application is upgraded.

Moving destination location safely

There are times when you might want to move your backup data from one location to another for instance if you have found a better or cheaper storage for your backups.

Before you make any changes I recommend you make a copy of your manifest director. On Windows the local data files are all located in the user directory AppData\Local\UnderscoreBackup.

On Unix or OSX if you run as a non-root user the default location of all files will be ~/.underscoreBackup.

If running as root the configuration files will be located in /etc/underscorebackup, the data files will be in /var/cache/underscorebackup.

After this follow the following steps to move a destination.

  1. Make sure your backup is not running and will not start running until you are done with these steps.
  2. Copy all files from your current location to your new location.
  3. Update the destination to point to the new location of your data.
  4. Re-enable your backup.

Unfortunately there is no way to move an existing backup with history into the just released Underscore Backup service because you can not copy files into the service manually in an easy way. You can however just start making a new backup to the Underscore Backup service location. Once the initial backup is completed you can remove your old backups (Assuming you are ok with loosing old versions).

If you want to move to using the Underscore Backup service for future backup data and to keep the manifest in this location while still keeping the history of your backups you can do this following these steps.

  1. Make sure your backup is not running and will not start running until you are done with these steps.
  2. Got into settings and make sure you are connected to the service by clicking the Connect button at the top. Also you are required to have an active subscription.
  3. Go to the Destinations tab and add a new destination with Underscore Backup as the destination.
  4. Go to the Sets tab and change the destination under the Advanced tab to your newly created destination. This will cause future data to be written to the new destination. You can also write data to both if you wish.
  5. Go back to settings and click the Edit Configuration button in the lower left. Find the part of the configuration that says destinations and find the destination ID fro the destination of type "UB". It will most likely be called something like "d1".
  6. Then take that value and change the value for the field "manifest"."destination" to the id of the destination in the previous step. Once done the relevant part of your config should look something like this.
      ...
      "destinations": {
        "d0": {
          "type": "FILE",
          "encryption": "AES256",
          "errorCorrection": "RS",
          "endpointUri": "/var/backups"
        },
        "d1": {
          "type": "UB",
          "encryption": "AES256",
          "errorCorrection": "NONE",
          "endpointUri": "us-west"
        }
      },
      "manifest": {
        "destination": "d1",
      ...
  7. Once that is done go to a command line and execute the following command which will cause Underscore Backup to rewrite the entire manifest log to the new manifest location.
    underscorebackup optimize-log
  8. Restart your backup.

Safe partial sharing of backups released

Introducing partial safe sharing of backups. Including the following major improvements.

  • Adding the ability to share portions of your backup to another destination with separate encryption keys.
  • A completely new small file encoding that allows individual encryption of each file with no storage overhead.
  • New installer for Windows that is based on jpackage instead of launch4j.
  • New installers for Linux that installs systemd service.
  • Run at lower scheduling priority on all supported platforms.
  • Better UI for scheduling jitter and now default.

Lots of other tweaks and fixes from the 1.1 release (See changelog for prereleased for details).

Available for free with source from GitHub now.

Added support for handling additional sources and better laptop battery handling

This release contains a lot of great new features such as.

  • Ability to handle and restore data from additional sources.
  • Added an option (On by default) to pause any backups when running on battery power.
  • Added a check to stop you from accidentally pointing to active backups to the same destination location.

The following improvements have also been added.

  • Improved restore log playback performance by around 3 to 5 times.
  • Introduced a new AES encryption scheme that allows sharing destinations and blocks between multiple backups.
  • Added option to reset configuration in local install to restart by replaying log.
  • Added the option to provide a default retention for files outside any defined sets.
  • Added ability to cancel and resume a log rebuild.
  • Improved UI feedback when accidentally providing incorrect destination credentials.
  • Added installers for Linux (deb & rpm) as well as two OSX installers for x64 and ARM64 CPU architectures.

Fetch it from GitHub as usual.

First stable release!

After a lot of bugfixes and field testing this is the first stable release of Underscore Backup. You can fetch it now from GitHub.