Logging into steamcommunity with python

Does anyone else have experience with that? I tried implement the login as descripted here, but I think I'm doing something wrong with the RSA key - I don't have much experience with cryptography.

Here's my code -- it's a mess, but I got kinda frustrated with it and uploaded it the way I left it.

Does anyone have any idea what I'm doing wrong? Specifically about the private key generation, I'm not sure if the way I'm doing is the correct one.

Posted Nov 13, 2012, 8:03 PM UTC

44
tritao•

I've done this in C# by using Valve's own JS code for the RSA part. I'm attaching an HTTP Node server that you can use to request the encrypted password.

https://dl.dropbox.com/u/194502/dev/NodeSteamLogin.zip

1
rodddsOPdeveloper•

Cool, I'll have to check that out.

I thought about using that too, but I really wanted to find a solution that uses pure python without adding another dependency, much less a dependency from another programming language!

I guess my greatest problem is that I have no idea how RSA works and how to recognize a successfully generated public key - there are a lot of details like padding and stuff that flies right by me.

I'll give your server a try, maybe I'll translate their code to python and see if I hammer it enough it comes out working.

Thanks!

1
tritao•

I tried making it work as pure C# by porting Valve's JS code, but after a few hours I could not make it work, and was actually starting to read the RSA RFC's. Also beware that the web site login can ocasionally ask for captchas.

At that point I just said screw it, and made a server in Node in 5 minutes. For the record I don't even use this method anymore, since I found how to do it the way the Steam client does it. This way only works with SteamKit though.

Good luck though.

1
rodddsOPdeveloper•

Thanks.

Yeah, the capcha part wasn't actually that difficult to figure out, I just can't for the life of me make it accept the key I generate. And that crossed my mind too, but I reeeeeeally didn't want to go into that rabbit hole of RFCs.

I don't know, maybe I'll take a look at SteamKit. Thanks for sharing your experience!

1