Lyra2 explained in plain terms means understanding the password hash that fills memory faster than any rival, a design from 2014 that turns a password into a key with a sponge and a wandering walk through memory. The central question is why a password hash would wander through memory instead of reading it in order, and the answer is that wandering makes each guess depend on data an attacker cannot predict, so Lyra2 gives defenders a hash that is fast to run and slow to crack, and that balance is the whole point of the design.
Lyra2 is a memory-hard password hashing scheme created by Marcos Simplicio Jr., Leonardo Almeida, Ewerton Andrade, Paulo dos Santos and Paulo Barreto at the University of São Paulo, built on a duplex sponge with the BLAKE2b permutation. It turns a password into a key by filling a memory matrix and wandering through it, and it is built on the idea that a hash should be strictly sequential, which means the design resists parallel hardware by design, and that resistance is what makes it unlike the password hashes of its era.
This article makes the case for Lyra2, explains what it is, how it works, and where its ideas still earn their keep.
Key takeaways
- Lyra2 is a password hash from 2014, by a São Paulo team.
- It is built on a duplex sponge with BLAKE2b.
- It fills a memory matrix and wanders through it.
- It was the fastest finalist in the Password Hashing Competition.
- It was adapted as a cryptocurrency proof-of-work hash.
What Lyra2 is
Lyra2 is a hash that turns a password into a key while filling memory at up to a gigabyte per second, and that filling speed is what makes it unusual among password hashes. A slow fill wastes the defender’s time, but Lyra2 fills memory quickly, which means a login server can afford a large memory cost, and because the cost is memory rather than time, the defence scales with hardware.
Its signature feature is the wandering phase. Most password hashes read their memory in a fixed order, but Lyra2 wanders through its matrix following data-dependent addresses, which means each step depends on the data itself, and because the walk cannot be predicted, an attacker cannot precompute it.
The design was a reaction to the cost of cracking. Password crackers had moved to graphics cards and custom chips, so the São Paulo team asked how a hash could stay sequential when hardware loves parallel work, because a hash that parallelises well loses to a graphics card, and that practicality is what made Lyra2 worth submitting to the Password Hashing Competition.
It became one of the best-known password hashes in the world, and it is named in every discussion of the field. Lyra2 was a finalist in the competition and received special recognition, it was the fastest finalist in the race, and it is still the first example engineers meet when they learn that a sponge can hash passwords, which means the design survives as a tool even though Argon2 won the competition.
Its most famous property is its second life in mining. Lyra2 was adapted as a cryptocurrency proof-of-work hash, which means it guards blockchains as well as passwords, and because the adaptation kept its memory hardness, the mining version resists the same hardware its password version does.
Our guide to yescrypt explains the other PHC finalist built on scrypt, and our guide to SHA-3 explains the standard sponge hash that shares its construction.
How Lyra2 works
Everything starts with the password, the salt and the parameters, which are absorbed first. Lyra2 takes the password and a salt and feeds them into its 1024-bit sponge state, which means the starting value depends on both, and because the parameters set the matrix size, the same password gives different hashes under different settings.
Each step begins with the setup phase, which fills the memory matrix. Lyra2 writes rows of pseudorandom data into a matrix of R rows and C columns, which means fresh data arrives at every step, and because the setup addresses memory in a fixed order, the fill is fast and predictable.
The wandering phase is what makes the design work as a whole. Lyra2 walks through the matrix following addresses derived from the data itself, mixing each visited cell back into the sponge, which means the value is scrambled thoroughly, and because the walk depends on the password, two passwords wander differently.
The sponge spreads the effect further. Every absorb and squeeze passes through the BLAKE2b permutation, which means the state is mixed thoroughly, and because the sponge is used in duplex mode, each call can absorb a block and return output at once.
The finalisation is what turns the state into a key. After the wandering passes, Lyra2 squeezes the key out of the sponge, which means the output depends on the whole computation, and because the number of passes is a parameter, a verifier can tune the cost to its own hardware.
The output comes from the final squeeze, read out as a key of any length. Lyra2 outputs the squeezed bytes directly as the derived key, which means the result is a fixed size whatever the settings, and that size is exactly what a login system needs to verify a password later.

