Using SSIS to automate PGP encryption of text file

  • I am trying to automate in SSIS the PGP encryption of a text file.  Has anyone done this before?  Any help would greatly be appreciated.  Thanks!


    Kindest Regards,

    Ryan

  • Ryan -

    Use the Execute Process task to run pgp.exe (or whatever the PGP executable is called on your system).  You may have to tinker with the parameters you pass to pgp.exe to get the expected result.

    hth

    Tim

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices

  • Thanks for the help.  I am able to launce the PGP command line program using the Execute Process Task, however I am not able to pass any arguments to the program.  Here is the code that I am attempting to pass to the PGP command line (using the the Execute Process task):

    filecryptsb --encrypt test.txt --user test

    This is the only input that I have to submit manually to encrypt the file.  However, when I place this code in the argument box it is ignored by SSIS Execute Process task.  It simply opens the DOS window and command line.

    One other question regarding the text file name...it will be variable in the future.  Can you please tell me how to indicate it is variable in the argument statement.

    Thanks again for all of your help.

    Ryan


    Kindest Regards,

    Ryan

  • Is filecryptsb the name of the executable?  If so, you need to add this in the Executable field and the remainder of your command [--encrypt test.txt --user test] in the Arguments field.

    Also, make sure that you don't have any file path issues.  Check to make sure that the executable is in your PATH environmental variable, or set the WorkingDirectory value to tell the task where to find this file.  Same thing with the source file - you may need to use absolute path to ensure success.

    To modify your task to use a variable, you need to create the variable in the designer, and then you can reference the variable in the Expressions tab.  For example, I am using the Expressions page to modify the Argument value with the following:

    "d:\\web\\cgi-bin\\awstats.pl -config=wnj -logfile=" + @[User::LocalFile]

    hth

    Tim

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices

  • Thanks for all of your help!  It is working now.


    Kindest Regards,

    Ryan

  • I am so glad to see this quesion in the website. I have to pgp encrypt the file by using security key? Can you please give the step by step solution for this. I am not familiar with SSIS that's why I am unable to use all the options directly. For example I have test.txt file, here I have to encrypt the file by using pgp encryption(test.txt.pgp). Please give the solution briefly.

    Thanks in advance.

  • Hi. I have progressed in automating pgp with SSIS. I am using the --password option and a package encryption to try not to put the password in plain sight.

    It works when I am in a debug environment, but when I put it in the agent as a job, the pgp task fails (I receive a classic error code 2 and the file is not decrypted).

    (the package is executed and decrypted, though).

    Any ideas?

    Thanks in advance

  • Can any one please give the information about PGP encryption?

    Santhoshi

  • Hi,

    Can you please help me to encrypt the file by PGP command line?

    I tried to ecnrypt some smaple file test.txt by using PGP command line

    pgp --encrypt test.txt --recipient santu in the command prompt but it is showing error as . Can you please tell me the problem?

    Thanks,

    Santhoshi

  • Check CozyRoc's SSIS+ library, if you want straightforward solution. It is your choice. You either have time on your hands or you want to get the job done ASAP.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • All any of you guys know what Im missing in the argument in Execute SQL Task.

    Im trying to encrypt a zip file

    Arguments : XXX -encrypt C:\A_20081023.zip

    (XXX refers to the User id for the public key given )

  • --recipient "YOUR-NAME" --output "C:\A_20081023.zip.gpg"

    --encrypt "C:\A_20081023.zip"

    If using GPG remember to look at the syntax here:

    http://www.glump.net/dokuwiki/gpg/gpg_intro

  • Thank You Eric,

    I shall try this right away.

    Do I need to pass the passphrase anywhere in Execute SQL Task ?

  • I tried to add the below in arguments for my Execute Script Task.

    It gets executed with no errors but It did not create a.gpg

    Here is what I am passing,this line works well in command prompt !

    Arguments

    --recipient "XXX" --output "C:\Testing.zip.gpg" --encrypt " C:\Testing.zip"

    XXX -name of public key

    Any idea why this does not work?

Viewing 15 posts - 1 through 15 (of 39 total)

You must be logged in to reply to this topic. Login to reply