Pages

Friday, August 13, 2010

File destroyer / obliterator

I stole the idea here and I wrote a a practical script to embellish on the theme.

#!/bin/sh

#set -e -x
set -e

if [ -f $1 ]; then
  echo "Are you sure? Hit ctrl+c to abort."
  for i in `seq 5`; do
    echo $i && sleep 1;
  done
  # mac osx / bsd: BYTES=$(stat -f%z $1)
  BYTES=$(/usr/bin/du -b $1 | sed 's/\([0-9]\+\).*/\1/')
  /bin/dd if=/dev/urandom of=$1 bs=$BYTES count=1 conv=notrunc
  echo "$1 has been written over with random bits."
  /bin/rm -f $1
  echo "$1 has been removed from the filesystem."
fi

Warning! Achtung baby! Do not use this on sensitive files you may need in the future.

This got me thinking. Imagine you work for a secretive branch of some government and you have sensitive info on your drive you wouldn't want to be caught with dead, like passwords etc. You could build a kill switch for your portable computer(s) with the sensitive files. This kill switch is attached to an artificial pacemaker which senses if you're still alive or not, by checking your heart-beat. This portable computer gets signals from the pacemaker. When it ceases to receive signals, the kill switch is engaged, after 5 minutes with no keep-alive signals from the pacemaker, the portable computer is erased completely.

The trick is to not let the signal get intercepted. Hmmmm... I should write spy-novels with a technical flavour.

No comments:

Post a Comment

Please help to keep this blog clean. Don't litter with spam.