reedlaw / ruby-mmo

Ruby MMO: massively multiplayer online programming challenge
274 stars 102 forks source link

add counter measures to @DanKnox's cracking attempt #78

Closed ghost closed 12 years ago

ghost commented 12 years ago

Added counter-measures for @DanKnox's attack vector. Stack check verifies that :set_target only comes from secure_bot_net.rb so that a straight call to :set_target no longer reveals any information unless one of my bots is making the call. There are still some other attack vectors but I'll leave that as an exercise for @DanKnox.

reedlaw commented 12 years ago

This is extremely slow and in my 4 test runs, @DanKnox still comes out on top.

ghost commented 12 years ago

I'm not causing the slowdown. Xor is an extremely cheap operation even with BigInt. The reason it's slow is because @DanKnox is going through a whole bunch of numbers and trying to see if each one is the first secret key. Anyway I'm done with the redesign so I'll send a pull request that removes the entire set of secret identifiers.

DanKnox commented 12 years ago

In my tests, my player caused no noticeable slowdown whatsoever. Iterating through the numbers to find the key is actually quite cheap. My code didn't need to perform any of the calculations that @davidk01's player was performing, as I was matching it against the stored result of his initial calculations. Initial tests of my cracking loop all took far less than a second and are merely exploiting the fact that numbers don't work well as encrypted keys no matter how many calculations you perform to derive them.

However, I understand this trend is not sustainable and I am more than happy to revert my player if it is still causing problems on your end.

DanKnox commented 12 years ago

I also haven't had time to test my player against this new update to his bot net. So far it is looking like he may have blocked all legitimate attacks.

DanKnox commented 12 years ago

Nevermind. I guess @davidk01 already reverted my player for me in his most recent pull request.