SAFER Explained: The Cipher That Put Speed First

SAFER explained in plain terms means understanding a cipher built on a bet, the bet that a design using only simple byte operations could be both fast and secure. The central question is whether speed and simplicity can really replace the heavy machinery of other ciphers, and the answer is that SAFER proved they could, at least for a while.

SAFER is a block cipher designed by James Massey in Switzerland and published in 1993, its name short for Secure And Fast Encryption Routine. It encrypts 64-bit blocks with a 64-bit key in the original version, runs for 6 rounds, later raised to 8, and it uses only byte operations, addition, and XOR, which makes it one of the fastest ciphers of its generation in software.

This article makes the case for SAFER, explains what it is, how it works, and where its successors still earn their keep.

Key takeaways

  • SAFER is a block cipher designed by James Massey in 1993.
  • It encrypts 64-bit blocks using only simple byte operations.
  • It runs for 6 rounds in the original version, 8 in the revised one.
  • Its successor SAFER+ uses 128-bit blocks and 128-bit keys.
  • SAFER+ is used in Bluetooth for authentication and key generation.

What SAFER is

SAFER is a cipher that encrypts data in 64-bit blocks using a structure built entirely from operations on single bytes. Each round passes the eight bytes of the block through substitution boxes based on exponentiation and logarithms, mixes them with subkeys, and then diffuses them with a Pseudo-Hadamard Transform, which spreads the effect of each changed byte across the whole block.

Its signature feature is the substitution boxes, which are built from mathematics rather than from arbitrary tables. One S-box raises its input to a power modulo 257, and the other takes the discrete logarithm, which means the boxes are inverses of each other and their properties can be proven rather than merely hoped for, and that mathematical grounding was a deliberate choice by a designer who trusted proofs over tables.

The design was a reaction to the ciphers of its day, which were built for hardware and ran slowly in software. Massey wanted a cipher that would fly on the ordinary processors of the early 1990s, so he built one from the operations those processors did fastest, and the result was a cipher that could encrypt data at speeds its rivals could not match on the same machines.

It became one of the best-known ciphers of the 1990s, studied widely and revised in public after early attacks showed that six rounds were not enough. The revised version, SAFER SK-128, added rounds and a stronger key schedule, and the family grew into SAFER+, a 128-bit version submitted to the AES contest, which shows how a design can evolve in the open rather than failing in secret.

Its most famous property is the name, which is also a promise. Secure And Fast Encryption Routine says exactly what the cipher aims to be, and the name has stuck through three decades of use, which is a reminder that cryptographers, for all their mathematics, still enjoy a name that says what it means.

Our guide to AES encryption explains the standard that SAFER+ competed against, and our guide to Serpent explains another cipher built for careful analysis.

How SAFER works

Everything starts with the key schedule, which expands the master key into the subkeys each round needs. The key is stretched through a series of additions and rotations that produce a different subkey for every round, and the schedule is designed so that the subkeys look random even when the master key is simple, which stops an attacker from working backwards from the subkeys to the key.

Each round transforms the eight bytes of the block through the substitution boxes. Four bytes pass through the exponentiation box and four through the logarithm box, which gives the round its nonlinearity, and each byte is then mixed with a subkey by addition or XOR, so that the key influences every byte before the diffusion step begins.

The Pseudo-Hadamard Transform is what makes the round work as a whole. The transform takes pairs of bytes and mixes them together with additions, so that a change in one byte affects its partner, and because the transform is applied in layers across the block, a single changed bit spreads to every byte within a couple of rounds, which is the diffusion every cipher needs.

The rounds alternate their key mixing, using addition in some rounds and XOR in others. The alternation matters because addition and XOR behave differently, and a cipher that uses only one of them can be easier to attack, so SAFER switches between them to keep the relationship between the key and the ciphertext as tangled as possible.

Decryption runs the same rounds in reverse, starting with the final subkeys and working backwards through the rounds. The receiver applies the inverse substitution boxes and the inverse transform in the opposite order, and the plaintext comes back out, which means the same design encrypts and decrypts without a second implementation.

The security of the design rests on the S-boxes and the diffusion. The best published attacks break only versions with fewer rounds than the real cipher uses, and the revised eight-round version has survived decades of public analysis, which is why the SAFER family is still respected even though its original form is retired.

A dark office desk with a laptop showing a glowing green cipher diagram, a brass key and a notebook beside it
A dark office desk with a laptop showing a glowing green cipher diagram, a brass key and a notebook beside it, shows how SAFER works: eight bytes take turns through exponentiation and logarithms, then diffuse through the transform until the block is transformed.

Comparing SAFER with other byte ciphers

