0 votes
by (350 points)

Hello there

I am writing a program to connect to a sftp server and upload the files. I want to enforce the sftp connection to use only AES256 algorithm.

I wrote the following code

With SFTP.Settings.sshParameters
.EncryptionAlgorithms = sshEncryptionAlgorithms.AES
End With

But how do I set it to use only AES256 Cipher

Your help is much appreciated

Thanks

Applies to: Rebex SFTP

1 Answer

0 votes
by (147k points)

Hello,

Use SetEncryptionAlgorithms method instead of EncryptionAlgorithms property to further limit SSH encryption ciphers. To only allow ciphers based on 256-bit AES, use the following code:

SFTP.Settings.SshParameters.SetEncryptionAlgorithms("aes256-gcm@openssh.com", "aes256-ctr", "aes256-cbc")
...