Question

Suppose you were almost paranoic (and forgetful also :b ) and had some confidential files you have to carry with you each day from day to work and back to home in a pendrive, and criminal indexes were rising in town. Generally you hide those, but you dont know how to encript/code/scramble or put a password to make impossible to a stranger read the content.

My questions are:

  1. How to make a shell scrip unix/windows systems that auto deletes the file or the content after x-time without modification (probably due to lost/robbery)... Is it possible that such an important file calls that script when the intruder try to open it (and letting, of course, a backdoor that allows you to recover your work if you where in vacation/absent/sick)?
  2. What is the best way to protect confidential files against spys, hackers?
Was it helpful?

Solution

If you are thinking about self-destructing files, those are not possible as such, as they need an application that runs. if you have a pen drive and a thief plugs it into their computer, no binaries get automatically executed.

If you want to run a script on your own computer that deletes files that haven't been accessed in a long time, you can use find to accomplish that:

find /mountpoint -mtime +42 -type f -exec rm {} \;

This would delete all files whose last modified -time is over 42 days. I would be a bit careful with this, though, as operating system file system implementations, especially if your pen drive is mounted to FAT as they usually are, can do weird things to timestamps. It is entirely possible to mount a file system in such a way that timestamps generally do not get updated. This would then delete even regularly used files after a certain period.

As cdarke correctly points out in the comments, removing a file does very little. It just marks the file as deleted and clusters occupied by the file free. I have a MSc in Computer Forensics and this is a regular misunderstanding that makes the work easier for the police and whoever is out there. Restoring deleted files is ridiculously simple as long as they haven't been actually overwritten. If you have a linux computer and want to see how it works, install Autopsy (sudo apt-get install autopsy), which is an extension to SleuthKit and allows a browser interface to a open source computer forensic tool.

Encryption is your solution. TrueCrypt is free and easy to use, and it allows additional security features (hidden partition inside a hidden partition) to thwart all the spooks interested in your data.

Hannu

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top