PGP Encrypt Only icon

PGP Encrypt Only

Encrypt text or binary data with a public key only.

Encrypt

AI-generated

Summary

Encrypt text or binary data using a PGP public key from credentials, optionally compressing binary data before encryption.

Inputs

  • message — Plain text to encrypt. Used only when input type is 'text'.
  • binaryPropertyName — Name of the binary property containing the data to encrypt (base64-encoded). Used only when input type is 'binary'. Default: 'data'.
  • outputBinaryPropertyName — Name under which the encrypted binary data will be stored. Output is a base64-encoded ASCII-armored PGP message with MIME type 'application/pgp-encrypted'. Used only when input type is 'binary'. Default: 'data'.
  • compressionAlgorithm — Compression to apply to binary data before encryption. Supported values: 'uncompressed', 'zip', 'zlib' (others will cause an error). Used only when input type is 'binary'. Default: 'uncompressed'.

Output shape

Each input item is returned with added encryption result. For text input, item.json.encrypted contains the armored PGP string. For binary input, item.binary[] holds the encrypted data (base64), and item.json.encrypted is set to true.

The node requires the 'pgpCredentialsApi' credential containing a 'public_key' field with the PGP public key in ASCII-armored format.

Examples

Example 1: Encrypt a text message

inputType: text; message: 'Hello, world!'; credentials: pgpCredentialsApi with public_key.

Example 2: Encrypt a binary file with ZIP compression

inputType: binary; binaryPropertyName: data; outputBinaryPropertyName: encryptedData; compressionAlgorithm: zip; credentials: pgpCredentialsApi with public_key.

Links

Discussion