Bug 404714 - Inadequate SSH key strength
Summary: Inadequate SSH key strength
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 4.2.2   Edit
Hardware: PC Windows 7
: P3 normal with 7 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 481512 490474 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-02 07:01 EDT by Art O Cathain CLA
Modified: 2022-04-28 04:04 EDT (History)
14 users (show)

See Also:


Attachments
Screenshot of the SSH key generation screen (78.03 KB, image/png)
2013-04-02 07:29 EDT, Art O Cathain CLA
no flags Details
patches RSA keys generation to 2048 bits (1.28 KB, patch)
2019-07-12 11:45 EDT, Alexander Levsha CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Art O Cathain CLA 2013-04-02 07:01:50 EDT
The SSH key generation only offers 1024 bit keys, which is now too weak. (See http://news.netcraft.com/archives/2012/09/10/minimum-rsa-public-key-lengths-guidelines-or-rules.html).

It should either be fixed at 4096, or user-configurable.
Comment 1 Paul Webster CLA 2013-04-02 07:13:30 EDT
What SSH key gen?  Where?  Please include a description or image of where.

PW
Comment 2 Art O Cathain CLA 2013-04-02 07:29:39 EDT
Created attachment 229231 [details]
Screenshot of the SSH key generation screen
Comment 3 Atsuhiko Yamanaka CLA 2013-04-02 08:48:43 EDT
The Eclipse Platform has depended jsch, and jsch can generate such a long key.
I have confirmed that it can generate 1024, 2048 and 4096 bit RSA keys,
and 512 and 1024 DSA keys due to the restrictions by Sun's JCE provider.

So, all we have to do is to change UI, I think.
Comment 4 Marco Blessing CLA 2014-10-17 08:50:33 EDT
I think the UI update is still missing.
Does anyone work on this case yet?
Comment 5 Philip D\'Ath CLA 2015-04-01 14:45:30 EDT
I note the Hardware platform on this one says "PC Windows 7".  I use Ubuntu 14.04 with an open JVM, and a Windows 7 machine using the Oracle JVM and have the same issue on both of them.

It would be really good to get 4096 bit key support.  I had to downgrade our existing keys just to use this product.
Comment 6 Atsuhiko Yamanaka CLA 2015-04-02 01:31:15 EDT
(In reply to Philip D\'Ath from comment #5)
> It would be really good to get 4096 bit key support.  I had to downgrade our
> existing keys just to use this product.

You don't have to downgrade your key.  In the current implementation,
it can not generate 496 bit key, but it can accept 4096 bit key.
Comment 7 Philip D\'Ath CLA 2015-04-02 04:57:04 EDT
Our existing 4096 bit ssh keys do not work with GitEye on either Ubuntu or Windows.  They were probably generated using ECDH.

I'll try generating some new 4096 bit keys using older crypto algorithms and see if that works.
Comment 8 Philip D\'Ath CLA 2015-04-06 21:14:11 EDT
I have managed to figure this out.

Modern ssh-keygen's (like on Ubuntu) use AES128 for the crypto cipher for the key for SSH2.  I have managed to figure out that GitEye/jsch only seems to support 3DES.

The tricky bit is ssh-keygen does not allow you to specify the crypto algorithm to use.

So to create a compatible SSH key 4096 bits long you need to do this:

openssl genrsa -des3 -out id_rsa 4096
chmod 600 id_rsa
ssh-keygen -y -f id_rsa >id_rsa.pub
Comment 9 Atsuhiko Yamanaka CLA 2015-04-07 07:51:52 EDT
(In reply to Philip D\'Ath from comment #8)
> Modern ssh-keygen's (like on Ubuntu) use AES128 for the crypto cipher for
> the key for SSH2.  I have managed to figure out that GitEye/jsch only seems
> to support 3DES.

FYI, it can not generate keys ciphered with AES-128-CBC,
but it can accept such keys.
Comment 10 Daniel Sokolowski CLA 2015-05-28 21:47:05 EDT
+1
Comment 11 Alexander Kurtakov CLA 2017-12-06 08:52:49 EST
*** Bug 490474 has been marked as a duplicate of this bug. ***
Comment 12 Alexander Kurtakov CLA 2017-12-06 08:53:25 EST
*** Bug 481512 has been marked as a duplicate of this bug. ***
Comment 13 Alexander Levsha CLA 2019-07-12 11:45:09 EDT
Created attachment 279262 [details]
patches RSA keys generation to 2048 bits

Bitbucket has rejected the RSA-1024 key generated by Eclipse. DSA-1024 was accepted but is deprecated elsewhere (e.g. OpenSSH).
This really needs to be finally updated.

I made a small patch for org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java
to generate RSA keys with length of 2048. I left DSA keys length at 1024 bits as it was since i'm not sure whether 2048 is supported.
I didn't test the patch but it's very simple: just pass another parameter to JSch and emit appropriate text comment.

(sorry, i submitted this to the duplicate bug the first time)
Comment 14 Thomas Wolf CLA 2019-07-12 13:42:18 EDT
OpenSSH 8.0 uses 3072 bits as default nowadays.[1]

[1] https://www.openssh.com/txt/release-8.0