Skip to content

How to generate an RSA PEM (asymmetric) key pair?

Step to generate an RSA PEM (asymmetric) key pair for use with SimpleBackups Encryption

Generating and Using RSA Keys for SimpleBackups

This guide will walk you through the steps to generate an RSA private key and derive the corresponding public key for use with SimpleBackups.

Step 1: Generate the Private Key

  1. Open a terminal.
  2. Run the following command to generate a private RSA key:
bash
openssl genrsa -aes256 -out private-key.pem 4096
  1. You will be prompted to enter a password (we recommend securing your keys with a passphrase).
plain
Generating RSA private key, 4096 bit long modulus...
Enter pass phrase for private-key.pem:

Alternative: Generate RSA Key with PSA256

If you need to generate a private key using the PSA256 algorithm, use the following command:

bash
openssl genpkey -algorithm RSA -out private-key-psa256.pem -pkeyopt rsa_keygen_bits:4096 -aes256

You will be prompted to enter a password as well.

Step 2: Obtain the PEM Public Key

  1. Use the following command to derive the public key from your private key:
bash
openssl rsa -in private-key.pem -pubout -out public-key.pem

For the PSA256 key, use:

bash
openssl rsa -in private-key-psa256.pem -pubout -out public-key-psa256.pem
  1. View the contents of the public-key.pem or public-key-psa256.pem file using:

or

bash
cat public-key-psa256.pem
  1. Copy the contents of the respective public key file and paste them into SimpleBackups' encryption key field.

Additional Notes

🔒

Security: Ensure that your private key (private-key.pem or private-key-psa256.pem) is stored securely. The passphrase adds an additional layer of security

Usage: The public key (public-key.pem or public-key-psa256.pem) will be used by SimpleBackups for encryption purposes. Only share the public key with trusted entities.