> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mainwp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenSSL Key Encryption After Upgrading to v5.3

> MainWP Dashboard version 5.3 adds encryption for private keys stored in your database, strengthening security for Dashboard-to-Child Site communication.

MainWP Dashboard version 5.3 introduced encryption for private keys stored in your database. MainWP Dashboard uses these private keys to sign requests to connected child sites. Encryption at rest helps protect the signing keys if the database is exposed without the separate key files.

![Shows the UI of MainWP Dashboard and the prompt to encrypt Keys after updating to v5.3](https://mintcdn.com/mainwp/OKpZbeo5_cAajLyl/images/miscellaneous/advanced-openssl-keys-encryption.mdx-f67248.png?fit=max\&auto=format\&n=OKpZbeo5_cAajLyl\&q=85\&s=b098b420a797bf9690aff36a0df68da6)

## What You'll Learn

* How to encrypt private keys after upgrading to v5.3
* What private key encryption protects
* How the encryption system works

## Prerequisites

* MainWP Dashboard version 5.3 or later
* Admin access to your Dashboard

***

## Encrypt Keys After Upgrade

After upgrading to v5.3, a one-time prompt appears to encrypt private keys for existing connections.

**1. View the notification**

After upgrading, look for the encryption notification on your Dashboard.

**2. Encrypt keys**

Click **Encrypt Keys Now** to encrypt all existing private keys.

**3. Wait for completion**

The process runs automatically. New child sites will have their private keys encrypted automatically going forward.

***

## Restore the Notification

If you dismissed the notification, restore it from the Tools page.

**1. Open Tools**

Navigate to **MainWP menu (three lines, top right) > MainWP Tools** (`/wp-admin/admin.php?page=MainWPTools`).

**2. Restore messages**

Click the **Restore Info Messages** button.

**3. Encrypt keys**

Click **Encrypt Keys Now** when the notification reappears.

![Encrypt Keys Now](https://mintcdn.com/mainwp/p-OFo6sXMnWfaTaL/images/miscellaneous/31fc86a30c5b.png?fit=max\&auto=format\&n=p-OFo6sXMnWfaTaL\&q=85\&s=b0d824dab8d4b3748704053fdb724720)

***

## What Private Key Encryption Protects

Private keys sign requests sent from MainWP Dashboard. Corresponding public keys on child sites verify the authenticity of those requests. Encryption at rest helps protect these private keys if someone obtains a copy of the database without the corresponding key files.

MainWP uses AES-256-CBC to encrypt site private keys. Third-party API keys use a separate AES-GCM workflow described in [API Key Storage](https://docs.mainwp.com/advanced/security/how-mainwp-stores-3rd-party-api-keys-and-other-sensitive-data.md).

***

## How the Encryption Works

Private-key encryption uses PHPSecLib to encrypt the signing key and keeps the decryption material in a separate key file.

| Step | Process | Description |
| - | - | - |
| 1 | Key Generation | PHPSecLib's `Random` class generates a random 32-byte AES key |
| 2 | IV Creation | A random 16-byte initialization vector (IV) is generated |
| 3 | Encryption | AES-256-CBC encrypts the site's signing private key |
| 4 | Key Wrapping | A fresh RSA-2048 public key encrypts the AES key and IV |
| 5 | Database Storage | The ciphertext is base64 encoded and stored in the database |
| 6 | Key File | The RSA private key and RSA-encrypted AES key and IV are base64 encoded and saved in a separate key file |

Decrypting an encrypted signing key requires both its database value and the corresponding key file.

***

## Technical Details

### AES-256-CBC Encryption

AES-256-CBC encrypts the site's signing private key with a random 32-byte AES key. This private-key storage workflow does not generate a GCM authentication tag.

### Initialization Vector (IV)

A fresh 16-byte IV is generated for each encryption operation, along with a new AES key.

### RSA Key Wrapping

A fresh RSA-2048 key pair protects the AES key and IV. The RSA public key encrypts both values; the corresponding RSA private key is needed to recover them.

### Key Management

The key file contains the RSA private key and wrapped AES key and IV. It is stored separately from the encrypted signing key in the database. Protect and back up both the database and key files so MainWP Dashboard can continue to decrypt its signing keys.

***

## Why This Matters

Request signing authenticates requests from MainWP Dashboard. HTTPS encrypts traffic in transit. Private-key encryption protects the signing keys at rest by keeping their decryption material separate from the database.

***

## Self-Check Checklist

* [ ] Dashboard upgraded to v5.3 or later
* [ ] Encryption notification acknowledged
* [ ] Private key encryption completed successfully
* [ ] Child site connections working after encryption

***

## Related Resources

* [How MainWP Stores API Keys](https://docs.mainwp.com/advanced/security/how-mainwp-stores-3rd-party-api-keys-and-other-sensitive-data.md) - Encryption for third-party credentials
* [How to Find the openssl.cnf File](https://docs.mainwp.com/advanced/how-to-find-the-openssl-cnf-file.md) - OpenSSL configuration
* [MainWP Security](https://docs.mainwp.com/getting-started/how-secure-is-the-mainwp-plugin.md) - Security overview


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.