Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[C Source] GunBound Encrypt & Decrypt Rijndael AES

Junior Spellweaver
Joined
Nov 21, 2006
Messages
137
Reaction score
38
Hello, If you want to decrypt or encrypt gunbound packets you will need this at some point.
Rijndael is an AES Implementation used by GunBound to encrypt and decrypt packet's data.

*This is valid only for STATIC ENCRYPTED packets.

Just include Rijndael.cpp and Rijndael.h to your project and you will be able to use it.

Example functions:

Code:
#include "Rijndael.h"

// GunBound WC Static Key
const char PublicKey[16] = { 0xa9, 0x27, 0x53, 4, 0x1b, 0xfc, 0xac, 230, 0x5b, 0x23, 0x38, 0x34, 0x68, 70, 3, 140 };

char* RijndaelStaticEncrypt(char* PacketData)
{
     // Create Rijndael Objects and Key
     CRijndael oRijndael;
     oRijndael.MakeKey(PublicKey, CRijndael::sm_chain0, 16, 16);

     // Create output buffers
     char* oDataOut = new char[16];

     // Encrypt ECB    oRijndael.Encrypt(PacketData, oDataOut, 16, CRijndael::ECB);
     return oDataOut;
}

char* RijndaelStaticDecrypt(char* PacketData)
{
     // Create Rijndael Objects and Key
     CRijndael oRijndael;
     oRijndael.MakeKey(PublicKey, CRijndael::sm_chain0, 16, 16);

     // Create output buffers
     char* oDataOut = new char[strlen(PacketData) + 1];

     // Decrypt ECB
     oRijndael.Decrypt(PacketData, oDataOut, 16, CRijndael::ECB);    
     return oDataOut;
}

* You can only encrypt/decrypt 16 bytes at once. If the buffer to encrypt/decrypt is bigger then 16 bytes, you should split it, encrypt/decrypt separatedly and then merge both encrypted/decrypted 16 byte blocks.
 

Attachments

You must be registered for see attachments list
Last edited:
Back
Top