Sam
Sam

Reputation: 10113

ASP.net MachineKey.Encode Changing Machine Key

The new MachineKey.Encode/MachineKey.Decode features in .Net seem to make encryption much easier.

My question is, in the event that you need to modify your MachineKey on a routine basis, does it need to be a 3 step process?

  1. Decrypt and store existing data
  2. Modify the MachineKey
  3. Re-encrypt and store the encrypted data

Or is there a way to call MachineKey.Encrypt/.Decrypt using two different keys?

Upvotes: 0

Views: 696

Answers (1)

mfanto
mfanto

Reputation: 14418

How long are you trying to store data for? These methods are typically used to protect round-trip data or values in cookies, not for long term data storage.

If you're using ASP.NET 4.5, MachineKey.Encode() and MachineKey.Decode() have been deprecated in favor of DataProtector

Upvotes: 1

Related Questions