javax.crypto.BadPaddingException: Decryption error on Android
See original GitHub issueThis happens if i connect from Android to an 1.12.2 Server (Vanilla and Spigot). I am logged in and i get disconnected because “Connection closed.”, the Server gives this Stacktrace:
[11:15:23 WARN]: javax.crypto.BadPaddingException: Decryption error [11:15:23 WARN]: at sun.security.rsa.RSAPadding.unpadV15(Unknown Source) [11:15:23 WARN]: at sun.security.rsa.RSAPadding.unpad(Unknown Source) [11:15:23 WARN]: at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:363) [11:15:23 WARN]: at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:389) [11:15:23 WARN]: at javax.crypto.Cipher.doFinal(Cipher.java:2164) [11:15:23 WARN]: at net.minecraft.server.v1_12_R1.MinecraftEncryption.a(SourceFile:117) [11:15:23 WARN]: at net.minecraft.server.v1_12_R1.MinecraftEncryption.b(SourceFile:112) [11:15:23 WARN]: at net.minecraft.server.v1_12_R1.PacketLoginInEncryptionBegin.b(SourceFile:50) [11:15:23 WARN]: at net.minecraft.server.v1_12_R1.LoginListener.a(LoginListener.java:203) [11:15:23 WARN]: at net.minecraft.server.v1_12_R1.PacketLoginInEncryptionBegin.a(SourceFile:39) [11:15:23 WARN]: at net.minecraft.server.v1_12_R1.PacketLoginInEncryptionBegin.a(SourceFile:12) [11:15:23 WARN]: at net.minecraft.server.v1_12_R1.NetworkManager.a(NetworkManager.java:126) [11:15:23 WARN]: at net.minecraft.server.v1_12_R1.NetworkManager.channelRead0(NetworkManager.java:330) [11:15:23 WARN]: at net.minecraft.server.v1_12_R1.NetworkManager.channelRead0(NetworkManager.java:1) [11:15:23 WARN]: at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [11:15:23 WARN]: at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [11:15:23 WARN]: at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [11:15:23 WARN]: at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [11:15:23 WARN]: at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [11:15:23 WARN]: at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [11:15:23 WARN]: at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [11:15:23 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [11:15:23 WARN]: at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [11:15:23 WARN]: at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [11:15:23 WARN]: at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) [11:15:23 WARN]: at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [11:15:23 WARN]: at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [11:15:23 WARN]: at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) [11:15:23 WARN]: at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [11:15:23 WARN]: at java.lang.Thread.run(Unknown Source) [11:15:23 ERROR]: Cipher data failed! [11:15:23 INFO]: com.mojang.authlib.GameProfile@56fa3948[id=<null>,name=ThisIsNotMyRealName,properties={},legacy=false] (/192.168.0.109:36941) lost connection: Internal Exception: java.lang.IllegalStateException: Invalid nonce!
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (7 by maintainers)
Top GitHub Comments
Very sorry, apparently I’ve been trying to test it in offline mode this whole time… It should work now. At the very least, it definitely works with OpenJDK now; I don’t have an Android app set up to test with.
Can you send the code you are using and what version of java you are running under.