For solving this problem, I need somewhere to store data. Even if I chose to use a key to decrypt the file and if it fails, think of it as a wrong key (that is not quite right) I would need the file address.
There are two possible ways:
- use the registry
- use another file
Both have positive and negative sides, but I recommend a file.
For a filename, you can create one name by using some properties like username, etc. (property should remain unique for user in acceptable conditions). Also, you can use
binaryformatter for save/load data.
Now the question is should this file be encrypted or not? Because we will store some data (file address) that we need them as they saved we cannot use inserted password for encryption else there would be hints to password. We can encrypt the file or some of its data with some other password created by some properties or do not encrypt it (I do not think encryption this way helps anyone).
It would be wise to have a backup of this file.
I will wait for a week or so and if there is not a better answer and this answer is valid (base on comments), I will accept it as the answer.