summaryrefslogtreecommitdiff
path: root/pipermail/pycrypto/2010q2/000219.html
diff options
context:
space:
mode:
Diffstat (limited to 'pipermail/pycrypto/2010q2/000219.html')
-rw-r--r--pipermail/pycrypto/2010q2/000219.html97
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:
+ &gt;&gt;&gt; key = Crypto.publicKey.RSA.generate(1024)
+ &gt;&gt;&gt; pubkey = key.pubkey()
+ &gt;&gt;&gt; pubkey_string = pickle.dumps(pubkey)
+ &gt;&gt;&gt; socket.send(pubkey_string)
+and on the other side
+ &gt;&gt;&gt; pubkey_string = socket.recv()
+ &gt;&gt;&gt; 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:
+ &gt;&gt;&gt; key = Crypto.publicKey.RSA.generate(1024)
+ &gt;&gt;&gt; pubkey = key.pubkey()
+ &gt;&gt;&gt; n, e = key.n, key.e
+ &gt;&gt;&gt; # send n and e over socket
+and on the other side
+ &gt;&gt;&gt; # get n and e from the socket
+ &gt;&gt;&gt; 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:
+&gt;<i>
+</I>&gt;<i> i'm just wondering is there a way to import AND export the public keys
+</I>&gt;<i> from RSA so i can, send the public key over a socket, import it on the
+</I>&gt;<i> otherside so i can create a &quot;secure&quot; socket ( i know authentication is
+</I>&gt;<i> not done in this process ).
+</I>&gt;<i> the socket is still subject to a MIM attack, but this is not the point
+</I>&gt;<i> at the moment
+</I>&gt;<i>
+</I>&gt;<i> it could be my inability to read the documentation but i found no way to
+</I>&gt;<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>