Revised Raspberry Pi TrueCrypt Benchmark

Revised March 31, 2013 with updated benchmarking approach that uses actual access to the mounted volume. New results show no appreciable sensitivity to hash, which is as expected. The numbers are for encryption only (write). I have not pursued read.

Hash
Algorithm
Encryption
Algorithm
Rate
(MB/s)
SHA-512 Twofish 2.8
Whirlpool Twofish 2.8
RIPEMD-160 Twofish 2.8
SHA-512 Serpent 2.6
Whirlpool Serpent 2.6
RIPEMD-160 Serpent 2.6
Whirlpool AES 2.1
RIPEMD-160 AES 2.1
SHA-512 AES 2.1
SHA-512 Twofish-Serpent 2.0
Whirlpool Twofish-Serpent 2.0
RIPEMD-160 Twofish-Serpent 1.9
SHA-512 AES-Twofish 1.6
RIPEMD-160 AES-Twofish 1.6
Whirlpool AES-Twofish 1.6
Whirlpool Serpent-AES 1.6
SHA-512 Serpent-AES 1.6
RIPEMD-160 Serpent-AES 1.6
Whirlpool AES-Twofish-Serpent 1.3
Whirlpool Serpent-Twofish-AES 1.3
SHA-512 Serpent-Twofish-AES 1.3
SHA-512 AES-Twofish-Serpent 1.3
RIPEMD-160 Serpent-Twofish-AES 1.3
RIPEMD-160 AES-Twofish-Serpent 1.3

Shell Script for Timing


#!/bin/bash

# Create a file of random elements, needs to be at least 300 bytes
 dd if=/dev/random of=random bs=512 count=1

# Iterate over the hash hash funnctions
 for HASH in RIPEMD-160 SHA-512 Whirlpool
 do
 # Iterate over the available encryption algorithms
 for ENCALG in AES Serpent Twofish AES-Twofish AES-Twofish-Serpent Serpent-AES Serpent-Twofish-AES Twofish-Serpent
 do
 # Write the algorithms to the log
 echo "Algorithms: $HASH $ENCALG" >> log
 # TrueCrypt will report the performance in the output
 truecrypt -c /home/pi/test.tc --filesystem=fat --size=10485760
 --encryption=$ENCALG -p ppp --random-source=random 
 --hash=$HASH --volume-type=normal --non-interactive
 # Mount the partition
 truecrypt --non-interactive -p ppp -m nokernelcrypto test.tc /home/pi/tcvol
 (time  ./timeit) 2>> log
 truecrypt -d /home/pi/tcvol
 # Erase the created file
 rm test.tc
 done
 done

Timed Routine


dd if=/dev/zero of=tcvol/test bs=5242880 count=1 &> /dev/null

sync

Python Reprocessor


import sys
 fid = open( sys.argv[1], 'r')
 lines = fid.readlines()
 fid.close()

tsecs = None
 while len( lines) > 0:
 line = lines.pop(0)
 lls = line.strip()

if lls.startswith( 'Algo'):
 # If we already have a tsecs, then print
 # the last elements
 toks = lls.split()
 if tsecs == None: # first record
 algo = ",".join( toks[1:3])
 else:
 print algo,",",tsecs
 algo = ",".join( toks[1:3])
 elif lls.startswith( 'real'):
 toks = lls.split()
 toks = toks[-1].split('m')
 tsecs = float( toks[0])*60 + float( toks[1].replace('s', ''))

print algo,",",tsecs


Comments

2 responses to “Revised Raspberry Pi TrueCrypt Benchmark”

  1. […] Note: The results in this post have been improved with more accurate values at Revised Raspberry Pi TrueCrypt Benchmark. […]

  2. Very nice script!
    I evere wanted to do the same but my scripting skills are at the very beginning..so thank you for sharing this!