Sequence
- Client generates a random 20-character salt (from an 84-char alphabet, non-cryptographic
System.Random, the exact PRNG doesn’t matter to the server, only the resulting bytes do). - Salt is RSA-PKCS1v1.5-encrypted against the server’s public key (delivered fresh every check-version response as base64 DER, no PEM armor) → base64 → URL-safe → this is the
uuidPOST field. - The AES key is derived as
ASCII(lowercase_hex(MD5(salt))), 32 ASCII bytes, not the raw 16-byte MD5 digest. - The request body (form-encoded device/session fields) is AES-256-ECB-PKCS7 encrypted with that key → base64 → URL-safe → the
dataPOST field. (Effective key size is 256 bits despite the source visually settingKeySize = 128, .NET’sKeysetter silently overrides it based on the 32-byte key length actually assigned.) - Response: if the top-level JSON has a non-empty
binfield, decrypt it the same way (same salt-derived key) and re-parse as the same response shape.
Request fields
The plaintext form body that step 4 encrypts joins its fields with&, without URL-encoding. In 1.0.364 (static-analysis-only), the UnityWebRequest path sends:
uuid is the device id, not the outer uuid POST field that carries the RSA-encrypted salt. The BestHTTP path sends the same fields with newServer after gameuid, and goclient matches the BestHTTP order. platform is "Android" on Android and "iOS" on iOS. goclient sends "iOS" for an iOS session (iosMode) and "Android" otherwise, and the session’s zone as zone (empty only when no zone is known). The device fields follow the identity: an iOS session sends its captured device’s fromCountry and lang as country and lang (US and en without a capture) and an empty simOp; an Android one sends US, en and the SIM operator of the catalog phone its device id selects. isSimulator is always 0 and openCountry always US. How the client picks opt, and what the response’s code field means, are on Identity, login & session.
The crypto itself is unchanged in 1.0.364: RSA PKCS#1 v1.5, a 20-character salt, and AES-256-ECB keyed by hex(MD5(salt)), with URL-safe base64.
Go implementation
Same AES-ECB scheme, reused elsewhere. The identical
AESDecrypt function is reused, with a hardcoded key, to decrypt a server-pushed Lua snippet (init.add.data) that’s fed directly to an eval-equivalent (GameEntry.Lua.Env.DoString); the result goes back to the server in login.ext (see Identity, login & session). That snippet is an integrity challenge, so this project documents it as a protocol fact only and leaves the key out. Elsewhere the same client also uses a properly-chained AES-CBC-with-explicit-IV helper for a Zendesk webchat URL, so the ECB choice for GSL is a deliberate (if weak) design decision for that one path, not a general “forgot the IV” bug.