IO性能を排除するため、tmpfsに適当なdataを作成。
pi@raspberrypi ~ $ dd if=/dev/urandom of=/run/shm/data bs=25M count=1
1+0 records in
1+0 records out
26214400 bytes (26 MB) copied, 26.3748 s, 994 kB/s
AESとcamelliaを、128bit, 256bitで比較。
pi@raspberrypi /run/shm $ time openssl aes-128-cbc -in data -out data.enc -k password
real 0m2.310s
user 0m1.920s
sys 0m0.380s
pi@raspberrypi /run/shm $ time openssl aes-128-cbc -d -in data.enc -k password > /dev/null
real 0m2.256s
user 0m2.050s
sys 0m0.190s
pi@raspberrypi /run/shm $ rm data.enc
pi@raspberrypi /run/shm $ time openssl camellia-128-cbc -in data -out data.enc -k password
real 0m3.134s
user 0m2.730s
sys 0m0.390s
pi@raspberrypi /run/shm $ time openssl camellia-128-cbc -d -in data.enc -k password > /dev/null
real 0m3.092s
user 0m2.820s
sys 0m0.260s
pi@raspberrypi /run/shm $ rm data.enc
pi@raspberrypi /run/shm $ time openssl aes-256-cbc -in data -out data.enc -k password
real 0m2.860s
user 0m2.430s
sys 0m0.380s
pi@raspberrypi /run/shm $ time openssl aes-256-cbc -d -in data.enc -k password > /dev/null
real 0m2.774s
user 0m2.600s
sys 0m0.170s
pi@raspberrypi /run/shm $ rm data.enc
pi@raspberrypi /run/shm $ time openssl camellia-256-cbc -in data -out data.enc -k password
real 0m3.820s
user 0m3.440s
sys 0m0.360s
pi@raspberrypi /run/shm $ time openssl camellia-256-cbc -d -in data.enc -k password > /dev/null
real 0m3.713s
user 0m3.490s
sys 0m0.220s
pi@raspberrypi /run/shm $ rm data.enc
入っていたopensslはこれ。
pi@raspberrypi /run/shm $ openssl version
OpenSSL 1.0.1c 10 May 2012
camellia予想以上に遅かった (´・ω・`)
PR