diff options
Diffstat (limited to 'pipermail/pycrypto/attachments/20110516/07a6ddd9/attachment.html')
-rw-r--r-- | pipermail/pycrypto/attachments/20110516/07a6ddd9/attachment.html | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pipermail/pycrypto/attachments/20110516/07a6ddd9/attachment.html b/pipermail/pycrypto/attachments/20110516/07a6ddd9/attachment.html new file mode 100644 index 0000000..1afd081 --- /dev/null +++ b/pipermail/pycrypto/attachments/20110516/07a6ddd9/attachment.html @@ -0,0 +1,7 @@ +<tt> +Hello,<br><br>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. For example:<br><br>from Crypto.Cipher import AES<br>foo = AES.new(&#39;a1b2c3d4e5f6g7h8&#39;, AES.MODE_ECB)<br><br> +bar=u&#39;&#39;<br>for i in range(0,16):<br> bar+=unichr(255)<br># At this point, bar is<br># u&#39;\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff&#39;<br>baz=foo.encrypt(bar.encode(&#39;utf-8&#39;))<br><br> +blah=foo.decrypt(baz)<br># baz is now<br># &#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>How can I get encrypt and decrypt to use UTF gracefully?<br><br> +<br>Thank you,<br>Tom<br><br> + +</tt> |