views:

138

answers:

2

Hi,

I'm trying to generate a custom key for encrypting the web.config in a project, and use the same key on several machines.

I've followed this example from Microsoft: http://support.microsoft.com/kb/312906

However, when I encrypt my web.config (and I'm using cassini, not IIS, on my machine) it doesn't seem to use the newly created section in my machine.config. Or does it? How do I know? When I've made the changes and encrypted the web.config, the sites works just fine. And to try to prove that my custom key is used, I change a character in the decryptionKey value and restart the dev environment. But it still works, which I guess points to the fact that my keys aren't used.

What am I missing here?

+1  A: 

I've got a simple test... put some garbage (invalid XML) in your machine.config and restart your dev environment (not Cassini) and see if Cassini chokes, which would indicate that it is reloading machine.config.

TAG
Then the site crashes, but I still don't feel certain that the keys are being used when encrypting the connection strings.
Microserf
A: 

I forgot to specify which provider to use when encrypting. Everything worked fine after that.

Microserf