XWIS:APGAR: Difference between revisions
Appearance
en>Gordon-creAtive m True pw |
No edit summary |
||
| 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
}