title: Decryption works with a IV that is String.getBytes(), but fails SecureRandom.generateSeed()
body: <p>I'm figuring out how to do cross platform (Android &amp; Python) encryption&amp;decryption using <code>AES</code>, and I seem to succeed transferring data if I use a <code>String</code> based IV. But immediately if I switch to using bytes generated with <code>SecureRandom.generateSeed()</code>, it goes awry. 
  The secret keys are preshared.</p>
  
  <p>Working Android code (try/catch blocks removed to keep it short):</p>
  
  <pre><code>String SecretKey = "0123456789abcdef";
  String iv = "fedcba9876543210";
  
  IvParameterSpec ivspec = new IvParameterSpec(iv.getBytes());
  SecretKeySpec keyspec = new SecretKeySpec(SecretKey.getBytes(), "AES");
  Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
  
  //Initialize the cipher
  cipher.init(Cipher.ENCRYPT_MODE, keyspec, ivspec); 
  
  String message = "What's up?";
  byte[] encrypted = cipher.doFinal(message.getBytes());
  
  //Send the data
  outputStream.write(encrypted);
  </code></pre>
  
  <p>There is a small transfer header that let's the client know the size of the incoming message, but I thought it's not relevant and I left that out.
  The Python code receiving this message looks like:</p>
  
  <pre><code>#Predefined:
  unpad = lambda s : s[0:-ord(s[-1])]
  
    encrypted = cs.recv(messagesize) # Receive the encrypted message
    iv = encrypted[:16]
  
    key = AES.new('0123456789abcdef', AES.MODE_CBC,IV=iv)
    padded_msg  = key.decrypt(encrypted[16:])
    decrypted = unpad(padded_msg) #Remove padding
  
    print "read [%s]" % decrypted
  </code></pre>
  
  <p>Result looks like:</p>
  
  <pre><code>read [What's up]
  </code></pre>
  
  <p>And if I change two lines in Java code:</p>
  
  <pre><code>SecureRandom rnd = new SecureRandom();
  IvParameterSpec ivspec = new IvParameterSpec(rnd.generateSeed(16));
  </code></pre>
  
  <p>Python output becomes:</p>
  
  <pre><code>read [?=H��m��lڈ�1ls]
  </code></pre>
  
  <p>I wonder what changes with the SecureRandom? I read that by default the String.getBytes() return platform default encoding (for <code>Android 4.0</code>), so I wonder if I have to do some manipulation on Python end to the IV that was generated with SecureRandom..?</p>