Way back once upon a time in a land far far away there was a program known as ‘Pokemon Netbattle‘. This program had quite the history for mischief after the original developers left the scene, and the release of Pokemon Diamond and Pearl set the game up to die.
During this time many tools were released that exploited bugs in the program’s code that allowed servers and clients alike to be crashed, simply by sending malformed network packets. Several users at the time released either patched versions (using the leaked source code) or used packet filtering software to prevent the packets from ever being received. One of the things that hindered the few of us that made custom clients, however, is the encryption on the network protocol. This prevented the custom clients from being able to attack servers that enabled encryption between the server and clients. Today, after nearly a decade of non-use of this program and moving on to much better alternatives, I’ll explain how the encryption worked, with modern code samples.