<div>You&#39;re mistaken here. AES *always* has a block size of 128 bits (it was one of the requirements for the competition to create the AES standard). The algorithm on which AES is based (Rijndael) can support 192 or 256 bits, but this is considered nonstandard today, and does not provide any provable benefit to security. The variable in AES that we usually refer to (as in aes-128) is the key size. Smaller key sizes mean a smaller key space (technically, easier to bruteforce, but still unreasonably hard at present), but they are also dramatically slower. If I recall correctly, aes-192 is almost 50% slower than aes-128 and aes-256 is an additional 15-25% (but I don&#39;t have a source for those numbers at this time). AES-128 is still considered secure.</div>
<div><br></div><div>All of that aside, the encryption speed is a non-issue here. Unless you&#39;re using a large portion of a gigabit connection, AES will work far faster than your line speed on a modern processor. Additionally, just measuring the speed of that algorithm is very far from the entire story; there are MACs involved and tor has its own things that need to be applied, including layers of encryption. Still, I don&#39;t see encryption being a large issue for any but low-powered machines with high bandwidth connections.&nbsp;</div>
<br clear="all"> &nbsp;- John Brooks<br>
<br><div class="gmail_quote">On Mon, Feb 23, 2009 at 9:23 AM, Arjan <span dir="ltr">&lt;<a href="mailto:n6bc23cpcduw@list.nospam.xutrox.com">n6bc23cpcduw@list.nospam.xutrox.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d">Olaf Selke wrote:<br>
&gt; hello there,<br>
&gt;<br>
&gt; as I understood tor spends most of its cpu time within openssl library aes crypto.<br>
&gt; Which result of &quot;openssl speed aes&quot; applies to tor? Is it aes-128 cbc 16 bytes?<br>
<br>
</div>It would be nice if Tor was using bigger blocks, but I&#39;ve not looked at<br>
the code yet.<br>
<div class="Ih2E3d"><br>
<br>
&gt; In this case my old Prestonia P4 Netburst Xeon box&#39;s throughput is supposed to<br>
&gt; be roughly about 40 MBit/s as middleman. Correct?<br>
&gt;<br>
&gt; type &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 16 bytes &nbsp; &nbsp; 64 bytes &nbsp; &nbsp;256 bytes &nbsp; 1024 bytes &nbsp; 8192 bytes<br>
&gt; aes-128 cbc &nbsp; &nbsp; &nbsp;84098.99k &nbsp; 119729.69k &nbsp; 138053.97k &nbsp; 142741.16k &nbsp; 144386.04k<br>
&gt; aes-192 cbc &nbsp; &nbsp; &nbsp;75035.35k &nbsp; 104143.72k &nbsp; 115681.81k &nbsp; 120099.84k &nbsp; 120949.42k<br>
&gt; aes-256 cbc &nbsp; &nbsp; &nbsp;69559.47k &nbsp; &nbsp;92221.78k &nbsp; 102006.05k &nbsp; 105361.75k &nbsp; 100274.74k<br>
&gt;<br>
&gt; Strange to say that my desktop Core2 Duo E8400 @home performs only 33% better in<br>
&gt; openssl aes crypto than one of the old P4 Netburst Xeon cores from my tor node.<br>
&gt; For the sake of better performance I&#39;m thinking about replacing my tor node&#39;s<br>
&gt; hardware.<br>
<br>
</div>If you&#39;re going to replace hardware, hardware assisted encryption may be<br>
an option. Recent VIA CPUs like the C7 and the Nano can do that. Their<br>
clock frequency isn&#39;t very high, so something else (instead of<br>
encryption) may become the bottleneck.<br>
<br>
Resuls for VIA Nano (with 32-bit openssl):<br>
<br>
VIA Nano 1.6 GHz with padlock engine<br>
<div class="Ih2E3d">type &nbsp; &nbsp; &nbsp; &nbsp; 16 bytes &nbsp; &nbsp;64 bytes &nbsp; 256 bytes &nbsp;1024 bytes &nbsp;8192 bytes<br>
</div>aes-128-cbc &nbsp;69796.09k &nbsp;275407.68k &nbsp;585574.57k &nbsp;815018.33k &nbsp;920136.36k<br>
aes-192-cbc &nbsp;52670.82k &nbsp;208539.14k &nbsp;472485.55k &nbsp;691277.82k &nbsp;798340.44k<br>
aes-256-cbc &nbsp;50984.77k &nbsp;201934.27k &nbsp;439964.25k &nbsp;623764.14k &nbsp;709612.89k<br>
<br>
VIA Nano 1.6 GHz without padlock engine<br>
<div class="Ih2E3d">type &nbsp; &nbsp; &nbsp; &nbsp; 16 bytes &nbsp; &nbsp;64 bytes &nbsp; 256 bytes &nbsp;1024 bytes &nbsp;8192 bytes<br>
</div>aes-128-cbc &nbsp;41429.86k &nbsp; 55836.29k &nbsp; 60886.87k &nbsp; 62508.03k &nbsp; 62974.63k<br>
aes-192-cbc &nbsp;35838.02k &nbsp; 47521.62k &nbsp; 51671.72k &nbsp; 52854.10k &nbsp; 53177.00k<br>
aes-256-cbc &nbsp;33208.77k &nbsp; 41789.16k &nbsp; 45009.83k &nbsp; 45891.24k &nbsp; 46153.73k<br>
<br>
Performance for 16-byte blocks is pretty poor, but for bigger blocks<br>
it&#39;s much faster.<br>
<br>
A VIA C7 running at the same clock frequency should produce similar results.<br>
<br>
</blockquote></div><br>