diff options
Diffstat (limited to 'pipermail/pycrypto/attachments/20110516/32f2687e/attachment-0001.htm')
-rw-r--r-- | pipermail/pycrypto/attachments/20110516/32f2687e/attachment-0001.htm | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/pipermail/pycrypto/attachments/20110516/32f2687e/attachment-0001.htm b/pipermail/pycrypto/attachments/20110516/32f2687e/attachment-0001.htm new file mode 100644 index 0000000..232fc24 --- /dev/null +++ b/pipermail/pycrypto/attachments/20110516/32f2687e/attachment-0001.htm @@ -0,0 +1,48 @@ +<tt> +Those worked. Thanks.<br><br><div class="gmail_quote">On Mon, May 16, 2011 at 3:54 PM, Lorenz Quack <span dir="ltr">&lt;<a href="mailto:don@amberfisharts.com">don@amberfisharts.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br> +Hi Thomas,<br><br> +<br><br> +what about either:<br><br> +<br><br> +blah=foo.decrypt(baz).decode(&quot;utf-8&quot;)<br><br> +<br><br> +or<br><br> +<br><br> +blah=unicode(foo.decrypt(baz), &quot;utf-8&quot;)<br><br> +<br><br> +cheers,<br><br> +Lorenz<br><br> +<div><div></div><div class="h5"><br><br> +On 05/16/2011 09:18 PM, Thomas Knox wrote:<br><br> +&gt; Hello,<br><br> +&gt;<br><br> +&gt; I&#39;m building an application in Python 2.7.1 using PyCrypto 2.3, and it&#39;s behaving badly with utf-8 and utf-16 strings.<br><br> +&gt; For example:<br><br> +&gt;<br><br> +&gt; from Crypto.Cipher import AES<br><br> +&gt; foo = AES.new(&#39;a1b2c3d4e5f6g7h8&#39;, AES.MODE_ECB)<br><br> +&gt; bar=u&#39;&#39;<br><br> +&gt; for i in range(0,16):<br><br> +&gt; bar+=unichr(255)<br><br> +&gt; # At this point, bar is<br><br> +&gt; # u&#39;\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff&#39;<br><br> +&gt; baz=foo.encrypt(bar.encode(&#39;utf-8&#39;))<br><br> +&gt; blah=foo.decrypt(baz)<br><br> +&gt; # baz is now<br><br> +&gt; #<br><br> +&gt; &#39;\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf\xc3\xbf&#39;<br><br> +&gt;<br><br> +&gt; How can I get encrypt and decrypt to use UTF gracefully?<br><br> +&gt;<br><br> +&gt; Thank you,<br><br> +&gt; Tom<br><br> +&gt;<br><br> +&gt;<br><br> +<br><br> +</div></div>_______________________________________________<br><br> +pycrypto mailing list<br><br> +<a href="mailto:pycrypto@lists.dlitz.net">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> +</blockquote></div><br><br> + +</tt> |