Skip to main content

Overview - The PGP Encryption Process

PGP (Pretty Good Privacy) is a security program that allows you to encrypt sensitive files. MoEngage supports PGP encryption in file imports (S3 Import, SFTP Import). This article explains how to use PGP encryption for your sensitive files.

Prequisites

  • PGP key pair: A PGP key pair consists of a public key and a private key. Use the public key to encrypt the file, and use the private key to decrypt the file. Do not share the private key with anyone, because it decrypts the sensitive information in the file. This private key is required for the SFTP (SSH File Transfer Protocol) integration process with MoEngage.
  • Signing key pair: A signing key pair consists of a public key and a private key. Use the public key to sign the file; it is required for MoEngage SFTP integration. Internally, the private key verifies the signature.
Pgp Encryp

Use a PGP Key Pair

The following steps describe how to use PGP encryption through GnuPG, a free implementation of the PGP standard.

Step 1: Generate a Standard Key Pair (Public and Private)

Generate the PGP key pair by using a PGP tool such as GnuPG. See the following example:
Information
  • MoEngage supports file encryption that uses RSA keys of up to 1024 bits in length. We do not recommend using higher bits.
  • Ensure that compression is turned off during the encryption process.

Step 2: Generate a Public Key and Encrypt the Files

Encrypt the file by using the generated public key, and then upload the encrypted file to the S3 or SFTP folder.
The --sign option is used to encrypt a file by signing it.

Step 3: Add the Keys in the MoEngage UI

Enter the private key in the Decryption Key section on the MoEngage UI, and then enter the passphrase in the Key Passphrase section. For more information, refer to the Adding your S3 Credentials (S3 Imports) and Adding your S3 Credentials (SFTP Imports) sections.

Step 4: Decrypt a File

To decrypt an encrypted file, you need two essential elements: your private key and the corresponding passphrase that you established when you created the key pair. In the PGP software, navigate to and select the encrypted file, and then type your passphrase. The software decrypts your file and generates an unencrypted version of the original document. For Python users, consider the python-gnupg package, a Pythonic wrapper for the gpg command.

Step 5: Verify the File’s Signature [Optional Step]

If a signing key was used to sign your file, copy the public key and signing key pair into the appropriate section on the MoEngage dashboard. MoEngage verifies the file in the S3 or SFTP folder for a signature match, as shown in the following example.

Next Steps

  1. S3 Imports
  2. SFTP Imports