Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My Linux server spends a lot of time computing LUKS encryption. Is there any way to hardware accelerate it (with a PCI express card for example)?

share|improve this question
1  
Depending on what kind of system you have now, a faster/better processor might do. Also, define "much time". –  SvW Aug 14 '11 at 19:36
    
It's 1/3 speed of normal I/O operation. I don't happy to waste the 2/3 of the speed beause of encryption. It's Ubuntu Server. –  Glendyr Aug 14 '11 at 19:53
1  
What is your processor? The last models of Intel has AES-NI and VIA has had cryptographic hardware for years. Intel (I dont' know AMD) has especial optimizations for AES gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html . –  Juan Francisco Cantero Hurtado Aug 14 '11 at 20:05
add comment

3 Answers

up vote 9 down vote accepted

Beginning with Kernel 2.6.32 the AES-NI instructions on newer Intel processors are supported by dm-crypt. You might want to check /proc/cpuinfo if your processor supports these instructions. Otherwise, upgrading your processor will speed up your harddisk encryption (provided you are actually using AES encryption)

More info: http://en.wikipedia.org/wiki/AES_instruction_set

share|improve this answer
    
Interesting - what you got and docs/links on the subject? –  Coops Aug 14 '11 at 20:36
1  
modprobe aesni-intel or add it to /etc/initramfs-tools/modules and run update-initramfs -u. –  earthmeLon Jan 15 '13 at 18:23
    
@earthmeLon that is exactly what i was looking for! –  ortang May 26 '13 at 14:39
add comment

AESNI is hardware acceleration for AES encryption. As long as your LUKS/dmcrypt is setup to use AES, which it most likely is, and so long that your processor supports it, you can add the AESNI kernel module manually or automatically.

Manual (test to make sure it works/is supported)

  • sudo modprobe aesni-intel

Automatic

  • sudo vim /etc/initramfs-tools/modules
    • Add aesni_intel
  • sudo update-initramfs -u

You want to add it to your initramfs, and not just your normal kernel because you want it to be available before you decrypt your drive and load your main kernel.

share|improve this answer
    
Note Most (if not all) Intel i3's do not support AESNI. You can check by looking for "aes" in /proc/cpuinfo: grep aes /proc/cpuinfo. –  earthmeLon May 26 '13 at 17:08
add comment

To my knowledge, there are no such add-on cards for dm-crypt/luks encrypion. DM doesn't support them.

That said, it does look like there is a move afoot to get GPU-acceleration into the processing pipeline if it is available. As servers still rarely have GPUs in them (though that's changing) this may not be that useful for you.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.