XTEA

XTEA Encryption

This encryption is divided in two phases, Auth Phase and Game Phase.

Every packet that uses this encryption gets encrypted and decrypted with the TEA algorithm and a TEA key.

The encryption works by having two XTEA keys, the first one (Referred as Auth phase key) is a static 16 bytes key used in the first stage of the communication, this key will be used until a Client has attempted to log in into a Channel (any core that is not an Auth one) with the login key method.

Once the client sends a Login packet to a channel, it will also send it’s encryptation keys where the server’s encryptation keys will be computed. The keys will be changed IMMEDIATLY, no extra packet or data is needed to change the keys.

This generated second keys are referred as Game phase keys.

The client computes it’s decryptation key (likewise, the server computes it’s encryptation key) by performing an XTEA of the encryptation key (decryptation key for the server) with a Special key.

Key list

Auth Phase keys

Auth phase keys (Both for encrypting and decrypting) Usage First number Second number Notes

Region

Key 1

Key 2

ASCII Representation

Worldwide

0x7473657474736574

0x7473657474736574

testtesttesttest

European servers

0x6867666538373635

0x6463626134333231

1234abcd5678efgh

Special keys

The Special key was generated by the Client and the Server during the login into the Game core, it is known that in very old version of M2 (such as the Korean 2003 beta) the following hardcoded key might be used rather than a random generated one.

Special keys Usage

First number

Second number

ASCII Representation

Korean server

0x6a6c48747854794a

0x726f484a566c4a48

JyTxtHljHJlVJHor