INadvisable EXperimental Asymmetric Crypto Tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

71 lines
1.8 KiB

#!/bin/bash
function print_rand_str() {
set="abcdefghijklmonpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
n=32
rand=""
for i in `seq 1 $n`; do
char=${set:$RANDOM % ${#set}:1}
rand+=$char
done
echo $rand
}
rm -f *.key
./inexact --no-password -g -k alices.key -p alicep.key
./inexact --no-password -g -k bobs.key -p bobp.key
MSG=$(print_rand_str)
MSG2=$(echo "$MSG" | ./inexact -e -k alices.key -p bobp.key | ./inexact -d -k bobs.key -p alicep.key )
if [[ "$MSG" == "$MSG2" ]]
then
echo "TEST: OK"
else
echo "TEST: KO"
fi
MSG=$(print_rand_str)
MSG2=$(echo "$MSG" | ./inexact -e -k alices.key -p bobp.key --base64 | ./inexact -d -k bobs.key -p alicep.key )
if [[ "$MSG" == "$MSG2" ]]
then
echo "TEST: OK"
else
echo "TEST: KO"
fi
MSG=$(print_rand_str)
MSG2=$(echo "$MSG" | ./inexact -e -k alices.key -p bobp.key -c 300 | ./inexact -d -k bobs.key -p alicep.key )
if [[ "$MSG" == "$MSG2" ]]
then
echo "TEST: OK"
else
echo "TEST: KO"
fi
MSG=$(print_rand_str)
MSG2=$(echo "$MSG" | ./inexact -e -k alices.key -p bobp.key -n 300 | ./inexact -d -k bobs.key -p alicep.key )
if [[ "$MSG" == "$MSG2" ]]
then
echo "TEST: OK"
else
echo "TEST: KO"
fi
MSG=$(print_rand_str)
MSG2=$(echo "$MSG" | ./inexact -e -k alices.key -p bobp.key -t 64 | ./inexact -d -k bobs.key -p alicep.key )
if [[ "$MSG" == "$MSG2" ]]
then
echo "TEST: OK"
else
echo "TEST: KO"
fi
MSG=$(print_rand_str)
MSG2=$(echo "$MSG" | ./inexact -e -k alices.key -p bobp.key -t 64 -n 16 | ./inexact -d -k bobs.key -p alicep.key )
if [[ "$MSG" == "$MSG2" ]]
then
echo "TEST: OK"
else
echo "TEST: KO"
fi
MSG2=$(echo "$MSG" | ./inexact -e -k alices.key -p bobp.key -w | ./inexact -d -k bobs.key -p alicep.key )
if [[ "$MSG" == "$MSG2" ]]
then
echo "TEST: OK"
else
echo "TEST: KO"
fi