I have an old library built using asp.net 4.8 which uses the MachineKey functions to protect sensitive data before saving it onto the database.
I'm looking to upgrade the whole solution to .net 6 from the ground up (as in rewriting all the existing source code and using whatever can be reused) but want to keep using the same database.
This database has fields which have data protected by .net 4.8's MachineKey protection.
Is there any way to either
- Implement a solution to use the new Data Protection API to encrypt and decrypt using the existing MachineKey keys - that is NOT using AspNetTicketBridge
or
- Update all existing data on the database to use new encrypted values created by the Data Protection APIs?
Ideally would like to go with approach 2, but haven't been able to find anything related to this. - Or even if it's possible to do using SQL scripts so the initial data can be updated and then going forwards the new Data Protection API can be used to encrypt the data?