diff options
Diffstat (limited to 'pipermail/pycrypto/2010q2/000219.html')
-rw-r--r-- | pipermail/pycrypto/2010q2/000219.html | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/pipermail/pycrypto/2010q2/000219.html b/pipermail/pycrypto/2010q2/000219.html new file mode 100644 index 0000000..c1334f0 --- /dev/null +++ b/pipermail/pycrypto/2010q2/000219.html @@ -0,0 +1,97 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> + <HEAD> + <TITLE> [pycrypto] Exporting/importing RSA publickeys + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20Exporting/importing%20RSA%20publickeys&In-Reply-To=1271546337.2005.15.camel%40localhost"> + <META NAME="robots" CONTENT="index,nofollow"> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="000217.html"> + <LINK REL="Next" HREF="000221.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[pycrypto] Exporting/importing RSA publickeys</H1> + <B>Lorenz Quack</B> + <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20Exporting/importing%20RSA%20publickeys&In-Reply-To=1271546337.2005.15.camel%40localhost" + TITLE="[pycrypto] Exporting/importing RSA publickeys">don at amberfisharts.com + </A><BR> + <I>Sun Apr 18 11:10:22 CST 2010</I> + <P><UL> + <LI>Previous message: <A HREF="000217.html">[pycrypto] Exporting/importing RSA publickeys +</A></li> + <LI>Next message: <A HREF="000221.html">[pycrypto] Exporting/importing RSA publickeys ( fixed ) +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#219">[ date ]</a> + <a href="thread.html#219">[ thread ]</a> + <a href="subject.html#219">[ subject ]</a> + <a href="author.html#219">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>Hello death! + +The easiest way is to use the pickle module from the python standard library. +untested pseudo code to show the general idea: + >>> key = Crypto.publicKey.RSA.generate(1024) + >>> pubkey = key.pubkey() + >>> pubkey_string = pickle.dumps(pubkey) + >>> socket.send(pubkey_string) +and on the other side + >>> pubkey_string = socket.recv() + >>> pubkey = pickle.loads(pubkey_string) + +an alternative is to access the relevant attributes of the pubkey and then use the construct method. +again untested code: + >>> key = Crypto.publicKey.RSA.generate(1024) + >>> pubkey = key.pubkey() + >>> n, e = key.n, key.e + >>> # send n and e over socket +and on the other side + >>> # get n and e from the socket + >>> pubkey = Crypto.publicKey.RSA.construct((n,e)) + +I hope this points you in the right direction. + +sincerely yours +//Lorenz + +On 04/18/2010 01:18 AM, death wrote: +><i> +</I>><i> i'm just wondering is there a way to import AND export the public keys +</I>><i> from RSA so i can, send the public key over a socket, import it on the +</I>><i> otherside so i can create a "secure" socket ( i know authentication is +</I>><i> not done in this process ). +</I>><i> the socket is still subject to a MIM attack, but this is not the point +</I>><i> at the moment +</I>><i> +</I>><i> it could be my inability to read the documentation but i found no way to +</I>><i> dump the key, and import it again. +</I></PRE> + + + + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="000217.html">[pycrypto] Exporting/importing RSA publickeys +</A></li> + <LI>Next message: <A HREF="000221.html">[pycrypto] Exporting/importing RSA publickeys ( fixed ) +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#219">[ date ]</a> + <a href="thread.html#219">[ thread ]</a> + <a href="subject.html#219">[ subject ]</a> + <a href="author.html#219">[ 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> |