java.security.InvalidAlgorithmParameterException

Prime size must be multiple of 64, and can only range from 512 to 2048 (inclusive)

Samebug tips1

You're either not using a valid size or you're out the boundaries. If you really must use a number bigger than 1024 please consider using BouncyCastle, as the JDK SSL only supports up to 1024


rafaelrafael

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web49

  • via Unknown by Marc Landry,
  • via Stack Overflow by Clearner88
    ,
  • Stack trace

    • java.security.InvalidAlgorithmParameterException: Prime size must be multiple of 64, and can only range from 512 to 2048 (inclusive) at com.sun.crypto.provider.DHKeyPairGenerator.initialize(DHKeyPairGenerator.java:120) at java.security.KeyPairGenerator$Delegate.initialize(KeyPairGenerator.java:674) at java.security.KeyPairGenerator.initialize(KeyPairGenerator.java:411) at org.apache.sshd.common.kex.DH.getE(DH.java:65) at org.apache.sshd.client.kex.DHGEX.next(DHGEX.java:118) at org.apache.sshd.common.session.AbstractSession.doHandleMessage(AbstractSession.java:425) at org.apache.sshd.common.session.AbstractSession.handleMessage(AbstractSession.java:326) at org.apache.sshd.client.session.ClientSessionImpl.handleMessage(ClientSessionImpl.java:306) at org.apache.sshd.common.session.AbstractSession.decode(AbstractSession.java:780) at org.apache.sshd.common.session.AbstractSession.messageReceived(AbstractSession.java:308) at org.apache.sshd.common.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:54) at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:184) at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:170) at org.apache.sshd.common.io.nio2.Nio2CompletionHandler$1.run(Nio2CompletionHandler.java:32) at java.security.AccessController.doPrivileged(Native Method) at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:30) at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126) at sun.nio.ch.Invoker$2.run(Invoker.java:218) at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitor2 times, last one
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    4 more bugmates