Comparing Lyra2 with other password hashes
Lyra2 is one of several password hashes built for logins, and each was built with a different emphasis. yescrypt is the scrypt-based hash that became the Linux default, scrypt is the memory-hard hash both build on, and Lyra2 is the one built on a sponge for the fastest memory fill, while each approach trades something for something else.
The table below sets out the main contrasts between the leading approaches.
| Aspect | Lyra2 | yescrypt | scrypt |
|---|---|---|---|
| Output | Variable | Variable | Variable |
| Core | Duplex sponge | scrypt plus tweaks | Salsa20/8 and PBKDF2 |
| Memory matrix | R rows by C columns | Flat | Flat |
| PHC result | Special recognition | Special recognition | Predates the PHC |
| Best for | Fast memory-hard hashing | Linux logins | Legacy hashing |
The practical result is that Lyra2 is the right choice for fast memory-hard hashing, yescrypt suits Linux logins, and scrypt fits legacy hashing instead.
Where Lyra2 is used
Cryptocurrency mining uses it as a proof-of-work hash. Lyra2REv2 powers mining on several coins, because its memory hardness resists specialised hardware, and that adaptation is the reason Lyra2 runs in real networks rather than only in papers.
Password storage uses it where speed matters. A login server that must fill memory quickly chooses Lyra2, because a slow fill wastes the defender’s budget, and that filling rate is the reason Lyra2 earns its keep in authentication code.
Key derivation uses it to stretch passwords into keys. A system that encrypts data with a password-derived key needs a slow, memory-hard step, because a fast derivation lets an attacker try many keys, and that cost is the reason Lyra2 appears in encryption tools.
Research uses it as the sponge password-hash example. Papers still cite Lyra2 when they discuss memory-hard designs, because it is the clearest example of a sponge used for passwords, and that citation is the reason the design survives in the literature.
Teaching uses it as the wandering-phase example. Courses introduce Lyra2 when they explain that memory access can depend on data, because it is the clearest case of the idea in a real design, and a student who understands Lyra2 understands why wandering beats reading in order.
Strengths and limits
The greatest strength of Lyra2 is its memory filling rate. A hash that fills a gigabyte of memory per second gives defenders a large cost for a small time budget, and that strength is real, measured in the competition’s own benchmarks and confirmed by the miners that adopted it.
It is also a strength that the design is a single sponge. A hash built on one construction is easy to audit and easy to build, and that simplicity is worth more than cleverness in a field where a hash nobody can audit is a hash nobody trusts.
The limits are real, though, and the biggest is the tradeoff cryptanalysis. Researchers showed time-memory tradeoffs that cut Lyra2’s cost, which means the design has a smaller margin than its authors first claimed, and a system that needs the strongest margin should use Argon2 instead.
Lyra2 checklist
- Use Lyra2 for password storage, never for fast hashing.
- Remember it is built on a duplex sponge with BLAKE2b.
- Note the matrix has R rows and C columns.
- Compare it with yescrypt to see two kinds of memory-hard hash.
- Study the wandering phase, which is what slows attackers.
- Check the parameters, since time and memory are tunable.
- Keep real secrets behind proper key management, not passwords alone.
- Read the Lyra2 paper to see how the phases were built.
- Choose Argon2 when the strongest margin is wanted.
Frequently asked questions
What is Lyra2 in simple terms?
It is a 2014 password hash that turns a password into a key by filling a memory matrix with a sponge and wandering through it.
Who created Lyra2?
Marcos Simplicio Jr., Leonardo Almeida, Ewerton Andrade, Paulo dos Santos and Paulo Barreto at the University of São Paulo.
How is Lyra2 different from yescrypt?
Both are memory-hard PHC finalists, but Lyra2 is built on a sponge while yescrypt is built on scrypt.
Is Lyra2 still secure?
It is fast and well studied, though tradeoff attacks cut its margin, so it is mainly a subject for research and mining.
Where is Lyra2 used?
In cryptocurrency mining, in password storage, in key derivation, in research, and in teaching about memory-hard hashing.
When should I use Lyra2?
When you need fast memory filling, when you mine with Lyra2REv2, or when you study sponge-based password design.
The bottom line
Lyra2 explained in one line is this: the wandering sponge hash, a 2014 design of a memory matrix and a data-dependent walk that filled memory faster than any rival and taught the field that wandering beats reading in order.
It is proof that a sponge can hash passwords, and the reason it still matters is that every password hash designed since has been judged partly by the lesson Lyra2 taught.
This article is general information about how Lyra2 works, not advice about choosing encryption for a particular device or system.







