diff options
Diffstat (limited to 'pipermail/pycrypto/2013q4/000737.html')
-rw-r--r-- | pipermail/pycrypto/2013q4/000737.html | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/pipermail/pycrypto/2013q4/000737.html b/pipermail/pycrypto/2013q4/000737.html new file mode 100644 index 0000000..8722f43 --- /dev/null +++ b/pipermail/pycrypto/2013q4/000737.html @@ -0,0 +1,126 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> + <HEAD> + <TITLE> [pycrypto] DES3 problem + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20DES3%20problem&In-Reply-To=%3CCAEncD4e3vq%3Dy0Xksc58%2B4x3j%3Di-nuyVBw2eZdA-%2BM0w56QgdOg%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="000736.html"> + <LINK REL="Next" HREF="000738.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[pycrypto] DES3 problem</H1> + <B>Dave Pawson</B> + <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20DES3%20problem&In-Reply-To=%3CCAEncD4e3vq%3Dy0Xksc58%2B4x3j%3Di-nuyVBw2eZdA-%2BM0w56QgdOg%40mail.gmail.com%3E" + TITLE="[pycrypto] DES3 problem">dave.pawson at gmail.com + </A><BR> + <I>Wed Nov 27 01:15:40 PST 2013</I> + <P><UL> + <LI>Previous message: <A HREF="000736.html">[pycrypto] DES3 problem +</A></li> + <LI>Next message: <A HREF="000738.html">[pycrypto] DES3 problem +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#737">[ date ]</a> + <a href="thread.html#737">[ thread ]</a> + <a href="subject.html#737">[ subject ]</a> + <a href="author.html#737">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>><i>From the lack of response, should I assume that DES3 isn't yet working? +</I> +TiA, DaveP + +On 24 November 2013 14:50, Dave Pawson <<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">dave.pawson at gmail.com</A>> wrote: +><i> <A HREF="https://www.dlitz.net/software/pycrypto/api/current/">https://www.dlitz.net/software/pycrypto/api/current/</A> states DES3 requires an iv. +</I>><i> +</I>><i> in the api docs the example uses DES not DES3? +</I>><i> +</I>><i> As an example, encryption can be done as follows: +</I>><i> +</I>>>>><i> from Crypto.Cipher import DES +</I>>>>><i> from Crypto import Random +</I>>>>><i> from Crypto.Util import Counter +</I>>>>><i> +</I>>>>><i> key = b'-8B key-' +</I>>>>><i> nonce = Random.new().read(DES.block_size/2) +</I>>>>><i> ctr = Counter.new(DES.block_size*8/2, prefix=nonce) +</I>>>>><i> cipher = DES.new(key, DES.MODE_CTR, counter=ctr) +</I>>>>><i> plaintext = b'We are no longer the knights who say ni!' +</I>>>>><i> msg = nonce + cipher.encrypt(plaintext) +</I>><i> +</I>><i> Using +</I>><i> iv=Random.new().read(DES3.block_size) +</I>><i> ciphere = DES3.new(key,mode,IV=iv) +</I>><i> +</I>><i> I'm getting +</I>><i> Traceback (most recent call last): +</I>><i> File "./tester.py", line 405, in testBlock5 +</I>><i> ciphere = DES3.new(key,mode,IV=iv) +</I>><i> File "/usr/lib64/python3.3/site-packages/Crypto/Cipher/DES3.py", +</I>><i> line 114, in new +</I>><i> return DES3Cipher(key, *args, **kwargs) +</I>><i> File "/usr/lib64/python3.3/site-packages/Crypto/Cipher/DES3.py", +</I>><i> line 76, in __init__ +</I>><i> blockalgo.BlockAlgo.__init__(self, _DES3, key, *args, **kwargs) +</I>><i> File "/usr/lib64/python3.3/site-packages/Crypto/Cipher/blockalgo.py", +</I>><i> line 155, in __init__ +</I>><i> raise ValueError("MODE_OPENPGP requires an IV") +</I>><i> ValueError: MODE_OPENPGP requires an IV +</I>><i> +</I>><i> Am I wrong in my usage or is the code incorrect please +</I>><i> wrt iv parameter? +</I>><i> +</I>><i> +</I>><i> Tia +</I>><i> +</I>><i> +</I>><i> +</I>><i> +</I>><i> +</I>><i> +</I>><i> -- +</I>><i> Dave Pawson +</I>><i> XSLT XSL-FO FAQ. +</I>><i> Docbook FAQ. +</I>><i> <A HREF="http://www.dpawson.co.uk">http://www.dpawson.co.uk</A> +</I> + + +-- +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="000736.html">[pycrypto] DES3 problem +</A></li> + <LI>Next message: <A HREF="000738.html">[pycrypto] DES3 problem +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#737">[ date ]</a> + <a href="thread.html#737">[ thread ]</a> + <a href="subject.html#737">[ subject ]</a> + <a href="author.html#737">[ 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> |