Encrypt Data Files and Push to SFTP (How to)

sidheshwarc5116

06-07-2017

I am trying to push the data in a file to a SFTP location but I want that file to be encrypted.

Is there any activity / componennt in AC v7 which has a provision to specify encryption command before it pushes the file to SFTP server ?

Also, is there a utility in AC which can be invoked from workflow to unzip the files before ingesting ?

Your help is all appreciated.

Sid

Accepted Solutions (1)

Accepted Solutions (1)

Vapsy

Employee

06-07-2017

Hi Sid,

If your instance is hosted by Adobe, ask support to install GPG utility on the server.

Get public private key pair generated for outbound transfer.

While doing export, inside the JS code activity, you can encrypt the file on Campaign server and also provide the public key to external sFTP server team for decrypting the file.

Regards,
Vipul

Answers (5)

Answers (5)

guillermoL

07-07-2017

Hi Sid,

After setting gpg on the server and importing the public key as Vipul said, a function like this below can help within the workflow:

function encryptFile(file) {   
  var systemCommand = "gpg --encrypt --recipient  recipientToEncryptTo " + file;  
  var result = execCommand(systemCommand, true);
}

guillermoL

04-12-2017

Hi,

Sorry for the delay. The inverse is:

function decryptImportFile(file) {

  var fullName = file.fullName.toString();

  var outputFile = 'decryptedFile.xxx';

  var systemCommand = "gpg --output " + outputFile + " --decrypt " + fullName;

  var result = execCommand(cmd, true);

}

To handle multiple keys you will need to import all of them into your gpg and the use one or another to encrypt by using the switch -r or --recipient when calling gpg.

I hope it makes sense.

Thanks

Guillermo

Jean-Serge_Biro

MVP

05-12-2017

Hi Sid,

Regarding the compression/uncompression method, it is provided OOTB by Adobe Campaign unfortunately.

So you must call an operation system script activity (command line) in your import workflow in order to do the unzip job.


If Linux server, you can use gunzip command.
If Windows server, I do recommend you to install 7Zip tool (free and very powerful, and all compression algorithms supported).

Please take care that recent AC build prohibits use of system script activity in workflow, so you would have to allow the commands to allow (unzip, gpg) on the server themselves (or ask to Adobe for configuration level if they can accept it, if not hosted On Premise).

Regards.

Jean-Serge

derrickr8850025

23-10-2017

Morning

What's the inverse of that?

Say you have a file that is encrypted and you need A.Campaign to decrypt it.

How do you specify the key to you?

Also, what if your instance has multiple keys? Say BrandA has keyA and BrandB uses keyB.

How do you handle that situation?