I am studying the storage of some sensitive data in an application that I am working on. I looked at the ProtectedData class provided by Microsoft and it looks pretty simple. However, I have a few questions regarding how this works.
First, I see that it uses "user credentials" to generate the encryption key. I saw in the documentation that only the current user will be able to decrypt the data. This is not a problem, I just want to know if the same user is registered on another machine, can they decrypt the data? I plan that the stored information will be transferred to OneDrive, so I hope it will be available on any device that uses the same user.
Example:
User A logs in on desktop computer, saves encrypted file abc.txt User A then logs in on tablet, loads file abc.txt
Is abc.txt for user A on the tablet?
Secondly, what happens when a user changes his password? It seems to me that then the encryption key will be different and will not lead to the fact that the decryption of the data that used the previous encryption key can no longer be restored?
Example:
User A logs in on desktop computer, saves encrypted file abc.txt User A changes password User A logs in on desktop computer, loads file abc.txt
Is abc.txt available to user A?
source share