Gimli explained in plain terms means understanding the 384-bit permutation that tiny devices use to hash and encrypt, a design that turns a small grid of numbers into a cryptographic engine with just 24 rounds of simple operations. The central question is how something this small can be trusted at all, and the answer is that Gimli was built to be simple, fast, and good enough for places where a big permutation cannot fit.
Gimli is a cryptographic permutation designed by Daniel Bernstein, Stefan Kölbl, Stefan Lucks, Pedro Massolino, Florian Mendel, Kashif Nawaz and Joost Rijmen, and published in 2017. It works on a state of 384 bits, runs for 24 rounds, and it is built around a small substitution-permutation box, which means it needs no tables and almost no memory.
This article explains what Gimli is, how it works, and where it runs in the real world.
Key takeaways
- Gimli is a 384-bit cryptographic permutation from 2017.
- It runs 24 rounds built around a small SP-box.
- It powers both hashing and authenticated encryption.
- It was a candidate in the NIST lightweight cryptography process.
- It is used in embedded systems and small devices.
What Gimli is
Gimli is a permutation that takes a 384-bit state and scrambles it, passing the state through 24 rounds that substitute, permute and mix the data. The state is arranged as three rows of four 32-bit words, and each round transforms the whole state at once, which means every word of the state is mixed with every other word over the course of the permutation, and that thorough mixing is what makes it hard to reverse.
Its signature feature is the SP-box. Most permutations use large substitution tables, but Gimli uses a tiny box that operates on three 32-bit words at a time, combining rotations, ANDs and XORs, which means the whole permutation fits in a few dozen lines of code, and that smallness is what makes it useful for tiny devices.
The design was a reaction to the needs of lightweight cryptography. By the mid-2010s, researchers wanted a single permutation that could do hashing, encryption and authentication on the smallest chips, and Gimli offered a practical way to do it, because a 384-bit state is small enough for a microcontroller yet large enough for real security, and that balance is why the design caught on.
It became one of the best-known lightweight permutations in the world, and it was submitted to the NIST lightweight cryptography competition. Reaching the competition was itself a mark of quality, because NIST only considers designs that survived public cryptanalysis, and Gimli has stood in that conversation since 2017.
Its most famous property is the name. Gimli is named after the dwarf of The Lord of the Rings, a small but formidable character, and the name has stuck through years of study, which is a reminder that cryptographers still enjoy a design with a story behind it.
Our guide to SHA-3 explains the standard hash built on the Keccak permutation, and our guide to Whirlpool explains the hash built like a block cipher.
How Gimli works
Everything starts with the state, which is a three-by-four grid of 32-bit words holding 384 bits in total. The data to be hashed or encrypted is absorbed into the state, and the permutation scrambles it, which means the state is the whole working memory of the scheme, and the security of the design rests on how thoroughly the permutation mixes it.
Each round begins with the SP-box, which takes three words from a column and transforms them. The box rotates each word, combines them with AND and XOR operations, and writes the results back, which means the substitution is non-linear, and because the box is applied to every column, the whole state is changed in every round.
The linear layer is what makes the permutation work as a whole. After the SP-box, the words are swapped between columns and rotated by small amounts, which means a change in one word spreads to other columns, and because the swaps and rotations are applied in every round, a single changed bit spreads across the whole state within a few rounds.
The round constants spread the effect further. Gimli adds a small constant that changes with the round number, which means the rounds behave differently from each other, and because the constants break the symmetry between rounds, an attacker cannot exploit repeated structure in the permutation.
The Gimli-Hash mode turns the permutation into a hash function. Data is absorbed into the state in blocks, the permutation runs, and the hash is squeezed out of the state, which means the same permutation that encrypts can also fingerprint data, and that reuse is what makes Gimli a complete cryptographic toolkit rather than just a permutation.
The Gimli-Cipher mode turns it into authenticated encryption. A key and a nonce are loaded into the state, the plaintext is absorbed and encrypted, and a tag is squeezed out at the end, which means the receiver can check that the message was not altered, and that authentication is what makes the cipher safe to use on real devices.

