title: Easy to use Python encryption library/wrapper?
body: <p>I want to encrypt an arbitrary-length string with a password in Python. I would prefer <em>not</em> to deal with padding, key generation and IVs as I honestly don't know that much about cryptography yet and I'd like to avoid messing up. I'd also prefer using a well-known cypher as AES.</p>
  
  <p>My ideal library (let's call it MagicCrypt) would work like this:</p>
  
  <pre><code>from MagicCrypt import AES
  p = "plaintext"
  k = "password"
  crypt = AES(k)
  c = crypt.encrypt(p)
  p == crypt.decrypt(c) # True
  </code></pre>
  
  <p>I've checked <a href="http://pycrypto.org" rel="noreferrer">PyCrypto</a>, <a href="http://chandlerproject.org/Projects/MeTooCrypto" rel="noreferrer">m2crypto</a>, <a href="http://pypi.python.org/pypi/pycryptopp" rel="noreferrer">pycryptopp</a>, <a href="http://www.gnupg.org/related_software/gpgme/index.en.html" rel="noreferrer">GPGme</a> and <a href="http://www.keyczar.org" rel="noreferrer">keyczar</a>. Neither of them seem to offer this really easy to use mode. keyczar comes closest, but for some reason wants to use a keyset saved in a file-like object or something similar.</p>
  
  <p>As far as I know I'll have to resort to calling <code>mcrypt</code> with Popen, which does offer a mode that works exactly like this - part of the reason I'm guessing there's really no technical reason for this not to exist.</p>
  
  <p>Do you know of an easy to use, secure, crypto library for Python? If not, what's the easiest (yet secure) way of using any of the already mentioned libraries?</p>