def trend_xor_encode(str):
 key = 2824028996
 ret = ''
 pad = (4 - (len(str) % 4))
 if (pad == 4):
  pad = 0
 str += ('\x00' * pad)
 while str:
  dword = struct.unpack('<L', str[:4])[0]
  str = str[4:]
  dword ^= key
  ret += struct.pack('<L', dword)
  key = dword
 return ret

def trend_xor_encode ( str ) : key = 2824028996 ret = '' pad = ( 4 - ( len ( str ) % 4 ) ) if ( pad == 4 ) : pad = 0 str += ( '\x00' * pad ) while str : dword = struct . unpack ( '<L' , str [ : 4 ] ) [ 0 ] str = str [ 4 : ] dword ^= key ret += struct . pack ( '<L' , dword ) key = dword return ret
simple bidirectional xor "encryption" routine used by this service .