Created
September 1, 2013 13:32
-
-
Save jvhaarst/6404493 to your computer and use it in GitHub Desktop.
Small script to test the different SSH cipher speeds, by copying a file through an SSH connection to localhost to /dev/null
This file contains 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 | |
#openssl rand -out 1G.rnd -base64 $(( 2**30 * 3/4 )) | |
# File should not be too small, otherwise measuring differences becomes harder | |
# And not be too big, otherwise it just takes too long... | |
testfile=$1 | |
# Print header | |
echo "cipher;time" | |
# First get the testfile into cache: | |
cat ${testfile} > /dev/null | |
cat ${testfile} > /dev/null | |
# Now run the tests | |
for try in `seq 1 10` ; do # I cycle through the ciphers, so that temporary system load is evened out over the ciphers | |
for cipher in arcfour arcfour256 arcfour128 3des-cbc blowfish-cbc cast128-cbc [email protected] aes128-ctr aes128-cbc aes192-ctr aes192-cbc aes256-ctr aes256-cbc; do | |
echo -n ${cipher}";" | |
# To get accurate timing, you need to bypass scp's reporting | |
bash -c "time -p scp -4 -o Compression=no -c ${cipher} ${testfile} ${USER}@localhost:/dev/null" 2>&1 | head -1 | awk '{print $2}' | |
done | |
done | |
# Graph in R: | |
# scp_local_speed <- read.csv("scp_local_speed.csv", sep=";");par(mar=c(12,5,1,1));boxplot(time ~ cipher,data=scp_local_speed,las=2,xlab="Cipher",ylab="Time(s)") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment