diff options
Diffstat (limited to 'pipermail/pycrypto/attachments/20110112/efd8b675/attachment-0001.htm')
-rw-r--r-- | pipermail/pycrypto/attachments/20110112/efd8b675/attachment-0001.htm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/pipermail/pycrypto/attachments/20110112/efd8b675/attachment-0001.htm b/pipermail/pycrypto/attachments/20110112/efd8b675/attachment-0001.htm new file mode 100644 index 0000000..bac6514 --- /dev/null +++ b/pipermail/pycrypto/attachments/20110112/efd8b675/attachment-0001.htm @@ -0,0 +1,35 @@ +<tt> +To all who gave me some of their time.<div><br></div><div>I&#39;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><br> +<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">&lt;<a href="mailto:joshua.a.strauss@gmail.com">joshua.a.strauss@gmail.com</a>&gt;</span> wrote:<br><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&#39;ve been playing around with different IV&#39;s but I can only get the output to match without the presence of an IV.</div><br> +<br> +<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&#39;t want to be on the wrong track.</div><br> +<br> +<div><br></div><div>I haven&#39;t done much coding at the byte level (I&#39;m mainly a web developer, and not seasoned by any means), I&#39;ll keep trucking from here I suppose.</div><div><br></div><div>Regards,</div><div><br> +<br> +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">&lt;<a href="mailto:gooksankoo@hoiptorrow.mailexpire.com" target="_blank">gooksankoo@hoiptorrow.mailexpire.com</a>&gt;</span> wrote:<br><br> +<br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>&gt; var t_byAry:ByteArray = Hex.toArray( Hex.fromString( t_toEnc ) );<br><br> +&gt; var t_key:ByteArray = Hex.toArray( Hex.fromString( &#39;Thisisthekey&#39; ) );<br><br> +&gt; var t_cbc:CBCMode = new CBCMode( new BlowFishKey( t_key ), new NullPad );<br><br> +</div><div>&gt; t_cbc.IV = Hex.toArray( &#39;30313233&#39; );<br><br> +&gt; t_cbc.encrypt( t_byAry );<br><br> +&gt; t_enc = Base64.encodeByteArray( t_byAry );<br><br> +<br><br> +</div><div>&gt; &gt;&gt;&gt; from Crypto.Cipher import Blowfish<br><br> +&gt; &gt;&gt;&gt; B = Blowfish.new( &#39;Thisisthekey&#39;, Blowfish.MODE_CBC, &#39;30313233&#39; )<br><br> +<br><br> +</div>Could it be that in you AS code your IV is 4 bytes (0x30,0x31,0x32,0x33)<br><br> +which t_cbc.encrypt() silently pads, whereas in the python code it is 8<br><br> +different bytes (0x33 for &#39;3&#39;, 0x30 for &#39;0&#39;, etc)?<br><br> +<font color="#888888"><br><br> +Legrandin<br><br> +</font><div><div></div><div><br><br> +_______________________________________________<br><br> +pycrypto mailing list<br><br> +<a href="mailto:pycrypto@lists.dlitz.net" target="_blank">pycrypto@lists.dlitz.net</a><br><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><br> +</div></div></blockquote></div><br></div><br> +</div></div></blockquote></div><br></div><br> + +</tt> |