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 '-C' - Display compression statistics
Encryption flags: Encryption flags:
'-e' Encrypt chunks with AES-CTR. The password can be prompted from the user '-e <ALGO>'
or read from a file. Unique keys are generated every time pcompress is Encrypt chunks using the given encryption algorithm. The algo parameter
run even when giving the same password. Of course enough info is stored\ can be one of AES or SALSA20. Both are used in CTR stream encryption
in the compresse file so that the key used for the file can be mode.
re-created given the correct password. 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 The Scrypt algorithm from Tarsnap is used
(See: http://www.tarsnap.com/scrypt.html) for generating keys from (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>' '-k <key length>'
Specify the key length. Can be 16 for 128 bit keys or 32 for 256 bit 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'. 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"); " '-C' - Display compression statistics\n\n");
fprintf(stderr, "\n" fprintf(stderr, "\n"
"8) Encryption flags:\n" "8) Encryption flags:\n"
" '-e' - Encrypt chunks with AES-CTR. The password can be prompted from the\n" " '-e <ALGO>'\n"
" user or read from a file. Unique keys are generated every time\n" " - Encrypt chunks with the given encrption algorithm. The ALGO parameter\n"
" pcompress is run even when giving the same password.\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" " '-w <pathname>'\n"
" - Provide a file which contains the encryption password. This file must\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" " 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` for tf in `cat files.lst`
do do
rm -f ${tf}.* 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 do
for seg in 2m 100m for seg in 2m 100m
do do

View file

@ -12,7 +12,7 @@ for algo in lzfx adapt2
do do
for tf in `cat files.lst` for tf in `cat files.lst`
do 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 do
for seg in 2m 5m for seg in 2m 5m
do do

View file

@ -35,7 +35,7 @@ do
break break
done 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 do
for algo in lzfx lz4 zlib bzip2 libbsc ppmd lzma for algo in lzfx lz4 zlib bzip2 libbsc ppmd lzma
do do
@ -117,7 +117,7 @@ do
rm -f ${tstf}.1 ${tstf}.1.pz ${tstf}.pz rm -f ${tstf}.1 ${tstf}.1.pz ${tstf}.pz
echo "plainpass" > /tmp/pwf 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" echo "Running $cmd"
eval $cmd eval $cmd
if [ $? -ne 0 ] if [ $? -ne 0 ]