lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sat, 13 Sep 2014 13:32:02 -0400
From: Bill Cox <>
Subject: A review per day - Catena

Hash: SHA1

Having Catena make it to the second round is a no-brainer.

There is the "wrapper" algorithm for more securely applying a hash
function H, and then there is the hash function H.  Catena
demonstrated so many good ideas in it's "framework" which created a
high bar for the wrapper functions.  So many of us copied good ideas
from Catena, that Catena already wins, even if it loses.  I personally
copied some of my favorite Catena features into TwoCats, including
garlic, client-independent update, a pluggable hash function,
bit-reversal combined with Alexander's sliding power of 2 window, and
server relief.  I only try to copy the best ideas, and so you can
clearly see that I think Catena has a *lot* of good ideas.  Some of
the best.

The choice of the Catena team to stick with the full 12-round Blake2b
function should not be held too strongly against Catena.  Simply plug
in the Blake2b reduced round function from RIG and Lyra2, and Blake
becomes faster than Scrypt, though not quite speed competitive with
Lyra2, TwoCats, or Yescrypt.  Still, to be close to this pack with a
cache-timing resistant algorithm is impressive.

I personally verified the potential speed of Catena by plugging my old
NoelKDF hash function into it.  The Catena team was kind enough to let
me commit my changes in a separate branch in their github repository:

I also did some research into pebbling cache-timing resistant
algorithms.  For those like Catena (and the first half of TwoCats),
that hash the head of the chain with some value in prior memory, and
repeat that for the whole runtime, there is a "free" 2X TMTO, where an
attacker trivially can use half the memory with zero recomputations.
Having even 2.5X lower TMTO than an unpredictable similar algorithm is
very difficult.

Catena used an ingenious trick.  Rather than give an attacker a free
2X TMTO, Catena-3 uses the same memory over again 3 times, giving both
the attacker and defender a 4X memory reduction compared to the
computation graph size.  This does result in a 3X lower peak memory *
time cost to the attacker compared to an unpredictable algorithm like
Yescrypt, but if cache-timing resistance is that important to you, you
can have it using Catena for only 3X lower defense against the
traditional brute-force attack.

It remains to be seen if there is an effective TMTO attack against
Catena.  Using even 1 fewer memory locations increases recomputations
considerably.  However, the defense increases somewhat slowly, and by
a 1/8 memory attack (compared to the 1/4 that Catena starts with),
Catena starts losing against other algorithms in my pebbling attacks.

One improvement I would suggest for Catena is to embed a sub-Catena
graph in the first row.  This only increases runtime slightly, but it
greatly improves TMTO.  Another idea is to plug in Lyra2's ingenious
sponge construction, perhaps without the extra read and write per
memory location.  These sorts of tweaks keep Catena competitive in
cache-timing resistant category.

One gripe:  Catena spends a *lot* of time generating cryptographically
strong pseudo-random data for filling memory, but then makes it very
easy to distinguish memory as not random.  This should be fixed in a

I personally am excited about Lyra2's reduced-round Blake2b function
which had a very interesting suggestion recently from Samuel Neves for
introducing better compute-time hardness by incorporating
multiplications in the hash function.  For Catena, we'd need to remove
one read and one write in the sponge function, so that it does 2 reads
and 1 write rather than 3 reads and 2 writes.  If Catena used such a
sponge, it would make it more difficult, though probably not
super-hard, to detect that the memory contents are non-random.

ASIC Defense
- ------------

Catena's ASIC defense depends on recomputations to defend against a
TMTO attack, and on the resistance of the underlying hash function.
Assuming Catena is rewarded for offering so many great ideas to the
other entries by allowing Catena to use the best hash function in the
competion, then likely as not, we'll be looking at the modified
Blake2b reduced round with multiplies instead of additions.  This
should have excellent ASIC computation defense, maybe as low as 2X
possible speed-up assuming the same process, which is fantastic.  It
still would have 3X lower time*peak memory, which is what counts in
all the ASIC attacks I've thought of, but that's the price of pure
cache-timing resistance.

There are some issues, however.  To start, predictable reads means an
ASIC attacker can *eliminate* memory read delays from on-chip memory.
 This is why it is *very* important for these algorithms to have solid
compute-timing hardening!  Straight Blake2b is likely going to speed
up 10X or more in an ASIC, and that speedup directly applies to an
ASIC Catena attack speed per core.  The ability to rely on SRAM
latency hardening is another reason I prefer the unpredictable algorithms.

Because of predictable addressing, an attacker might benefit from a
TMTO against Catena.  He can use parallel cores to have recomputed
data ready when needed.  For a light TMTO, such as using half the
memory that Catena does, the recomputations required are about 9X
using my pebbler. 9 times as many cores is no big deal for the
attacker, since memory may dominate the ASIC area.  Cutting it in half
may allow nearly twice as many hashing cores per ASIC, with no speed

However, I don't actually believe this will work out.  Those 9 extra
reads my not take any time (because they are predictable), but they
will consume power!  So will the 9 recomputations.  Contrary to what
has been posted in the discussion forum, a TMTO against Catena will
almost certainly *increase* power, rather than decrease.  Since power
is likely a significant component an ASIC attacker's budget, more
likely than not, this attack will not benefit him.

Still, Catena should embed a sub-Catena graph in the first row to
increase the TMTO penalty.

- -------

Catena remains my favorite of the cache-timing resistant entries.  I
think their team deserve a round of applause.

However, I prefer TwoCat's hybrid design over pure cache-timing
resistant algorithms.  Lyra2, with some improvements in the memory
filling loop, and Yescrypt, with a cache-timing defense upgrade, would
also be my preferred algorithms for defending passwords, even if
cache-timing attacks become a common attack in the wild.

One last thought: Catena innovated heavily in the "framework" area.  I
believe the eventual winner should be combined with either Catena's
framework directly, or one motivated heavily from it.  Catena's
framework can make every password hashing scheme better.

If we pick a winner without enabling it to have a chance to adopt
Catena's excellent framework features, I will be disappointed.  Of
course, I already built most of them into my entry :-)

Version: GnuPG v1


Powered by blists - more mailing lists