0

I am using JSch version (jsch-0.1.54) and Bitvise SSH personal edition as sftp server on my local machine.

Currently I have provided all the ciphers in the code as given in the JSch documentation (http://www.jcraft.com/jsch/) as below.

session.setConfig("cipher.s2c", "blowfish-cbc,3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-ctr,arcfour,arcfour128,arcfour256");
session.setConfig("cipher.c2s", "blowfish-cbc,3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-ctr,arcfour,arcfour128,arcfour256");

And when I connected to the server I found that only the below algorithms (given against "Remote List" in the error node) are accepted (This is my understanding from the log file).

<error type="Flow" component="SshManager/transport" class="LocalSshDisconn" code="KeyExchangeFailed" description="FlowSshTransport: no mutually supported inbound encryption algorithm. Local list: aes256-gcm,aes128-gcm,aes256-cbc. Remote list: blowfish-cbc,3des-cbc,aes128-cbc,aes128-ctr,3des-ctr,arcfour,arcfour128."/>

In the server I didnt chose any of these algorithms and this led to an "Algorithm Negotiation Fail" error as expected.

So my question is - Whether these list of acceptable algorithms vary or not based on different environment (Testing Environment , UAT , Production etc..) and some server settings (some sftp server settings)?.

If this doesnt vary then I can hard code those algorithms in the code.Right??. But If it vary then how I need to handle it in the code so that no "Algorithm negotiation Fail" error?.

user3742125
  • 617
  • 2
  • 9
  • 31

0 Answers0