dswisher / swish-sftp

Tinkering with SFTP protocol in C#
MIT License
3 stars 0 forks source link

Implement `aes128-ctr` cipher (and 192, 256) #5

Open dswisher opened 4 years ago

dswisher commented 4 years ago

The openssh SFTP client by default does not include 3des-cbc in the key exchange. Implement aes128-ctr (and/or 192/256 bit lengths) so that the openssh SFTP can connect without having to explicitly override the allowed ciphers.

The .NET framework includes support for AES, but not the CTR cipher mode. We'll need to implement something. There are resources available:

It would be nice to write a unit test for this (and the other cipher/crypto bits).

dswisher commented 4 years ago

To write a unit test, it would be good to encrypt something with openssh and feed that into the unit test.

dswisher commented 4 years ago

FileZilla supports aes192-cbc, as does openssh (with the -oCiphers=aes192-cbc option).

Redo the way ciphers are handled in the code, to accept a CipherMode implementation. Implement cbc and get it working with 3des-cbc, then apply to aes192-cbc. Next, write a ctr mode and apply it to aes192-ctr.