How to encrypt WordPress backups with a key pair (Restora Pro), and what happens if the key is lost
AES-256 encrypted backups locked with a key pair, so the site never holds the key, or with a password; how to create and store the private key, how an encrypted backup is restored (also with the free plugin), and what a lost key means.

A backup is a complete copy of your site: every user, order and password hash in it. If it is going to sit on remote storage, or be downloaded to laptops, it should be encrypted. Restora Pro encrypts the contents of backups with AES-256 and offers two ways to lock them. The settings are in the Encryption card on the Restora screen.
Two ways to lock a backup
| Key pair (recommended) | Password | |
|---|---|---|
| What the site stores | Only the public key (RESTORA-PK1-…) | The password, encrypted in the database |
| What opens a backup | The private key (RESTORA-SK1-…), kept outside the site | The password |
| If someone gets into the site | They still cannot read the backups | They can read the backups |
| Needs | PHP with sodium (PHP 7.2+; WordPress ships a fallback) | OpenSSL |
With a key pair, every backup gets its own random password. That password is sealed to your public key and written into the backup's manifest; only the private key can unseal it. Restora's own explanation: “Every backup gets its own random password, locked with the public key and kept inside the backup. Only the private key opens it: someone who gets into this site, its database or its files still cannot read the backups. You paste the private key when you restore; it is used for that restore only and never saved.”
File names inside the archive stay visible (so the Details panel and selective restore still work); their contents do not.
Set it up with a key pair
- In the Encryption card tick Encrypt the contents of backups (AES-256) and choose With a key pair (recommended): the site keeps only the public key.
- Press Create a key pair. Restora shows the private key once: “Your private key. Save it now, outside this site: it is not stored and cannot be shown again. Without it, backups locked with this key cannot be restored by anyone, including you.” Use Copy or Download as a file.
- Put the private key in a password manager, and a second copy somewhere offline. Do not keep it on the site.
- Press Save settings. Backups made from now on are encrypted; earlier ones are not touched. The card shows the public key and a short key id (
Key a1b2-c3d4-e5f6) so you can tell keys apart.
If you already have a key pair from another site, paste its public key instead of creating a new one. Pasting the private key by mistake is refused: “That is the private key. Keep it outside the site; only the public key (RESTORA-PK1-...) goes here.”
Creating a new pair later is allowed, with a warning: “Create a new key pair? Backups made from now on will need the new private key; older ones keep needing the old one.” Keep every private key you have ever used for as long as you keep the backups made with it.
Or with a password
Choose With a password stored on the site and enter a Backup password of at least 12 characters (“The backup password needs at least 12 characters.”). It is kept encrypted in the database, so the site can restore without asking. The trade-off is in the table above. Switching from a password to a key removes the stored password, so older backups then need their password typed in at restore time.
Restore an encrypted backup
- From the Restora screen: the Restore card asks for the password, or shows “This backup is locked with a key pair. Paste the private key (it starts with RESTORA-SK1-). It is used only for this restore and is not saved.”
- With the free plugin, or after Pro has ended: the same. Any Restora backup restores with the free plugin as long as you have its password or private key.
- From WP-CLI:
RESTORA_PASSWORD=… wp restora restore <name> --yes; the variable takes the password or the private key, so it stays out of the shell history. - On the emergency recovery page or the installer (Pro): a field for “Password or private key (RESTORA-SK1-…) of this backup”.
- By hand: the archive is an AES-256 WinZip-style zip, so 7-Zip, WinRAR or WinZip open a password-locked backup with its password. A backup locked with a key pair first needs its private key turned into the backup's own password, which Restora or the recovery page does for you.
Wrong credentials are refused before anything changes: “The password is not right for this backup.” or “This private key does not open this backup.” A server without sodium says “This server cannot open backups locked with a key: PHP has no sodium extension. Restore on a server with PHP 7.2 or later.”
What happens if the private key is lost
Nobody can open those backups: not you, not Perforks, not your host. That is the point of the design; there is no recovery path, no master key and nothing support can do. Treat the private key like the backups themselves: a password manager plus one offline copy, checked once in a while.
If you realise the key is gone while the site still works, create a new key pair at once and make a fresh backup; the old archives are unreadable, but the site is not lost. If your remote storage holds only key-locked backups, keep the private key where you can reach it without the site, for example printed with the recovery page address.