Created
June 30, 2016 11:21
-
-
Save WOnder93/51bc8300bdf05c4654e9926477ed913c to your computer and use it in GitHub Desktop.
Cryptsetup benchmark script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VERSIONS='1.6.8 1.7.0' | |
BACKENDS='openssl gcrypt' | |
HASHES='ripemd160 sha1 sha256 sha512' | |
TEMPFILE=$(mktemp) | |
dd if=/dev/zero of="$TEMPFILE" count=1 bs=8M | |
for BACKEND in $BACKENDS; do | |
for VER in $VERSIONS; do | |
DIR="cryptsetup-${VER}-${BACKEND}" | |
if ! [ -e "$DIR" ]; then | |
git clone https://gitlab.com/cryptsetup/cryptsetup.git "$DIR" || continue | |
( | |
cd "$DIR" | |
git checkout v${VER//\./_} || continue | |
./autogen.sh --with-crypto_backend=$BACKEND || continue | |
make || continue | |
) | |
fi | |
done | |
done | |
for BACKEND in $BACKENDS; do | |
for VER in $VERSIONS; do | |
DIR="cryptsetup-${VER}-${BACKEND}" | |
( | |
cd "$DIR" | |
echo "Benchmark for $DIR..." | |
for HASH in $HASHES; do | |
src/cryptsetup benchmark -s 256 -h "$HASH" | grep PBKDF2 | |
done | |
for HASH in $HASHES; do | |
echo -n password | src/cryptsetup -h "$HASH" luksFormat "$TEMPFILE" /dev/stdin # --debug | |
echo -n "$HASH" | |
printf '\t' | |
src/cryptsetup luksDump "$TEMPFILE" | grep "Iterations" | egrep -o "[0-9]+" | |
done | |
) | |
done | |
done | |
rm -f "$TEMPFILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment