Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Closer to TrueCrypt support. Only missing the command line switch now

  • Loading branch information...
commit 3231f9c48d9817d279de1db5017e40f262c0cabf 1 parent 4ab88b8
Thomas Frivold authored
Showing with 39 additions and 33 deletions.
  1. +5 −4 LUKSUS
  2. +17 −22 LUKSUS.checks
  3. +14 −4 LUKSUS.functions
  4. +3 −3 LUKSUS.variables
View
9 LUKSUS
@@ -20,7 +20,7 @@
if [ -r LUKSUS.variables ]; then
source LUKSUS.variables
else
- exit 0
+ exit 1
fi
###############################
@@ -31,7 +31,7 @@ fi
if [ -r LUKSUS.functions ]; then
source LUKSUS.functions
else
- exit 0
+ exit 1
fi
@@ -42,7 +42,7 @@ fi
if [ -r LUKSUS.welcome ]; then
source LUKSUS.welcome
else
- exit 0
+ exit 1
fi
@@ -54,7 +54,7 @@ fi
if [ -r LUKSUS.checks ]; then
source LUKSUS.checks
else
- exit 0
+ exit 1
fi
@@ -77,4 +77,5 @@ THESECRETSAUCE
CREATEANDMOUNTFS
DISPLAYLOGO
DISPLAYSUMMARY
+DISPLAYSUMMARY 1>$keydir/$name.information 2>$keydir/$name.information
exit 0
View
39 LUKSUS.checks
@@ -5,37 +5,30 @@
# for consistency and correctness sake. It only checks the first $1
# and second $2 argument.
-
## COMMAND LINE ARGUMENTS
## Checking to see if the user wants to use truecrypt
-USAGE="Usage: `basename $0` [-t]"
+## Playing around with arcane getopts
-# Parse command line options.
-while getopts t: OPT; do
- case "$OPT" in
- t)
- TRUECRYPT=true
- echo TrueCrypt encryption facility chosen.
- ;;
+options=':t'
+while getopts $options option
+do
+ case $option in
+ t ) USETRUECRYPT=true;;
+ \? ) if (( (err & ERROPTS) != ERROPTS ))
+ then
+ error $NOEXIT $ERROPTS "Unknown option."
+ fi;;
+ * ) error $NOEXIT $ERROARG "Missing option argument.";;
esac
done
-# Remove the switches we parsed above.
-#shift `expr $OPTIND - 1`
+shift $(($OPTIND - 1))
-# We want at least one non-option argument.
-# Remove this block if you don't need it.
-#if [ $# -eq 0 ]; then
-# echo $USAGE >&2
-# exit 1
-#fi
-# Access additional arguments as usual through
-# variables $@, $*, $1, $2, etc. or using this loop:
-for PARAM; do
- echo $PARAM
-done
+## Testing if the user has any options for LUKSUS. These should
+# probably be ported to GETOPTS code, but it has to stay like this for
+# now.
if [ -z "$1" ]
then
echo ""
@@ -121,3 +114,5 @@ vnconfig 1>/dev/null 2>/dev/null
else
echo On Linux, continuing.
fi
+
+
View
18 LUKSUS.functions
@@ -80,8 +80,9 @@ DRIVE: $device \n
MOUNTPOINT: $mountpoint \n
KEYFILE: $keyfile \n
HEADER BACKUP: $headerfile\n
-FILECONTAINER LOCATION: $luksfile
-FILECONTAINER SIZE: $luksfilesize
+FILECONTAINER LOCATION: $luksfile\n
+FILECONTAINER SIZE: $luksfilesize\n
+USING TRUECRYPT: $USETRUECRYPT\n
" 50 50
@@ -109,12 +110,17 @@ THESECRETSAUCE()
mkdir -p $mountpoint
mkdir -p $keydir
-
# dd
# generate a keyfile using completely random data
# from /dev/urandom
dd if=/dev/urandom of=$keyfile bs=512 count=256
-echo cryptsetup starting
+
+# Begin the encryption - with TrueCrypt or LUKS
+if [[ $USETRUECRYPT = true ]];
+then
+echo TrueCrypt mode
+tcplay --create --device=$device --cipher=AES-256-XTS --keyfile=$keyfile --map=$name
+else
# cryptsetup
# format the drive using encryption
# create an encrypted drive with aes-xts-plain cipher
@@ -122,7 +128,11 @@ echo cryptsetup starting
# remember that the key size will increase the safety of the
# encryption, but the a stronger keyfile with more entropy (randomness)
# will produce the best security.
+echo Cryptsetup mode
cryptsetup --batch-mode --verbose --key-size=512 --cipher=aes-xts-plain64 luksFormat $device $keyfile
+fi
+
+
# cryptsetup isLuks
# check to see if the device has got a valid LUKS container
View
6 LUKSUS.variables
@@ -1,6 +1,6 @@
programname=LUKSUS
-version=v0.8.91
-date=05.03.2013
+version=v0.95
+date=06.03.2013
author="Thomas J. Frivold"
time1="$(date +%s.%N)"
@@ -19,4 +19,4 @@ UNAME=`uname`
screensize=`stty size`
height=$(echo $screensize | cut -d " " -f 1)
width=$(echo $screensize | cut -d " " -f 2)
-
+USETRUECRYPT=false
Please sign in to comment.
Something went wrong with that request. Please try again.