hey, i just did some benchmarking regarding the speed of luksOpen, as i have the impression that it sometimes takes really long. for the benchmark i created eight different key files (dd if=/dev/urandom of=key_<size> bs=<size> count=1) with different sizes: 128b 512b 1k 16k 64k 128k 512k 1m afterwards i added all these keys to key slots of a luks device. i used a 4mb lvm logical volume as device. after running luksOpen for the device with every key several times i got the following result: run #1: luksOpen_128b: 0:10.14 luksOpen_512b: 0:16.08 luksOpen_1k: 0:05.70 luksOpen_16k: 0:14.10 luksOpen_64k: 0:11.73 luksOpen_128k: 0:02.14 luksOpen_512k: 0:05.26 luksOpen_1m: 0:13.41 run #2: luksOpen_128b: 0:09.70 luksOpen_512b: 0:16.05 luksOpen_1k: 0:05.67 luksOpen_16k: 0:14.05 luksOpen_64k: 0:12.11 luksOpen_128k: 0:01.79 luksOpen_512k: 0:05.23 luksOpen_1m: 0:13.36 run #3: luksOpen_128b: 0:09.62 luksOpen_512b: 0:16.05 luksOpen_1k: 0:05.69 luksOpen_16k: 0:13.22 luksOpen_64k: 0:12.07 luksOpen_128k: 0:02.12 luksOpen_512k: 0:05.30 luksOpen_1m: 0:12.92 it is obvious that the time luksOpen takes is related to the keysize. but for some non-obvious reason it is neither proportional nor inverse proportional related to size. instead there seem to be keyfile sizes which cryptsetup is able to process a lot faster than others. especially 128k seems to be a very good size for key files. can anybody explain that to me? greetings, jonas
Attachment:
signature.asc
Description: Digital signature