title: AES Encrypt/Decrypt Mode
body: <p>I have a task to decrypt some AES encryped code as follow:</p>
  <p>key: bQeThWmYq3t6w9z$</p>
  <p>plain text: 6D5Q47W8</p>
  <p>encrypt: U2FsdGVkX18+sRkQkI3z/i4RQZbhALd7hKGZw4TmAaU=</p>
  <p>I use Crypto-JS lib, it works. Crypto-JS use CBC mode, Pkcs7 as default.
  But I use Python, PyCryptodome Lib. It didn't work and I don't know why ?.
  Does key need to be <code>key derivation</code> ?</p>
  <p>JS code:</p>
  <pre><code>var CryptoJS = require('crypto-js');
  
  var encrypted = CryptoJS.AES.encrypt(&quot;6D5Q47W8&quot;, &quot;bQeThWmYq3t6w9z$&quot;);
  
  console.log(encrypted.toString());
  var decrypted = CryptoJS.AES.decrypt('U2FsdGVkX18+sRkQkI3z/i4RQZbhALd7hKGZw4TmAaU=', &quot;bQeThWmYq3t6w9z$&quot;);
  var plaintext = decrypted.toString(CryptoJS.enc.Utf8);
  console.log(plaintext.toString());
  </code></pre>
  <p>Python Code</p>
  <pre><code>from hashlib import md5
  
  from Crypto.Cipher import AES
  from Crypto.Random import get_random_bytes
  from Crypto.Util.Padding import pad, unpad
  
  
  key = b'bQeThWmYq3t6w9z$'
  plain_text = '6D5Q47W8'
  
  cipher = AES.new(key, AES.MODE_CBC)
  
  print(cipher.encrypt(pad(plain_text.encode(), AES.block_size)))
  </code></pre>
  <p>Result in python: b'\xcd\x8f\xf6\xf9\x85fLr\xac\x8b\xbb\x11\xf6\xdc\x105'</p>