title: Converting Rijndael encryption from python 2 to 3
body: <p>I am trying to update some code from python2 to 3 and have some issues with a specific encryption function. This is the python 2 code:</p>
  
  <pre><code>trans_raw = '6c9474469ddf7578f3e5ad8a4c703d99'
  raw_prime = '583423bbbf900e9a211664861e28c9f347835017'
  
  transkey = trans_raw.decode('hex')
  prime = raw_prime.decode('hex')[:16]
  
  r = rijndael.rijndael(transkey)
  result = r.encrypt(prime).encode('hex')
  
  print result
  
  #result = fa016bdda2f884d9126fc746f5a00714
  </code></pre>
  
  <p>the rijndael used in this function was from this: <a href="https://github.com/sectroyer/SmartCrypto/blob/master/PySmartCrypto/rijndael.py" rel="nofollow noreferrer">https://github.com/sectroyer/SmartCrypto/blob/master/PySmartCrypto/rijndael.py</a></p>
  
  <p>I have tried converting this to python3 but i dont feel like im coming anywhere close.
  This is what i have tried</p>
  
  <pre><code>trans_raw = '6c9474469ddf7578f3e5ad8a4c703d99'
  raw_prime = '583423bbbf900e9a211664861e28c9f347835017'
  
  transkey = binascii.unhexlify(trans_raw)
  prime = binascii.unhexlify(raw_prime)[:16]
  
  r = AES.new(transkey, AES.MODE_ECB)
  ciphertext = r.encrypt(prime)
  result = binascii.hexlify(ciphertext).decode('utf-8')
  print(result)
  
  #result = ba5a2b6bb7176dd321250e7d672b0a4a
  </code></pre>
  
  <p>i have tried using <a href="https://gist.github.com/jeetsukumaran/1291836#gistcomment-901601" rel="nofollow noreferrer">https://gist.github.com/jeetsukumaran/1291836#gistcomment-901601</a>
  which someone in the comments said was updated for python 3. I have also tried using the built in python AES.new(transkey, AES.MODE_ECB) but neither of those options return anything close to what i am looking for. Does anyone know what i am missing?</p>