I have deployed an asp.net mvc 5 website to our client's testing server and got the following error when i browsed to a page with a form on it:
"Decryption key specified has invalid hex characters"
Looking at the stack trace i can see that this is caused by the anti forgery token used on the forms which uses: System.Web.Security.Cryptography.MachineKeyMasterKeyProvider.GenerateCryptographicKey().
I fixed this issue by adding the the machine key element to the web.config, as described in the first answer to this question, and many others.
Having read up on this issue on StackOverflow, and elsewhere, i can't understand why it would be necessary on the server i deployed to. It seems that explicitly defining the machine key in the web.config should only be a requirement if the server is part of a 'web farm' but the environment i deployed to was a single server. In addition neither myself or any other developers i work with have had this issue when running the site locally or on our internal development server.
Can anyone help me to understand why adding the machine key to the web.config would be necessary on a single server setup? Could it be to do with a setting on the server itself?
Ideally i'd like to not have to specify the machine key but my primary concern is to get a full understanding of what might be the cause of this error.
Any suggestions or information would be welcome