SFTP EncryptionAlgorithm AES256

0 votes
asked Nov 15 by Ritesh (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


Applies to: Rebex SFTP

1 Answer

0 votes
answered Nov 15 by Lukas Pokorny (96,250 points)


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")