java.security.InvalidAlgorithmParameterException: Prime size must be multiple of 64, and can only range from 512 to 2048 (inclusive)

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

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

Solutions on the web

via Google Groups by Marc Landry, 1 year ago
Prime size must be multiple of 64, and can only range from 512 to 2048 (inclusive)
via Stack Overflow by thotheolh
, 2 years ago
Prime size must be multiple of 64, and can only range from 512 to 2048 (inclusive)
via Google Groups by Tomy, 2 years ago
Prime size must be multiple of 64, and can only range from 512 to 1024 (inclusive)
via Stack Overflow by Clearner88
, 2 years ago
Prime size must be multiple of 64, and can only range from 512 to 1024 (inclusive)
via Google Groups by Brian Ic, 5 months ago
Prime size must be multiple of 64, and can only range from 512 to 1024 (inclusive)
via Stack Overflow by user3592768
, 2 years ago
Prime size must be multiple of 64, and can only range from 512 to 1024 (inclusive)
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 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)

Users with the same issue

Samebug visitor profile picture
Unknown user
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.