title: how to decrypt a file in python which was encrypted using openssl
body: <p>I encrypted a file using <code>openssl</code> using the below command</p>
  
  <pre><code>cat input.txt
  hello world
  openssl aes-256-cbc -pass pass:'00112233445566778899aabbccddeeff' -iv a2a8a78be66075c94ca5be53c8865251 -nosalt -base64 -in input.txt -out output.txt
  cat output.txt
  pt7DqtAwtTjPbTlzVApucQ==
  </code></pre>
  
  <p>How can i decrypt the file using python Crypto package. I tried the below and it didn't work. </p>
  
  <pre><code>&gt;&gt;&gt; from Crypto.Cipher import AES
  &gt;&gt;&gt; from base64 import b64decode
  &gt;&gt;&gt; with open('output.txt') as f:
  ...     aes = AES.new('00112233445566778899aabbccddeeff', AES.MODE_CBC, IV='a2a8a78be66075c94ca5be53c8865251'.decode('hex'))
  ...     print(aes.decrypt(b64decode(f.read())))
  ...
  L�|�L   ��O�*$&amp;9�
  </code></pre>
  
  <p>I need a way to encrypt a file using openssl aes-256-cbc cipher and decrypt in python</p>