Weak encryption with SFTP plugin

Support for Android version of Total Commander

Moderators: Hacker, petermad, Stefan2, white

Post Reply
sugi
Junior Member
Junior Member
Posts: 4
Joined: 2013-08-06, 21:17 UTC

Weak encryption with SFTP plugin

Post by *sugi »

Hello,
I'm having some issues with the weak encryption supported by the SFTP plugin.
I have disabled weak crypto algorythms on my ssh server, following the suggestions on bettercrypto. org. Now the result is that the SFTP plugin is unable to connect.
JuiceSSH is able to connect just fine, incidcating that this is not a system issue, but merely a lack of support in the plugin.
Is there any chance to get the support for better encryption?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Can you give me more information, please?
- which ciphers are not supported?
- how do I need to configure the ssh server (on ghisler.com, using CentOD Linux) to reproduce the problem?
Author of Total Commander
https://www.ghisler.com
sugi
Junior Member
Junior Member
Posts: 4
Joined: 2013-08-06, 21:17 UTC

Post by *sugi »

Wow, thanks for the quick reply.
My ssh server is configured (/etc/ssh/sshd_config with the following settings.

Code: Select all

Ciphers aes256-ctr,aes128-ctr
MACs hmac-sha2-512,hmac-sha2-256,hmac-ripemd160
KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
The details about the configuration can be found on bettercrypto. org. The PDF file on the top right explains the reasons why the other algorythms were disabled. One being forward secrecy in case the key is leaked for any reason..

After configuring the ssh server and trying to login with a client that doesn't support the necessary algorythms I have an error like the following in /var/log/auth.log. Also the Total Commander display a similar error message.

Code: Select all

May  2 16:06:18 aerith sshd[9542]: fatal: no matching mac found: client hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96 server hmac-sha2-512,hmac-sha2-256,hmac-ripemd160
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Edit: The problem seems to be SHA2-256. The sshj library from 2012 only supports MD5 and SHA1. I will check whether I can add SHA-256 somehow.
Author of Total Commander
https://www.ghisler.com
sugi
Junior Member
Junior Member
Posts: 4
Joined: 2013-08-06, 21:17 UTC

Post by *sugi »

Thanks, that would make Total Commander unique, as I didn't find another app that would allow good encryption.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Please try the following beta:
tcandroidsftp103b1.apk

I cannot guarentee that it will work - I had to write quite a bit of code to make it work:
- hmac-sha2-512,
- hmac-sha2-256,
- diffie-hellman-group-exchange-sha256,
- diffie-hellman-group-exchange-sha1

The following was already supported, but it's weaker than the above two:
- diffie-hellman-group14-sha1

I tested all with ghisler.com, but didn't turn off the weaker algorithms - I just put the new ones in front and checked in the debugger that they were used.

Here are the changed sources:
sshj_changes_sha2.zip
Author of Total Commander
https://www.ghisler.com
sugi
Junior Member
Junior Member
Posts: 4
Joined: 2013-08-06, 21:17 UTC

Post by *sugi »

ghisler(Author) wrote:Please try the following beta:
tcandroidsftp103b1.apk
It's working like a charm!
Login is working well, and files are copying right now.
Thanks a lot.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Nice to hear that! Currently hmac-sha2-512 is the default, but I will probably make hmac-sha2-256 the default. The encryption uses 256bit too, so using 512bit for authenticity seems to be overkill.
Author of Total Commander
https://www.ghisler.com
Post Reply