locked
RSA Private/Public key RRS feed

  • Question

  • User194909979 posted

    I have an web application that encrypts data using a public and sent it to another web application. Which will then decrypt the data using a the user private key.

    My question is, since but the Private and Public key are generated in the first application. how does the other application get the private?


    Thanks!

    Friday, September 17, 2010 12:27 PM

Answers

  • User-29804325 posted

    Hi,

    The RSA encryption need Public/Private key when decrypt the encrypted code.

    So I think we need to export the Public/Private key and import to other application so that other application can do the decryption.

    But at first, It is not recommend to store the plain asymmetric private keys on local computer. 

    We need to store Asymmetric Keys in a Key Container. we should generate RSA Class with this key container.

    Then We have to Importing and Exporting Protected Configuration RSA Key Containers from one application to other application.

    If this two application is on the same server, I think we just need to create a key container(share the same key container,machine-key level). and add web.config like this:

    <configuration>
       <configProtectedData>
          <providers>
             <add name="MyProvider"
                  type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0,
                        Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
                        processorArchitecture=MSIL"
                  keyContainerName="MyKeys"
                  useMachineContainer="true" />
          </providers>
       </configProtectedData>

    </configuration>

    http://msdn.microsoft.com/en-us/library/2w117ede.aspx

    Hopes can help you.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 23, 2010 4:01 AM

All replies

  • User-341994687 posted

    The basic idea of public encryption works around factors but alot more complicated i.e if you have a number 15 what are the factors i.e 5 and 3. But if you get a number 12398239482984299898 of that length it gets far harder to find. So anyone given the public key can encrypt. But it is only the computer retrieving the encrypted data that will be able to decrypt the data if they have the key.   

    Friday, September 17, 2010 1:54 PM
  • User-29804325 posted

    Hi,

    The RSA encryption need Public/Private key when decrypt the encrypted code.

    So I think we need to export the Public/Private key and import to other application so that other application can do the decryption.

    But at first, It is not recommend to store the plain asymmetric private keys on local computer. 

    We need to store Asymmetric Keys in a Key Container. we should generate RSA Class with this key container.

    Then We have to Importing and Exporting Protected Configuration RSA Key Containers from one application to other application.

    If this two application is on the same server, I think we just need to create a key container(share the same key container,machine-key level). and add web.config like this:

    <configuration>
       <configProtectedData>
          <providers>
             <add name="MyProvider"
                  type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0,
                        Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
                        processorArchitecture=MSIL"
                  keyContainerName="MyKeys"
                  useMachineContainer="true" />
          </providers>
       </configProtectedData>

    </configuration>

    http://msdn.microsoft.com/en-us/library/2w117ede.aspx

    Hopes can help you.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 23, 2010 4:01 AM