I have been reading about ransomware, and I was wondering if it could be defended against by having certain "trap" files on a drive. Sometimes I look through Code Golf and am thoroughly impressed by some of the solutions posted, some of which I wouldn't think are possible.
So I wondered: Is there a way to have ransomware's encryption process get hung up by specially created files (not just exceedingly large files)?
Could a file be created that, when encryption was attempted, would send the encryption process into an infinite loop, or at least one that might take a long time to complete? Maybe a monitoring program that is able to begin creating dummy files, while at the same time deleting encrypted dummy files as they are encrypted, so that the encrypting process is led down an endless path?
Of course the idea here is to stall the encryption process midway. Or, perhaps, could accessing the special file cause the computer to enter some form of "safe mode" that halts current processes?
(Note: this would obviously be a last-line-of-defense strategy, certainly not something that one would ever want to rely on for security, but an extra measure in case more proper measures all fail)