title: Python AES decrypt string end with different char
body: <p>I have an input string and I'm encrypting it with MySQL's <code>AES_ENCRYPT</code> and then decrypting it with python (not mysql <code>AES_DECRYPT</code>). I printed out some tests of the decrypted string:</p>
  
  <pre><code>print decrypt_string
  print "%sxxx" % decrypt_string
  print len(decrypt_string)
  print self.toHex(decrypt_string)
  </code></pre>
  
  <p>When the input string length is 8, i.e. abcdefgh, the tests output will be:</p>
  
  <pre><code>abcdefgh
  xxxdefgh
  16
  0x610x620x630x640x650x660x670x680x80x80x80x80x80x80x80x8
  </code></pre>
  
  <p>If input string length is 7, i.e. abcdefg:</p>
  
  <pre><code>abcdefg                                 
  abcdefg                                 xxx
  16
  0x610x620x630x640x650x660x670x90x90x90x90x90x90x90x90x9
  </code></pre>
  
  <p>I found out that the ending char progressively decreases while the length of input string increases. Why is there a difference? If I use PHP AES encrypt instead of MySQL AES_ENCRYPT, the ending char will be 0x00. I am using use a third party <a href="http://www.josh-davis.org/pythonAES" rel="nofollow">python AES lib</a>.</p>