I know very little about encryption, so I figured I'd ask the internet if it's possible to do the following (and if so, what kind of algorithm should I be looking at):
Write some code that saves data to and loads data from a file, however the file is usable only once. What I mean is that the data is loaded in from it, and the file is overwritten with new data by the software which is now the file that can be loaded. If the user however made a copy of the previous version and replaces the new file with it, that same file should no longer work.
The conditions under which I'd like to achieve this are the following:
- Windows environment.
- The software is offline, on the user's machine.
- The user is smart enough to be able to locate any files the software creates and make copies (meaning keeping some sort of validation code in a separate file would be insufficient as a solution). They are smart, tenacious and motivated in finding a method to load data from old files, but they don't know much about computer science, so they wouldn't decompile the software or crack any encryption that might be involved in the solution.