79251870

Date: 2024-12-04 15:57:25
Score: 2
Natty:
Report link

The name of the application doesn't affect the key file. The data protection provider concatenates the application name and the 'purpose' you send when you create the data protector, and uses that to salt the encryption/decryption. So you can have multiple applications that use the same application name, and same key file, and use a different purpose string per-application, or a different application name and the same key file, and the applications still won't understand each other's encrypted data.

The only difference between the application name and the purpose string is that the application name persists for the lifetime of the data protection service, and the purpose string can create many protectors for different...purposes.

Here is the link to the relevant data protection code on GitHub:

https://github.com/dotnet/aspnetcore/blob/de76fa24ba1dee7f55357332df7ea2c60decd2de/src/DataProtection/DataProtection/src/KeyManagement/KeyRingBasedDataProtector.cs#L20

Reasons:
  • Blacklisted phrase (1): Here is the link
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Aaron Newman