P
P
Porto_b2020-04-30 15:05:18
Delphi
Porto_b, 2020-04-30 15:05:18

DELPHI file protection?

In general, I have a program in which they pass the test, there are two answer files in txt format, one is correct and the other is incorrect, the question is formulated and the correct answer and incorrect answers are read. The files themselves are encrypted with a simple algorithm, so you won't be able to see the answers, but you can delete the files and edit the txt file itself. If the files do not exist, the testing program report this, but there is no protection against vandalism, is there any way to solve this problem? Embedding the answer inside the program is not an option.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2020-04-30
@Porto_b

Put the checksums in the 3rd file.
Questions / answers were counted and, according to the 3rd file, checked.
Did not match - we output: "The integrity of the test files has been violated.".
Bonus "snack": You can also put the checksum of the CS file itself into it. Then it will be difficult to correct anything even with open answers (in plain text).

A
akelsey, 2020-04-30
@akelsey

Connect to your legitimate network storage every time you run the program (even Yandex disk via webdav) and get the hashes of these files, check at startup - if local files have the same hashes - then everything is OK, if not, then exit the program with a message that there are attempts to replace .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question