Cryptography

NetDragon's Asymmetric Authentication Cipher:
This cipher decrypts all packets in the Account and Game servers until patch 5018. In patch 5018, an additional cipher was added. Here's an example in C# by Sparkie:

Here are some more examples in C# by CptSky:

Blowfish Cipher:
This cipher decrypts all packets in the Game server for clients running on a patch from 5018 to 5508. Information on this cipher can be found here: Wikipedia You may choose to implement the cipher from the OpenSSL library (C++) or the managed OpenSSL wrapper library (C#). The source for OpenSSL can be found here. You may also find an example of the implementation in C# and C++ by CptSky:

Diffie-Hellman Key Exchange:
This exchange algorithm is used in all clients after patch 5017. It was introduced with the Blowfish Cipher. You can find information about the algorithm here. You may choose to implement the algorithm from the OpenSSL library (C++) or the managed OpenSSL wrapper library (C#). The source for OpenSSL can be found here. You may also find an implementation in C# by CptSky in his CO2_CORE_DLL library.

CAST-128 / CAST 5 Cipher:
This cipher decrypts all packets in the Game server for clients running on a patch from 5509 to the present client. Information on this cipher can be found here: Wikipedia You may choose to implement the cipher from the OpenSSL library (C++) or the managed OpenSSL wrapper library (C#). The source for OpenSSL can be found here. You may also find an example of the implementation in C# by CptSky:

Legacy Password Cipher:
This cipher decrypts the account holder's password from the Account Authentication Request packet (1051 or 1086 depending on the client version). This cipher was retired around patch 5174. Here is an example implementation of the cipher in C# by Tane:

Rivest Cipher 5:
This cipher decrypts the account holder's password from the Account Authentication Request packet (1086 or 1060 depending on the client version). This cipher was put in place around patch 5174 and retired around patch 5532. Here is an example of the cipher from CptSky in C#:

Additional Notes:
If you're having a hard time opening these files, try opening them with Notepad++. Download Link: Notepad++