GPG (GNU Privacy Guard) provides an additional layer of security for files transferred using SFTP (Secure File Transfer Protocol). By using GPG encryption, you ensure that sensitive data remains encrypted while at REST on the SFTP server. Meaning, it’s only accessible to parties using the corresponding private key.
Setting up GPG encryption in Unqork involves a three-step process:
Configure an Encryption (GPG) Service: Create a GPG Encryption service in Services Administration.
Enable Server-Side Execute: Set up a module to execute its data server-side.
Execute via Plug-In: Use a Plug-in component to encrypt specific files using the parameters defined in your GPG service.
Discover how to decrypt files in our How to: Set Up GPG Decryption for Files article.
Preconfiguration
Before configuring the module, set up the encryption service to connect with the party receiving and decrypting the files.
Set Up the Encryption (GPG) Service
First, set up an Encryption (GPG) service in Services Administration.
You must have the public key from the party that's receiving and decrypting the files. They'll have to set up the public/private GPG keypair.
At the top right of the Unqork Designer Platform, click Administration.
Under Integration, select Services Administration.
Click + Add a Service.
In the Service Title* field, enter a title for your service. For example,
GPG Encryption.In the Service Name* field, enter a name for your service. For example,
GPG-encryption.The Service Name value is final once created. You can update the Service Title value anytime.
In the Service protocol + host* field, enter a temporary value. You’ll delete this value in a later step.
Click Next.
In the Share To* field, specify which workspaces to make this service available.
Click Create. The Service page displays.
From the menu to the left, select Service-Type.
From the Service Type drop-down, select Encryption.
In the Service Protocol + Host field, delete the temporary value.
Set the Authentication Method to Encryption (GPG).
In the GPG Public Key (Armored) field, enter the public key.
The public key must be provided by the service you’re integrating with. A sample key is not available.

Click Save Changes.
After enabling the GPG Encryption service, return to the Module Builder.
Configure the GPG Module
Learn how to set up the GPG module be selecting the tab that corresponds to your Unqork Designer experience:
Enable Server-Side Execution Only
For security purposes, modules calling a GPG service must execute server-side only. While API modules always execute server-side, your requirements might use a Front-End or Other module type to contain the Plug-In component that calls the GPG service.
From the Module Builder page:
Click the
(ellipsis) button. Click Module Settings. The Settings modal displays.
Click Module Settings.
Set the Server Side Execution Only toggle to
(ON).
Click Save & Close.
Configure the Encryption Module
Set up the module that will encrypt the file, then send it using SFTP.
Files encrypted using the Encryption (GPG) internal service must be in binary form, not Base64. If using a Plug-In component to retrieve your file to encrypt, ensure you set Expect Binary Response to
(ON).
Configure the fileToEncrypt Hidden Component
Configure a Hidden component to store the file that you want to encrypt. This configuration does not include steps for passing a value to this Hidden component. When applying these steps to your use case, remember to pass the file you want to encrypt into this Hidden component.
Drag and drop a Hidden component onto your canvas.
In the Property ID and Label Text fields, enter
fileToEncrypt.Click Save Component.
Configure the initPluginEncrypt Initializer Component
Next, set up an Initializer component to trigger the Plug-In component you'll create next.
If your module already has a component that can trigger the Plug-In component, skip this step. For example, if you're using a Plug-In component to retrieve the file you want to encrypt, you can use the Plug-In component's Post Trigger field to trigger the
pluginEncryptPlug-In component.
Drag and drop an Initializer component onto your canvas, placing it below your Hidden component.
In the Property ID and Canvas Label Text fields, enter
initPluginEncrypt.From the Trigger Type drop-down, select New Submission.
In the Outputs table, enter the following:
Property ID
Type
Value
1
pluginEncrypt
trigger
GO

