blob: 4d938406cb429219f8a6544a207d98eab597dd2e (
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
96
97
98
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [pycrypto] Public key algos usage
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20Public%20key%20algos%20usage&In-Reply-To=bc7b5ef50911160607l37f73f6bsae0a000cdca6ead3%40mail.gmail.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="000160.html">
<LINK REL="Next" HREF="000162.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[pycrypto] Public key algos usage</H1>
<B>Lorenz Quack</B>
<A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20Public%20key%20algos%20usage&In-Reply-To=bc7b5ef50911160607l37f73f6bsae0a000cdca6ead3%40mail.gmail.com"
TITLE="[pycrypto] Public key algos usage">don at amberfisharts.com
</A><BR>
<I>Mon Nov 16 11:26:06 CST 2009</I>
<P><UL>
<LI>Previous message: <A HREF="000160.html">[pycrypto] Public key algos usage
</A></li>
<LI>Next message: <A HREF="000162.html">[pycrypto] Public key algos usage
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#161">[ date ]</a>
<a href="thread.html#161">[ thread ]</a>
<a href="subject.html#161">[ subject ]</a>
<a href="author.html#161">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Hi Stefano,
As far as I know the API remains the same whether the key is a private/public key pair
or only the public key. So this should work (However, I didn't test this code):
>>> message = "this is a secret"
>>> pub_key = key_pair.publickey()
>>> cipher_text = pub_key.encrypt(message, "")
I also think that the API-Reference [1] is fairly accurate.
I hope that helps. If not, maybe you show some code how you try to use it.
yours
//Lorenz
[1] <A HREF="http://www.dlitz.net/software/pycrypto/apidoc/">http://www.dlitz.net/software/pycrypto/apidoc/</A>
Kiwi wrote:
><i> I cannot find documentation on using PyCrypto's public keys algorithms.
</I>><i> The main problem is that while I can easily create a private/public
</I>><i> keypair and use it, I don't understand how to create an object given
</I>><i> only a public key (encryption/verify only).
</I>><i> The only documentation says to "look at the source code".
</I>><i> What is the best thing to do at this time?
</I>><i> Wait for a definitive API? Use a development version? Use the old
</I>><i> undocumented API?
</I>><i> Is there a code snipplet somewhere on using RSA or ElGamal with the current API?
</I>><i> By the way I already use PyCrypto symmetric encryption in the
</I>><i> application I'm writing and it works well and fast.
</I>><i>
</I>><i> Thank you for your time,
</I>><i> Stefano Cavallari
</I>><i> _______________________________________________
</I>><i> pycrypto mailing list
</I>><i> <A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">pycrypto at lists.dlitz.net</A>
</I>><i> <A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto</A>
</I>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="000160.html">[pycrypto] Public key algos usage
</A></li>
<LI>Next message: <A HREF="000162.html">[pycrypto] Public key algos usage
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#161">[ date ]</a>
<a href="thread.html#161">[ thread ]</a>
<a href="subject.html#161">[ subject ]</a>
<a href="author.html#161">[ 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>
|