summaryrefslogtreecommitdiff
path: root/pipermail/pycrypto/2013q4/000750.html
diff options
context:
space:
mode:
Diffstat (limited to 'pipermail/pycrypto/2013q4/000750.html')
-rw-r--r--pipermail/pycrypto/2013q4/000750.html103
1 files changed, 103 insertions, 0 deletions
diff --git a/pipermail/pycrypto/2013q4/000750.html b/pipermail/pycrypto/2013q4/000750.html
new file mode 100644
index 0000000..63aee7c
--- /dev/null
+++ b/pipermail/pycrypto/2013q4/000750.html
@@ -0,0 +1,103 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+ <HEAD>
+ <TITLE> [pycrypto] AES, MODE_CTR
+ </TITLE>
+ <LINK REL="Index" HREF="index.html" >
+ <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20AES%2C%20MODE_CTR&In-Reply-To=%3CCAEncD4cEuH4VpEMGRg8%3DA%2BtCztfjBtPZpyPvREV2TddOg36TUw%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="000749.html">
+
+ </HEAD>
+ <BODY BGCOLOR="#ffffff">
+ <H1>[pycrypto] AES, MODE_CTR</H1>
+ <B>Dave Pawson</B>
+ <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20AES%2C%20MODE_CTR&In-Reply-To=%3CCAEncD4cEuH4VpEMGRg8%3DA%2BtCztfjBtPZpyPvREV2TddOg36TUw%40mail.gmail.com%3E"
+ TITLE="[pycrypto] AES, MODE_CTR">dave.pawson at gmail.com
+ </A><BR>
+ <I>Thu Dec 5 23:24:42 PST 2013</I>
+ <P><UL>
+ <LI>Previous message: <A HREF="000749.html">[pycrypto] AES, MODE_CTR
+</A></li>
+
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#750">[ date ]</a>
+ <a href="thread.html#750">[ thread ]</a>
+ <a href="subject.html#750">[ subject ]</a>
+ <a href="author.html#750">[ author ]</a>
+ </LI>
+ </UL>
+ <HR>
+<!--beginarticle-->
+<PRE>On 5 December 2013 19:41, Legrandin &lt;<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">helderijs at gmail.com</A>&gt; wrote:
+&gt;&gt;<i>Thanks Richard. Now working
+</I>&gt;&gt;<i> def test_AES5(self):
+</I>&gt;&gt;<i> pt=b' '*10
+</I>&gt;&gt;<i> ctr=Counter.new(128)
+</I>&gt;&gt;<i> iv = Random.new().read(AES.block_size)
+</I>&gt;&gt;<i> cipher = AES.new(b' '*16, AES.MODE_CTR, IV=iv, counter=ctr)
+</I>&gt;&gt;<i> ct = cipher.encrypt(pt)
+</I>&gt;&gt;<i> ctrr=Counter.new(128)
+</I>&gt;&gt;<i> decipher = AES.new(b' '*16, AES.MODE_CTR, IV=iv, counter=ctrr)
+</I>&gt;&gt;<i> ptr = decipher.decrypt(ct)
+</I>&gt;&gt;<i> self.assertEqual(pt,ptr)
+</I>&gt;&gt;<i> iv added as suggested.
+</I>&gt;<i>
+</I>&gt;<i> Actually, the IV parameter is ignored in Counter mode.
+</I>&gt;<i> If you want to add a nonce to the counter block you must pass it to
+</I>&gt;<i> the Counter class:
+</I>&gt;<i>
+</I>&gt;<i> nonce = Random.new().read(8)
+</I>&gt;<i> ctr = Counter.new(64, nonce)
+</I>&gt;<i> cipher = AES.new(b' '*16, AES.MODE_CTR, counter=ctr)
+</I>&gt;<i>
+</I>&gt;<i> The counter block is then made up by 64 bits of nonce and 64 bits of counter.
+</I>
+Another undocumented feature?
+Sigh.
+
+
+
+
+&gt;<i>
+</I>&gt;<i> PS: I think I get 1 out of 3 messages out of this mailing list.
+</I>
+Your email system or the server?
+It seems that the repo owner and the mailing list are both
+somewhat lax.
+
+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="000749.html">[pycrypto] AES, MODE_CTR
+</A></li>
+
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#750">[ date ]</a>
+ <a href="thread.html#750">[ thread ]</a>
+ <a href="subject.html#750">[ subject ]</a>
+ <a href="author.html#750">[ 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>