I wrote this program a number of years ago because I was frustrated about the fact that all encryption offered to the public (no matter what the operating system or app) used minimal strength encryption by default.  This remains true today – without additional configuration and understanding of what you’re changing, all cryptography software with few exceptions use the weakest encryption possible; they practically go out of their way to do this.

It pissed me off.

Not only that but in Linux, using strong encryption involves some pretty hefty command lines that you have to type correctly every single time, and over time the probability of making a mistake is certain.

LUKS – demonstrated to be one of the most security encryption system on Linux – is based on a password.  This script abstracts that password into a separate file which is then password protected.  This way if the attacker has the password, if they don’t have the file it won’t matter.  If they have the file, they’re not getting at its contents without the password.  Getting into the encrypted volume requires multifactor : what you know and what you have, which is not normally something LUKS can do.

This script also resists the Lest We Remember memory attack by mounting fake volumes alongside the real one – the odds of recovering the correct key is 1/<no. of volumes>, which considering memory degradation makes recovery of the actual key a real bitch.

Once you copy the script to a .sh file and make it executable (chmod 755 lukstool.sh) it’ll take some practice to get used to it, but I think you’ll find it incredibly useful.  

  • You can create a 4 gig file for example and open that file as a hard drive.  Copy your photos, documents and other data into this mounted volume, then unmount it (./lukstool.sh umount /media/mountpoint) then burn it to DVD.  Safe as houses and can only be recovered by whomever has the password AND the keyfile.
  • Instead of a file you can format a partition (ie, /dev/sdb1) as a lukstool partition.  The only way to mount the resulting hard drive partition is with the keyfile and its password.
