/* Optima API FTP Servers password encryption algorithm 0.1 by Luigi Auriemma e-mail: aluigi@autistici.org web: aluigi.org example of packet on port 10260: 0x03ea type 0x0009 opcode 0xff value used to encrypt the password (c) 0x05 length of the password (len) ????? encrypted password (data) */ static const unsigned char apiftpserver_table[] = "\x20\x09\x0e\x9b\x1e\x9c\x76\x7b\xc8\x67\x10\x06\xde\x3d\x1d\xdd" "\x22\xbf\xbc\x36\x26\xc6\xda\x30\x12\x1b\x71\x68\x9d\x6d\x82\x6c" "\x0d\x78\x96\xdc\xb5\x66\xf0\xeb\x07\x86\xd5\x34\x73\x28\xa8\xab" "\x80\xf5\x5c\xb4\x5f\x74\x60\x17\x18\xfc\xc0\xe2\x6a\x7e\x53\x84" "\x89\x13\x50\x37\x45\x4c\xec\x3a\x81\x62\xd6\x92\xe8\x2c\xe5\x29" "\x2e\x51\xac\xcd\x4f\xc7\xb2\x56\x1f\x4d\x3b\x8c\xea\x47\x44\x9a" "\x8a\x05\x97\x94\x00\xc5\x52\x19\x8e\xad\x24\x8d\x93\x69\x85\x59" "\x11\xb7\xb8\xf3\xa5\x4e\xd0\x04\x1a\x41\x8f\xe4\x7d\x3e\x5e\x8b" "\x98\xb1\xfa\xf4\xa9\x70\xd8\xbd\x42\xa1\x0b\xc2\xdf\x83\x6b\x99" "\x9f\x5d\xfd\x77\xa3\x2a\xa2\x32\x27\x7a\xcf\xfe\xe0\x3f\x35\xb3" "\xc3\xff\xf2\xe1\x9e\x87\xfb\xe7\xce\x58\xb9\xae\x0f\xaf\x61\xef" "\x38\x65\xf1\xd7\xb0\x1c\xd9\x6f\x2f\xd1\x16\x21\xed\x0a\xf9\xba" "\x63\x75\x7f\x95\x3c\x5a\xbe\x4a\x46\x25\x79\x2b\x48\x03\xa7\xa6" "\x02\x43\xc4\xe3\x0c\xe6\x33\xdb\xc9\x72\x54\xf6\x88\x01\x49\x55" "\xd2\x23\xc1\xb6\x7c\xaa\x2d\xe9\x4b\x40\xbb\xa0\x90\xca\xd4\xf8" "\xcb\x08\xf7\x39\x6e\xee\x5b\x57\x14\x31\x64\xd3\x91\x15\xcc\xa4"; void apiftpserver_decrypt(unsigned char c, unsigned char *data, int len) { int i; for(i = 0; i < len; i++) { data[i] = ((data[i] ^ 0xff) - c) + apiftpserver_table[i & 0xff]; } } void apiftpserver_encrypt(unsigned char c, unsigned char *data, int len) { int i; for(i = 0; i < len; i++) { data[i] = ((data[i] - apiftpserver_table[i & 0xff]) + c) ^ 0xff; } }