I wrote a simple application for forwarding local ports, it works great and was really easy!
But i have one concern, when investigating the memory of my application i found that my password was found no less then 13 times. I tried to remove it but setting _password (in PasswordConnectionInfo) to null after successful authentication but without luck.
Would it be possible to either encrypt the password stored in memory or after authentication, remove it completely from memory?
Also, my application clears the passwordbox used for entering the password. This is how i establish a connection:
client = new SshClient(tbHost.Text, tbUsername.Text, pbPassword.Password);
client.ConnectionInfo.AuthenticationBanner += new EventHandler<Renci.SshNet.Common.AuthenticationBannerEventArgs>(ConnectionInfo_AuthenticationBanner);