ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.
Difference between revisions of "XWIS:APGAR"
From ModEnc
m (True pw) |
|||
Line 1: | Line 1: | ||
− | APGAR is a token sent by a C&C game to tell XWIS | + | APGAR is a token sent by a C&C game to tell XWIS the players' password. The password is encrypted using a weak algorithm. |
Example (decrypted password "reneproj"): | Example (decrypted password "reneproj"): | ||
Line 6: | Line 6: | ||
</pre> | </pre> | ||
The closing zero seems to have a special function. | The closing zero seems to have a special function. | ||
+ | |||
+ | Algorithm to calculate encrypted password: | ||
+ | <pre> | ||
+ | string apgar(string input) { | ||
+ | lookup = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" | ||
+ | out = "" | ||
+ | i = 1 | ||
+ | while (i <= 8) { | ||
+ | left = input[i] | ||
+ | right = input[length[input] - i + 1] | ||
+ | |||
+ | x = left & 1 ? ((left << 1) ^ (left & 1)) & right : left ^ right | ||
+ | |||
+ | out += lookup[x & 63] | ||
+ | i++ | ||
+ | } | ||
+ | return out | ||
+ | } | ||
+ | </pre> | ||
[[Category:XWIS Protocol]] | [[Category:XWIS Protocol]] |
Revision as of 23:34, 18 June 2008
APGAR is a token sent by a C&C game to tell XWIS the players' password. The password is encrypted using a weak algorithm.
Example (decrypted password "reneproj"):
apgar Ykbcaxop 0
The closing zero seems to have a special function.
Algorithm to calculate encrypted password:
string apgar(string input) { lookup = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" out = "" i = 1 while (i <= 8) { left = input[i] right = input[length[input] - i + 1] x = left & 1 ? ((left << 1) ^ (left & 1)) & right : left ^ right out += lookup[x & 63] i++ } return out }