Update README and test cases with new crypto options.

Update usage text.
This commit is contained in:
Moinak Ghosh 2013-03-05 21:07:54 +05:30
parent fa9fbdb7a4
commit e41f156beb
5 changed files with 22 additions and 13 deletions

View file

@ -131,11 +131,17 @@ NOTE: The option "libbsc" uses Ilya Grebnov's block sorting compression library
'-C' - Display compression statistics
Encryption flags:
'-e' Encrypt chunks with AES-CTR. The password can be prompted from the user
or read from a file. Unique keys are generated every time pcompress is
run even when giving the same password. Of course enough info is stored\
in the compresse file so that the key used for the file can be
re-created given the correct password.
'-e <ALGO>'
Encrypt chunks using the given encryption algorithm. The algo parameter
can be one of AES or SALSA20. Both are used in CTR stream encryption
mode.
The password can be prompted from the user or read from a file. Unique
keys are generated every time pcompress is run even when giving the same
password. Of course enough info is stored in the compresse file so that
the key used for the file can be re-created given the correct password.
Default key length if 256 bits but can be reduced to 128 bits using the
'-k' option.
The Scrypt algorithm from Tarsnap is used
(See: http://www.tarsnap.com/scrypt.html) for generating keys from
@ -148,7 +154,7 @@ NOTE: The option "libbsc" uses Ilya Grebnov's block sorting compression library
'-k <key length>'
Specify the key length. Can be 16 for 128 bit keys or 32 for 256 bit
keys. Default value is 23 for 256 bit keys.
keys. Default value is 32 for 256 bit keys.
NOTE: When using pipe-mode via -p the only way to provide a password is to use '-w'.

9
main.c
View file

@ -172,9 +172,12 @@ usage(void)
" '-C' - Display compression statistics\n\n");
fprintf(stderr, "\n"
"8) Encryption flags:\n"
" '-e' - Encrypt chunks with AES-CTR. The password can be prompted from the\n"
" user or read from a file. Unique keys are generated every time\n"
" pcompress is run even when giving the same password.\n"
" '-e <ALGO>'\n"
" - Encrypt chunks with the given encrption algorithm. The ALGO parameter\n"
" can be one of AES or SALSA20. Both are used in CTR stream encryption\n"
" mode. The password can be prompted from the user or read from a file.\n"
" Unique keys are generated every time pcompress is run even when giving\n"
" the same password. Default key length is 256-bits (see -k below).\n"
" '-w <pathname>'\n"
" - Provide a file which contains the encryption password. This file must\n"
" be readable and writable since it is zeroed out after the password is\n"

View file

@ -10,7 +10,7 @@ do
for tf in `cat files.lst`
do
rm -f ${tf}.*
for feat in "-e" "-e -L -S SHA256" "-D -e -S SHA512" "-D -EE -L -e -S BLAKE512" "-e -S CRC64" "-e -P" "-e -L -P -S KECCAK256" "-D -e -L -S KECCAK512"
for feat in "-e AES" "-e AES -L -S SHA256" "-D -e SALSA20 -S SHA512" "-D -EE -L -e SALSA20 -S BLAKE512" "-e AES -S CRC64" "-e -P" "-e AES -L -P -S KECCAK256" "-D -e SALSA20 -L -S KECCAK512" "-e AES -k16" "-e SALSA20 -k16"
do
for seg in 2m 100m
do

View file

@ -12,7 +12,7 @@ for algo in lzfx adapt2
do
for tf in `cat files.lst`
do
for feat in "-e" "-e -L" "-D -e" "-D -EE -L -e" "-e -S CRC64"
for feat in "-e SALSA20" "-e AES -L" "-D -e SALSA20" "-D -EE -L -e AES" "-e SALSA20 -S CRC64" "-e SALSA20 -L" "-e AES -E"
do
for seg in 2m 5m
do

View file

@ -35,7 +35,7 @@ do
break
done
for feat in "-B8 -s2m -l1" "-B0 -s2m -l1" "-D -s10k -l1" "-D -F -s2m -l1" "-p -e -s2m -l1" "-s2m -l15"
for feat in "-B8 -s2m -l1" "-B0 -s2m -l1" "-D -s10k -l1" "-D -F -s2m -l1" "-p -e AES -s2m -l1" "-s2m -l15" "-e AES -k64" "-e SALSA20 -k8" "-e AES -k8" "-e SALSA20 -k64"
do
for algo in lzfx lz4 zlib bzip2 libbsc ppmd lzma
do
@ -117,7 +117,7 @@ do
rm -f ${tstf}.1 ${tstf}.1.pz ${tstf}.pz
echo "plainpass" > /tmp/pwf
cmd="../../pcompress -c zlib -l3 -s1m -e -w /tmp/pwf $feat ${tstf}"
cmd="../../pcompress -c zlib -l3 -s1m -e SALSA20 -w /tmp/pwf $feat ${tstf}"
echo "Running $cmd"
eval $cmd
if [ $? -ne 0 ]