[pastacode lang=”bash” manual=”%23!%2Fbin%2Fbash%0A%0A%23%20This%20script%20written%20by%20Whisper%20%0A%23%20the%20purpose%20is%20to%20create%20an%20armourfile%20%2F%20partition%20that%20can%20be%20mounted%2C%20with%20its%20keyfile%20that%20can%20be%20put%20on%20a%20USB%20drive%0A%23%20it%20contains%20no%20new%20material%20really%2C%20just%20makes%20using%20LUKS%20to%20create%20and%20use%20an%20amourfile%20easy%20while%20enabling%20every%0A%23%20security%20feature%20available%20consistently.%20%20This%20script%20also%20does%20its%20best%20to%20ensure%20data%20and%20file%20system%20integrity.%0A%23%20Even%20small%20parts%20are%20made%20functions%20not%20just%20for%20code%20re-use%20but%20to%20ensure%20consistency%2C%20making%20sure%20functions%2C%20no%20matter%20how%0A%23%20easy%2C%20are%20done%20the%20same%20way%20every%20time.%0A%23%20developed%20for%20Ubuntu%2C%20can%20be%20used%20with%20any%20Linux%20with%20LUKS%20installed%0A%23%20please%20see%20www.death-zone.org%20-%20Projects%20-%20Military%20Grade%20Crypto%20for%20more%20information%20and%20updates%0A%23%0A%23%20081208%20*%20retrifitted%20to%20allow%20for%20crypto%20devices%20as%20well%20as%20files%0A%23%20083108%20*%20installed%20checking%20functions%2C%20cleaned%20up%20code%20a%20little%0A%23%20090408%20*%20tested%20on%20CentOS%2C%20modified%20path%20for%20sudo%20ease%20of%20use%2C%20improved%20syscheck.%0A%23%20%20%20noted%20differences%20in%20uuencode%20loads%20and%20GPG-agent.%20%20%20Thanks%20to%20LuckyBambu%20and%20drendeah%0A%23%20090508%20*%20changed%20the%20way%20GnuPG%20is%20referenced%20and%20tested%2C%20certified%20to%20work%20on%20CentOS%20%2F%20RedHat%20%2F%20Fedora%20Core%0A%23%20%20%20%20corrected%20block%20size%20and%20correlated%20armorfile%20size%20error.%0A%23%20122909%20*%20verify%20randomness%2C%20augmented%20by%20the%20random%20key%20length%20(2010%20-%3E%202099%2C%20who%20knows).%20%20Correctly%20designed%20to%20augment%0A%23%20%20%20%20random%20even%20if%20the%20seed%20is%20corrupt%20%2F%20compromised%0A%23%20%20%20%20%20%20%20*%20augment%20GPG%20to%20ensure%20it’s%20consistently%20set%20to%20use%20the%20right%20digest%2C%20no%20compression%0A%23%20%20%20%20%20%20%20*%20ability%20create%20obscuring%20volumes%20in%20an%20effort%20to%20defeat%20memory%20attack%0A%23%20%20%20%20%20%20%20*%20I%20could%20have%20bound%20the%20gpg%20key%20to%20a%20specific%20USB%20%2F%20drive%2C%20but%20that’s%20VERY%20dangerous%20(USB%20stick%20dies%2C%20so%20does%20your%20data)%0A%23%20%20%20%20%20%20%20%20%20%20it%20also%20introduces%20key%20management%20complexity%20and%20risk.%20%20Thus%2C%20I%20specifically%20chose%20not%20to%20do%20this%0A%23%20%20%20%20%20%20%20*%20validated%20all%20checks%20and%20improved%20specificity%2C%20verbiage%2C%20compatibility%0A%23%20%20%20%20%20%20%20*%20improved%20filesystem%20detection%20routines%0A%23%20%20%20%20%20%20%20*%20added%20’lukstool%20cleanup’%2C%20which%20will%20clean%20up%20any%20stray%20volumes%20(because%20however%20rare%2C%20when%20it’s%20necessary%20it’s%0A%23%20%20%20%20%20%20%20%20%20%20a%20pain%20to%20do%20all%20the%20obscuring%20volumes%20too%20by%20hand!)%0A%23%20%20%20%20%20%20%20*%20augmented%20password%20generation%20routine%20to%206000%20characters%2C%20speeding%20things%20up%20while%20adding%20to%20the%20total%20figure%0A%23%20%20%20%20%20%20%20%20%20%20(4000%20more%20characters%20the%20old%20way%20would%20have%20SUCKED%0A%23%20010710%20*%20improved%20the%20password%20generation%20routine%20so%20much%2C%20I%20feel%20stupid%20for%20having%20done%20it%20the%20other%20way…%0A%23%20012010%20*%20learned%20more%20about%20randomness%20and%20instructed%20the%20script%20to%20look%20for%20known%20%2Fdev%2Frandom%20improvements%20and%0A%23%20%20%20%20%20%20%20warn%20the%20user%20as%20necessary%0A%23%20082010%20*%20learned%20about%20a%20new%20way%20to%20shred%20devices%20prior%20to%20encryption%20that’s%20wicked%20fast%20and%20scriptable%20-%20credit%20goes%20to%0A%23%20%20%20%20%20%20%20Derek%20at%20’http%3A%2F%2Fwww.mail-archive.com%2Flinux-list%40lists2.linuxjournal.com%2Fmsg00020.html’%0A%23%20%20%20%20%20%20%20*%20incrased%20keysizes%20from%20256%20to%20512%0A%23%20040415%20*%20corrected%20minor%20bug%20in%20zeroing%20codeblock%2C%20updated%20verbiage.%0A%23%20051015%20*%20changed%20cryptofile%20behavior%20to%20allow%20for%20zeroed%20file%20or%20urandom%20file%20(compression%20of%20file%20improves%20at%0A%23%20%20%20%20%20%20%20the%20cost%20of%20potential%20cryptoanalysis%20vuln)%0A%0A%0A%23————————————————%20Variable%20Declaration%2C%20user%20editable%20area%20-%20CASE%20MATTERS%0A%23%20filesys%20%3D%20ext4%20%7C%20ext3%20%7C%20reiserfs%0A%23%20I%20prefer%20ext4%20for%20larger%20volumes%2C%20it’s%20more%20resilient.%20%20ext3%20is%20best%20for%20smaller%20devices%20%2F%20files%20%2F%20compatibility%0A%23%20ext4%20if%20your%20system%20supports%20it%2C%20reiserfs%20if%20it%20doesn’t.%0Afilesys%3Dext4%0A%23%20blocksize%20%3D%201024%20%7C%202048%20%7C%204096%20-%201024%20best%20for%20flash%20devices%2C%204096%20for%20hard%20drives%0Ablocksize%3D4096%0A%0A%23%20ensure%20%2Fsbin%20is%20part%20of%20the%20path%20for%20sudo%20ease%20of%20use%0A%23%20modify%20as%20necessary%20(%2Fsbin%3F%20%20%2Fusr%2Fsbin%3F%20%20where’s%20your%20stuff%3F%20%3A)%20)%0A%23%20if%20lukstool%20runcheck%20exits%20clean%2C%20then%20it%20can%20find%20all%20you%20need.%20Comment%20out%20if%20you%20don’t%20like%20it%20there.%0A%23%20PATH%3D%24PATH%3A%2Fsbin%3A%2Fusr%2Fsbin%0A%0A%23%20obfuscating%20the%20keys%20in%20memory%20by%20loading%20multiple%20dynamically-generated%20volumes%20at%20load-time%20in%20an%20effort%20to%20prevent%20memory%0A%23%20%20%20%20attacks.%20%20If%20set%20to%205%2C%20for%20example%2C%20one%20of%20the%206%20total%20volumes%20loaded%20is%20yours%2C%20the%20others%20are%20junk%20(and%20are%20automatically%20generated%2C%20loaded%2C%20unloaded)%0A%23%20%20%20%20having%206%20twofish-256%20keys%20in%20memory%20combined%20with%20memory%20entropy%20makes%20this%20a%20nasty%20shell%20game%20to%20play..!%20%20Naturally%20it’s%20still%20possible%20to%20defeat%20this%2C%0A%23%20%20%20%20but%20it%20would%20SUCK%2C%20and%20if%20a%20single%20character%20in%20the%20real%20key%20is%20corrupt%20it%20would%20suck%20even%20harder%20as%20the%20attacker%20can%20no%20longer%20focus%20on%20recovery%20of%20a%20single%0A%23%20%20%20%20key%20’cause%20they%20can’t%20tell%20which%20one%20is%20corrupt!%0A%23%20each%20obscuring%20volume%20takes%20about%205%20seconds%20to%20create%20and%20load%0A%23%20key%20searching%20tools%20will%20hit%20on%20the%20first%20value%20(obscount%20can’t%20be%201)%2C%20and%202%20would%20result%20in%20the%20correct%20key%20always%20being%20the%20second%20key%20found%0A%23%203%20would%20result%20in%20it%20being%20either%20the%202nd%20or%203rd%20key%20found%20(not%20much%20of%20a%20shell%20game)%0A%23%20therefore%2C%20the%20best%20options%20are%204%2C%205%20and%206.%20%206%20is%20the%20strongest%2C%205%20is%20the%20most%20compatible%2C%20therefore%20the%20’sweet%20spot’%20is%205!%0A%23%20IF%20OPENING%20VOLUME%20FILES%20-%20this%20value%20is%20NOT%20TO%20EXCEED%206!%20%20losetup%20can%20only%20handle%207%20concurrent%20mappings%0A%23%20IF%20COPYING%20FROM%20ONE%20FILE-BASED%20VOLUME%20TO%20ANOTHER%2C%20best%20to%20set%20this%20to%200%2C%20get%20it%20done%2C%20shut%20down%2C%20wait%2C%20boot%20up%20and%20set%20back%20to%205%0A%23%20valid%20values%20are%202%2C3%2C4%2C5%2C6%0Aobscount%3D5%0A%23%20are%20new%20crypto%20volumes%20shredded%20first%3F%20%20I%20strongly%20recommend%20yes%2C%20and%20with%20the%20082010%20update%20there’s%20no%20excuse%20not%20to%20(values%200%20%7C%201)%0Ashreddevice%3D0%0A%23%20minimum%20number%20of%20randomness-augmenting%20packages%20running%20-%20I%20recommand%20at%20least%20one%0A%23%20haveged%20is%20the%20best%20entropy%20pool%20improving%20solution%20as%20of%202014%0Anumrandhelper%3D1%0A%23%20———————-%20probably%20shouldn’t%20make%20changes%20beneath%20this%20line%0A%23%20twofish%20is%20fast%2C%20cbc%20and%20essiv%20salting%20mandatory%20for%20preventing%20watermark%20attacks..%20%20SHA512%20because%20nothing%20else%20will%20do%0A%23%20.gov%20says%20to%20use%20AES%20and%20Bruce%20Schneier%20created%20twofish%20-%20I’m%20going%20with%20Bruce!%0A%23%20sha256%20is%20the%20max%20that%20essiv%20salting%20supports%0Acipher%3D%22twofish-cbc-essiv%3Asha256%22%0A%23%20GPG%20-%20replaced%20blowfish%20with%20twofish%20for%20a%20number%20of%20reasons%2C%20including%3A%0A%23%20%20%20%20%20-%20it’s%20old%2C%20twofish%20has%20had%20more%20eyes%20recently%20and%20the%20more%20eyes%20the%20better%0A%23%20%20%20%20%20-%20apparently%20there’s%20a%20-chance-%20that%20a%20weak%20key%20could%20be%20selected%20for%20blowfish%20and%20broken%20somewhat%20more%20easily%20than%20other%20keys%0A%23%20%20%20%20%20-%20apparently%20it’s%20been%20broken%20to%2014%20of%20the%2016%20rounds%2C%20which%20is%20a%20little%20close%20for%20comfort%0A%23%20GPG%20compression%20is%20disabled%20because%20in%20fact%20sometimes%20the%20addition%20of%20compression%20can%20compromise%20the%20encryption%20algorithm%0Agpgcipher%3Dtwofish%0Agpgdigest%3DSHA512%0Agpgcompress%3Dnone%0A%23%20minimum%20length%20of%20encrypt%20GPG%20keytoken%0Akeylength%3D6000%0A%23%20length%20of%20twofish%20crypto%20hash%2C%20which%20maxes%20out%20at%20256%20(unlike%20AES%2C%20it%20doesn’t%20need%20512)%0Akeysize%3D256%0A%23%20———————-%0A%0Afunction%20help%20%7B%0A%20%20%20%20%20%20%20%20echo%20%22Usage%3A%20lukstool%20make%20%7C%20load%20%7C%20unload%20%7C%20check%20%7C%20rekey%20%7C%20runcheck%20%7C%20cleanup%22%0A%20%20%20%20%20%20%20%20echo%20%22%20%20NOTE%20-%20Never%20have%20a%20trailing%20backslash%20in%20a%20path!%20%20Messes%20everything%20up.%22%0A%20%20%20%20%20%20%20%20echo%20%22%20%23%20lukstool%20make%22%0A%20%20%20%20%20%20%20%20echo%20%22%20lukstool%20load%20%3Csource%3E%20%3Ckey%3E%20%3Cmountpoint%3E%22%0A%20%20%20%20%20%20%20%20echo%20%22%20lukstool%20unload%20%3Cmountpoint%3E%22%0A%20%20%20%20%20%20%20%20echo%20%22%20lukstool%20rekey%20%3Csource%3E%20%3Ckey%3E%20%3Cnewkey%3E%22%0A%20%20%20%20%20%20%20%20echo%20%22%20lukstool%20check%20%3Csource%3E%20%3Ckey%3E%20%3Cmountpoint%3E%22%0A%20%20%20%20%20%20%20%20echo%20%22%20%22%0A%20%20%20%20%20%20%20%20echo%20%22Examples%3A%22%0A%20%20%20%20%20%20%20%20echo%20%22lukstool%20load%20data.dat%20key.gpg%20%2Fmedia%2Fremovable%22%0A%20%20%20%20%20%20%20%20echo%20%22lukstool%20unload%20%2Fmedia%2Fremovable%22%0A%20%20%20%20%20%20%20%20echo%20%22lukstool%20check%20data.dat%20key.gpg%20%2Fmedia%2Fremovable%22%0A%20%20%20%20%20%20%20%20echo%20%22lukstool%20rekey%20data.dat%20key.gpg%20new-key.gpg%22%0A%20%20%20%20%20%20%20%20echo%20%22lukstool%20runcheck%22%0A%20%20%20%20%20%20%20%20echo%20%22lukstool%20cleanup%22%0A%0A%20%20%20%20%20%20%20%20echo%20%22This%20tool%20detects%20whether%20you’re%20dealing%20with%20a%20device%20or%20file%22%0A%20%20%20%20%20%20%20%20echo%20%20%22%20%20if%20%3Csource%3E%20has%20’dev’%20in%20it%20(ie%2C%20%2Fdev%2Fsdb1)%20it%20acts%20accordingly%22%0A%0A%20%20%20%20%20%20%20%20echo%20%22’lukstool%20runcheck’%20will%20ensure%20you%20can%20run%20this%20without%20any%20grief%20-%20use%20this%20first!%22%0A%7D%0A%0Afunction%20dieroller%20%7B%0A%20%20%20%20%20%20%20%20%23%20this%20routine%20can%20go%20up%20to%20a%20100-sided%20die%0A%20%20%20%20%20%20%20%20%23%20returns%20variable%20’total’%0A%20%20%20%20%20%20%20%20iterations%3D1%0A%20%20%20%20%20%20%20%20total%3D0%0A%20%20%20%20%20%20%20%20numdie%3D%241%0A%20%20%20%20%20%20%20%20sided%3D%242%0A%20%20%20%20%20%20%20%20number%3D%0A%20%20%20%20%20%20%20%20if%20%5B%20%24sided%20-gt%20100%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20%22dieroller-sided%22%0A%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20while%20%5B%20%24iterations%20-le%20%24numdie%20%5D%3B%20do%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23fetch%20random%20number%20from%20sysrandom%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20confirm%20it’s%204%20digits%20or%20more%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20acceptable%3D0%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20while%20%5B%20%24acceptable%20-eq%200%20%5D%3B%20do%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20getrand%3D%24RANDOM%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24(echo%20%24getrand%20%7C%20wc%20-c)%20-ge%205%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20acceptable%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20done%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20charcount%3D%24((%24(echo%20%24getrand%20%7C%20wc%20-c)-1))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23reverse%20number%20to%20make%20leading%20zeroes%20possible%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20countdown%3D%24charcount%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20while%20%5B%20%24countdown%20-gt%200%20%5D%3B%20do%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20number%3D%24number%24(echo%20%24getrand%20%7C%20cut%20-b%24countdown)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20countdown%3D%24((%24countdown-1))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20done%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23create%20divisor%20based%20on%20size%20of%20random%20number%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20divisor%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20count%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20while%20%5B%20%24count%20-le%20%24charcount%20%5D%3B%20do%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20divisor%3D%24(echo%20%22%24divisor%20*%2010%22%20%7C%20bc)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20count%3D%24((%24count%2B1))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20done%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20roll%3D%24(echo%20%22((%24number%20*%20%24sided)%20%2F%20%24divisor)%20%2B1%22%20%7C%20bc)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20total%3D%24(echo%20%22%24total%20%2B%20%24roll%22%20%7C%20bc)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20iterations%3D%24((%24iterations%2B1))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23reset%20number%20variable%20for%20next%20iteration%2C%20if%20there%20is%20one%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20number%3D%0A%20%20%20%20%20%20%20%20done%0A%7D%0A%0Afunction%20errcheck%20%7B%0A%20%20%20%20%20%20%20%20if%20%5B%20%24%3F%20-ne%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Error%20detected%2C%20section%20’%241’%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20loopclean%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20fi%0A%7D%0Afunction%20testperm%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20permission%20test%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%241%22%20%3D%20%22root%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(whoami)%22%20!%3D%20%22root%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22error%20-%20this%20must%20be%20done%20as%20root%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20touch%20%2Froot%2Ftestfile%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24%3F%20-ne%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22error%20-%20you%20must%20have%20sudo%20access%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20rm%20%2Froot%2Ftestfile%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%7D%0A%0Afunction%20loopclean%20%7B%0A%20%20%20%20%20%20%20%20%23%20cldevice%20expected%20to%20be%20full%20path%0A%20%20%20%20%20%20%20%20sync%0A%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24mapper%22%20%5D%20%26%26%20%5B%20-e%20%2Fdev%2Fmapper%2F%24mapper%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20cryptsetup%20luksClose%20%2Fdev%2Fmapper%2F%24mapper%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24%3F%20-ne%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Device%20activity%20detected%20-%20waiting%20for%20a%20few..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sleep%203%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20try%20again%20(sometimes%20device%20mappers%20interfere)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20cryptsetup%20luksClose%20%2Fdev%2Fmapper%2F%24mapper%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24%3F%20-ne%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Error%20detected%2C%20loopclean-luksclose%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20if%20%5B%20%22%24cldevice%22%20!%3D%20%22%22%20%5D%20%26%26%20%5B%20%22%24(sudo%20losetup%20-a%20%7C%20grep%20%22%24cldevice%22)%22%20!%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20losetup%20-d%20%24cldevice%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24%3F%20-ne%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Error%20detected%2C%20loopclean-loopd%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%23%20flush%20keybuffer%20in%20place%20to%20prevent%20memory%20attacks%0A%20%20%20%20%20%20%20%20keybuffer%3D%24(sudo%20head%20-c%20%24((%24keylength%2B300))%20%2Fdev%2Fzero)%0A%7D%0A%0Afunction%20mountcheck%20%7B%0A%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(mount%20%7C%20grep%20%22%241%22%7C%20cut%20-d%20%22%20%22%20-f%203%20%7C%20grep%20%22%241%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Mountpoint%20already%20in%20use%20-%20exiting..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20fi%0A%7D%0A%0Afunction%20genkey%20%7B%0A%20%20%20%20%20%20%20%20total%3D0%0A%20%20%20%20%20%20%20%20echo%20-n%20%22Generating%20strong%20key….%22%0A%20%20%20%20%20%20%20%20unset%20keybuffer%0A%20%20%20%20%20%20%20%20charcount%3D0%0A%20%20%20%20%20%20%20%20while%20%5B%20%24charcount%20-le%20%24keylength%20%5D%3B%20do%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20pull%20out%20from%20urandom%20any%20’visible’%20chracters%20(alnum%2C%20punct)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20keybuffer%3D%24keybuffer%24(head%20-c300%20%2Fdev%2Furandom%20%7C%20tr%20-dc%20’%5B%3Agraph%3A%5D’)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20charcount%3D%24(echo%20%24keybuffer%20%7C%20wc%20-c)%0A%20%20%20%20%20%20%20%20done%0A%20%20%20%20%20%20%20%20echo%20%22complete%20(%22%24(echo%20%24keybuffer%20%7C%20wc%20-c)%20%22characters).%22%0A%20%20%20%20%20%20%20%20if%20%5B%20%24(echo%20%24keybuffer%20%7C%20wc%20-c)%20-ge%20%24keylength%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22The%20following%20passphrase%20unlocks%20your%20keyfile%2C%20and%20thus%20the%20armour%20file%20%2F%20device.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Enter%20the%20passphrase%20for%20your%20new%20keyfile%20(twice).%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22It%20needs%20to%20be%20longer%20than%2030%20characters%20and%20have%20some%20uppercase%20characters%2C%20numbers%20and%20punctuation.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22(note%20-%20is%20okay%20to%20ignore%20any%20gpg-agent%20error%20that%20may%20follow)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22Press%20enter%20to%20continue…%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20read%20proceed%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20this%20method%20ensures%20the%20key%20never%20hits%20the%20hard%20drive%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%24keybuffer%20%7C%20sudo%20gpg%20–no-secmem-warning%20–no-random-seed-file%20–cipher-algo%20%24gpgcipher%20%5C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20–digest-algo%20%24gpgdigest%20–compress-algo%20%24gpgcompress%20–symmetric%20–force-mdc%20-a%20%3E%20%241%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20create-keyfile%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Unexpected%20error%20with%20key%20generation%20routine!%20%20Faulting..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20fi%0A%7D%0A%0Afunction%20fileordev%20%7B%0A%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(echo%20%24filename%20%7C%20grep%20%22%2Fdev%2F%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-e%20%24filename%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20isdevice%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%22%24cldevice%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cldevice%3D%24filename%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mapper%3D%24(echo%20%24filename%20%7C%20cut%20-d%20%22%2F%22%20-f3)-map-ltool%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20fileordev-dev-doesnt-exist%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20isdevice%3D0%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%22%24cldevice%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cldevice%3D%22%24(sudo%20losetup%20-f)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%22%24cldevice%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Error%20-%20no%20loop%20devices%20available!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mapper%3D%24(echo%20%24cldevice%20%7C%20cut%20-d%20%22%2F%22%20-f3)-map-ltool%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20fi%0A%7D%0A%0Afunction%20obfuscate%20%7B%0A%20%20%20%20%20%20%20%20case%20%22%241%22%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20create)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Creating%20obfuscating%20volume%2C%20stand%20by..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obsdatesec%3D%24(date%20%2B%25s)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obscurefile%3D%22%2Ftmp%2Fobscurevol%24obsdatesec%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obscuremap%3D%22obscurevol%24obsdatesec%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20generate%20scrap%20volumes%20with%20zeroes%20as%20contents%2C%20but%20no%20file%20system%2C%20minimum%20size%20possible%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20dcfldd%20if%3D%2Fdev%2Fzero%20of%3D%24obscurefile.dat%20bs%3D1024%20count%3D2088%202%3E%261%20%3E%20%2Fdev%2Fnull%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20loop%20the%20file%20into%20a%20device%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20loopdev%3D%22%24(sudo%20losetup%20-f)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24loopdev%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20losetup%20%24loopdev%20%24obscurefile.dat%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20obfuscate-losetup%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23generate%20throw-away%20key%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obskey%3D%22%24(sudo%20head%20-c%2010%20%2Fdev%2Furandom)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%24obskey%20%7C%20sudo%20cryptsetup%20–cipher%20%24cipher%20–key-size%20%24keysize%20luksFormat%20%24loopdev%202%3E%261%20%3E%20%2Fdev%2Fnull%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20obfuscate-cryptsetup%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20mount%20the%20scrap%20volume%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%24obskey%20%7C%20sudo%20cryptsetup%20luksOpen%20%24loopdev%20%24obscuremap%202%3E%261%20%3E%20%2Fdev%2Fnull%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20obfuscate-mount%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Error%20-%20no%20loop%20devices%20available!%20%20’lukstool%20cleanup’%20needs%20to%20be%20run.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20destroy)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obscurevols%3D%22%24(ls%20%2Fdev%2Fmapper%20%7C%20grep%20obscurevol)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24obscurevols%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Cleaning%20up%20obscuring%20volumes..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20obsvolume%20in%20%24(ls%20%2Fdev%2Fmapper%20%7C%20grep%20obscurevol)%3B%20do%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20cryptsetup%20luksClose%20%2Fdev%2Fmapper%2F%24obsvolume%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20obscure-luksclose%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20losetup%20-d%20%22%24(sudo%20losetup%20-a%20%7C%20grep%20%24obsvolume%20%7C%20cut%20-d%20%22%3A%22%20-f1)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20obscure-losetupclose%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20rm%20%2Ftmp%2F%24obsvolume.dat%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20obscure-rmobsvolume%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20done%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22No%20obscuring%20volumes%20found.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20esac%0A%7D%0A%0Afunction%20performmount%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fileordev%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24isdevice%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20losetup%20%24cldevice%20%24filename%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20gpg%20–no-secmem-warning%20–quiet%20–decrypt%20%24filekey%20%7C%20sudo%20cryptsetup%20luksOpen%20%24cldevice%20%24mapper%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20armorfile-load%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(sudo%20head%20-c%2066000%20%2Fdev%2Fmapper%2F%24mapper%20%7C%20grep%20%22ReIsEr2Fs%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Mounting%20reiserfs..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20mount%20-t%20reiserfs%20%2Fdev%2Fmapper%2F%24mapper%20%24mounttarget%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20ext4-reiser-mount%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filesystemstatus%3D%22%24(sudo%20tune2fs%20-l%20%2Fdev%2Fmapper%2F%24mapper)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(echo%20%22%24filesystemstatus%22%20%7C%20grep%20%22Filesystem%20features%22%20%7C%20grep%20%22huge_file%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Mounting%20ext4..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20mount%20-t%20ext4%20%2Fdev%2Fmapper%2F%24mapper%20%24mounttarget%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20ext4-mount%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Mounting%20ext3..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20mount%20-t%20ext3%20%2Fdev%2Fmapper%2F%24mapper%20%24mounttarget%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20ext3-mount%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%7D%0A%0Afunction%20checkrand%20%7B%0A%20%20%20%20%20%20%20%20%23%20checks%20for%20randomness%20improvement%20software%2C%20two%20or%20more%20passes%0A%20%20%20%20%20%20%20%20%23%20caller%20of%20this%20function%20checks%20for%20hasrand%20value%0A%20%20%20%20%20%20%20%20hasrand%3D0%0A%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(ps%20-ef%20%7C%20grep%20%22haveged%22%20%7C%20grep%20-v%20%22grep%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20hasrand%3D%24((hasrand%2B1))%0A%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(ps%20-ef%20%7C%20grep%20%22timer_entropyd%22%20%7C%20grep%20-v%20%22grep%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20hasrand%3D%24((hasrand%2B1))%0A%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(ps%20-ef%20%7C%20grep%20%22video_entropyd%22%20%7C%20grep%20-v%20%22grep%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20hasrand%3D%24((hasrand%2B1))%0A%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(ps%20-ef%20%7C%20grep%20%22audio_entropyd%22%20%7C%20grep%20-v%20%22grep%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20hasrand%3D%24((hasrand%2B1))%0A%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(ps%20-ef%20%7C%20grep%20%22randomsound%22%20%7C%20grep%20-v%20%22grep%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20hasrand%3D%24((hasrand%2B1))%0A%20%20%20%20%20%20%20%20fi%0A%7D%0A%0Acase%20%22%241%22%20in%0A%20%20%20%20%20%20%20%20make)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20testperm%20root%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20checkrand%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24hasrand%20-lt%20%24numrandhelper%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22WARNING%20-%20random%20number%20entropy%20not%20improved%20by%20randomness%20improvement%20software!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20this%20will%20result%20in%20your%20cryptofile%20being%20tough%2C%20but%20not%20as%20tough%20as%20it%20should%20be.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20Please%20review%20www.death-zone.org%20-%20Projects%20-%20Military%20Grade%20Cryptofile%20-%20Real%20Randomness%20Comes%20First!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Press%20ENTER%20to%20proceed%2C%20or%20CNTL-C%20to%20abort!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20read%20proceed%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22This%20script%20creates%20a%20luks%20cryptofile%20%2F%20device%20AND%20its%20correlating%20physical%20key%22%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20enter%20name%20of%20target%20file%20or%20device%20(example%20-%20%2Fhome%2Fcryptofile.dat%20%7C%20%2Fdev%2Fsdb1%20)%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20read%20filename%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fileordev%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20enter%20name%20of%20key%20file%20(example%20-%20%2Fhome%2Fcryptofile-key.gpg)%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20read%20keyfile%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20enter%20mountpoint%20for%20testing%20(example%20-%20%2Fmedia%2Fremovable)%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20read%20mountpoint%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mountcheck%20%24mountpoint%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20name%20of%20owner%20(will%20’chown%20name%3Ausers%3B%20chmod%20700′)%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20read%20owner%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20genkey%20%24keyfile%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24isdevice%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22minimum%20sizes%20-%20ext3%2C%20ext4%20-%208%20Mb.%20%20Reuserfs%20-%2032Mb%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20enter%20size%20of%20target%20file%20in%20megs%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20read%20size%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20if%20shreddevice%20eq%200%2C%20then%20just%20use%20zero%2C%20but%20if%20clearing%20slack%20matters%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20then%20use%20urandom.%20This%20improves%20compressability%20of%20the%20file%20at%20the%20potential%20cost%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20of%20cryptoanalysis%20vulnerability.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24shreddevice%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22shreddevice%3D0%20%3A%20Creating%20data%20file%20with%20zeroes..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22shreddevice%3D1%20%3A%20Creating%20data%20file%20from%20urandom..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%24blocksize%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%201024)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24shreddevice%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20dd%20if%3D%2Fdev%2Fzero%20of%3D%24filename%20bs%3D%24blocksize%20count%3D%24((%24size%20*%201024))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20dd%20if%3D%2Fdev%2Furandom%20of%3D%24filename%20bs%3D%24blocksize%20count%3D%24((%24size%20*%201024))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%202048)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24shreddevice%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20dd%20if%3D%2Fdev%2Fzero%20of%3D%24filename%20bs%3D%24blocksize%20count%3D%24((%24size%20*%20512))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20dd%20if%3D%2Fdev%2Furandom%20of%3D%24filename%20bs%3D%24blocksize%20count%3D%24((%24size%20*%20512))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%204096)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24shreddevice%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20dd%20if%3D%2Fdev%2Fzero%20of%3D%24filename%20bs%3D%24blocksize%20count%3D%24((%24size%20*%20256))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20dd%20if%3D%2Fdev%2Furandom%20of%3D%24filename%20bs%3D%24blocksize%20count%3D%24((%24size%20*%20256))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20esac%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20losetup%20%24cldevice%20%24filename%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24shreddevice%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22not%20clearing%20slack%20space%20on%20%24filename%20as%20per%20configuration%20-%20bad%20idea%2C%20but%20it’ll%20be%20fast..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Clearing%20slack%20space%20on%20%24cldevice..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20This%20not%20only%20clears%20slack%20but%20makes%20the%20entire%20volume%20cryptographically%20consistent.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20NOTE%20-%20this%20could%20take%20a%20very%20long%20time%2C%20especially%20on%20USB%20sticks..!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20This%20has%20the%20added%20benefit%20of%20confirming%20device%20integrity.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20General%20rate%20-%20120%20gig%20%2F%20hour%20on%20a%20hard%20disk%20-%20You%20could%20hit%20CNTL-C%20now%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20and%20pick%20up%20later%20if%20you%20really%20have%20to.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20NOTE%20-%20because%20of%20the%20way%20this%20is%20done%2C%20if%20you%20try%20to%20compress%20the%20partition%20you%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20will%20get%20zero%20compression%20as%20a%20result%20-%20true%20random.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22You%20will%20get%20status%20by%20means%20of%20amount%20written%20as%20well%20as%20how%20long%20it%20took%20afterwards.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Press%20ENTER%20once%20to%20continue%20(and%20then%20wait%20a%20while..)%20or%20press%20CNTL-C%20to%20abort..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20read%20pressenter%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20create%20one-time%20crypto%20device%20on%20the%20target%20partition%2C%20the%20key%20to%20the%20device%20is%20randomly%20generated%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20with%20a%20randomized%2C%20throw-away%20key%20it%20doesn’t%20need%20to%20be%20a%20brutal%20cipher%20but%20it%20does%20need%20to%20be%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20truly%20random%20-%20check%20out%20the%20reference%20URL’s%20for%20more%20information%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cryptsetup%20create%20–cipher%20%24cipher%20random_sdx%20%24cldevice%20-d%20%2Fdev%2Furandom%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20send%20%2Fdev%2Fzero%20(fast)%20to%20be%20encrypted%20by%20the%20kernel%20and%20written%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20time%20dcfldd%20if%3D%2Fdev%2Fzero%20of%3D%2Fdev%2Fmapper%2Frandom_sdx%20bs%3D%24blocksize%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23clean%20up%20the%20one-time%20device%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cryptsetup%20remove%20%2Fdev%2Fmapper%2Frandom_sdx%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Formatting%20cryptovolume..%22%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%24keybuffer%20%7C%20cryptsetup%20–cipher%20%24cipher%20–key-size%20%24keysize%20luksFormat%20%24cldevice%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20armorfile-format%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Initial%20mount%20of%20armourfile%20%2F%20device..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%24keybuffer%20%7C%20cryptsetup%20luksOpen%20%24cldevice%20%24mapper%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20armorfile-mount%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Successfully%20mounted%20-%20formatting%20with%20filesystem%20’%24filesys’…%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%24filesys%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext4)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mkfs.ext4%20-q%20-b%20%24blocksize%20%2Fdev%2Fmapper%2F%24mapper%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20ext4-format%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext3)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mke2fs%20-j%20-b%20%24blocksize%20%2Fdev%2Fmapper%2F%24mapper%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20ext3-format%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20reiserfs)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mkfs.reiserfs%20-b%20%24blocksize%20-q%20%2Fdev%2Fmapper%2F%24mapper%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20reiserfs-format%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20*)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22filesys%20variable%20improperly%20set%20(ext4%20%7C%20ext3%20%7C%20reiserfs)%20-%20aborting!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20loopclean%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20esac%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mount%20%2Fdev%2Fmapper%2F%24mapper%20%24mountpoint%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20final-mount%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22New%20device%20is%20now%20mounted.%20Updating%20ownership…%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chown%20%24owner%3Ausers%20%24mountpoint%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chmod%20700%20%24mountpoint%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sync%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20umount%20%24mountpoint%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20loopclean%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chown%20%24owner%3Ausers%20%24filename%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chown%20%24owner%3Ausers%20%24keyfile%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24isdevice%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chmod%20600%20%24filename%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chmod%20700%20%24filename%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chmod%20400%20%24keyfile%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Device%20unmounted%2C%20permissions%20updated.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Now%20run%20’lukstool%20check%20%24filename%20%24keyfile%20%24mountpoint’%20as%20owner%20(%24owner)%20for%20final%20check.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22When%20the%20check%20is%20complete%20and%20everything%20looks%20good%2C%20you%20can%20load%20the%20volume%20as%20regular%20user.%22%0A%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20load)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20lukstool%20load%20data.dat%20key.gpg%20%2Fmedia%2Fremovable%22%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20testperm%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%244%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20help%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filename%3D%242%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filekey%3D%243%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mounttarget%3D%244%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20!%20%5B%20-e%20%24filename%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Error%20-%20file%20to%20load%20does%20not%20exist%20(%24filename)%20-%20exiting.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mountcheck%20%24mounttarget%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24obscount%20-gt%201%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20randomize%20load%20order%2C%20though%20the%20real%20volume%20should%20never%20be%20the%20first%20one%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20totalvols%3D%24((obscount%2B1))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20dieroller%201%20%24obscount%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20dieroller%20returns%20value%20’total’%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20realmount%3D%24((%24total%2B1))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obscount%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20while%20%5B%20%24obscount%20-le%20%24totalvols%20%5D%3B%20do%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24obscount%20-eq%20%24realmount%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20performmount%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obfuscate%20create%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obscount%3D%24((obscount%2B1))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20done%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20performmount%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20uload%7Cunload%7Cumount%7Cunmount%7Cclose)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20lukstool%20unload%20%2Fmedia%2Fremovable%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20testperm%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%242%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20help%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mounttarget%3D%242%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sync%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(lsof%20%2Bf%20–%20%24mounttarget)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Unable%20to%20unmount%20’%24mounttarget’%20as%20there%20are%20open%20files%20on%20that%20volume%20-%20aborting!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Results%20of%20lsof%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%24(lsof%20%2Bf%20–%20%24mounttarget)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mapper%3D%22%24(mount%20%7C%20grep%20mapper%20%7C%20grep%20%22%24mounttarget%22%20%7C%20cut%20-d%20%22%2F%22%20-f4%20%7C%20cut%20-d%20%22%20%22%20-f1)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cldevice%3D%22%2Fdev%2F%24(echo%20%24mapper%20%7C%20cut%20-d%20%22-%22%20-f1)%22%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sync%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20umount%20%24mounttarget%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20umount-target%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20cryptsetup%20luksClose%20%2Fdev%2Fmapper%2F%24mapper%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24%3F%20-ne%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20try%20again%20(sometimes%20device%20mappers%20interfere)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Device%20activity%20detected%20-%20waiting%20for%20a%20few..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sleep%203%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20cryptsetup%20luksClose%20%2Fdev%2Fmapper%2F%24mapper%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20uload-luksclose%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(echo%20%24cldevice%20%7C%20grep%20loop)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20losetup%20-d%20%24cldevice%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20loopclean-losetup-d%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20remove%20any%20obfuscating%20volumes%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24obscount%20-ne%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obfuscate%20destroy%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20check)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20this%20routine%20checks%20the%20integrity%20of%20a%20given%20file%2C%20key%20and%20filesystem%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20lukstool%20check%20data.dat%20key.gpg%20%2Fmedia%2Fremovable%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20testperm%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%244%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20help%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filename%3D%242%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filekey%3D%243%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mounttarget%3D%244%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D0%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20it’s%20all%20good%2C%20right%3F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%20%5B%20-e%20%24filename%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-e%20%24filekey%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-d%20%24mounttarget%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mountcheck%20%24mounttarget%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Cryptovolume%2C%20key%20and%20test%20mount%20point%20confirmed%2C%20proceeding..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20check-notarget%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20check-nokey%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20check-nofile%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Checking%20general%20GPG%20program%20configuration..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20%20%20%20%20%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20gpg%20–list-keys%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24%3F%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22GPG%20working%20normally%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22ERROR%20-%20problem%20with%20GPG%20detected.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Reviewing%20key%20checksum..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20%20%20%20%20%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%22%24(gpg%20–no-secmem-warning%20–verify%20%24filekey%202%3E%261%20%7C%20grep%20-v%20%22signatures%20failed%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22GPG%20Key%20integrity%20good.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22GPG%20Key%20integrity%20check%20failed.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Checking%20GPG%20armorfile%20integrity%20-%20please%20enter%20your%20password%20for%20this%20step%3A%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20gpgfileparam%3D%22%24(gpg%20-v%20–list-packets%20%24filekey%202%3E%261)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20check-gpgpass%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20gpgfileparamcypher%3D%24(echo%20%22%24gpgfileparam%22%20%7C%20grep%20%22symkey%20enc%20packet%22%20%7C%20cut%20-d%20%22%20%22%20-f7%20%7C%20cut%20-d%20%22%2C%22%20-f1)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20gpgfileparamhash%3D%24(echo%20%22%24gpgfileparam%22%20%7C%20grep%20%22symkey%20enc%20packet%22%20%7C%20cut%20-d%20%22%2C%22%20-f%204%20%7C%20cut%20-d%20%22%20%22%20-f3)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20gpgfileparamsaltcount%3D%24(echo%20%22%24gpgfileparam%22%20%7C%20grep%20%22salt%22%20%7C%20grep%20%22count%22%20%7C%20cut%20-d%20%22%2C%22%20-f2%20%7C%20cut%20-d%20%22%20%22%20-f3)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Checking%20cipher..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20%20%20%20%20%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24gpgfileparamcypher%20-ne%204%20%5D%20%26%26%20%5B%20%24gpgfileparamcypher%20-ne%2010%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22GPG%20Key%20is%20not%20Blowfish%20or%20Twofish%20encrypted%20(%24(echo%20%22%24gpgfileparam%22%20%7C%20grep%20%22encrypted%20data%22%20%7C%20cut%20-d%20%22%3A%22%20-f2))%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22good%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Checking%20compression%20status.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20%20%20%20%20%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(echo%20%22%24gpgfileparam%22%20%7C%20grep%20%22compressed%20packet%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22WARNING%20-%20GPG%20keyfile%20utilizes%20compression%2C%20indicating%20it’s%20an%20old%20blowfish%20key.%20%20Probably%20secure%2C%20but%20old..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22good%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Checking%20GPG%20Keysize%20and%20content%20integrity%20-%20please%20enter%20your%20password%20again%20(last%20time)%3A%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20%20%20%20%20%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20keybuffer%3D%22%24(gpg%20–no-secmem-warning%20–decrypt%20%24filekey)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20check-key-decrypt%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24(echo%20%24keybuffer%20%7C%20wc%20-c)%20-lt%20%24keylength%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22GPG%20key%20decrypts%2C%20but%20keylength%20is%20too%20short!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Armourfile%20password%20not%20adequate%2C%20whole%20thing%20needs%20to%20be%20regenerated%20(lukstool%20script%20tampered%20with%3F)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20Keysize%20is%20good%20(%3E%20%24keylength%20characters).%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Checking%20load%20process%3A%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fileordev%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24isdevice%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20losetup%20%24cldevice%20%24filename%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20check-losetup%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Checking%20for%20null%20LUKS%20keyslot%20values..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20%20%20%20%20%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%22%20%7C%20sudo%20cryptsetup%20luksOpen%20%24cldevice%20%24mapper%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24%3F%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20ERROR%20-%20NULL%20password%20on%20LUKS%20volume!%20Back%20up%20data%2C%20create%20a%20new%20one%20and%20destroy%20the%20old%20one%20(script%20tampered%20with%3F).%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20LUKS%20keyslots%20are%20not%20null%2C%20proceeding..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20get%20data%20from%20luks%20volume%20for%20examination%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20luksvol%3D%22%24(sudo%20cryptsetup%20luksDump%20%24cldevice%202%3E%261%20)%22%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Checking%20for%20extra%20LUKS%20keyslots…%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22%20%20%20%20%20%20%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24(echo%20%24luksvol%20%7C%20grep%20ENABLED%20%7C%20wc%20-l)%20-gt%201%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20ERROR%20-%20LUKS%20volume%20has%20more%20than%20one%20keyslot%20-%20back%20door%20present..%3F%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20Only%20one%20keyslot%20found%2C%20proceeding..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Confirming%20LUKS%20volume%20integrity%3A%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%20%24%3F%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%20%24(echo%20%22%24luksvol%22%20%7C%20grep%20%22Key%20Slot%22%20%7C%20grep%20ENABLED%20%7C%20wc%20-l)%20-eq%201%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20no%20back%20door%20keys…%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(echo%20%22%24luksvol%22%20%7C%20grep%20%22MK%20bits%22%20%7C%20grep%20%24keysize)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20LUKS%20using%20%24keysize-bit%20master%20key..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22ERROR%20-%20LUKS%20not%20using%20a%20%24keysize%20bit%20key%2C%20volume%20needs%20to%20be%20re-created%20(script%20tampered%20with%3F)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(echo%20%22%24luksvol%22%20%7C%20grep%20%22Cipher%20mode%22%20%7C%20grep%20sha256)%22%20%5D%20%26%26%20%5B%20-n%20%22%24(echo%20%22%24luksvol%22%20%7C%20grep%20%22Hash%20spec%22%20%7C%20grep%20sha1)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20LUKS%20volume%20SHA%20salting%20confirmed%20correct.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22ERROR%20-%20LUKS%20volume%20not%20using%20sha%20salt%20(script%20tampered%20with%3F)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20check-back-door-key-detected%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20check-cannot-luks-dump%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%24keybuffer%20%7C%20sudo%20cryptsetup%20luksOpen%20%24cldevice%20%24mapper%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20armorfile-load%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22File%20system%20check%2C%20%22%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20check%20for%20reiser%20(backward%20compatability)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(sudo%20head%20-c%2066000%20%2Fdev%2Fmapper%2F%24mapper%20%7C%20grep%20%22ReIsEr2Fs%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22ReiserFS%3A%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(which%20fsck.reiserfs)%22%20%3D%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Volume%20is%20a%20ReiserFS%20file%20system%2C%20which%20I%20can’t%20check.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fsckresults%3D%22Can’t%20check%20ReiserFS%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fsckresults%3D%22%24(sudo%20fsck.reiserfs%20-y%20%2Fdev%2Fmapper%2F%24mapper%202%3E%261)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filesystemstatus%3D%22%24(sudo%20tune2fs%20-l%20%2Fdev%2Fmapper%2F%24mapper)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(echo%20%22%24filesystemstatus%22%20%7C%20grep%20%22Filesystem%20features%22%20%7C%20grep%20%22huge_file%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22EXT4%3A%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fsckresults%3D%22%24(sudo%20fsck.ext4%20-y%20%2Fdev%2Fmapper%2F%24mapper%202%3E%261)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22EXT3%3A%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fsckresults%3D%22%24(sudo%20fsck.ext4%20-y%20%2Fdev%2Fmapper%2F%24mapper%202%3E%261)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(echo%20%22%24fsckresults%22%20%7C%20grep%20-i%20%22no%20corruptions%20found%22)%22%20%5D%20%7C%7C%20%5C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B%20-n%20%22%24(echo%20%22%24fsckresults%22%20%7C%20grep%20%22clean%22)%22%20%5D%20%7C%7C%20%5C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B%20-n%20%22%24(echo%20%22%24fsckresults%22%20%7C%20grep%20%22ReiserFS%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20no%20filesystem%20corruptions%20detected.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Filesystem%20errors%20detected.%20%20It’s%20very%20risky%20to%20auto-repair%2C%20this%20is%20best%20done%20manually.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20it’s%20best%20to%20load%20as%20best%20you%20can%20and%20back%20everything%20up%20before%20you%20try.%20%20If%20backups%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20Are%20successful%2C%20it’s%20best%20to%20nuke%20this%20volume%2C%20re-create%20and%20then%20restore%20backups!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22test%20results%20were%3A%20’%24fsckresults’%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20fsckresults%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20loopclean%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24haserror%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Check%20successful%2C%20volume%20unmounted%20-%20no%20errors%20found.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22***%20Errors%20were%20detected%2C%20volume%20unmounted%20-%20please%20review%20above%20data.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20rekey)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20testperm%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%244%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20help%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filename%3D%242%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filekey%3D%243%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20newkey%3D%244%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fileordev%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24isdevice%20-eq%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20losetup%20%24cldevice%20%24filename%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20GPG%20pw%20only%20due%20to%20LUKS%20keyslot%20and%20command%20parameter%20difficulties%20-%20passwords%20are%20easy%2C%20keyfiles%20not%20so%20much.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20while%20possible%20with%20Dump%20examination%2C%20you%20have%20to%20use%20–key-file%20which%20means%20the%20key%20would%20hit%20the%20hard%20drive%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20at%20some%20point%20-%20not%20acceptable.%20%20Better%20to%20create%20a%20whole%20new%20one%20as%20necessary%20and%20move%20between%20cryptovolumes.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22This%20routine%20will%20render%20your%20old%20keyfile%20(‘%24filekey’)%20useless%20and%20issue%20a%20new%20key%20(‘%24newkey’).%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20The%20old%20keyfile%20will%20be%20wiped%20after%20the%20new%20one%20is%20created%20and%20verified.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20NOTE%20-%20this%20only%20changes%20the%20GPG%20password%2C%20not%20the%20LUKS%202000%2B%20character%20password!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20%20%20In%20order%20to%20do%20that%2C%20it’s%20best%20to%20generate%20a%20completely%20new%20LUKS%20volume%20and%20copy%20data%20from%20A%20to%20B%2C%20because%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20%20%20changing%20a%20password%20in%20LUKS%20doesn’t%20actually%20change%20the%20master%20key%2C%20only%20the%20keyslot%20contents.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22Press%20ENTER%20to%20proceed%20or%20CNTL-C%20to%20exit.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20read%20proceed%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22First%2C%20enter%20the%20password%20to%20your%20old%20key%20when%20prompted%20(press%20ENTER)%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20read%20proceed%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20keybuffer%3D%22%24(gpg%20–no-secmem-warning%20–quiet%20–decrypt%20%24filekey)%22%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22Second%2C%20enter%20the%20password%20for%20the%20new%20key%20when%20prompted%20(press%20ENTER)%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20read%20proceed%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%24keybuffer%20%7C%20sudo%20gpg%20–no-secmem-warning%20–no-random-seed-file%20–cipher-algo%20%24gpgcipher%20%5C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20–digest-algo%20%24gpgdigest%20–compress-algo%20%24gpgcompress%20–symmetric%20–force-mdc%20-a%20%3E%20%24newkey%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20rekey-gennewkey%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mapper%3D%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Cleaning%20up..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20loopclean%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20shred%20-u%20-n%2010%20%24filekey%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Task%20Complete.%22%0A%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20runcheck)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22This%20script%20was%20designed%20on%20OpenSuSE%20and%20BASH%20(later%20on%20Ubuntu)%20-%20this%20routine%20will%20help%20verify%20compatibility%20with%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20your%20particular%20Linux%20environment.%20%20Make%20sure%20you%20have%20reviewed%20the%20filesystem%20and%20blocksize%20preferences%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20the%20script%20prior%20to%20running.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D0%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(whoami)%22%20%3D%20%22root%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22running%20as%20’root’%20-%20you%20need%20to%20runcheck%20as%20a%20user.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20(You’ll%20need%20to%20run%20’lukstool%20make’%20as%20root%2C%20however)%20%20Exiting.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exit%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22You%20need%20to%20run%20’lukstool%20make’%20as%20root%20-%20make%20sure%20you%20can%20do%20so.%20%20Proceeding..%22%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22testing%20for%20randomness%20augmentation..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20checkrand%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24hasrand%20-lt%20%24numrandhelper%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22WARNING%20-%20random%20number%20entropy%20not%20improved%20by%20randomness%20improvement%20software!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20this%20will%20result%20in%20your%20cryptofile%20being%20tough%2C%20but%20not%20as%20tough%20as%20it%20should%20be.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20Please%20review%20www.death-zone.org%20-%20Projects%20-%20Military%20Grade%20Cryptofile%20-%20Real%20Randomness%20Comes%20First!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22sudoers%20access..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20touch%20%2Froot%2Ftestfile%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24%3F%20-ne%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20you%20need%20to%20be%20able%20to%20use%20’sudo’%20without%20a%20password.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20check%20your%20%2Fetc%2Fsudoers%20and%20make%20sure%20you’re%20in%20the%20’wheel’%20group.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20rm%20%2Froot%2Ftestfile%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22cryptsetup..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(which%20cryptsetup)%22%20%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20cryptsetup%20not%20found.%20%20Is%20LUKS%20installed%3F%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20check%20for%20RPM%20%2F%20packages%20cryptsetup%20and%20dm-crypt%2C%20or%20your%20path%20as%20a%20user%20%2F%20non-root.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22..filesystem%20support..%22%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20reiser%3D4%2C%20ext4%3D2%2C%20ext3%3D1%20(chmod%20summing%20method)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filesystems%3D0%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(which%20mkfs.reiserfs)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filesystems%3D%24((filesystems%2B4))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(which%20mkfs.ext4)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filesystems%3D%24((filesystems%2B2))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24(which%20mkfs.ext3)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20filesystems%3D%24((filesystems%2B1))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%24filesystems%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%207)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22..All%20file%20systems%20supported..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%206)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%24filesys%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext3)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22ext3%20configured%20but%20not%20supported!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext4)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22..ext4%20configured%20and%20supported..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20reiserfs)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22..ReiserFS%20configured%20and%20supported..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20esac%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%205)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%24filesys%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext3)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22…ext3%20configured%20and%20supported..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext4)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22ext4%20configured%20but%20not%20supported!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20reiserfs)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22..ReiserFS%20configured%20and%20supported..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20esac%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%204)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22ReiserFS%20is%20the%20only%20supported%20file%20system%20detected..%3F%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%24filesys%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext3)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22…ext3%20configured%20but%20not%20supported!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext4)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22…ext4%20configured%20but%20not%20supported!.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20esac%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%203)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Warning%20%3A%20ReiserFS%20support%20depricated%20on%20this%20host%2C%20may%20be%20unable%20to%20open%20old%20volumes.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%24filesys%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext3)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22…ext3%20configured%20and%20supported..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext4)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22…ext4%20configured%20and%20supported..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20esac%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Warning%20%3A%20ReiserFS%20support%20depricated%20on%20this%20host%2C%20may%20be%20unable%20to%20open%20old%20volumes.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%24filesys%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext3)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22ext3%20not%20supported%20by%20this%20system%20but%20that’s%20what’s%20configured%20for%20use!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext4)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22..ext4%20configured%20and%20supported..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20esac%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%201)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Warning%20%3A%20ReiserFS%20support%20depricated%20on%20this%20host%2C%20may%20be%20unable%20to%20open%20old%20volumes.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%24filesys%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext3)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22…ext3%20configured%20and%20supported..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext4)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22ext4%20not%20supported%20by%20this%20system%20but%20that’s%20what’s%20configured!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20esac%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%200)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Error%20-%20no%20file%20systems%20supported!%20(WTF%3F)%20%20Check%20system%20integrity!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20esac%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22losetup..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(which%20losetup)%22%20%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20’losetup’%20not%20found.%20%20Are%20you%20able%20to%20use%20loopback%20devices%3F%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20or%2C%20check%20also%20your%20path%20as%20a%20user%20%2F%20non-root.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22lsof..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(which%20lsof)%22%20%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20’lsof’%20not%20found.%20(or%2C%20check%20also%20your%20path%20as%20a%20user%20%2F%20non-root.)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22tr..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(which%20tr)%22%20%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20’tr’%20not%20found%2C%20which%20is%20used%20for%20password%20generation.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22gpg..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(which%20gpg)%22%20%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20’gpg’%20not%20found.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20this%20script%20requires%20GnuPG%20-%20hit%20www.gnupg.org%2C%20download%20and%20install%20it.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22dcfldd..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(which%20dcfldd)%22%20%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20’dcfldd’%20not%20found.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20this%20script%20requires%20dcfldd%2C%20which%20is%20an%20enhanced%20version%20of%20dd.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20’apt-get%20install%20dcfldd’%20or%20get%20it%20here%20-%20http%3A%2F%2Fdcfldd.sourceforge.net%2F%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22sha512sum..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(which%20sha512sum)%22%20%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20’sha512sum’%20not%20found.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20this%20script%20requires%20sha512sum.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22tune2fs..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(which%20tune2fs)%22%20%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20’tune2fs’%20not%20found.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22bc..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(which%20bc)%22%20%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20’bc’%20not%20found.%20%20This%20is%20a%20precision%20calculator%20program%20that%20is%20needed.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22confirming%20RANDOM..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(echo%20%24RANDOM)%22%20%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20problem%20with%20the%20RANDOM%20number%20generation%2C%20which%20could%20impact%20other%20parts%20of%20your%20machine%20as%20well..!.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20gpgver%3D%22%24(gpg%20–version)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22gpg%20compatibility..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%20%22%24(echo%20%24gpgver%20%7C%20grep%20%22Cipher%22%20%7C%20grep%20-i%20%24gpgcipher)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20GPG%20cipher%20%24gpgcipher%20is%20not%20supported%20on%20your%20system%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20you%20could%20change%20the%20cipher%20setting%2C%20but%20you%20really%20need%20to%20review%20why%20your%20GPG%20implementation%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20supports%20what%20it%20does%2C%20which%20is%3A%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%24gpgver%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%20%22%24(echo%20%24gpgver%20%7C%20grep%20%22Hash%22%20%7C%20grep%20%24gpgdigest)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20GPG%20digest%20%24gpgdigest%20is%20not%20supported%20on%20your%20system%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20you%20could%20change%20the%20digest%20setting%2C%20but%20you%20really%20need%20to%20review%20why%20your%20GPG%20implementation%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20supports%20only%20what%20it%20does%2C%20which%20is%3A%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%24gpgver%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22shred..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%22%24(which%20shred)%22%20%3D%20%22%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20’shred’%20not%20found.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20this%20script%20requires%20shred%2C%20a%20linux%20utility%20to%20eliminate%20files.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22dm_crypt..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%22%24(lsmod%20%7C%20grep%20%22dm_crypt%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20dm_crypt%20module%20not%20loaded%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20try%20’sudo%20modprobe%20dm_crypt’%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20-n%20%22sha512%20module..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%22%24(lsmod%20%7C%20grep%20%22sha512%22)%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20sha512%20module%20not%20loaded%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22%20%20try%20’sudo%20modprobe%20sha512’%2C%20and%20edit%20%2Fetc%2Fmodules%20to%20auto-load%20at%20next%20boot%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24obscount%20-gt%206%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22*%20error%20-%20obscount%20has%20an%20illegal%20value%20(cannot%20exceed%206)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20haserror%3D1%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20%24haserror%20%3D%200%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Testing%20complete%2C%20looks%20good.%20%20You%20should%20be%20able%20to%20use%20this%20script%20without%20grief.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Errors%20were%20found%20-%20please%20review%20the%20above%20prior%20to%20using%20this%20script!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20cleanup)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Cleaning%20up%20any%20stranded%20obscuring%20volumes..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obscurevols%3D%22%24(ls%20%2Fdev%2Fmapper%20%7C%20grep%20obscurevol)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-n%20%22%24obscurevols%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Cleaning%20up%20obscuring%20volumes..%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20obsvolume%20in%20%24(ls%20%2Fdev%2Fmapper%20%7C%20grep%20obscurevol)%3B%20do%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20cryptsetup%20luksClose%20%2Fdev%2Fmapper%2F%22%24obsvolume%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20obscure-luksclose%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sudo%20losetup%20-d%20%22%24(sudo%20losetup%20-a%20%7C%20grep%20%22%24obsvolume%22%20%7C%20cut%20-d%20%22%3A%22%20-f1)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20obscure-losetupclose%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20rm%20%2Ftmp%2F%22%24obsvolume%22.dat%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20errcheck%20obscure-rmobsvolume%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20done%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22No%20obscuring%20volumes%20found.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20mapper%20in%20%24(ls%20%2Fdev%2Fmapper)%3B%20do%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%5B%20-z%20%22%24(mount%20%7C%20grep%20%22%24mapper%22)%22%20%5D%20%26%26%20%5B%20%22%24mapper%22%20!%3D%20%22control%22%20%5D%3B%20then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20%22Cleaning%20%24mapper%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20loop%3D%24(echo%20%24mapper%20%7C%20cut%20-d%20′-‘%20-f1)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cldevice%3D%2Fdev%2F%24loop%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20loopclean%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fi%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20done%0A%20%20%20%20%20%20%20%20%3B%3B%0A%20%20%20%20%20%20%20%20*)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20help%0A%20%20%20%20%20%20%20%20%3B%3B%0Aesac%0A” message=”lukstool.sh” highlight=”” provider=”manual”/]
Leave A Reply