Click to See Complete Forum and Search --> : how to send public key through socket
kmm64
May 28th, 2004, 09:24 AM
Hi, I'm trying to create a simple client server program that allows the client to request a file from the server and the server then encrypts the file and sends it along with its public key and the signature created using RSACryptoServiceProvider through the socket connection. But I can't seem to figure out how to export the public parameters to the client so that the file can be decrypted and verified on that side.
I know how to encrypt the file and create the signature but how exactly would you send the public key through the socket.
Any ideas would be greatly appreciated.
Thanks
Viperius
May 28th, 2004, 09:51 AM
Hi, i don't know the answer to your question but i'm wondering why you would sent a public key along with an encrypted file (encrypted with the private key from the server i assume).
What use does that have? Its not for encryption (everyone can use the provided public key to decrypt), and its not for authenthication (anyone can intercept the message, and send his own file along with his own public key).
I'm just curious, always trying to learn :p.
kmm64
May 28th, 2004, 10:05 AM
Hi, I see why you would question that....mistake in my post. My final app is not going to send the server's private key along with the files (no security in that). I'm only trying to figure out how does the client and server exchange public key's initially to encrypt files for each other. In order for the server to encrypt a file for a specific client it must have the clients public key (please correct me if I'm wrong) and vice versa. I apologize for my first post. Basically I'm trying to find out how to exchange public keys over a socket.
thanks
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.