Comparing Gimli with other lightweight permutations
Gimli is one of several permutations built for small devices, and each was built with a different emphasis. Keccak-f is the permutation behind SHA-3 with a larger state, Xoodoo is the permutation behind Xoodyak with the same state size, and Gimli is the one with the smallest code footprint of the three, while each approach trades something for something else.
The table below sets out the main contrasts between the leading approaches.
| Aspect | Gimli | Keccak-f[400] | Xoodoo |
|---|---|---|---|
| State | 384 bits | 400 bits | 384 bits |
| Rounds | 24 | 20 | 12 |
| Design | SP-box | Keccak-f | Xoodoo |
| Use | AEAD and hashing | SHA-3 | Xoodyak |
| Best for | Tiny devices | Standard hashing | Lightweight use |
The practical result is that Gimli is the right choice for tiny devices, Keccak-f suits standard hashing, and Xoodoo fits lightweight use instead.
Where Gimli is used
Research uses it as a case study in lightweight design. Cryptographers still cite Gimli when they discuss how small a permutation can be, because it is the clearest example of a design that fits in a few lines of code, and that lesson shapes how new lightweight schemes are judged today.
Teaching uses it to show how permutations work. Gimli is clean enough to explain in a lecture and well documented enough to implement in an afternoon, which makes it a favourite example in cryptography courses that cover sponge designs and the ideas that shaped them.
Benchmarks use it to measure tiny designs. When someone builds a new library or a new piece of hardware, Gimli is one of the designs they test, because its simple rounds exercise different parts of a processor than heavier designs do, and a platform that runs Gimli well is likely to run most lightweight schemes well.
Embedded systems use it where memory is scarce. A small number of devices and libraries include Gimli support because it needs almost no memory, and those implementations keep running in the background of systems that were built around that choice, even though most new designs choose a NIST standard today.
Standards history uses it to mark the lightweight era. Gimli was part of the wave of designs that chased the smallest possible permutation, and it represents the most compact path that wave explored, which means historians of the field return to it whenever they ask what small cryptography might have looked like.
Strengths and limits
The greatest strength of Gimli is its size. A permutation that fits in a few dozen lines of code can run anywhere, and that smallness is real, measured in the code itself and confirmed by the designers’ own analysis of the round function.
It is also a strength that the design does two jobs. A single permutation that provides both hashing and authenticated encryption saves code space on tiny devices, and that reuse is worth more than cleverness in a field where every byte of flash memory counts.
The limits are real, though, and the biggest is adoption. Gimli was not selected as a NIST standard, which means smaller communities of implementers, fewer independent reviews in recent years, and less tooling than the winning designs enjoy, and a system that must interoperate will usually choose a standard instead.
Gimli checklist
- Use Gimli for study and tiny devices, not for new systems.
- Remember it is a 384-bit permutation, not a cipher on its own.
- Study its SP-box to understand lightweight design.
- Compare it with Keccak to see the size trade-off.
- Note its 24 rounds when benchmarking.
- Test against published test vectors before trusting any implementation.
- Keep keys random and protect them as carefully as with any cipher.
- Use a proper mode of operation, never the raw permutation.
- Choose a NIST standard for any system that needs one today.
Frequently asked questions
What is Gimli in simple terms?
It is a small cryptographic permutation that scrambles a 384-bit state, used to build both hash functions and authenticated encryption for tiny devices.
Why is it called Gimli?
After Gimli the dwarf from The Lord of the Rings, a small but formidable character, which fits a permutation designed to be small and strong.
How is Gimli different from Keccak?
Both are permutations used in sponge designs, but Gimli has a 384-bit state and a tiny SP-box, while Keccak uses a larger state and a different round function.
Is Gimli still secure?
Yes, no practical attack against it has been published, and its design has survived years of public analysis in the NIST lightweight process.
Where is Gimli used?
In embedded systems and research implementations, wherever a tiny permutation is needed for hashing or authenticated encryption on small devices.
When should I use Gimli?
When you study lightweight cryptography, when you teach sponge designs, or when you want a permutation small enough to fit on the tiniest device.
The bottom line
Gimli explained in one line is this: the tiny permutation that does two jobs, a 384-bit design that proved small can still be strong.
It is proof that size is not security, and the reason it still matters is that every lightweight design since has been judged partly by the lesson Gimli taught.
This article is general information about how Gimli works, not advice about choosing encryption for a particular device or system.







