Encrypting text file to UTF8 using powershell

  • Current Process -

    I have a text file and is encrypted to PGP file using powershell script as in the process below.

    In SSIS i have a execute process task and the properties are -

    executable - C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

    working directory - C:\Windows\System32\WindowsPowerShell\v1.0\

    Arguements - G:\EncryptionScripts\AnswerRefExport.ps1

    The file G:\EncryptionScripts\AnswerRefExport.ps1 contains the following code to encrypt the text file to PGP.

    Invoke-Command -ComputerName DAZ02SQL285 -ScriptBlock {Invoke-Expression "C:\WINDOWS\system32\cmd.exe /c PGP--encrypt C:\ExportFiles\Folder\File.txt --recipient 0x136FB28F --recipient 0x98084AC4"}

    This process of encrypting to PGP file is working good.

    Now I want to encrypt the text file to UTF8 using the same process. Can you please help me solving this issue. I searched online for articles but could'nt find anything.

  • UTF8 has nothing to do with encryption. It refers to a character set. If you want to convert your output to UTF8 then forget about what you did for PGP. The 2 process have nothing in common.

    What I would try is setting my output connection manager codepage to 65001 (UTF-8). On my computer it's the last item in the list.

    You'll probably also have to convert each column to the correct format using the data conversion task or the derived column.

    Edit:

    Oops, I meant to say that I would do this in a DataFlow. I could also do this using a script task but I believe the DataFlow should be more efficient.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • I have to ask... Am I the only one concerned that someone responsible for the successful encryption of data that needs to be encrypted doesn't know that UTF-8 isn't a method of encryption especially in the age of Google?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (8/26/2010)


    I have to ask... Am I the only one concerned that someone responsible for the successful encryption of data that needs to be encrypted doesn't know that UTF-8 isn't a method of encryption especially in the age of Google?

    Scary, eh?



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Thank You, I got it.

Viewing 5 posts - 1 through 4 (of 4 total)

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