SAFER is one of several ciphers built for software speed, and each was built with a different emphasis. SAFER+ is its own successor with 128-bit blocks and a stronger design, AES is the global standard that every software cipher is measured against, and the original SAFER is the pioneer that proved byte operations alone could carry a cipher, while each approach trades something for something else.

The table below sets out the main contrasts between the leading approaches.

Aspect SAFER SAFER+ AES
Block size 64 bits 128 bits 128 bits
Key size 64 or 128 bits 128 to 256 bits 128 to 256 bits
Rounds 6 or 8 8 or 16 10 to 14
S-boxes Exponentiation Exponentiation Fixed table
Best for Historical interest Bluetooth General use

The practical result is that SAFER is the right choice for historical interest, SAFER+ suits Bluetooth, and AES fits general use everywhere else.

Where SAFER is used

Bluetooth uses SAFER+ for authentication and key generation. The Bluetooth standard includes SAFER+ in the procedures that let two devices prove who they are and agree on a key, which means the cipher family guards the pairing of billions of headphones, speakers, and phones, even though most of their owners have never heard its name.

Research uses it as a case study in cipher design. Cryptographers still cite SAFER when they discuss S-boxes built from mathematics, because it is the clearest example of a design whose substitution boxes can be proven rather than merely tested, and that lesson shapes how new ciphers are judged today.

Teaching uses it to show how diffusion works. The Pseudo-Hadamard Transform is simple enough to explain on a whiteboard and powerful enough to carry a cipher, which makes SAFER a favourite example in cryptography courses that cover the building blocks of block ciphers and the trade-offs behind them.

Standards history uses it to mark the road to AES. SAFER+ was submitted to the AES contest, and its evaluation helped reviewers understand what a software-first cipher could and could not do, which means the family is part of the story of how the world chose its encryption standard.

Legacy systems use it where its speed once mattered. A small number of older products and libraries include SAFER support because it was fast on the processors of its day, and those implementations keep running in the background of systems that were built around it, even though nobody chooses SAFER for a new design today.

Strengths and limits

The greatest strength of SAFER is its speed in software. Using only byte operations, addition, and XOR makes it one of the fastest ciphers of its generation on ordinary processors, and that speed is real, measured in published benchmarks and confirmed by the Bluetooth standard’s choice of its successor.

It is also a strength that the design is mathematically grounded. Substitution boxes built from exponentiation and logarithms can be analysed with proofs rather than with guesswork, and that grounding gives reviewers a confidence that arbitrary tables cannot, which is why the design earned respect even from its critics.

The limits are real, though, and the biggest is the 64-bit block of the original. Short blocks mean that after enough data is encrypted with one key, patterns can start to leak, so the original SAFER suits history and teaching, and a system that needs real protection today should choose SAFER+ or AES instead.

SAFER checklist

  • Use SAFER for study and history, not for new systems.
  • Use SAFER+ where Bluetooth compatibility is needed.
  • Always use the eight-round version, never the original six.
  • Use a proper mode of operation, never raw block encryption.
  • Use a fresh initialisation vector for every message.
  • Remember SAFER encrypts but does not authenticate on its own.
  • Add a message authentication code if tampering is a concern.
  • Test against published test vectors before shipping any implementation.
  • Compare with AES for systems that do not need Bluetooth compatibility.

Frequently asked questions

What is SAFER in simple terms?

It is a block cipher from Switzerland that encrypts 64-bit blocks using only simple byte operations, built for speed in software, and its successor SAFER+ is used in Bluetooth.

What does SAFER stand for?

It stands for Secure And Fast Encryption Routine, three words that describe exactly what the cipher promises: strong protection in a design built for speed.

How is SAFER different from AES?

Both are block ciphers, but SAFER uses byte operations with mathematically built S-boxes in 6 or 8 rounds, while AES uses a fixed substitution table in 10 to 14 rounds.

Is SAFER still secure?

The revised eight-round version has no known practical attack, but its 64-bit block is short by modern standards, so it is studied as history rather than used for new systems.

What is the Pseudo-Hadamard Transform?

It is a simple mixing step that takes pairs of bytes and combines them with additions, so that a change in one byte spreads to its partner and then across the block.

When should I use SAFER?

When you study cipher design, when you work with Bluetooth, or when you want a cipher whose S-boxes can be proven rather than merely tested.

The bottom line

SAFER explained in one line is this: the cipher that bet everything on speed and simplicity, a byte-sized design from Switzerland that proved fast could also be serious.

It is proof that a good idea can outlive its own cipher, and the reason it still matters is that its successor still guards every Bluetooth pairing, and its lessons still shape new designs.

This article is general information about how SAFER works, not advice about choosing encryption for a particular device or system.

Latest articles

Scroll to Top