Gw2 client use RC4 encryption and Diffie-Hellman key exchange. So, I tell you about this crypto system.
1) At the server side:
a_server - (random) server private key;
g ^ (a_server) mod prime - server public key;
2) At the client side (the moment of exchange):
private - client private key;
public ^ private mod prime - shared key(Diffie-Hellman);
y_client (g ^ private mod prime) - client public key;
3) Client send y_client to the server;
4) At the server side (the moment of exchange):
y_client^
x_server mod prime - shared key(Diffie-Hellman).
The size of public, prime and private key is 64 byte(512bit).
Prime is the constant of this schema, public key is static and private key is generating at process run.
There you go.