I've just found a solution and wanted to quickly let you know it, in case it's interesting for you, too: First, a random byte array is generated using a cryptographically secure random number generator. This is the key used for encryption. It is protected using ProtectedData.Protect with the DataProtectionScope.CurrentUser option and written to the registry. When loading, the protected key is retrieved from the registry, unprotected using ProtectedData.Unprotect and used as decryption key for our file. I'm not sure what data ProtectedData is using, but it seems that the password can be changed, without making the ProtectedData behavior change, i.e. the user's password actually doesn't matter. Same applies to the user name. Probably Windows keeps some secret key for each user, which we can't access manually. Best regards Dominik
Too many passwords to remember? Try KeePass Password Safe!