summaryrefslogtreecommitdiff
path: root/pipermail/pycrypto/2012q1/000544.html
blob: bedc810e7826ca5a2fc0493d75ea0c3a4164f482 (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
91
92
93
94
95
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
 <HEAD>
   <TITLE> [pycrypto] same RSA.construct fails on OSX
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20same%20RSA.construct%20fails%20on%20OSX&In-Reply-To=%3CCAGfyce0Q%3DDtQscTAFLD7kqj3DX4DD9HOKksA7tsYDdsArWTATg%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="000543.html">
   <LINK REL="Next"  HREF="000545.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[pycrypto] same RSA.construct fails on OSX</H1>
    <B>Legrandin</B> 
    <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20same%20RSA.construct%20fails%20on%20OSX&In-Reply-To=%3CCAGfyce0Q%3DDtQscTAFLD7kqj3DX4DD9HOKksA7tsYDdsArWTATg%40mail.gmail.com%3E"
       TITLE="[pycrypto] same RSA.construct fails on OSX">gooksankoo at hoiptorrow.mailexpire.com
       </A><BR>
    <I>Fri Jan 20 10:22:50 EST 2012</I>
    <P><UL>
        <LI>Previous message: <A HREF="000543.html">[pycrypto] same RSA.construct fails on OSX
</A></li>
        <LI>Next message: <A HREF="000545.html">[pycrypto] same RSA.construct fails on OSX
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#544">[ date ]</a>
              <a href="thread.html#544">[ thread ]</a>
              <a href="subject.html#544">[ subject ]</a>
              <a href="author.html#544">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>Hi Antoine,

&gt;<i> I've just found that simply removing p (or 'd' as it should be called..)
</I>&gt;<i> is enough to fix it, so the code becomes:
</I>&gt;<i> if d==0:
</I>&gt;<i> &#160;k = RSA.construct((long(m), long(e)))
</I>&gt;<i> else:
</I>&gt;<i> &#160;k = RSA.construct((long(m), long(e), long(d)))
</I>
In the first case you generate a public key no matter which library
you have installed.
In the second case you generate a private key, but only if you are on 2.5.

Do you need a public key or a private key?

If you need a public key, just use 2 arguments.
If you need a private key and you want it to work with all pycrypto
versions, go and look for the remaining 2 parameters (p and q)... ;-)

&gt;&gt;<i> With previous version you had to provide at least 5 elements,
</I>&gt;&gt;<i> m+e+d+p+q (I don't recall how they complain if you provide only 3).
</I>&gt;<i> According to the docs, it's 2 minimum (as above), anyone know if the
</I>&gt;<i> code above is going to have problems running on distros with old
</I>&gt;<i> versions of pycrypto?
</I>
I would simply assume it will have problem with previous versions:
it's clearly off spec for them.
</PRE>









<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="000543.html">[pycrypto] same RSA.construct fails on OSX
</A></li>
	<LI>Next message: <A HREF="000545.html">[pycrypto] same RSA.construct fails on OSX
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#544">[ date ]</a>
              <a href="thread.html#544">[ thread ]</a>
              <a href="subject.html#544">[ subject ]</a>
              <a href="author.html#544">[ 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>