- 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:
* 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.
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: