How to encrypt the username and password in script task?

  • Hi,

    I have to create a scrip task using vb.net which reads the username and password written in the xml configuration file and later I need to encrypt it.

    I am using visual studio 2005 for creating this script task.

    Can anyone please help?

    Thanks in Advance.

  • Where do you need to encrypt it? (where are you planning to store the username and password?)

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I want to save the password in the xml config file.

  • That's unfortunately not how config file works. If you would encrypt it, the SSIS package cannot use the contents any more. You probably want to use the script task to read it out again and decrypt it, but configurations are applied before the script task even starts. The SSIS package will take the encrypted value and apply it to the connection manager. And then probably fail validation as it cannot make a connection.

    I would use a SQL Server config table instead. The data is inside SQL Server, which is of course a more secure environment. Put the protectionlevel of the package to Server Storage when you deploy it to the server.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

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

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