21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Pentium III, which should give a good indication of how the algorithms perform in<br />

general.<br />

On a 1 GHz machine, you would need an algorithm running at 1 cycle per byte to be<br />

able to encrypt 1 gigabyte per second. On a 3 GHz machine, you would only need<br />

the algorithm to run at 3 cycles per byte. Some of the implementations listed in the<br />

table are therefore capable of handling gigabit speeds fairly effortlessly on reasonable<br />

PC hardware.<br />

Note that you won’t generally quite get such speeds in practice as a result of overhead<br />

from cache misses and other OS-level issues, but you may come within a cycle<br />

or two per byte.<br />

Table 5-1. Noncommercial implementations for popular patent-free encryption algorithms<br />

Cipher Key size Speeda Implementation Notes<br />

AES 128 bitsb 14.1 cpb in asm, Brian Gladman’s<br />

22.6 cpb in C<br />

c The assembly version currently works only<br />

on Windows.<br />

AES 128 bits 41.3 cpb OpenSSL This could be a heck of a lot better and<br />

should probably improve in the near future.<br />

Currently, we recommend Brian Gladman’s<br />

C code instead. Perhaps OpenSSL will incorporate<br />

Brian’s code soon!<br />

Triple DES 192 bitsd 108.2 cpb OpenSSL<br />

SNOW 2.0 128 or 256 bits 6.4 cpb Fast reference<br />

implementatione This implementation is written in C.<br />

RC4 Up to 256 bits<br />

(usually 128 bits)<br />

10.7 cpb OpenSSL<br />

Serpent 128, 192, or 256 35.6 cpb Fast reference It gets a lot faster on 64-bit platforms and is<br />

bits<br />

implementation at least as fast as AES in hardware.<br />

Blowfish Up to 256 bits<br />

(usually 128 bits)<br />

23.2 cpb OpenSSL<br />

a All timing values are best cases based on empirical testing and assumes that the data being processed is already in cache. Do not expect<br />

that you’ll quite be able to match these speeds in practice.<br />

b AES supports 192-bit and 256-bit keys, but the algorithm then runs slower.<br />

c http://fp.gladman.plus.com/AES/<br />

d The effective strength of Triple DES is theoretically no greater than112 bits.<br />

e Available from http://www.it.lth.se/cryptology/snow/<br />

As we mentioned, we generally prefer AES (when used properly), which is not only a<br />

standard but also is incredibly fast for a block cipher. It’s not quite as fast as RC4,<br />

but it seems to have a far better security margin. If speed does make a difference to<br />

you, you can choose SNOW 2.0, which is actually faster than RC4. Or, in some environments,<br />

you can use an AES mode of operation that allows for parallelization,<br />

which really isn’t possible in an interoperable way using RC4. Particularly in hardware,<br />

AES in counter mode can achieve much higher speeds than even SNOW can.<br />

Figuring Out Which Encryption Algorithm Is Best | 159<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!