title: Blowfish decryption in python of string encoded by javax.crypto
body: <p>Using the code found at <a href="https://raw.github.com/usefulfor/usefulfor/master/security/JBoss.java" rel="nofollow">https://raw.github.com/usefulfor/usefulfor/master/security/JBoss.java</a>, I did thefollowing:</p>
  
  <pre><code>bash-3.2$ java -cp . JBoss -e testpython
  -27038292d345798947e2852756afcf0a
  bash-3.2$ java -cp . JBoss -d -27038292d345798947e2852756afcf0a
  testpython
  </code></pre>
  
  <p>However, I can't for the life of me, figure out how to decrypt the string '27038292d345798947e2852756afcf0a' using pycrypto in python.  My understanding is that the Java code is using Blowfish, and the phrase 'jaas is the way' as the key for the cipher.  But I can't make any sense of how to do this in python.  The following results in mostly unprintable garbage:</p>
  
  <pre><code>import Crypto
  from Crypto.Cipher import Blowfish
  from base64 import b64encode, b64decode
  
  bs        = Blowfish.block_size
  key       = 'jaas is the way'
  plaintext = b'27038292d345798947e2852756afcf0a'
  iv        = '\0' * 8
  
  c1 = Blowfish.new(key, Blowfish.MODE_ECB)
  c2 = Blowfish.new(key, Blowfish.MODE_CBC, iv)
  c3 = Blowfish.new(key, Blowfish.MODE_CFB, iv)
  c4 = Blowfish.new(key, Blowfish.MODE_OFB, iv)
  
  msg1 = c1.decrypt(plaintext)
  msg2 = c2.decrypt(plaintext)
  msg3 = c3.decrypt(plaintext)
  msg4 = c4.decrypt(plaintext)
  
  print "msg1 = %s\n" % msg1
  print "msg2 = %s\n" % msg2 
  print "msg3 = %s\n" % msg3 
  print "msg4 = %s\n" % msg4 
  </code></pre>
  
  <p>What am I missing ?</p>
  
  <p>thanks.</p>