summaryrefslogtreecommitdiff
path: root/pipermail/pycrypto/2012q2/000600.html
blob: 2c6bddd0f89fa355f506ed06ed211433d60e311c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
 <HEAD>
   <TITLE> [pycrypto] Typo or bug?
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20Typo%20or%20bug%3F&In-Reply-To=%3CCAGfyce1rtehF8rrk0D7Edx0uMS4%2B2CbF_8sEdsdt_%3D7_t8dv3Q%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="000599.html">
   <LINK REL="Next"  HREF="000601.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[pycrypto] Typo or bug?</H1>
    <B>Legrandin</B> 
    <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20Typo%20or%20bug%3F&In-Reply-To=%3CCAGfyce1rtehF8rrk0D7Edx0uMS4%2B2CbF_8sEdsdt_%3D7_t8dv3Q%40mail.gmail.com%3E"
       TITLE="[pycrypto] Typo or bug?">gooksankoo at hoiptorrow.mailexpire.com
       </A><BR>
    <I>Tue Jun 26 05:52:50 EDT 2012</I>
    <P><UL>
        <LI>Previous message: <A HREF="000599.html">[pycrypto] Typo or bug?
</A></li>
        <LI>Next message: <A HREF="000601.html">[pycrypto] Typo or bug?
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#600">[ date ]</a>
              <a href="thread.html#600">[ thread ]</a>
              <a href="subject.html#600">[ subject ]</a>
              <a href="author.html#600">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>&gt;<i>
</I>&gt;<i>   encobj = AES.new(secret, AES.MODE_CFB)
</I>&gt;<i>   File &quot;/usr/lib64/python2.7/site-packages/Crypto/Cipher/blockalgo.py&quot;,
</I>&gt;<i> line 141, in __init__
</I>&gt;<i>   self._cipher = factory.new(key, *args, **kwargs)
</I>&gt;<i> ValueError: IV must be 16 bytes long
</I>&gt;<i>
</I>&gt;<i> So although the 'secret' is 16 bytes long, I'm getting a report saying it
</I>&gt;<i> isn't?
</I>&gt;<i>
</I>&gt;<i>
</I>Hi Dave,

The key is OK, but the IV is missing and it is mandatory for CFB.
Your code should be:

encobj = AES.new(secret, AES.MODE_CFB, some_iv)

where len(some_iv)==16.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: &lt;<A HREF="http://lists.dlitz.net/pipermail/pycrypto/attachments/20120626/7afc9474/attachment.html">http://lists.dlitz.net/pipermail/pycrypto/attachments/20120626/7afc9474/attachment.html</A>&gt;
</PRE>









<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="000599.html">[pycrypto] Typo or bug?
</A></li>
	<LI>Next message: <A HREF="000601.html">[pycrypto] Typo or bug?
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#600">[ date ]</a>
              <a href="thread.html#600">[ thread ]</a>
              <a href="subject.html#600">[ subject ]</a>
              <a href="author.html#600">[ 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>