[pycrypto] Re: jibberish output with blowfish cbc
tannhauser at nerdshack.com
Sat Feb 14 13:59:04 CST 2009
another case, where i had to write to a list before i see my error.
if i see this right, when i decrypted, decrypt() had no idea what the iv is.
si, changing this solved my problem.
On Sat, 14.02, 20:37, tannhauser wrote:
> i use the latest release of amk.ca, v2.0.1 and python 2.6.1.
> i have a problem when using blowfish with the cbc-mode.
> some example code:
> #!/usr/bin/env python
> from Crypto.Cipher import Blowfish
> key = 'xyz123'
> iv = 'aaaaaaaa'
> obj = Blowfish.new(key, Blowfish.MODE_CBC, iv)
> # use misspelling as padding technique
> plain = 'yet another test sentenc'
> ciph = obj.encrypt(plain)
> # decrypt
> plain = obj.decrypt(ciph)
> print plain
> obviously, "print plain" should give me "yet another test sentenc"
> well, it does not, instead the first 8 characters are something
> jibberish, the rest is ok: "ڦ¼obf²her test sentenc". i don't have that
> problem with MODE_ECB.
> any ideas?
> pycrypto mailing list
> pycrypto at lists.dlitz.net
---end quoted text---
More information about the pycrypto