none
Key exchange mechanism using private key cryptography (RSA & ECDH) RRS feed

  • Question

  • i wanted to know the key exchange mechanism executed by the public key cryptosystems. theoretically i hav com to knw now. but now want to see how it works in c# code. i knw there are libraries existing in visual studio. i have newly installed VS 2010. can anyone give me a source code or a code snippet where two parties exchange secret by encrypting and decrypting the secret using RSA and ECDH algorithms.

    PS: i am very new to C# language

    Sunday, June 22, 2014 11:17 AM

Answers

  • The fix part of the key should never be transmitted.  It should be built into the application or manually sent. The encrypted data should be sent as a byte array with UTF8 encoding if a stream class is being used.  The code you are using should be modified so there is an option to either encrypt or decrypt.  The decrypt function should be installed in the server class and started first.  The encrypt code should be placed in the client application which will connect to the server.  The encrypted data will be sent over the connection.

    jdweng

    Sunday, June 22, 2014 10:06 PM

All replies

  • See website below

    http://www.di-mgt.com.au/rsa_alg.html

    RSA is a standard and can be found on the web.


    jdweng

    Sunday, June 22, 2014 12:05 PM
  • i want to study the libraries provided in visual c#. i knw the algorithms.
    Sunday, June 22, 2014 1:38 PM
  • What is the difference?  RSA is a standard and the Net Library meet the standard.  Microsoft doesn't provide source code for their libraries.  They just certify that it meets the standard.


    jdweng

    Sunday, June 22, 2014 2:20 PM
  • i'm sorry i wasnt clear about what i want.. i want to learn how to use those library functions to implement RSA algorithm under a client server scenario. the tutorials i went through showed me only encryption n decryption in the same code.

    i have til now developed the client-server applications. n they r communicating succesfully. next i need them to exchange a secret. here the server wil send its public key to client and then client uses it to encrypt the secret. to do this i dnt know how to use RSACryptoServiceProvider.

    Sunday, June 22, 2014 5:47 PM
  • The fix part of the key should never be transmitted.  It should be built into the application or manually sent. The encrypted data should be sent as a byte array with UTF8 encoding if a stream class is being used.  The code you are using should be modified so there is an option to either encrypt or decrypt.  The decrypt function should be installed in the server class and started first.  The encrypt code should be placed in the client application which will connect to the server.  The encrypted data will be sent over the connection.

    jdweng

    Sunday, June 22, 2014 10:06 PM