Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Encrypting the SFTP server password

I am using an SSIS package script task which has reference to winscp.dll and I am using

SessionOptions sessionOptions = new SessionOptions
Protocol = Protocol.Sftp,
HostName = ftpSite,
UserName = username,
Password = password,
SshHostKeyFingerprint = sshKey
using (Session session = new Session())
// WinSCP .NET assembly must be in GAC to be used with SSIS,
// set path to WinSCP.exe explicitly, if using non-default path.
session.ExecutablePath = winscpPath;
session.DisableVersionCheck = true;

if (winSCPLog)
session.SessionLogPath = @winSCPLogPath + @"WinscpSessionLog.txt";
session.DebugLogPath = @winSCPLogPath + @"WinscpDebugLog.txt";

// Connect
session.Timeout = new TimeSpan(0, 2, 0); // two minutes
But here my company does not want SFTP server password to be visible to others(even with the developers). Do we have an option like using the WINSCP client(GUI), we can save a site information(site,username and password) and directly open the FTP session in the scripting by passing SavedSite name?