Click Save Component.
Configure the pluginEncrypt Plug-In Component
Configure a Plug-In component to the GPG Encrypt a File API call. The Plug-In component’s Inputs table needs to reference two values:
The Property ID of the component storing the file you want to encrypt. In this case, it's the
fileToEncryptHidden component. This value maps to the file parameter.The Service Name of your Encryption (GPG) service. This value maps to the
{{serviceName}}parameter.
To configure the Plug-In component:
Drag and drop a Plug-In component onto the canvas, placing it below the
initPluginEncryptInitializer component.In the Property ID and Canvas Label Text fields, enter
pluginEncrypt.From the Internal Services drop-down, select GPG Encrypt a File.
Set Make a Multipart API Call to
(ON).In the Alternative Multipart Sub-Type (Services) field, enter
form-data.
In the Inputs table, enter the following:
Property ID
Mapping
1
fileToEncrypt
file
2
'GPG-encryption'
{{serviceName}}
Replace
{{serviceName}}with the Service Name you created in the Set Up the Encryption (GPG) Service steps.Navigate to the Actions settings.
In the Post Trigger field, enter
fsSendEncrypted.This is the Property ID of the File Storage component you'll set up next.
Always add single quotes around values in the Property ID column that aren't actually Property IDs in the module. For example,
fileToEncryptreferences the Hidden component in your module, so it doesn't need single quotes. GPG-encryption, though, is not a Property ID in the module. So, it needs single quotes.Navigate to the Advanced settings.
Set Expect Binary Response to
(ON).Click Save Component.
Configure the fsSendEncrypted File Storage Component
Lastly, send the encrypted file using a File Storage component.
Drag and drop a File Storage component onto the canvas, placing it below the
pluginEncryptPlug-In component.In the Property ID and Canvas Label Text fields, enter
fsSendEncrypted.From the Method drop-down, select PUT.
Under Path, in the Property ID field, enter
{{'/myfolder/myfile.pgp'}}.Replace
{{'/myfolder/myfile.pgp’}}with the file path on the file server. Now the GPG encryption is ready to encrypt files in Unqork.Under File Object, in the Property ID field, enter
pluginEncrypt.file.
Click Save Component.
Save your module.
Here's how the final configuration looks in the Module Builder:

Enable Server-Side Execution Only
For security purposes, modules calling a GPG service must execute server-side only. While API modules always execute server-side, your requirements might use a Front-End or Other module type to contain the Plug-In component that calls the GPG service.
From the Module Builder page:
On the Module Builder header, click the
(ellipsis) button. Click Settings. The Settings modal displays.
Navigate to the Module Settings tab.
Set Server Side Execution Only to
(ON).
Click Save.
Configure the Encryption Module
Set up the module that will encrypt the file, then send it using SFTP.
Files encrypted using the Encryption (GPG) internal service must be in binary form, not Base64. If using a Plug-In component to retrieve your file to encrypt, ensure you set Expect Binary Response to
(ON).
Configure the Hidden Component
Configure a Hidden component to store the file that you want to encrypt. This configuration does not include steps for passing a value to this Hidden component. When applying these steps to your use case, remember to pass the file you want to encrypt into this Hidden component.
Drag and drop a Hidden component onto your canvas.
In the Property ID and Label Text fields, enter
fileToEncrypt.Click Save & Close.
Configure the initPluginEncrypt Initializer Component
Next, set up an Initializer component to trigger the Plug-In component you'll create next.
If your module already has a component that can trigger the Plug-In component, skip this step. For example, if you're using a Plug-In component to retrieve the file you want to encrypt, you can use the Plug-In component's Post Trigger field to trigger the
pluginEncryptPlug-In component.
Drag and drop an Initializer component onto your canvas, placing it below your Hidden component.
In the Property ID and Label Text fields,
initPluginEncrypt.Navigate to the Actions section.
From the Trigger Type drop-down, select New Submission.
In the Outputs table, enter the following:
Property ID
Type
Value
pluginEncrypt
trigger
GO

Click Save & Close.
Configure the pluginEncrypt Plug-In Component
Configure a Plug-In component to the GPG Encrypt a File API call. The Plug-In component’s Inputs table needs to reference two values:
The Property ID of the component storing the file you want to encrypt. In this case, it's the
fileToEncryptHidden component. This value maps to the file parameter.The Service Name of your Encryption (GPG) service. This value maps to the
{{serviceName}}parameter.
To configure the Plug-In component:
Drag and drop a Plug-In component onto the canvas, placing it below the
initPluginEncryptInitializer component.In the Property ID and Canvas Label Text fields, enter
pluginEncrypt.From the Internal Services drop-down, select GPG Encrypt a File.
Set Make a Multipart API Call to
(ON).In the Alternative Multipart Sub-Type (Services) field, enter
form-data.In the Inputs table, enter the following:
Property ID
Mapping
fileToEncrypt
file
'GPG-encryption'
{{serviceName}}

In the Post Trigger field, enter
fsSendEncrypted.This is the Property ID of the File Storage component you'll set up next.
Always add single quotes around values in the Property ID column that are not actually Property IDs in the module. For example,
fileToEncryptreferences the Hidden component in your module, so it doesn't need single quotes. GPG-encryption, though, is not a Property ID in the module. So, it needs single quotes.Click the Advanced Settings tab.
Set Expect Binary Response to
(ON).
Click Save.
Configure the fsSendEncrypted File Storage Component
Lastly, send the encrypted file using a File Storage component.
Drag and drop a File Storage component onto the canvas, placing it below the
pluginEncryptPlug-In component.In the Property ID and Canvas Label Text fields, enter
fsSendEncrypted.Set the Method as PUT.
In the Inputs table, enter the following:
Get From
Property ID
Watch
Required
Path
'/myfolder/myfile.pgp'
(unchecked)
(checked)File Object
pluginEncrypt.file
(unchecked)
(checked)'/myfolder/myfile.pgp' is a placeholder value. Be sure to update it with the actual file path on the file server.

Click Save & Close.
Save your module.
Now the GPG encryption is ready to encrypt files in Unqork.
Here's how the final configuration looks in the Module Builder:
Best Practices
For most occasions, use the SFTP File Storage Type. FTP (File Transfer Protocol) is only for legacy systems that do not support SFTP.
Enable Server-Side Execution Only for services used by the File Storage component.
Discover how to decrypt files in our How To: Set Up GPG Decryption for Files article.