Top-Cat / SteamKit-Java

SteamKit in java
top-cat.github.com/SteamKit-Java
47 stars 38 forks source link

Issue using SteamWeb doLogin #7

Closed VoidWhisperer closed 8 years ago

VoidWhisperer commented 10 years ago
java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: RSA keys must be at least 512 bits long
    at sun.security.rsa.RSAKeyFactory.engineGeneratePublic(Unknown Source)
    at java.security.KeyFactory.generatePublic(Unknown Source)
    at uk.co.thomasc.steamkit.util.crypto.RSACrypto.init(RSACrypto.java:56)
    at uk.co.thomasc.steamkit.util.crypto.RSACrypto.<init>(RSACrypto.java:48)
    at info.voidwhisperer.steambot.BaseBot.doLogin(BaseBot.java:373)
    at info.voidwhisperer.steambot.BaseBot.<init>(BaseBot.java:94)
    at info.voidwhisperer.steambot.SteamBot.<init>(SteamBot.java:17)
    at info.voidwhisperer.steambot.Main.main(Main.java:9)
Caused by: java.security.InvalidKeyException: RSA keys must be at least 512 bits long
    at sun.security.rsa.RSAKeyFactory.checkKeyLengths(Unknown Source)
    at sun.security.rsa.RSAKeyFactory.checkRSAProviderKeyLengths(Unknown Source)
    at sun.security.rsa.RSAPublicKeyImpl.<init>(Unknown Source)
    at sun.security.rsa.RSAKeyFactory.generatePublic(Unknown Source)
    ... 8 more
Exception in thread "main" java.lang.NullPointerException
    at uk.co.thomasc.steamkit.util.crypto.RSACrypto.encrypt(RSACrypto.java:80)
    at info.voidwhisperer.steambot.BaseBot.doLogin(BaseBot.java:374)
    at info.voidwhisperer.steambot.BaseBot.<init>(BaseBot.java:94)
    at info.voidwhisperer.steambot.SteamBot.<init>(SteamBot.java:17)
    at info.voidwhisperer.steambot.Main.main(Main.java:9)

That is what happens when I'm attempting to use the method from doLogin on steamweb... I have JCE, so I'm not sure what the problem here is.

Top-Cat commented 10 years ago
at info.voidwhisperer.steambot.BaseBot.doLogin(BaseBot.java:373)
at info.voidwhisperer.steambot.BaseBot.<init>(BaseBot.java:94)
at info.voidwhisperer.steambot.SteamBot.<init>(SteamBot.java:17)
at info.voidwhisperer.steambot.Main.main(Main.java:9)

The issue is with the key you're passing from your code, which I can't see so I can't help...

VoidWhisperer commented 10 years ago

I fixed that error, because apparently in the code you have the modulus and exponent switched on the rsacrypto, resulting in that error.. However, now steam's login is denying it with returning { success: false }

Top-Cat commented 10 years ago

Interesting point, but I have it working the "wrong" way round. But again can't help without code.

VoidWhisperer commented 10 years ago

Are you sure it's 'still working'? Given the fact that the repository hasn't been updated in 8 months..

Top-Cat commented 10 years ago

Yes