Author: F.B. ten Kate | Posted on: 9/22/2009 12:52:21 AM | Views : 615

Hello,
Currently i'm working on trying to get SFTP to work, i've noticed that there isn't any out of the box support for this in .NET, google left me with one working free solution called SharpSSH.

I've gone to work but i quickly ran into a brickwall; Bad Data Exception.
Me beeing pretty much a novice at this security stuff have no idea what exactly this problem is, the only "known" issue that causes this is leading 0's that need to be stripped, which SharpSSH does.
The following code gives the problem; it should be noted that the keyfile and passpharse i use do work when testing them in a FTP application (that supports SFTP obvioulsy)
System.Security.Cryptography.DSAParameters DSAKeyInfo; public void setPrvKey(byte[] x, byte[] p, byte[] q, byte[] g) { DSAKeyInfo.X = Util.stripLeadingZeros( x ); DSAKeyInfo.P = Util.stripLeadingZeros( p ); ...

Go to the complete details ...