To all who gave me some of their time.<div><br></div><div>I've sorted the problem, it was how the IV was being fed into the byte array in AS3.</div><div><br></div><div>Thank you all for your help :)</div><div><br></div>
<div>Regards,</div><div>Joshua<br><br><div class="gmail_quote">On Wed, Jan 12, 2011 at 1:49 PM, Joshua Strauss <span dir="ltr"><<a href="mailto:joshua.a.strauss@gmail.com">joshua.a.strauss@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Legrandin,<div><br></div><div>I think you are on to something here. Removing the initialization vector from both pycrypto and as3crypto produces the same b64encoded output. I've been playing around with different IV's but I can only get the output to match without the presence of an IV.</div>
<div><br></div><div>This does lead me to believe that the IV is the source of my problem but if anyone can think of a reason why this might not be, it would be helpful to know as I don't want to be on the wrong track.</div>
<div><br></div><div>I haven't done much coding at the byte level (I'm mainly a web developer, and not seasoned by any means), I'll keep trucking from here I suppose.</div><div><br></div><div>Regards,</div><div>
Joshua</div><div><div></div><div class="h5"><div><br><div class="gmail_quote">On Wed, Jan 12, 2011 at 1:15 PM, Legrandin <span dir="ltr"><<a href="mailto:gooksankoo@hoiptorrow.mailexpire.com" target="_blank">gooksankoo@hoiptorrow.mailexpire.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>> var t_byAry:ByteArray = Hex.toArray( Hex.fromString( t_toEnc ) );<br>
> var t_key:ByteArray = Hex.toArray( Hex.fromString( 'Thisisthekey' ) );<br>
> var t_cbc:CBCMode = new CBCMode( new BlowFishKey( t_key ), new NullPad );<br>
</div><div>> t_cbc.IV = Hex.toArray( '30313233' );<br>
> t_cbc.encrypt( t_byAry );<br>
> t_enc = Base64.encodeByteArray( t_byAry );<br>
<br>
</div><div>> >>> from Crypto.Cipher import Blowfish<br>
> >>> B = Blowfish.new( 'Thisisthekey', Blowfish.MODE_CBC, '30313233' )<br>
<br>
</div>Could it be that in you AS code your IV is 4 bytes (0x30,0x31,0x32,0x33)<br>
which t_cbc.encrypt() silently pads, whereas in the python code it is 8<br>
different bytes (0x33 for '3', 0x30 for '0', etc)?<br>
<font color="#888888"><br>
Legrandin<br>
</font><div><div></div><div><br>
_______________________________________________<br>
pycrypto mailing list<br>
<a href="mailto:pycrypto@lists.dlitz.net" target="_blank">pycrypto@lists.dlitz.net</a><br>
<a href="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto" target="_blank">http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>