diff options
Diffstat (limited to 'pipermail/pycrypto/2014q1/000767.html')
-rw-r--r-- | pipermail/pycrypto/2014q1/000767.html | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/pipermail/pycrypto/2014q1/000767.html b/pipermail/pycrypto/2014q1/000767.html new file mode 100644 index 0000000..4e48098 --- /dev/null +++ b/pipermail/pycrypto/2014q1/000767.html @@ -0,0 +1,95 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> + <HEAD> + <TITLE> [pycrypto] AES, python 2.7 vs 3 + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20AES%2C%20python%202.7%20vs%203&In-Reply-To=%3CCAEncD4ex63yBS4PGujXBF9G-JjdkfDpmzdB5AUK6whyOF%2BcvsA%40mail.gmail.com%3E"> + <META NAME="robots" CONTENT="index,nofollow"> + <style type="text/css"> + pre { + white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */ + } + </style> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="000766.html"> + <LINK REL="Next" HREF="000769.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[pycrypto] AES, python 2.7 vs 3</H1> + <B>Dave Pawson</B> + <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20AES%2C%20python%202.7%20vs%203&In-Reply-To=%3CCAEncD4ex63yBS4PGujXBF9G-JjdkfDpmzdB5AUK6whyOF%2BcvsA%40mail.gmail.com%3E" + TITLE="[pycrypto] AES, python 2.7 vs 3">dave.pawson at gmail.com + </A><BR> + <I>Mon Feb 3 06:56:24 PST 2014</I> + <P><UL> + <LI>Previous message: <A HREF="000766.html">[pycrypto] AES, python 2.7 vs 3 +</A></li> + <LI>Next message: <A HREF="000769.html">[pycrypto] AES, python 2.7 vs 3 +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#767">[ date ]</a> + <a href="thread.html#767">[ thread ]</a> + <a href="subject.html#767">[ subject ]</a> + <a href="author.html#767">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>On 3 February 2014 14:51, Mirko Dziadzka <<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">mirko.dziadzka at gmail.com</A>> wrote: +><i> Hi +</I>><i> +</I>><i> Without testing or verifying: +</I>><i> +</I>><i> You should probably use bytes in Python 3, not characters. +</I>><i> +</I>>><i> v = ''.join(chr(random.randint(0, 0xFF)) for i in range(16)) +</I>><i> +</I>><i> creates a string of 16 (unicode) characters in Python 3 +</I>><i> +</I>><i> iv = os.urandom(16) +</I>><i> +</I>><i> creates 16 bytes +</I>><i> +</I>><i> Mirko +</I> +Which is what I had (and works fine in 2.7) + +iv = Random.new().read(AES.block_size) +seems to work OK in 3.3 + + +regards + +-- +Dave Pawson +XSLT XSL-FO FAQ. +Docbook FAQ. +<A HREF="http://www.dpawson.co.uk">http://www.dpawson.co.uk</A> +</PRE> + + + + + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="000766.html">[pycrypto] AES, python 2.7 vs 3 +</A></li> + <LI>Next message: <A HREF="000769.html">[pycrypto] AES, python 2.7 vs 3 +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#767">[ date ]</a> + <a href="thread.html#767">[ thread ]</a> + <a href="subject.html#767">[ subject ]</a> + <a href="author.html#767">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">More information about the pycrypto +mailing list</a><br> +</body></html> |