Thank you. Your information is perfect.
file. This seems true since the RSA key pair is stored on the local machine
"Jialiang Ge [MSFT]" <jialge@online.microsoft.com> wrote in message
news:5ehMg$%23CIHA.5204@TK2MSFTNGHUB02.phx.gbl...
> Hello Tom,
>
> I notice that you have posted the same question in our
> microsoft.public.dotnet.framework newsgroup, which I have already
> responded. So please check my answer there and if you need any further
> assistance on this particular issue, please reply to me in that thread so
> I
> can follow up with you in time.
>
> For your convenience, I have included my reply as follows:
>
> ----------------------
> Hello Tom,
>
> From your post, my understanding on this issue is: you wonder where the
> encryption and decryption key is stored when you encrypt the configuration
> nodes. If I'm off base, please feel free to let me know.
>
> I notice that you are using RsaProtectedConfigurationProvider, the RSA
> mechanism, to encrypt the configurations. RSA needs two keys: one is
> public
> key which is used to encrypt the content; another is private key, to
> decrypt the content. According to the MSDN article
>
http://msdn2.microsoft.com/en-us/library/ms998283.aspx, the key pair for
> the current application is stored either in machine level key container,
> or
> user level container. For RsaProtectedConfigurationProvider, it uses
> machine level key container by default. Machine level keys are stored in
> the directory:
> C:\Documents and Settings\All Users\Application
> Data\Microsoft\Crypto\RSA\MachineKeys
> Each file in the directory represents one key container (public - private
> key pair).
> You could use the command:
> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pc
> "keycontainer_name" -exp
> to create a new key container with the specified keycontainer_name.
>
> But actually, it is not the public key of RSA key container that encrypt
> the content of configuration information, because RSA is a kind of
> asymmetric encryption, and it is slow to encrypt large messages. We
> usually
> use symmetric key cipher, such as DES, to encrypt large messages. When we
> start to encrypt the content of a configuration file,
> Firstly, it will find the RSA key container according to the key name
> specified in <EncryptedData><EncryptedKey><KeyInfo><KeyName> node.
> Secondly, it randoms a DES key and use the public key from the key
> container to encrypt the DES key. Then store the encrypted result in the
> node <EncryptedData><KeyInfo><<EncryptedKey><CipherData>
> Lastly, it uses the DES key to encrypt the configuration information.
>
> When we decrypt the configuration information,
> Firstly, it will find the RSA key container according to the key name
> specified in <EncryptedData><EncryptedKey><KeyInfo><KeyName> node.
> Secondly, it use the private key to decrypt the encrypted DES key.
> Lastly, it uses the DES key to decrypt the configuration information
>
> For more information, please refer to the page
>
http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html >
> Please let me know if you have any other concerns, or need anything else.
> ----------------------
>
> Thank you and have a nice day!
>
> Sincerely,
> Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
>
> =================================================
> When responding to posts, please "Reply to Group" via your newsreader
> so that others may learn and benefit from your issue.
> =================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>