I need a way of determining whether contents of a folder containing some executable stuff have not been modified in any way a moment before I decide to execute the whatever is in it. Check every time before executing.
The problem is I am very limited in terms of time (the check has to be make nearly instantly, something like 100ms would be too much for this particular case) and a bit in computational power (running the whole thing on just a computer that's got a bunch of other stuff happening on it - internet browsing, music playing, whatever).
Talking about a Linux machine. The size of the folders would be up to 6MB worst case.
My primary idea was to have some kind of checksums-map-storing-file kept somewhere encrypted, and comparing a newly calculated value with the stored one. I do not have a big concern about storing the checksum-file. I do have a concern about using an efficient algorithm that lets me be as sure as possible that the files weren't modified.
Suggestions? Would it be safe enough to, say, only look into the files' metadata? or would checking the contents matter each time as well?
The algorithm I will be using is safe with me - I can kind of be sure that the "intruder" cannot "know" it, so its not my worry.
I feel like steganography could come in handy here, but I just can't figure out a possible useful way for it here.