我正在使用 WinSCPnet,版本=5.19.0 通过 SFTP 进行文件传输。我传输文件的供应商已经弃用了一些密码。我想检查我在代码中使用的 SFTP 会话正在使用哪种密码或加密算法。
这是我打开 SFTP 连接的代码:
SessionOptions sessionOptionsSFTP = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = sftpServerIP,
UserName = sftpUserID,
Password = sftpPassword,
PortNumber = sftpPort,
SshHostKeyFingerprint = sftpHostKey,
Timeout = new TimeSpan(0, 2, 0)
};
Session sessionSFTP = new Session();
sessionSFTP.Open(sessionOptionsSFTP);
log.Info("SFTP session has been opened");
有没有办法记录或检查正在使用哪种算法?
在 WinSCP .NET 程序包中查找
winscp.exe
二进制文件(或者直接单独下载 WinSCP 5.19 二进制文件)。
/info
命令行参数运行它。您将得到:
SSH encryption ciphers:
aes256-ctr
aes256-cbc
[email protected]
aes192-ctr
aes192-cbc
aes128-ctr
aes128-cbc
[email protected]
blowfish-ctr
blowfish-cbc
3des-ctr
3des-cbc
arcfour256
arcfour128
des-cbc
[email protected]
...
尽管我强烈建议您不要使用旧版本的 WinSCP。请使用最新版本。